NeoPZ
pzelchdiv.h
Go to the documentation of this file.
1 
6 #ifndef PZELCHDIVHTT
7 #define PZELCHDIVHTT
8 
9 #include "pzelctemp.h"
10 #include "TPZOneShapeRestraint.h"
11 
12 
21 template<class TSHAPE>
22 class TPZCompElHDiv : public TPZIntelGen<TSHAPE> {
23 
26 
28  std::list<TPZOneShapeRestraint> fRestraints;
29 
30 protected:
33 
34 public:
35 
36  TPZCompElHDiv(TPZCompMesh &mesh, TPZGeoEl *gel, int64_t &index);
37 
39 
45  const TPZCompElHDiv<TSHAPE> &copy,
46  std::map<int64_t,int64_t> & gl2lcConMap,
47  std::map<int64_t,int64_t> & gl2lcElMap);
48 
49  TPZCompElHDiv();
50 
51  virtual ~TPZCompElHDiv();
52 
53  virtual TPZCompEl *Clone(TPZCompMesh &mesh) const override {
54  return new TPZCompElHDiv<TSHAPE> (mesh, *this);
55  }
56 
64  virtual TPZCompEl *ClonePatchEl(TPZCompMesh &mesh,std::map<int64_t,int64_t> & gl2lcConMap,std::map<int64_t,int64_t>&gl2lcElMap) const override
65  {
66  return new TPZCompElHDiv<TSHAPE> (mesh, *this, gl2lcConMap, gl2lcElMap);
67  }
68 
70  virtual void SetCreateFunctions(TPZCompMesh *mesh) override;
71 
73  virtual void Print(std::ostream &out = std::cout) const override;
74 
75 
76 
77  virtual MElementType Type() override;
78 
79  virtual int NConnects() const override;
80 
81  virtual void SetConnectIndex(int i, int64_t connectindex) override;
82 
84  int RestrainedFace();
85 
91  virtual int NConnectShapeF(int connect, int order) const override;
92 
93  virtual int Dimension() const override {
94  return TSHAPE::Dimension;
95  }
96 
97  virtual int NCornerConnects() const override {
98  return 0;
99  }
103  virtual int NFluxShapeF() const;
104 
105  virtual int NSideConnects(int side) const override;
106 
110  virtual int SideConnectLocId(int node, int side) const override;
111 
115  virtual int ConnectSideLocId(int connect) const;
116 
117  virtual int64_t ConnectIndex(int con) const override;
118 
120  virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
121  {
122  fRestraints.push_back(restraint);
123  }
124 
126  virtual std::list<TPZOneShapeRestraint> GetShapeRestraints() const override
127  {
128  return fRestraints;
129  }
130 
132  virtual void ResetShapeRestraints() override
133  {
134  fRestraints.clear();
135  }
136 
142  virtual int GetSideOrient(int side) override;
143 
149  virtual void SetSideOrient(int side, int sideorient) override;
150 
151 
152  virtual void SetIntegrationRule(int ord) override;
153 
155  virtual void GetInterpolationOrder(TPZVec<int> &ord) override;
156 
158  virtual int PreferredSideOrder(int iside) override;
159 
160  /*
161  * @brief Sets the preferred interpolation order along a side \n
162  * This method only updates the datastructure of the element
163  * In order to change the interpolation order of an element, use the method PRefine
164  */
165  virtual void SetPreferredOrder(int order) override;
166 
168  virtual void SetSideOrder(int side, int order) override;
169 
171  virtual int EffectiveSideOrder(int side) const override;
172 
176  virtual int ConnectOrder(int connect) const override;
180  int NShapeContinuous(TPZVec<int> &order);
181 
183  void FillOrder(TPZVec<int> &order) const ;
184 
186  virtual int MaxOrder() override;
187 
189  int SideOrient(int face)
190  {
191 #ifdef PZDEBUG
192  if (face < 0 || face >= TSHAPE::NFaces) {
193  DebugStop();
194  }
195 #endif
196  return fSideOrient[face];
197  }
198 
201  virtual void InitMaterialData(TPZMaterialData &data) override;
202 
204  virtual void ComputeRequiredData(TPZMaterialData &data,
205  TPZVec<REAL> &qsi) override;
206 
208  void ComputeShapeIndex(TPZVec<int> &sides, TPZVec<int64_t> &shapeindex);
209 
215 
222  void IndexShapeToVec(TPZVec<int> &VectorSide,TPZVec<std::pair<int,int64_t> > & IndexVecShape, int pressureorder);
223 
230  void IndexShapeToVec(TPZVec<int> &VectorSide, TPZVec<int> &bilinear, TPZVec<int> &direction, TPZVec<std::pair<int,int64_t> > & IndexVecShape, int pressureorder);
231  void IndexShapeToVec2(TPZVec<int> &VectorSide, TPZVec<int> &bilinear, TPZVec<int> &direction, TPZVec<std::pair<int,int64_t> > & IndexVecShape, int pressureorder);
232 
234  virtual void SideShapeFunction(int side,TPZVec<REAL> &point,TPZFMatrix<REAL> &phi,TPZFMatrix<REAL> &dphi) override;
235 
236  void Shape(TPZVec<REAL> &pt, TPZFMatrix<REAL> &phi, TPZFMatrix<REAL> &dphi) override;
237 
239  virtual void Solution( TPZVec<REAL> &qsi,int var,TPZVec<STATE> &sol) override;
240 
241 public:
242  virtual void ComputeSolution(TPZVec<REAL> &qsi, TPZSolVec &sol, TPZGradSolVec &dsol,TPZFMatrix<REAL> &axes) override;
243 
244 public:
245 
251  virtual void ComputeSolution(TPZVec<REAL> &qsi, TPZMaterialData &data) override;
252 
254  virtual void ComputeSolution(TPZVec<REAL> &qsi, TPZFMatrix<REAL> &phi, TPZFMatrix<REAL> &dphix,
255  const TPZFMatrix<REAL> &axes, TPZSolVec &sol, TPZGradSolVec &dsol) override;
256 
271  virtual void ComputeSolution(TPZVec<REAL> &qsi,
272  TPZVec<REAL> &normal,
273  TPZSolVec &leftsol, TPZGradSolVec &dleftsol,TPZFMatrix<REAL> &leftaxes,
274  TPZSolVec &rightsol, TPZGradSolVec &drightsol,TPZFMatrix<REAL> &rightaxes) override
275  {
276  DebugStop();
277  }
278 
279 
282 
283  void CreateGraphicalElement(TPZGraphMesh &grafgrid, int dimension) override;
284 
285 
289  TPZTransform<> TransformSideToElement(int side) override;
290 
292  public:
293 int ClassId() const override;
294 
296  void Write(TPZStream &buf, int withclassid) const override;
297 
299  void Read(TPZStream &buf, void *context) override;
301  virtual void PRefine(int order) override;
302 
303 };
304 
305 template<class TSHAPE>
307  return Hash("TPZCompElHDiv") ^ TPZIntelGen<TSHAPE>::ClassId() << 1;
308 }
309 
310 #include "pzcmesh.h"
311 
312 template<class TSHAPE>
315 }
316 
317 
319 TPZCompEl *CreateHDivLinearEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
321 TPZCompEl *CreateHDivQuadEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
323 TPZCompEl *CreateHDivTriangleEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
325 TPZCompEl *CreateHDivCubeEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
327 TPZCompEl *CreateHDivPrismEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
329 TPZCompEl *CreateHDivPyramEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
331 TPZCompEl *CreateHDivTetraEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
333 TPZCompEl *CreateHDivBoundPointEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
335 TPZCompEl *CreateHDivBoundLinearEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
337 TPZCompEl *CreateHDivBoundQuadEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
339 TPZCompEl *CreateHDivBoundTriangleEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
340 
341 TPZCompEl * CreateRefHDivLinearEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
342 TPZCompEl * CreateRefHDivQuadEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
343 TPZCompEl * CreateRefHDivTriangleEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
344 TPZCompEl * CreateRefHDivCubeEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
345 TPZCompEl * CreateRefHDivPrismEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
346 TPZCompEl * CreateRefHDivPyramEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
347 TPZCompEl * CreateRefHDivTetraEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index);
348 
349 
352 #endif
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
void Shape(TPZVec< REAL > &pt, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Computes the shape function set at the point x.
Definition: pzelchdiv.cpp:1300
virtual void Print(std::ostream &out=std::cout) const override
Prints the relevant data of the element to the output stream.
Definition: pzelchdiv.cpp:1671
TPZCompEl * CreateRefHDivTriangleEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzelchdiv.cpp:1876
virtual void ResetShapeRestraints() override
Return a list with the shape restraints.
Definition: pzelchdiv.h:132
Contains declaration of TPZIntelGen class which implements a generic computational element...
virtual void GetInterpolationOrder(TPZVec< int > &ord) override
Identifies the interpolation order on the interior of the element.
Definition: pzelchdiv.cpp:449
TPZCompEl * CreateHDivPrismEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational prismal element for HDiv approximate space.
Definition: pzelchdiv.cpp:1837
void FirstShapeIndex(TPZVec< int64_t > &Index) const
Returns the vector index of the first index shape associate to to each side Special implementation to...
Definition: pzelchdiv.cpp:599
TPZCompEl * CreateHDivCubeEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational cube element for HDiv approximate space.
Definition: pzelchdiv.cpp:1833
virtual int GetSideOrient(int side) override
It returns the normal orientation of the reference element by the side. Only side that has dimension ...
Definition: pzelchdiv.cpp:873
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
int RestrainedFace()
return the first one dof restraint
Definition: pzelchdiv.cpp:1751
virtual int NCornerConnects() const override
Returns the number of corner connects of the element.
Definition: pzelchdiv.h:97
TPZTransform TransformSideToElement(int side) override
Returns the transformation which transform a point from the side to the interior of the element...
Definition: pzelchdiv.cpp:1336
TPZCompEl * CreateRefHDivQuadEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzelchdiv.cpp:1872
virtual ~TPZCompElHDiv()
Definition: pzelchdiv.cpp:144
TPZCompEl * CreateHDivBoundPointEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational point element for HDiv approximate space.
Definition: pzelchdiv.cpp:1805
virtual MElementType Type() override
Return the type of the element.
Definition: pzelchdiv.cpp:187
TPZCompEl * CreateRefHDivCubeEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzelchdiv.cpp:1880
virtual int ConnectSideLocId(int connect) const
return the local index for side
Definition: pzelchdiv.cpp:442
Definition of the retraint associated with the top of the pyramid.
virtual int ClassId() const override
returns the unique identifier for reading/writing objects to streams
Definition: pzelctemp.h:155
virtual int Dimension() const override
Returns the dimension of the element.
Definition: pzelchdiv.h:93
std::list< TPZOneShapeRestraint > fRestraints
Data structure which defines the restraints.
Definition: pzelchdiv.h:28
TPZCompEl * CreateHDivTetraEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational tetrahedral element for HDiv approximate space.
Definition: pzelchdiv.cpp:1845
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZVec< REAL > &normal, TPZSolVec &leftsol, TPZGradSolVec &dleftsol, TPZFMatrix< REAL > &leftaxes, TPZSolVec &rightsol, TPZGradSolVec &drightsol, TPZFMatrix< REAL > &rightaxes) override
Computes solution and its derivatives in the local coordinate qsi.
Definition: pzelchdiv.h:271
void Read(TPZStream &buf, void *context) override
Read the element data from a stream.
Definition: pzelchdiv.cpp:1572
void IndexShapeToVec(TPZVec< int > &VectorSide, TPZVec< std::pair< int, int64_t > > &IndexVecShape, int pressureorder)
Returns a matrix index of the shape and vector associate to element.
Definition: pzelchdiv.cpp:861
virtual void PRefine(int order) override
Refinement along the element.
Definition: pzelchdiv.cpp:1603
int NShapeContinuous(TPZVec< int > &order)
return the number of continuous functions
Definition: pzelchdiv.cpp:1320
virtual void SetPreferredOrder(int order) override
Sets the preferred interpolation order along a side.
Definition: pzelchdiv.cpp:512
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
Definition: pzelchdiv.cpp:1549
virtual int MaxOrder() override
Return the maximum order??
Definition: pzelchdiv.cpp:1689
virtual void Solution(TPZVec< REAL > &qsi, int var, TPZVec< STATE > &sol) override
Compute the solution for a given variable.
Definition: pzelchdiv.cpp:993
TPZCompEl * CreateHDivPyramEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational pyramidal element for HDiv approximate space.
Definition: pzelchdiv.cpp:1841
virtual void InitMaterialData(TPZMaterialData &data) override
Initialize a material data and its attributes based on element dimension, number of state variables a...
Definition: pzelchdiv.cpp:1471
void ComputeShapeIndex(TPZVec< int > &sides, TPZVec< int64_t > &shapeindex)
Compute the correspondence between the normal vectors and the shape functions.
Definition: pzelchdiv.cpp:1341
virtual TPZCompEl * ClonePatchEl(TPZCompMesh &mesh, std::map< int64_t, int64_t > &gl2lcConMap, std::map< int64_t, int64_t > &gl2lcElMap) const override
Create a copy of the given element. The clone copy have the connect indexes mapped to the local clone...
Definition: pzelchdiv.h:64
TPZCompEl * CreateHDivTriangleEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational triangular element for HDiv approximate space.
Definition: pzelchdiv.cpp:1829
int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
Definition: pzelchdiv.h:306
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
void IndexShapeToVec2(TPZVec< int > &VectorSide, TPZVec< int > &bilinear, TPZVec< int > &direction, TPZVec< std::pair< int, int64_t > > &IndexVecShape, int pressureorder)
Definition: pzelchdiv.cpp:664
TPZCompEl * CreateRefHDivPyramEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzelchdiv.cpp:1888
void SetAllCreateFunctionsHDiv()
Definition: pzcmesh.h:523
virtual void SetConnectIndex(int i, int64_t connectindex) override
Sets the node pointer of node i to nod.
Definition: pzelchdiv.cpp:200
TPZCompEl * CreateHDivBoundTriangleEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational triangular element for HDiv approximate space.
Definition: pzelchdiv.cpp:1817
virtual void SetSideOrient(int side, int sideorient) override
It set the normal orientation of the element by the side. Only side that has dimension equal to my di...
Definition: pzelchdiv.cpp:888
void CreateGraphicalElement(TPZGraphMesh &grafgrid, int dimension) override
Creates corresponding graphical element(s) if the dimension matches graphical elements are used to ge...
Definition: pzelchdiv.cpp:1743
virtual int NFluxShapeF() const
return the number of shape for flux(just for flux)
Definition: pzelchdiv.cpp:625
TPZCompEl * CreateRefHDivPrismEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzelchdiv.cpp:1884
TPZCompEl * CreateHDivBoundQuadEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational quadrilateral element for HDiv approximate space.
Definition: pzelchdiv.cpp:1813
virtual void ComputeRequiredData(TPZMaterialData &data, TPZVec< REAL > &qsi) override
Compute and fill data with requested attributes.
Definition: pzelchdiv.cpp:1376
TPZCompEl * CreateRefHDivLinearEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzelchdiv.cpp:1868
TPZCompEl * CreateRefHDivTetraEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzelchdiv.cpp:1892
int64_t Index() const
Returns element index of the mesh fELementVec list.
Definition: pzcompel.h:821
void Append(TPZFMatrix< REAL > &u1, TPZFMatrix< REAL > &u2, TPZFMatrix< REAL > &u12)
To append vectors.
Definition: pzelchdiv.cpp:1213
virtual void SetCreateFunctions(TPZCompMesh *mesh) override
Set create function in TPZCompMesh to create elements of this type.
Definition: pzelchdiv.h:313
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
Add a shape restraint (meant to fit the pyramid to restraint.
Definition: pzelchdiv.h:120
Contains declaration of TPZCompMesh class which is a repository for computational elements...
void FillOrder(TPZVec< int > &order) const
Fill the polynomial order needed from the continuous shape functions.
Definition: pzelchdiv.cpp:1248
int SideOrient(int face)
the orientation of the face
Definition: pzelchdiv.h:189
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
virtual int PreferredSideOrder(int iside) override
Returns the preferred order of the polynomial along side iside.
Definition: pzelchdiv.cpp:459
virtual void SetSideOrder(int side, int order) override
Sets the interpolation order of side to order.
Definition: pzelchdiv.cpp:519
virtual int SideConnectLocId(int node, int side) const override
return the local index for connect
Definition: pzelchdiv.cpp:430
virtual int NConnects() const override
Returns the number of connect objects of the element.
Definition: pzelchdiv.cpp:193
MElementType
Define the element types.
Definition: pzeltype.h:52
virtual int NSideConnects(int side) const override
Returns the number of dof nodes along side iside.
Definition: pzelchdiv.cpp:411
void ComputeSolutionHDiv(TPZVec< REAL > &qsi, TPZMaterialData &data)
Definition: pzelchdiv.cpp:1007
virtual int64_t ConnectIndex(int con) const override
Returns the index of the ith connectivity of the element.
Definition: pzelchdiv.cpp:479
TPZCompEl * CreateHDivBoundLinearEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational linear element for HDiv approximate space.
Definition: pzelchdiv.cpp:1809
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
virtual void SideShapeFunction(int side, TPZVec< REAL > &point, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Computes the values of the shape function of the side.
Definition: pzelchdiv.cpp:899
virtual std::list< TPZOneShapeRestraint > GetShapeRestraints() const override
Return a list with the shape restraints.
Definition: pzelchdiv.h:126
virtual int EffectiveSideOrder(int side) const override
Returns the actual interpolation order of the polynomial along the side.
Definition: pzelchdiv.cpp:574
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
TPZCompEl * CreateHDivQuadEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational quadrilateral element for HDiv approximate space.
Definition: pzelchdiv.cpp:1825
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
virtual int ConnectOrder(int connect) const override
return the interpolation order of the polynomial for connect
Definition: pzelchdiv.cpp:544
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
virtual int NConnectShapeF(int connect, int order) const override
Number of shapefunctions of the connect associated.
Definition: pzelchdiv.cpp:221
TPZCompEl * CreateHDivLinearEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational linear element for HDiv approximate space.
Definition: pzelchdiv.cpp:1821
virtual void SetIntegrationRule(int ord) override
Definition: pzelchdiv.cpp:404
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZSolVec &sol, TPZGradSolVec &dsol, TPZFMatrix< REAL > &axes) override
Computes solution and its derivatives in the local coordinate qsi.
Definition: pzelchdiv.cpp:1035
TPZManVector< int, TSHAPE::NFaces > fSideOrient
vector which defines whether the normal is outward or not
Definition: pzelchdiv.h:25
virtual TPZCompEl * Clone(TPZCompMesh &mesh) const override
Method for creating a copy of the element.
Definition: pzelchdiv.h:53
Implements a generic computational element. Computational Element.
Definition: pzelctemp.h:20