v0.13.0
PrismsFromSurfaceInterface.hpp
Go to the documentation of this file.
1 /** \file PrismsFromSurface.hpp
2  * \brief PrismsFromSurface interface
3  *
4  * Create prisms from surface triangle elements
5  */
6 
7 /* MoFEM is distributed in the hope that it will be useful, but WITHOUT
8  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  * License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
14  */
15 
16 #ifndef __PRISMS_FORM_SURFACE_HPP__
17 #define __PRISMS_FORM_SURFACE_HPP__
18 
19 namespace MoFEM {
20 
21 /** \brief merge node from two bit levels
22  * \ingroup mofem
23  */
25 
26  MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
27  UnknownInterface **iface) const;
28 
31  : cOre(const_cast<MoFEM::Core &>(core)) {}
32 
33  std::map<EntityHandle, EntityHandle> createdVertices;
34 
35  /**
36  * \brief List of types of node swapping performed on a created prism
37  * Node swapping is required to satisfy the canonical ordering for the prism
38  * in case the surface normal is pointing inwards rather than outwards
39  * Currently supported options (assuming canonical ordering of nodes 0-5):
40  * NO_SWAP : node swapping is not performed
41  * SWAP_TRI_NODE_ORDER : swap the order of nodes on prism's triangle faces
42  * (1 <-> 2, 4 <-> 5)
43  * SWAP_TOP_AND_BOT_TRI : swap nodes between the top and the bottom triangles
44  * (0 <-> 3, 1 <-> 4, 2 <-> 5)
45  */
46  enum SwapType {
47  NO_SWAP = 0,
50  };
51 
52  /**
53  * \brief Make prisms from triangles
54  * @param ents Range of triangles
55  * @param swap_type Defines how the nodes of the created prism are swapped
56  * (required for canonical ordering if the surface normal is pointing inwards)
57  * @param prisms Returned range of prisms
58  * @param verb Verbosity level
59  * @return Error code
60  */
61  MoFEMErrorCode createPrisms(const Range &ents, const SwapType swap_type,
62  Range &prisms, int verb = -1);
63 
64  /// \deprecated Use the function with the same name and a parameter
65  /// *swap_type*, permitting to swap the order of each triangle's nodes or
66  /// alternatively swap nodes between top and bottom triangles, which is
67  /// required for the canonical ordering if surface normal is pointing inwards
68  DEPRECATED MoFEMErrorCode createPrisms(const Range &ents, Range &prisms,
69  int verb = -1);
70  /**
71  * \brief Seed prism entities by bit level
72  * @param prisms Range of entities
73  * @param bit BitRefLevel
74  * @param verb Verbosity level
75  * @return Error code
76  */
77  MoFEMErrorCode seedPrismsEntities(Range &prisms, const BitRefLevel &bit,
78  int verb = -1);
79 
80  /**
81  * \brief Make prisms by extruding top or bottom prisms
82  * @param prisms Input prisms
83  * @param from_down Use top or down face, if true from f3
84  * @param out_prisms Returned prisms entities
85  * @param verb Verbosity level
86  * @return Error code
87  */
88  MoFEMErrorCode createPrismsFromPrisms(const Range &prisms, bool from_down,
89  Range &out_prisms, int verb = -1);
90 
91  /**
92  * Set uniform thickness
93  * @param prisms Range of prisms
94  * @param director3 Displacement of face 3
95  * @param director4 Displacement of face 4
96  * @return
97  */
98  MoFEMErrorCode setThickness(const Range &prisms, const double director3[],
99  const double director4[]);
100 
101  /**
102  * Set normal thickness
103  * @param prisms Range of prisms
104  * @param thickness normal thickness
105  * @return
106  */
107  MoFEMErrorCode setNormalThickness(const Range &prisms, double thickness3,
108  double thickness4);
109 
110  /**
111  * @brief Add quads to bockset
112  *
113  * If quad is adjacent to extruded edge, is added to given blockset
114  *
115  * @param prisms
116  * @return MoFEMErrorCode
117  */
118  MoFEMErrorCode updateMeshestByEdgeBlock(const Range &prisms);
119 
120  /**
121  * @brief Add prism to bockset
122  *
123  * If prism is adjacent to extruded triangle, is added to given blockset
124  *
125  * @param prisms
126  * @return MoFEMErrorCode
127  */
128  MoFEMErrorCode updateMeshestByTriBlock(const Range &prisms);
129 };
130 
131 } // namespace MoFEM
132 
133 #endif //__PRISMS_FORM_SURFACE_HPP__
#define DEPRECATED
Definition: definitions.h:30
auto bit
set bit
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
Core (interface) class.
Definition: Core.hpp:92
std::map< EntityHandle, EntityHandle > createdVertices
MoFEMErrorCode setNormalThickness(const Range &prisms, double thickness3, double thickness4)
MoFEMErrorCode createPrisms(const Range &ents, const SwapType swap_type, Range &prisms, int verb=-1)
Make prisms from triangles.
MoFEMErrorCode updateMeshestByEdgeBlock(const Range &prisms)
Add quads to bockset.
MoFEMErrorCode setThickness(const Range &prisms, const double director3[], const double director4[])
PrismsFromSurfaceInterface(const MoFEM::Core &core)
SwapType
List of types of node swapping performed on a created prism Node swapping is required to satisfy the ...
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode seedPrismsEntities(Range &prisms, const BitRefLevel &bit, int verb=-1)
Seed prism entities by bit level.
MoFEMErrorCode createPrismsFromPrisms(const Range &prisms, bool from_down, Range &out_prisms, int verb=-1)
Make prisms by extruding top or bottom prisms.
MoFEMErrorCode updateMeshestByTriBlock(const Range &prisms)
Add prism to bockset.
base class for all interface classes