NeoPZ
pzintel.h
Go to the documentation of this file.
1 
6 #ifndef PZINTEL_H
7 #define PZINTEL_H
8 
9 #include "pzcompel.h"
10 #include "pzinterpolationspace.h"
11 //#include "pzmaterial.h"
12 struct TPZElementMatrix;
13 
14 class TPZIntPoints;
15 #include "TPZCompElDisc.h"
16 #include "TPZOneShapeRestraint.h"
17 #include "pzblockdiag.h"
18 
28 
29 protected:
30 
37  void UpdateNeighbourSideOrder(int side, TPZVec<TPZCompElSide> &elvec);
38 
45  static int ComputeSideOrder(TPZVec<TPZCompElSide> &elementset);
46 
47 
48 public:
55  TPZInterpolatedElement(TPZCompMesh &mesh, TPZGeoEl *reference, int64_t &index);
56 
61 
69  const TPZInterpolatedElement &copy,
70  std::map<int64_t,int64_t> & gl2lcElMap);
71 
74  virtual ~TPZInterpolatedElement();
75 
77  virtual void SetCreateFunctions(TPZCompMesh *mesh) override;
78  int ClassId() const override;
79 
81  void Write(TPZStream &buf, int withclassid) const override;
82 
84  void Read(TPZStream &buf, void *context) override;
85 
93  virtual void Print(std::ostream &out = std::cout) const override;
94 
96  int NShapeF() const override;
97 
99  int NSideShapeF(int side) const;
100 
102  virtual int NSideConnects(int iside) const override = 0;
103 
109  virtual int SideConnectLocId(int icon,int is) const override = 0;
110 
115  virtual int MidSideConnectLocId(int is) const;
116 
121  virtual TPZConnect &MidSideConnect(int is) const;
122 
123 
125  int64_t SideConnectIndex(int icon,int is) const;
126 
128  TPZConnect &SideConnect(int icon,int is);
129 
131  virtual int Dimension() const override = 0;
132 
134  virtual int NCornerConnects() const = 0;
135 
137  virtual int NConnects() const override = 0;
138 
140  virtual void BuildCornerConnectList(std::set<int64_t> &connectindexes) const override;
141 
142 
148  virtual void GetInterpolationOrder(TPZVec<int> &ord) = 0;
149 
151  virtual int PreferredSideOrder(int iside) = 0;
152 
158  int AdjustPreferredSideOrder(int side, int order);
159 
161  virtual int EffectiveSideOrder(int side) const = 0;
162 
164  bool VerifyConstraintConsistency(int side, TPZCompElSide large) const;
174  virtual void SetConnectIndex(int i, int64_t connectindex) override = 0;
175 
176  virtual void SetIntegrationRule(int order) override {
177  std::cout << "TPZInterpolatedElement::SetIntegrationRule called\n";
178  }
179 
185  virtual void SetPreferredOrder(int order) override = 0;
186 
187 public:
194  virtual void SetSideOrder(int side, int order) = 0;
195 
197  virtual void ForceSideOrder(int side, int order);
198 
201 public:
202 
203 
211  virtual void SideShapeFunction(int side, TPZVec<REAL> &point, TPZFMatrix<REAL> &phi, TPZFMatrix<REAL> &dphi) override = 0;
212 
224 public:
232  virtual void ComputeSolution(TPZVec<REAL> &qsi, TPZSolVec &sol, TPZGradSolVec &dsol,TPZFMatrix<REAL> &axes) override;
233 
234  public:
235 
241  virtual void ComputeSolution(TPZVec<REAL> &qsi, TPZMaterialData &data) override;
242 
252  virtual void ComputeSolution(TPZVec<REAL> &qsi, TPZFMatrix<REAL> &phi, TPZFMatrix<REAL> &dphix,
253  const TPZFMatrix<REAL> &axes, TPZSolVec &sol, TPZGradSolVec &dsol) override;
254 
267  virtual void ComputeSolution(TPZVec<REAL> &qsi,
268  TPZVec<REAL> &normal,
269  TPZSolVec &leftsol, TPZGradSolVec &dleftsol,TPZFMatrix<REAL> &leftaxes,
270  TPZSolVec &rightsol, TPZGradSolVec &drightsol,TPZFMatrix<REAL> &rightaxes) override;
271 
283  virtual REAL CompareElement(int var, char *matname) override;
284 
306  void Divide(int64_t index,TPZVec<int64_t> &sub,int interpolatesolution = 0) override;
307 
318  void PRefine(int order) override;
319 
322  virtual void RestrainSide(int side, TPZInterpolatedElement *neighbour, int neighbourside);
323 
332 
342  virtual void RemoveSideRestraintsII(MInsertMode mode);
343 
352  virtual void RemoveSideRestraintWithRespectTo(int side, const TPZCompElSide &neighbour);
353 
359  void RecomputeRestraints(int side);
360 
362  virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
363  {
364  DebugStop();
365  }
366 
375  virtual void BuildTransferMatrix(TPZInterpolatedElement &coarsel, TPZTransform<> &t, TPZTransfer<STATE> &transfer);
376 
383  virtual int64_t CreateMidSideConnect(int side);
384 
390  virtual void IdentifySideOrder(int side);
391 
401  void CheckConstraintConsistency(int side);
402 
405 
407  virtual int CheckElementConsistency();
408 
419  int CompareShapeF(int sides, int sidel, TPZFMatrix<REAL> &phis, TPZFMatrix<REAL> &dphis, TPZFMatrix<REAL> &phil, TPZFMatrix<REAL> &dphil, TPZTransform<> &transform);
420 
427  virtual TPZTransform<> TransformSideToElement(int side) = 0;
428 
431 public:
432 
434  virtual void SetInterface(int /*side*/, int64_t /*index*/) { }
435  virtual int Interface(int /*side*/) { return -1; }
436  virtual int CanHaveInterface() { return 0; }
437  virtual void DeleteInterfaces() { }
439  REAL MeanSolution(int var);
441  void CalcIntegral(TPZElementMatrix &ef);
442 
443 };
444 
445 #endif
void RecomputeRestraints(int side)
Will recompute the restraints of all connects which are restrained by this side.
Definition: pzintel.cpp:404
void UpdateNeighbourSideOrder(int side, TPZVec< TPZCompElSide > &elvec)
Updates the interpolation order of all neighbouring elements along side to have side order equal to t...
Definition: pzintel.cpp:432
virtual void SetConnectIndex(int i, int64_t connectindex) override=0
Sets the node pointer of node i to nod.
Implements computational element and a side. Computational Element.
Definition: pzcompel.h:632
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Definition: pzconnect.h:30
virtual void RestrainSide(int side, TPZInterpolatedElement *neighbour, int neighbourside)
Compute the shapefunction restraints which need to be applied to the shape functions on the side of t...
Definition: pzintel.cpp:849
virtual int Dimension() const override=0
Returns the dimension of the element.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
Definition: pzintel.cpp:1940
REAL MeanSolution(int var)
Returns total mass contained into the element.
Definition: pzintel.cpp:1630
Contains declaration of TPZCompEl class which defines the interface of a computational element...
int AdjustPreferredSideOrder(int side, int order)
Adjusts the preferredSideOrder for faces.
Definition: pzintel.cpp:1755
virtual void DeleteInterfaces()
Definition: pzintel.h:437
virtual void Print(std::ostream &out=std::cout) const override
Prints the relevant data of the element to the output stream.
Definition: pzintel.cpp:1528
Contains declaration of TPZInterpolationSpace class which implements the interface for interpolated c...
virtual void RemoveSideRestraintsII(MInsertMode mode)
Delete the restraints on the nodes of the connected elements if necessary.
Definition: pzintel.cpp:1286
Definition of the retraint associated with the top of the pyramid.
virtual int64_t CreateMidSideConnect(int side)
Verify the neighbours of the element and create a node along this side.
Definition: pzintel.cpp:654
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: pzintel.cpp:1956
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const override
adds the connect indexes associated with base shape functions to the set
Definition: pzintel.cpp:2053
Contains TPZBlockDiagonal class which defines block diagonal matrices.
virtual void ForceSideOrder(int side, int order)
Impose an interpolation order on a given side (without using computesideorder)
Definition: pzintel.cpp:114
virtual int CanHaveInterface()
Definition: pzintel.h:436
int NShapeF() const override
Returns the total number of shapefunctions.
Definition: pzintel.cpp:63
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
Definition: pzintel.cpp:1945
TPZConnect & SideConnect(int icon, int is)
Returns a pointer to the icon th connect object along side is.
Definition: pzintel.cpp:105
void CalcIntegral(TPZElementMatrix &ef)
Computes the integral over the finite element.
Definition: pzintel.cpp:1674
virtual void SideShapeFunction(int side, TPZVec< REAL > &point, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override=0
Compute the values of the shape function along the side.
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
virtual void IdentifySideOrder(int side)
Checks if the side order is consistent with the preferred side order and with the constraints and rec...
Definition: pzintel.cpp:216
virtual ~TPZInterpolatedElement()
Destructor, does nothing.
Definition: pzintel.cpp:60
virtual void GetInterpolationOrder(TPZVec< int > &ord)=0
Identifies the interpolation order of all connects of the element different from the corner connects...
void CheckConstraintConsistency()
Check the consistency of the constrained connects for all sides.
Definition: pzintel.cpp:1087
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
Add a shape restraint (meant to fit the pyramid to restraint.
Definition: pzintel.h:362
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
void Divide(int64_t index, TPZVec< int64_t > &sub, int interpolatesolution=0) override
Implement the refinement of an interpolated element.
Definition: pzintel.cpp:1396
virtual int SideConnectLocId(int icon, int is) const override=0
Returns the local node number of icon along is.
virtual TPZConnect & MidSideConnect(int is) const
Returns a reference to the connect in the middle of the side.
Definition: pzintel.cpp:94
int CompareShapeF(int sides, int sidel, TPZFMatrix< REAL > &phis, TPZFMatrix< REAL > &dphis, TPZFMatrix< REAL > &phil, TPZFMatrix< REAL > &dphil, TPZTransform<> &transform)
Compare the shape functions of sides of an element.
Definition: pzintel.cpp:1167
bool VerifyConstraintConsistency(int side, TPZCompElSide large) const
return true if the connects associated with the side have dependency with large and if the dependency...
Definition: pzintel.cpp:2062
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
virtual int NConnects() const override=0
Returns the number of connect objects of the element.
virtual void SetInterface(int, int64_t)
To enable to work with discontinuous element that can have interface elements.
Definition: pzintel.h:434
virtual int PreferredSideOrder(int iside)=0
Returns the preferred order of the polynomial along side iside.
virtual void SetCreateFunctions(TPZCompMesh *mesh) override
Set create function in TPZCompMesh to create elements of this type.
Definition: pzintel.cpp:2126
virtual int CheckElementConsistency()
Checks element data structure consistancy.
Definition: pzintel.cpp:1093
virtual void BuildTransferMatrix(TPZInterpolatedElement &coarsel, TPZTransform<> &t, TPZTransfer< STATE > &transfer)
Accumulates the transfer coefficients between the current element and the coarse element into the tra...
Definition: pzintel.cpp:447
virtual TPZTransform TransformSideToElement(int side)=0
Returns the transformation which transform a point from the side to the interior of the element...
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
virtual int EffectiveSideOrder(int side) const =0
Returns the actual interpolation order of the polynomial along the side.
virtual int NCornerConnects() const =0
Returns the number of corner connects of the element.
MInsertMode
Defines a flag indicating the state of creation/deletion of the element This has an impact on how con...
Definition: pzintel.h:331
int NSideShapeF(int side) const
Returns the number of shape functions on a side.
Definition: pzintel.cpp:73
virtual void SetPreferredOrder(int order) override=0
Sets the preferred interpolation order along a side.
virtual int NSideConnects(int iside) const override=0
Returns the number of dof nodes along side iside.
int64_t SideConnectIndex(int icon, int is) const
Returns the index of the c th connect object along side is.
Definition: pzintel.cpp:101
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
virtual void RemoveSideRestraintWithRespectTo(int side, const TPZCompElSide &neighbour)
Removes the side restraints of the current element along side with respect to neighbour/side.
Definition: pzintel.cpp:1253
void PRefine(int order) override
Changes the interpolation order of a side. Updates all constraints and block sizes ...
Definition: pzintel.cpp:1592
virtual REAL CompareElement(int var, char *matname) override
Compare the L2 norm of the difference between the švarš solution of the current element with the švar...
Definition: pzintel.cpp:1487
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
virtual int Interface(int)
Definition: pzintel.h:435
Implements rectangular matrix which extends a solution vector of the coarse mesh to a solution vector...
Definition: pzcmesh.h:33
virtual void SetIntegrationRule(int order) override
Definition: pzintel.h:176
int ClassId() const override
Define the class id associated with the class.
Definition: pzintel.cpp:1935
virtual void SetSideOrder(int side, int order)=0
Sets the interpolation order of side to order.
Implements computational element based on an interpolation space. Computational Element.
Definition: pzintel.h:27
static int ComputeSideOrder(TPZVec< TPZCompElSide > &elementset)
Computes the minimum interpolation order of the elements contained in elementset this method is used ...
Definition: pzintel.cpp:1371
virtual int MidSideConnectLocId(int is) const
Returns the local id of the connect in the middle of the side.
Definition: pzintel.cpp:83