NeoPZ
pzcreateapproxspace.h
Go to the documentation of this file.
1 
6 #ifndef CREATECONTINUOUSHPP
7 #define CREATECONTINUOUSHPP
8 
9 class TPZCompEl;
10 class TPZCompMesh;
11 class TPZGeoEl;
12 class TPZCompEl;
13 class TPZCompMesh;
14 #include <set>
15 #include "pzvec.h"
16 #include "TPZSavable.h"
17 
18 typedef TPZCompEl *(*TCreateFunction)(TPZGeoEl *el,TPZCompMesh &mesh,int64_t &index);
19 /*
20  * @brief Administer the creation of approximation spaces
21  * @author Philippe Devloo
22  * @since 2009
23  * @ingroup interpolation
24  */
27  TPZCompEl *(*fp[8])(TPZGeoEl *el,TPZCompMesh &mesh,int64_t &index);
28 
30 
34 
37 
40 
41 public:
42 
43  TPZCreateApproximationSpace() : fCreateHybridMesh(false), fCreateLagrangeMultiplier(false), fCreateWithMemory(false)
44  {
46  }
47 
48  TPZCreateApproximationSpace(const TPZCreateApproximationSpace &copy) : fCreateHybridMesh(copy.fCreateHybridMesh), fCreateLagrangeMultiplier(copy.fCreateLagrangeMultiplier)
49  ,fCreateWithMemory(copy.fCreateWithMemory)
50  {
51  for (int i=0; i<8; i++) {
52  fp[i] = copy.fp[i];
53  }
54  }
55 
57  {
58  for (int i=0; i<8; i++) {
59  fp[i] = copy.fp[i];
60  }
61  fCreateHybridMesh = copy.fCreateHybridMesh;
62  fCreateLagrangeMultiplier = copy.fCreateLagrangeMultiplier;
63  fCreateWithMemory = copy.fCreateWithMemory;
64  return *this;
65  }
66  int ClassId() const override;
67 
68  void Read(TPZStream &buf, void *context) override;
69 
70  void Write(TPZStream &buf, int withclassid) const override;
71 
72  void SetCreateLagrange(bool flag)
73  {
74  fCreateLagrangeMultiplier = flag;
75  }
76 
77  void CreateWithMemory(bool flag)
78  {
79  fCreateWithMemory = flag;
80  }
81 
91  void SetAllCreateFunctionsHDiv(int meshdim);
93  void SetAllCreateFunctionsHDivReferred(int meshdim);
95 // void SetAllCreateFunctionsHDivFull(int meshdim);
96 
97 #if defined(USING_MKL) && defined(USING_LAPACK) && !defined(STATE_COMPLEX)
98 
99  void SetAllCreateFunctionsSBFem(int meshdim);
100 #endif
101 
102 #ifndef STATE_COMPLEX
103 
104  void SetAllCreateFunctionsHDivPressure(int meshdim);
105 #endif
106 
107  void SetAllCreateFunctions(TPZCompEl &cel, TPZCompMesh *mesh);
116 
118  void SetCreateFunctions(TPZVec<TCreateFunction> &createfuncs);
119 
121  TPZCompEl *CreateCompEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index) const;
122 
125  void BuildMesh(TPZCompMesh &cmesh, const std::set<int> &MaterialIDs) const;
126 
128  void BuildMesh(TPZCompMesh &cmesh) const;
129 
131  void BuildMesh(TPZCompMesh &cmesh, const TPZVec<int64_t> &gelindexes) const;
132 
135  static void CreateInterfaces(TPZCompMesh &cmesh, const std::set<int> &MaterialIDs);
136 
138  static void CreateInterfaces(TPZCompMesh &cmesh);
139 
145  static void AutoBuildContDisc(const TPZVec<TPZGeoEl*> &continuous, const TPZVec<TPZGeoEl*> &discontinuous);
146 
148  static void CondenseLocalEquations(TPZCompMesh &cmesh);
149 
151  static void UndoCondenseLocalEquations(TPZCompMesh &cmesh);
152 
154  static void MakeRaviartThomas(TPZCompMesh &cmesh);
155 
157  static void UndoMakeRaviartThomas(TPZCompMesh &cmesh);
158 
160  static void CreateInterfaceElements(TPZCompMesh *mesh, bool onlydiscontinuous = true, bool multiphysics = false);
161 
165  void CreateDisconnectedElements(bool create)
166  {
167  fCreateHybridMesh = create;
168  }
169 
170  bool NeedsMemory()
171  {
172  return fCreateWithMemory;
173  }
174 
176  static void Hybridize(TPZCompMesh &cmesh,const std::set<int> &matids, bool isconnectedElem = false);
177 };
178 
179 #endif
void SetAllCreateFunctionsHDivPressure(int meshdim)
Create an approximation space with HDiv elements and full basis for quadrilateral element...
void SetAllCreateFunctionsMultiphysicElemWithMem()
Create an approximation space based on multiphysics elements with memory.
void SetAllCreateFunctionsDiscontinuous()
Create discontinuous approximation spaces.
void SetAllCreateFunctions(TPZCompEl &cel, TPZCompMesh *mesh)
Create approximation spaces corresponding to the space defined by cel.
static void UndoCondenseLocalEquations(TPZCompMesh &cmesh)
Undo the encapsulate elements.
Contains declaration of the TPZSavable class which defines the interface to save and restore objects ...
void SetAllCreateFunctionsContinuousWithMem()
Create an approximation space with continous elements with memory. Only dimension 3 elements quem hav...
static void MakeRaviartThomas(TPZCompMesh &cmesh)
transform in low order Raviar Tomas
TPZCompEl *(* fp[8])(TPZGeoEl *el, TPZCompMesh &mesh, int64_t &index)
Function pointer which determines what type of computational element will be created.
Templated vector implementation.
static void Hybridize(TPZCompMesh &cmesh, const std::set< int > &matids, bool isconnectedElem=false)
this method will substitute all interface elements with materialid within the set by three elements :...
static void UndoMakeRaviartThomas(TPZCompMesh &cmesh)
transform in low order Raviar Tomas
void SetCreateFunctions(TPZVec< TCreateFunction > &createfuncs)
Set custom function pointers.
void SetAllCreateFunctionsContinuousReferred()
Create a continuous approximation space with referred elements.
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
static void CreateInterfaceElements(TPZCompMesh *mesh, bool onlydiscontinuous=true, bool multiphysics=false)
Create interface elements between the computational elements.
void SetAllCreateFunctionsDiscontinuousReferred()
Create a discontinuous approximation space with referred elements.
void SetAllCreateFunctionsMultiphysicElem()
Create an approximation space based on multiphysics elements.
void CreateDisconnectedElements(bool create)
Determine if the mesh will be created with disconnected elements After the mesh is created...
static void AutoBuildContDisc(const TPZVec< TPZGeoEl *> &continuous, const TPZVec< TPZGeoEl *> &discontinuous)
Creates the computational elements, and the degree of freedom nodes.
bool fCreateWithMemory
flag indicating that the elements need to be created with memory
static void CreateInterfaces(TPZCompMesh &cmesh, const std::set< int > &MaterialIDs)
Creates the interface elements.
void SetAllCreateFunctionsHDiv(int meshdim)
Create an approximation space with HDiv elements.
bool fCreateLagrangeMultiplier
flag indicating whether each element should have an aditional lagrange multiplier ...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
TPZCreateApproximationSpace & operator=(const TPZCreateApproximationSpace &copy)
int ClassId() const override
Define the class id associated with the class.
void SetAllCreateFunctionsContinuous()
Create continuous approximation spaces.
void Read(TPZStream &buf, void *context) override
read objects from the stream
TPZCreateApproximationSpace(const TPZCreateApproximationSpace &copy)
bool fCreateHybridMesh
boolean indicating if each element should be created disconnected from the others ...
TPZCompEl * CreateCompEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index) const
Create a computational element using the function pointer for the topology.
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
void BuildMesh(TPZCompMesh &cmesh, const std::set< int > &MaterialIDs) const
Creates the computational elements, and the degree of freedom nodes.
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
static void CondenseLocalEquations(TPZCompMesh &cmesh)
Encapsulate the elements in condensed computational elements.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
void SetAllCreateFunctionsHDivReferred(int meshdim)
Create an approximation space with HDiv elements.