NeoPZ
TPZMHMixedHybridMeshControl.h
Go to the documentation of this file.
1 //
2 // TPZMHMixedHybridMeshControl.hpp
3 // PZ
4 //
5 // Created by Philippe Devloo on 09/10/16.
6 //
7 //
8 
9 #ifndef TPZMHMixedHybridMeshControl_hpp
10 #define TPZMHMixedHybridMeshControl_hpp
11 
12 #include <stdio.h>
13 
14 #include "TPZMHMixedMeshControl.h"
16 
19 {
20 
21 
22 
23 public:
24 
26  {
27 
28  }
29 
31  {
32 
33  }
34 
35  // TPZMHMixedHybridMeshControl(TPZAutoPointer<TPZGeoMesh> gmesh, std::set<int64_t> &coarseindices);
36 
38 
40 
41 
43  {
44  }
45 
47 
49  {
52  return *this;
53  }
54 
56  virtual void InsertPeriferalMaterialObjects();
57 
60 
63 
65  virtual void BuildComputationalMesh(bool usersubstructure);
66 
67 public:
68 
70  int fHDivWrapperMatId = 505;
71 
73  int fPressureDim1MatId = 506;
74 
76  int fPressureDim2MatId = 507;
77 
79  std::set<int> fFractureFlowDim1MatId;
80 
82  virtual bool IsSkeletonMatid(int matid)
83  {
84  return matid == fSkeletonMatId || fSkeletonWithFlowMatId.find(matid) != fSkeletonWithFlowMatId.end();
85  }
86 
89 
91  std::set<int> fSkeletonWithFlowMatId;
92 
95 
96 protected:
97  // create the elements domain per domain with approximation spaces disconnected from each other
98  virtual void CreateInternalFluxElements();
99 
100  // create the approximation space associated with the skeleton and restrain the connects
101  virtual void CreateSkeleton();
102 
104  virtual void CreateMultiPhysicsInterfaceElements(int dim);
105 
106 
107 public:
108 
110  {
111  if (fFractureFlowDim1MatId.find(matid) != fFractureFlowDim1MatId.end()) {
112  DebugStop();
113  }
114  fFractureFlowDim1MatId.insert(matid);
115  }
116 
117  // create HDiv approximation spaces associated with the pressure skeleton elements
118  // initially we will create only HDiv elements associated with the coarse skeleton elements
120 
121  // create HDiv approximation spaces associated with the pressure elements on internal side
122  // initially we will create only HDiv elements associated with the coarse skeleton elements
124 
127  // the material id of the pressure element can be either fPressureSkeletonMatId or fPressureDim1MatId
128  // An H(div) and a pressure element will be created with material Id of the geometric element
129  // HDivWrapper boundary elements will also be created
130  void CreateAxialFluxElement(TPZInterpolatedElement *PressureElement, int gelfluxmatid);
131 
134 
135 
137  // if the element is neighbour of a pressure boundary condition, maintain the pressure bc
138  // if the element is neighbour of a flux boundary condition, apply a homogeneous flux condition
140 
142  // only implemented in the hybrid Hdiv version
143  virtual void CheckMeshConsistency();
144 
146  virtual void PrintFriendly(std::ostream &out);
147 
149  virtual void SetHybridize(bool flag)
150  {
151  fHybridize = flag;
152  }
153 
154 protected:
155 
157  virtual void CreatePressureMHMMesh();
158 
159 
160  // create the dim-1 pressure elements between the hdiv elements
161  // this method now relies on the existence of the geometric elements
163 
166  virtual void HybridizeSkeleton(int skeletonmatid, int pressurematid);
167 
170  // when dim==2 create a point pressure element for each skeleton element
171  // only create internal elements - we do not hybridize the contours
172  // associate an L2 do nothing material
174 
176  // the method will look if there is a neighbouring geometric element with material id fPressureDim1MatId
177  bool NeedsHDivWrapper(TPZGeoElSide gelside);
178 
179  // create a boundary element around each flux element to optimize calculations
180  void CreateHDivWrappers();
181 
182  // Find the two connected flux elements to a pressure element
183  void FindConnectedElements(TPZGeoElSide &pressureindex, int domain, TPZVec<TPZCompElSide> &fluxconnected);
184 
186  virtual void GroupandCondenseElements();
187 
189  void GroupElements(TPZCompMesh *cmesh);
190 
196 
197 };
198 
199 #endif /* TPZMHMixedHybridMeshControl_hpp */
class for creating TPZMHMM with Mixed Meshes
class for creating TPZMHMM with Mixed Meshes
TPZMHMixedMeshControl & operator=(const TPZMHMixedMeshControl &cp)
bool NeedsHDivWrapper(TPZGeoElSide gelside)
verifies if a HDiv wrapper needs to be created for a given element/side
void SplitFluxElementsAroundFractures()
split the fluxes between the flux elements adjacent to a fracture
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
int fPressureDim1MatId
material id of the pressure Lagrange multipliers of dimension fDim-1
int fSkeletonMatId
material id associated with the skeleton elements
void CreateAxialFluxElement(TPZInterpolatedElement *PressureElement, int gelfluxmatid)
Add axial flux to a pressure element.
bool fHybridize
flag to indicate whether we create a hybridized mesh
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Definition: pzgeoelside.h:83
virtual void GroupandCondenseElements()
group and condense the elements
int fHomogeneousNeumannBcMatId
material id of zero flux boundary condition, used for fracture elements
int fHDivWrapperMatId
material id of the wrapper elements at the end of H(div) elements
int fPressureDim2MatId
material id of the pressure Lagrange multipliers of dimension fDim-2
std::set< int > fFractureFlowDim1MatId
material id of the flow elements of dimension fDim-1
virtual void CreatePressureMHMMesh()
Create the pressure mesh which is dual to the flux mesh.
TPZMHMixedHybridMeshControl(const TPZMHMixedHybridMeshControl &copy)
void GroupElements(TPZCompMesh *cmesh)
group element H(div) elements with surrounding interface elements
virtual void CreateSkeleton()
will create the elements on the skeleton
void FindConnectedElements(TPZGeoElSide &pressureindex, int domain, TPZVec< TPZCompElSide > &fluxconnected)
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
std::set< int > fSkeletonWithFlowMatId
material id of skeleton elements which have axial flow
TPZMHMixedHybridMeshControl & operator=(const TPZMHMixedHybridMeshControl &cp)
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
virtual void SetHybridize(bool flag)
Set the hybridization to true.
virtual bool IsSkeletonMatid(int matid)
Return true if the material id is related to a skeleton.
virtual void PrintFriendly(std::ostream &out)
print the elements in a readable format
virtual void InsertPeriferalHdivMaterialObjects()
Insert the necessary H(div) material objects to create the flux mesh.
virtual void CreateMultiPhysicsInterfaceElements(int dim)
Create the interfaces between the pressure elements of dimension dim.
virtual void CheckMeshConsistency()
verify the consistency of the datastructure
void AdjustBoundaryConditionsOfFractures()
Change the material id of the boundary elements associated with fracture flow.
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
virtual void HybridizeSkeleton(int skeletonmatid, int pressurematid)
hybridize the flux elements - each flux element becomes 5 elements
virtual void InsertPeriferalPressureMaterialObjects()
Insert the necessary pressure material objects to create the pressure mesh.
virtual void BuildComputationalMesh(bool usersubstructure)
Create all data structures for the computational mesh.
virtual void InsertPeriferalMaterialObjects()
Insert Boundary condition objects that do not perform any actual computation.
Implements computational element based on an interpolation space. Computational Element.
Definition: pzintel.h:27
int fSkeletonWithFlowPressureMatId
material id of the pressure corresponding to the skeleton with axial flow