moab
|
00001 00017 #ifndef MOAB_HIGHER_ORDER_FACTORY_HPP 00018 #define MOAB_HIGHER_ORDER_FACTORY_HPP 00019 00020 #ifndef IS_BUILDING_MB 00021 #error "HigherOrderFactory.hpp isn't supposed to be included into an application" 00022 #endif 00023 00024 #include "moab/Interface.hpp" 00025 00026 namespace moab { 00027 00028 class ElementSequence; 00029 class Core; 00030 00038 class HigherOrderFactory 00039 { 00040 public: 00041 00042 HigherOrderFactory(Core* , Interface::HONodeAddedRemoved* function_object); 00043 ~HigherOrderFactory(); 00044 00045 ErrorCode convert(const EntityHandle meshset, const bool mid_edge_nodes, 00046 const bool mid_face_nodes, const bool mid_volume_nodes); 00047 00048 ErrorCode convert( const Range& entities, const bool mid_edge_nodes, 00049 const bool mid_face_nodes, const bool mid_volume_nodes); 00050 00051 unsigned char mNodeMap[MBMAXTYPE][8][8]; 00052 00053 private: 00054 00055 //static bool mMapInitialized; 00056 void initialize_map(); 00057 00058 Core* mMB; 00059 Interface::HONodeAddedRemoved* mHONodeAddedRemoved; 00060 00061 ErrorCode convert_sequence(ElementSequence* sequence, 00062 EntityHandle sequence_subset_start, 00063 EntityHandle sequence_subset_end, 00064 bool mid_edge_nodes, 00065 bool mid_face_nodes, 00066 bool mid_volume_nodes); 00067 ErrorCode add_mid_edge_nodes(ElementSequence*); 00068 ErrorCode add_mid_face_nodes(ElementSequence*); 00069 ErrorCode add_mid_volume_nodes(ElementSequence*); 00070 00074 EntityHandle center_node_exist(EntityHandle corner1, EntityHandle corner2, 00075 std::vector<EntityHandle>& adj_entities); 00076 00081 EntityHandle center_node_exist(EntityHandle corners[4], std::vector<EntityHandle>& adj_entities); 00082 00084 bool add_center_node(EntityType type, EntityHandle* element_conn, int conn_size, 00085 EntityHandle corner_node1, EntityHandle corner_node2, EntityHandle center_node); 00086 00087 00088 ErrorCode copy_corner_nodes( ElementSequence* src, ElementSequence* dst ); 00089 ErrorCode copy_mid_edge_nodes( ElementSequence* src, ElementSequence* dst ); 00090 ErrorCode copy_mid_face_nodes( ElementSequence* src, ElementSequence* dst ); 00091 ErrorCode copy_mid_volume_nodes( ElementSequence* src, ElementSequence* dst ); 00092 ErrorCode copy_nodes( ElementSequence* src, 00093 ElementSequence* dst, 00094 unsigned nodes_per_elem_to_copy, 00095 unsigned src_conn_offset, 00096 unsigned dst_conn_offset ); 00097 00098 ErrorCode zero_mid_edge_nodes( ElementSequence* dst ); 00099 ErrorCode zero_mid_face_nodes( ElementSequence* dst ); 00100 ErrorCode zero_mid_volume_nodes( ElementSequence* dst ); 00101 ErrorCode zero_nodes( ElementSequence* dst, 00102 unsigned nodes_per_elem_to_zero, 00103 unsigned dst_conn_offset ); 00104 00105 ErrorCode remove_mid_edge_nodes( ElementSequence* seq, 00106 EntityHandle start, 00107 EntityHandle stop, 00108 Tag deletable_ndoes ); 00109 ErrorCode remove_mid_face_nodes( ElementSequence* seq, 00110 EntityHandle start, 00111 EntityHandle stop, 00112 Tag deletable_ndoes ); 00113 ErrorCode remove_mid_volume_nodes( ElementSequence* seq, 00114 EntityHandle start, 00115 EntityHandle stop, 00116 Tag deletable_ndoes ); 00117 ErrorCode remove_ho_nodes( ElementSequence* sequence, 00118 EntityHandle subset_start_handle, 00119 EntityHandle subset_end_handle, 00120 int nodes_per_elem_to_remove, 00121 int elem_conn_offset_to_remove, 00122 Tag deletable_nodes ); 00123 bool tag_for_deletion( EntityHandle element_with_node, 00124 int node_index_in_elem_connectivity, 00125 ElementSequence* sequence ); 00126 }; 00127 00128 } // namespace moab 00129 00130 #endif 00131