MOAB: Mesh Oriented datABase  (version 5.2.1)
HigherOrderFactory.hpp
Go to the documentation of this file.
00001 /**
00002  * MOAB, a Mesh-Oriented datABase, is a software component for creating,
00003  * storing and accessing finite element mesh data.
00004  *
00005  * Copyright 2004 Sandia Corporation.  Under the terms of Contract
00006  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
00007  * retains certain rights in this software.
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  */
00015 
00016 #ifndef MOAB_HIGHER_ORDER_FACTORY_HPP
00017 #define MOAB_HIGHER_ORDER_FACTORY_HPP
00018 
00019 #ifndef IS_BUILDING_MB
00020 #error "HigherOrderFactory.hpp isn't supposed to be included into an application"
00021 #endif
00022 
00023 #include "moab/Interface.hpp"
00024 
00025 namespace moab
00026 {
00027 
00028 class ElementSequence;
00029 class Core;
00030 
00031 /** \class HigherOrderFactory
00032  * \brief Functions for converting to/from higher-order elements
00033  *  \authors Clinton Stimpson
00034  *  \date    11/25/02
00035  *  \brief
00036  *
00037  */
00038 class HigherOrderFactory
00039 {
00040   public:
00041     HigherOrderFactory( Core*, Interface::HONodeAddedRemoved* function_object );
00042     ~HigherOrderFactory();
00043 
00044     ErrorCode convert( const EntityHandle meshset, const bool mid_edge_nodes, const bool mid_face_nodes,
00045                        const bool mid_volume_nodes );
00046 
00047     ErrorCode convert( const Range& entities, const bool mid_edge_nodes, const bool mid_face_nodes,
00048                        const bool mid_volume_nodes );
00049 
00050     unsigned char mNodeMap[MBMAXTYPE][8][8];
00051 
00052   private:
00053     // static bool mMapInitialized;
00054     void initialize_map();
00055 
00056     Core* mMB;
00057     Interface::HONodeAddedRemoved* mHONodeAddedRemoved;
00058 
00059     ErrorCode convert_sequence( ElementSequence* sequence, EntityHandle sequence_subset_start,
00060                                 EntityHandle sequence_subset_end, bool mid_edge_nodes, bool mid_face_nodes,
00061                                 bool mid_volume_nodes );
00062     ErrorCode add_mid_edge_nodes( ElementSequence* );
00063     ErrorCode add_mid_face_nodes( ElementSequence* );
00064     ErrorCode add_mid_volume_nodes( ElementSequence* );
00065 
00066     //! returns the handle of the first center node found between the two corner nodes.
00067     //! returns zero if none found
00068     //! entities that share those two corner nodes and have space allocated for mid-edge nodes are
00069     //! returned in a vector
00070     EntityHandle center_node_exist( EntityHandle corner1, EntityHandle corner2,
00071                                     std::vector< EntityHandle >& adj_entities );
00072 
00073     //! returns the handle of the first center node found between the 3-4 corner nodes.
00074     //! set the last node to zero if you want only 3 nodes
00075     //! returns zero if none found
00076     //! entities that share those corner nodes and have space allocated for mid face nodes are
00077     //! returned in a vector
00078     EntityHandle center_node_exist( EntityHandle corners[4], std::vector< EntityHandle >& adj_entities );
00079 
00080     //! adds a center node to element between corner nodes, returns success
00081     bool add_center_node( EntityType type, EntityHandle* element_conn, int conn_size, EntityHandle corner_node1,
00082                           EntityHandle corner_node2, EntityHandle center_node );
00083 
00084     ErrorCode copy_corner_nodes( ElementSequence* src, ElementSequence* dst );
00085     ErrorCode copy_mid_edge_nodes( ElementSequence* src, ElementSequence* dst );
00086     ErrorCode copy_mid_face_nodes( ElementSequence* src, ElementSequence* dst );
00087     ErrorCode copy_mid_volume_nodes( ElementSequence* src, ElementSequence* dst );
00088     ErrorCode copy_nodes( ElementSequence* src, ElementSequence* dst, unsigned nodes_per_elem_to_copy,
00089                           unsigned src_conn_offset, unsigned dst_conn_offset );
00090 
00091     ErrorCode zero_mid_edge_nodes( ElementSequence* dst );
00092     ErrorCode zero_mid_face_nodes( ElementSequence* dst );
00093     ErrorCode zero_mid_volume_nodes( ElementSequence* dst );
00094     ErrorCode zero_nodes( ElementSequence* dst, unsigned nodes_per_elem_to_zero, unsigned dst_conn_offset );
00095 
00096     ErrorCode remove_mid_edge_nodes( ElementSequence* seq, EntityHandle start, EntityHandle stop, Tag deletable_ndoes );
00097     ErrorCode remove_mid_face_nodes( ElementSequence* seq, EntityHandle start, EntityHandle stop, Tag deletable_ndoes );
00098     ErrorCode remove_mid_volume_nodes( ElementSequence* seq, EntityHandle start, EntityHandle stop,
00099                                        Tag deletable_ndoes );
00100     ErrorCode remove_ho_nodes( ElementSequence* sequence, EntityHandle subset_start_handle,
00101                                EntityHandle subset_end_handle, int nodes_per_elem_to_remove,
00102                                int elem_conn_offset_to_remove, Tag deletable_nodes );
00103     bool tag_for_deletion( EntityHandle element_with_node, int node_index_in_elem_connectivity,
00104                            ElementSequence* sequence );
00105 };
00106 
00107 }  // namespace moab
00108 
00109 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines