Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
Mesh_decl.hpp
1#ifndef Mesh_decl_hpp
2#define Mesh_decl_hpp
3
4#define FULL_Mesh_TIMER
5
6#include "feddlib/core/FEDDCore.hpp"
7#include "feddlib/core/General/DefaultTypeDefs.hpp"
8#include "feddlib/core/LinearAlgebra/MultiVector.hpp"
9#include "feddlib/core/FE/Elements.hpp"
10#include "feddlib/core/FE/FiniteElement.hpp"
11#include "feddlib/core/FE/Helper.hpp"
12#include "feddlib/core/Mesh/AABBTree.hpp"
13
22
23namespace FEDD {
24template <class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
25class Mesh {
26
27public:
28 typedef Elements Elements_Type;
29 typedef FiniteElement FiniteElement_Type;
30 typedef Teuchos::RCP<FiniteElement_Type> FiniteElementPtr_Type;
31 typedef Teuchos::RCP<Elements_Type> ElementsPtr_Type;
32
33 typedef Teuchos::RCP<Mesh> Mesh_ptr_Type;
34
35 typedef Teuchos::RCP<Teuchos::Comm<int> > CommPtr_Type;
36 typedef Teuchos::RCP<const Teuchos::Comm<int> > CommConstPtr_Type;
37 typedef const CommConstPtr_Type CommConstPtrConst_Type;
38
39 typedef Map<LO,GO,NO> Map_Type;
40 typedef Teuchos::RCP<Map_Type> MapPtr_Type;
41 typedef Teuchos::RCP<const Map_Type> MapConstPtr_Type;
42 typedef Teuchos::RCP<const Map_Type> MapConstPtrConst_Type;
43
44 typedef MultiVector<SC,LO,GO,NO> MultiVector_Type;
45 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
46
47 typedef AABBTree<SC,LO,GO,NO> AABBTree_Type;
48 typedef Teuchos::RCP<AABBTree_Type > AABBTreePtr_Type;
49
50 /* ###################################################################### */
51 //
52 Mesh();
53
54 Mesh(CommConstPtrConst_Type &comm);
55
56 virtual ~Mesh() = default;
57
61 void deleteData();
62
65 void setParameterList( ParameterListPtr_Type& pL );
66
69 ParameterListConstPtr_Type getParameterList( ) const;
70
73 vec_int_ptr_Type getElementsFlag() const;
74
77 MapConstPtr_Type getMapUnique() const;
78
81 MapConstPtr_Type getMapRepeated() const;
82
85 MapConstPtr_Type getElementMap() const;
86
89 MapConstPtr_Type getEdgeMap(); // Edge Map
90
93 vec2D_dbl_ptr_Type getPointsRepeated() const;
94
97 vec2D_dbl_ptr_Type getPointsUnique() const;
98
101 vec_int_ptr_Type getBCFlagRepeated() const;
102
105 vec_int_ptr_Type getBCFlagUnique() const;
106
109 ElementsPtr_Type getElementsC();
110
113 ElementsPtr_Type getSurfaceElements();
114
118
122
126
130 LO getNumPoints(std::string type="Unique");
131
135
138 CommConstPtrConst_Type getComm(){return comm_;};
139
143 int setStructuredMeshFlags(int flags){return 0;};
144
147 void setElementFlags(std::string type="");
148
151
155 void moveMesh( MultiVectorPtr_Type displacementUnique, MultiVectorPtr_Type displacementRepeated );
156
161 int getSurfaceElementOrder() { return surfaceElementOrder_; };
162
167 int getEdgeElementOrder() { return edgesElementOrder_; };
168
169
170 // Creates an AABBTree from own vertice- and elementlist.
171 void create_AABBTree();
172
173 vec_int_ptr_Type findElemsForPoints(vec2D_dbl_ptr_Type query_points);
174
175 vec_dbl_Type getBaryCoords(vec_dbl_Type point, int element);
176
177 bool isPointInElem(vec_dbl_Type point, int element);
178
181 tuple_intint_Type getRankRange() const {return rankRange_;};
182
184 void deleteSurfaceElements(){ surfaceElements_.reset(); };
185
188
191
195 vec2D_int_ptr_Type getElements();
196
197 /* ###################################################################### */
198
199 int dim_;
200 long long numElementsGlob_;
201
202 std::string FEType_;
203 MapPtr_Type mapUnique_;
204 MapPtr_Type mapRepeated_;
205 vec2D_dbl_ptr_Type pointsRep_;
206 vec2D_dbl_ptr_Type pointsUni_;
207 vec_int_ptr_Type bcFlagRep_;
208 vec_int_ptr_Type bcFlagUni_;
209
210 ElementsPtr_Type surfaceElements_;
211
212 ElementsPtr_Type elementsC_;
213 MapPtr_Type elementMap_;
214 MapPtr_Type edgeMap_;
215
216
217 CommConstPtrConst_Type comm_;
218
219 vec2D_int_ptr_Type elementsVec_;
220
221 vec2D_dbl_ptr_Type pointsRepRef_; // Repeated Referenzkonfiguration
222 vec2D_dbl_ptr_Type pointsUniRef_; // Unique Referenzkonfiguration
223
224 //vec_int_ptr_Type elementFlag_;
225
226 int elementOrder_;
227 int surfaceElementOrder_;
228 int edgesElementOrder_;
229
230 AABBTreePtr_Type AABBTree_;
231
232 tuple_intint_Type rankRange_;
233
234 /* ###################################################################### */
235private:
236
237 void flipSurface(ElementsPtr_Type subEl, int surfaceNumber);
238 void flipElement(ElementsPtr_Type elements, int elementNumber);
239};
240}
241
242#endif
Definition AABBTree_decl.hpp:24
Definition Elements.hpp:22
Definition FiniteElement.hpp:17
Definition Map_decl.hpp:36
ElementsPtr_Type getElementsC()
Returns element list as c-object.
Definition Mesh_def.hpp:150
tuple_intint_Type getRankRange() const
Definition Mesh_decl.hpp:181
int setStructuredMeshFlags(int flags)
This is done in meshStructured. Maybe we should move it here or delete this.
Definition Mesh_decl.hpp:143
void setParameterList(ParameterListPtr_Type &pL)
Setting input parameterlist to be parameterlist here.
vec2D_dbl_ptr_Type getPointsRepeated() const
getter for list of repeated points with x,y,z coordinates in each row
Definition Mesh_def.hpp:126
CommConstPtrConst_Type getComm()
Communicator object.
Definition Mesh_decl.hpp:138
MapConstPtr_Type getEdgeMap()
Getter for edge map.
Definition Mesh_def.hpp:120
vec2D_dbl_ptr_Type getPointsUnique() const
getter for list of unique points with x,y,z coordinates in each row
Definition Mesh_def.hpp:132
vec_int_ptr_Type getBCFlagRepeated() const
Getter for flags corresponting to repeated points.
Definition Mesh_def.hpp:138
void setElementFlags(std::string type="")
Something for TPM. Can be deprecated soon.
Definition Mesh_def.hpp:67
void correctNormalDirections()
Correcting the normal direction of all surface normals set as subelements of volume elements to be ou...
Definition Mesh_def.hpp:442
GO getNumElementsGlobal()
Global number of elements.
Definition Mesh_def.hpp:166
vec_int_ptr_Type getElementsFlag() const
Getter for element flags.
Definition Mesh_def.hpp:94
MapConstPtr_Type getMapUnique() const
Getter for unique node map.
Definition Mesh_def.hpp:101
MapConstPtr_Type getElementMap() const
Getter for element map.
Definition Mesh_def.hpp:113
void correctElementOrientation()
Correct the element orientation of all elements to have positive volume / det when doint transformati...
Definition Mesh_def.hpp:508
vec2D_int_ptr_Type getElements()
Returns elements as a vector type contrary to the C-object list.
Definition Mesh_def.hpp:433
ParameterListConstPtr_Type getParameterList() const
Getter for paramaeterlist that is set here.
ElementsPtr_Type getSurfaceElements()
Getter for surface elements. Probably set in mesh partitioner. They are generally the dim-1 surface e...
Definition Mesh_def.hpp:155
void deleteData()
int getEdgeElementOrder()
Get EdgeElement order.
Definition Mesh_decl.hpp:167
int getSurfaceElementOrder()
Get SurfaceElement order.
Definition Mesh_decl.hpp:161
MapConstPtr_Type getMapRepeated() const
Getter for repeated node mal.
Definition Mesh_def.hpp:107
LO getNumElements()
Local number of elements.
Definition Mesh_def.hpp:172
void deleteSurfaceElements()
Deleting surface elements, called after reading input mesh.
Definition Mesh_decl.hpp:184
LO getNumPoints(std::string type="Unique")
Get local (LO) number of points either in unique or repeated version.
Definition Mesh_def.hpp:178
int getDimension()
Definition Mesh_def.hpp:160
void moveMesh(MultiVectorPtr_Type displacementUnique, MultiVectorPtr_Type displacementRepeated)
Moving mesh according to displacement based on reference configuration.
Definition Mesh_def.hpp:268
int getOrderElement()
Definition Mesh_def.hpp:189
void setReferenceConfiguration()
Setting current coordinates as reference configuration. Should only be called once :D.
Definition Mesh_def.hpp:232
vec_int_ptr_Type getBCFlagUnique() const
Getter for flags corresponting to unique points.
Definition Mesh_def.hpp:144
Definition MultiVector_decl.hpp:36
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5