Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
MeshStructured_decl.hpp
1#ifndef MeshStructured_decl_hpp
2#define MeshStructured_decl_hpp
3
4#include "feddlib/core/Utils/FEDDUtils.hpp"
5#include "Mesh.hpp"
6
15
26namespace FEDD {
27template <class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
28class MeshStructured : public Mesh<SC,LO,GO,NO> {
29
30public:
31 typedef Mesh<SC,LO,GO,NO> Mesh_Type;
32 typedef typename Mesh_Type::CommPtr_Type CommPtr_Type;
33 typedef typename Mesh_Type::CommConstPtrConst_Type CommConstPtrConst_Type;
34 typedef typename Mesh_Type::Map_Type Map_Type;
35 typedef typename Mesh_Type::MapPtr_Type MapPtr_Type;
36 typedef typename Mesh_Type::ElementsPtr_Type ElementsPtr_Type;
37 typedef Teuchos::RCP<MeshStructured<SC,LO,GO,NO> > MeshStrPtr_Type;
38 /* ###################################################################### */
39 //
40 MeshStructured();
41
42 MeshStructured(CommConstPtrConst_Type& comm);
43
44 ~MeshStructured();
45
46 void setGeometry2DRectangle(std::vector<double> coordinates, double l, double h);
47
48 void setGeometry3DBox(std::vector<double> coordinates, double l, double w, double h);
49
50
56 void buildMesh2D(std::string FEType,
57 int N,
58 int M,
59 int numProcsCoarseSolve=0);
60
61 // /// @brief Building 2D TPM rectangular mesh with the lenght and height as defined per 'setGeomerty2DRectangle' - characterized by building addition line segments for boundary conditions
62 // /// @param FEType Finite element discretization
63 // /// @param N Number of subdomains
64 // /// @param M H/h with H subdomain diameter (length/H) and h characteristic mesh size (length/(M*N))
65 // /// @param numProcsCoarseSolve if we want to reserve certain processors for coarse solve
66 // /// @param underlyingLib underlying linear algebra library
67 // void buildMesh2DTPM(std::string FEType,
68 // int N,
69 // int M,
70 // int numProcsCoarseSolve=0,
71 // std::string underlyingLib="Tpetra");
72
78 void buildMesh3D(std::string FEType,
79 int N,
80 int M,
81 int numProcsCoarseSolve=0);
82
88 void buildMesh3D5Elements(std::string FEType, int N, int M, int numProcsCoarseSolve);
89
90
96 void buildMesh2DBFS(std::string FEType,
97 int N,
98 int M,
99 int numProcsCoarseSolve=0);
100
106 void buildMesh3DBFS(std::string FEType,
107 int N,
108 int M,
109 int numProcsCoarseSolve=0);
110
116 int M,
117 int numProcsCoarseSolve);
118
124 int M,
125 int numProcsCoarseSolve);
126
131 void build3DQ1Cube(int N,
132 int M,
133 int numProcsCoarseSolve);
134
139 void build3DQ2Cube( int N,
140 int M,
141 int numProcsCoarseSolve);
142
148 int M,
149 int numProcsCoarseSolve);
154 void build3DQ1BFS(int N,
155 int M,
156 int numProcsCoarseSolve);
157
158
163 void build3DQ2BFS( int N,
164 int M,
165 int numProcsCoarseSolve);
166
167// /// @brief Building 2D mini TPM rectangular mesh with the lenght and height as defined per 'setGeomerty2DRectangle' - characterized by building addition line segments for boundary conditions
168// /// @param FEType Finite element discretization
169// /// @param N Number of subdomains
170// /// @param M H/h with H subdomain diameter (length/H) and h characteristic mesh size (length/(M*N))
171// /// @param numProcsCoarseSolve if we want to reserve certain processors for coarse solve
172// /// @param underlyingLib underlying linear algebra library
173// void buildMesh2DMiniTPM(std::string FEType,
174// int N,
175// int M,
176// int numProcsCoarseSolve=0,
177// std::string underlyingLib="Tpetra" );
178
179 // /// @brief Building suface lines for TPM square mini. Empty.
180 // /// @param feType
181 // void buildSurfaceLinesSquareMiniTPM( string feType );
182
183 void setRankRange( int numProcsCoarseSolve );
184
185 void buildElementsClass( vec2D_int_ptr_Type elements, vec_int_ptr_Type elementFlag = Teuchos::null );
186
189
190 GO globalID_Q2_20Cube(int r, int s , int t, int &rr, int off_x, int off_y, int off_z, int M, int N,
191 GO nmbPoints_oneDirFull, GO nmbPoints_oneDirMid);
192
196 void setStructuredMeshFlags(int flagsOption,std::string FEType="P1");
197
200
204 void buildSurfaces(int flagsOption, std::string FEType);
205
206 void flipSurface(vec_int_Type &surfaceElements_vec);
207
208
209 /* ###################################################################### */
210
211 std::vector<double> coorRec;
212 double length; // length of geometry
213 double height; // height of geometry
214 double width; // width of geometry
215
216 /* ###################################################################### */
217private:
218};
219}
220#endif
void buildMesh3DBFS(std::string FEType, int N, int M, int numProcsCoarseSolve=0)
Building general 3D backward facing step with length, width and height as defines by 'setGeometry3DBo...
Definition MeshStructured_def.hpp:2456
void buildElementMap()
Building element map.
Definition MeshStructured_def.hpp:4237
void build3DQ1BFS(int N, int M, int numProcsCoarseSolve)
Building general 3D backward facing step with length, width and height as defines by 'setGeometry3DBo...
Definition MeshStructured_def.hpp:1627
void buildMesh3D(std::string FEType, int N, int M, int numProcsCoarseSolve=0)
Building general 3D cuboid with length, width and height as defines by 'setGeometry3DBox'....
Definition MeshStructured_def.hpp:575
void buildP1_Disc_Q2_3DCube(int N, int M, int numProcsCoarseSolve)
Building general 3D cuboid with length, width and height as defines by 'setGeometry3DBox' with Q2-P1 ...
Definition MeshStructured_def.hpp:964
void buildMesh3D5Elements(std::string FEType, int N, int M, int numProcsCoarseSolve)
Building general 3D cuboid with length, width and height as defines by 'setGeometry3DBox'....
Definition MeshStructured_def.hpp:3681
void buildMesh2DBFS(std::string FEType, int N, int M, int numProcsCoarseSolve=0)
Building 2D backward facing step geometry with the lenght and height as defined per 'setGeomerty2DRec...
Definition MeshStructured_def.hpp:1999
void build3DQ2_20Cube(int N, int M, int numProcsCoarseSolve)
Building general 3D cuboid with length, width and height as defines by 'setGeometry3DBox' with Q2 dis...
Definition MeshStructured_def.hpp:1477
void build3DQ1Cube(int N, int M, int numProcsCoarseSolve)
Building general 3D cuboid with length, width and height as defines by 'setGeometry3DBox' with Q1 dis...
Definition MeshStructured_def.hpp:1144
void buildP1_Disc_Q2_3DBFS(int N, int M, int numProcsCoarseSolve)
Building general 3D backward facing step with length, width and height as defines by 'setGeometry3DBo...
Definition MeshStructured_def.hpp:2920
void build3DQ2Cube(int N, int M, int numProcsCoarseSolve)
Building general 3D cuboid with length, width and height as defines by 'setGeometry3DBox' with Q2 dis...
Definition MeshStructured_def.hpp:1267
void buildSurfaces(int flagsOption, std::string FEType)
Building surfaces. This is useful for structural problems. Each surface gets another flag....
Definition MeshStructured_def.hpp:3974
void buildSurfaceLinesSquare()
Building suface lines aka edges. Empty.
Definition MeshStructured_def.hpp:227
void setStructuredMeshFlags(int flagsOption, std::string FEType="P1")
Setting corresponding flags to structured mesh depending on underlying problem. Rectangles/Cuboids ar...
Definition MeshStructured_def.hpp:3103
void build3DQ2BFS(int N, int M, int numProcsCoarseSolve)
Building general 3D backward facing step with length, width and height as defines by 'setGeometry3DBo...
Definition MeshStructured_def.hpp:1803
void buildMesh2D(std::string FEType, int N, int M, int numProcsCoarseSolve=0)
Building a general 2D rectangular mesh with the lenght and height as defined per 'setGeomerty2DRectan...
Definition MeshStructured_def.hpp:237
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36