Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
HigherOrderFactory.hpp
Go to the documentation of this file.
1 /**
2  * MOAB, a Mesh-Oriented datABase, is a software component for creating,
3  * storing and accessing finite element mesh data.
4  *
5  * Copyright 2004 Sandia Corporation. Under the terms of Contract
6  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
7  * retains certain rights in this software.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  */
15 
16 #ifndef MOAB_HIGHER_ORDER_FACTORY_HPP
17 #define MOAB_HIGHER_ORDER_FACTORY_HPP
18 
19 #ifndef IS_BUILDING_MB
20 #error "HigherOrderFactory.hpp isn't supposed to be included into an application"
21 #endif
22 
23 #include "moab/Interface.hpp"
24 
25 namespace moab
26 {
27 
28 class ElementSequence;
29 class Core;
30 
31 /** \class HigherOrderFactory
32  * \brief Functions for converting to/from higher-order elements
33  * \authors Clinton Stimpson
34  * \date 11/25/02
35  * \brief
36  *
37  */
39 {
40  public:
43 
44  ErrorCode convert( const EntityHandle meshset,
45  const bool mid_edge_nodes,
46  const bool mid_face_nodes,
47  const bool mid_volume_nodes );
48 
50  const bool mid_edge_nodes,
51  const bool mid_face_nodes,
52  const bool mid_volume_nodes );
53 
54  unsigned char mNodeMap[MBMAXTYPE][8][8];
55 
56  private:
57  // static bool mMapInitialized;
58  void initialize_map();
59 
62 
64  EntityHandle sequence_subset_start,
65  EntityHandle sequence_subset_end,
66  bool mid_edge_nodes,
67  bool mid_face_nodes,
68  bool mid_volume_nodes );
72 
73  //! returns the handle of the first center node found between the two corner nodes.
74  //! returns zero if none found
75  //! entities that share those two corner nodes and have space allocated for mid-edge nodes are
76  //! returned in a vector
78  EntityHandle corner2,
79  std::vector< EntityHandle >& adj_entities );
80 
81  //! returns the handle of the first center node found between the 3-4 corner nodes.
82  //! set the last node to zero if you want only 3 nodes
83  //! returns zero if none found
84  //! entities that share those corner nodes and have space allocated for mid face nodes are
85  //! returned in a vector
86  EntityHandle center_node_exist( EntityHandle corners[4], std::vector< EntityHandle >& adj_entities );
87 
88  //! adds a center node to element between corner nodes, returns success
89  bool add_center_node( EntityType type,
90  EntityHandle* element_conn,
91  int conn_size,
92  EntityHandle corner_node1,
93  EntityHandle corner_node2,
94  EntityHandle center_node );
95 
101  ElementSequence* dst,
102  unsigned nodes_per_elem_to_copy,
103  unsigned src_conn_offset,
104  unsigned dst_conn_offset );
105 
109  ErrorCode zero_nodes( ElementSequence* dst, unsigned nodes_per_elem_to_zero, unsigned dst_conn_offset );
110 
111  ErrorCode remove_mid_edge_nodes( ElementSequence* seq, EntityHandle start, EntityHandle stop, Tag deletable_ndoes );
112  ErrorCode remove_mid_face_nodes( ElementSequence* seq, EntityHandle start, EntityHandle stop, Tag deletable_ndoes );
114  EntityHandle start,
115  EntityHandle stop,
116  Tag deletable_ndoes );
118  EntityHandle subset_start_handle,
119  EntityHandle subset_end_handle,
120  int nodes_per_elem_to_remove,
121  int elem_conn_offset_to_remove,
122  Tag deletable_nodes );
123  bool tag_for_deletion( EntityHandle element_with_node,
124  int node_index_in_elem_connectivity,
125  ElementSequence* sequence );
126 };
127 
128 } // namespace moab
129 
130 #endif