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