NeoPZ
TPZInterfaceEl.h
Go to the documentation of this file.
1 
5 //$Id: TPZInterfaceEl.h,v 1.60 2010-06-17 17:46:56 phil Exp $
6 
7 #ifndef ELEMINTERFACEHH
8 #define ELEMINTERFACEHH
9 
10 #include "pzcompel.h"
11 #include "pzinterpolationspace.h"
12 #include "pzgeoel.h"
13 #include "pzcmesh.h"
14 #include "pzfmatrix.h"
15 #include "pzvec.h"
16 #include "pzreal.h"
17 
18 #include <stdio.h>
19 #include <time.h>
20 #include <stdlib.h>
21 #include <iostream>
22 #include "TPZCompElDisc.h"
23 #include "pzmaterialdata.h"
24 
25 
31 
32  private :
33 
36 
39 
42 
44  // TPZIntPoints *fIntegrationRule;
45  virtual void InitializeIntegrationRule() override;
46 
48  void DecreaseElConnected();
49 
51  void IncrementElConnected();
52 
53 protected:
54 
57 
60 
64  TPZVec<REAL> &IntPoint);
65 
67  virtual void ComputeRequiredData(TPZMaterialData &data,
68  TPZVec<REAL> &qsi);
69 
70  virtual void ComputeRequiredData(TPZVec<REAL> &intpointtemp, TPZVec<TPZTransform<> > &trvec, TPZVec<TPZMaterialData> &datavec){
71  DebugStop();
72  }
73 
74 
75 public:
76 
78  void GetConnects(TPZCompElSide &elside, TPZVec<TPZConnect*> &connects, TPZVec<int64_t> &connectindex);
79 
89  void NeighbourSolution(TPZCompElSide & Neighbor, TPZVec<REAL> & qsi, TPZSolVec &sol, TPZGradSolVec &dsol, TPZFMatrix<REAL> &NeighborAxes);
90 
91 protected:
92 
98 public:
99  bool CheckConsistencyOfMappedQsi(TPZCompElSide &Neighbor, TPZVec<REAL> &qsi, TPZVec<REAL>&NeighIntPoint);
100 
101  void ComputeSideTransform(TPZCompElSide &Neighbor, TPZTransform<> &transf);
102 protected:
104  void ComputeNormal(TPZVec<REAL>&qsi, TPZVec<REAL> &normal);
105 
108  void ComputeNormal(TPZFMatrix<REAL> &axes, TPZVec<REAL> &normal);
109 
112  void ComputeCenterNormal(TPZVec<REAL> &normal);
113 
114 public:
115 
118 
125  void MapQsi(TPZCompElSide &Neighbor, TPZVec<REAL> &qsi, TPZVec<REAL> &NeighIntPoint);
126 
127  enum CalcStiffOptions{ENone = -1, EStandard /*Deprecated*/ = 0, EPenalty, EContDisc,EReferred};
128 
130  TPZInterfaceElement(TPZCompMesh &mesh,TPZGeoEl *geo,int64_t &index,TPZCompElSide & left, TPZCompElSide &right);
131 
134 
143  const TPZInterfaceElement &copy,
144  std::map<int64_t,int64_t> &gl2lcConIdx,
145  std::map<int64_t,int64_t> &gl2lcElIdx);
146 
148  TPZInterfaceElement(TPZCompMesh &mesh, const TPZInterfaceElement &copy, int64_t &index);
149 
152 
154  TPZInterfaceElement(TPZCompMesh &mesh,TPZGeoEl *geo,int64_t &index);
155 
158 
159  virtual int IsInterface() override { return 1; }
160 
161 
163  void SetLeftRightElements(TPZCompElSide & left, TPZCompElSide & right);
164 
166  virtual TPZCompEl *Clone(TPZCompMesh &mesh) const override{
167  return new TPZInterfaceElement(mesh, *this);
168  }
169 
171  virtual TPZCompEl *ClonePatchEl(TPZCompMesh &mesh,std::map<int64_t,int64_t> &gl2lcConMap, std::map<int64_t,int64_t> &gl2lcElMap) const override
172  {
173  return new TPZInterfaceElement(mesh, *this, gl2lcConMap,gl2lcElMap);
174  }
175 
177  TPZCompEl * CloneInterface(TPZCompMesh &aggmesh,int64_t &index, /*TPZCompElDisc **/TPZCompElSide & left, /*TPZCompElDisc **/ TPZCompElSide &right) const;
178 
180  void VolumeEls(TPZCompEl &thirdel);
181 
184  return fRightElSide.Element();
185  }
186 
189  return fLeftElSide.Element();
190  }
191 
194 
197 
200 
202  void SetCenterNormal(const TPZVec<REAL> &CenterNormal)
203  {
204  fCenterNormal = CenterNormal;
205  }
206 
212  void Normal(TPZFMatrix<REAL> &axes, TPZVec<REAL> &normal);
213 
216  void Normal(TPZVec<REAL>&qsi, TPZVec<REAL> &normal);
217 
219  virtual int NConnects() const override;
220 
222  int NRightConnects() const;
223 
225  int NLeftConnects() const;
226 
228  int64_t ConnectIndex(int i) const override;
229 
231  void SetConnectIndex(int node, int64_t index) override;
232 
234  virtual void BuildCornerConnectList(std::set<int64_t> &connectindexes) const override;
235 
237  int Dimension() const override{
238  return this->Reference()->Dimension();
239  }
240 
242  MElementType Type() override { return EInterface; }
243 
251  virtual void LoadSolution() override{
252  //NOTHING TO BE DONE HERE
253  }
254 
260  virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override;
261 
266  virtual void CalcResidual(TPZElementMatrix &ef) override;
267 
279  virtual void ComputeSolution(TPZVec<REAL> &qsi,
280  TPZVec<REAL> &normal,
281  TPZSolVec &leftsol, TPZGradSolVec &dleftsol,TPZFMatrix<REAL> &leftaxes,
282  TPZSolVec &rightsol, TPZGradSolVec &drightsol,TPZFMatrix<REAL> &rightaxes) override;
283 
293  virtual void ComputeSolution(TPZVec<REAL> &qsi, TPZFMatrix<REAL> &phi, TPZFMatrix<REAL> &dphix,
294  const TPZFMatrix<REAL> &axes, TPZSolVec &sol, TPZGradSolVec &dsol) override;
295 
303  virtual void ComputeSolution(TPZVec<REAL> &qsi,
304  TPZSolVec &sol, TPZGradSolVec &dsol,TPZFMatrix<REAL> &axes) override;
305 
311  virtual void ComputeSolution(TPZVec<REAL> &qsi,
312  TPZMaterialData &data) override;
313 
314  void VetorialProd(TPZVec<REAL> &ivet,TPZVec<REAL> &jvet,TPZVec<REAL> &kvet);
315 
317  void Print(std::ostream &out = std::cout) const override;
318 
323  virtual void CreateGraphicalElement(TPZGraphMesh & graphmesh, int dimension) override{
324  //Nothing to be done here
325  }
326 
336  static int ExistInterfaces(TPZCompElSide &comp);
337 
338  static int FreeInterface(TPZCompMesh &cmesh);
339 
341  void CloneInterface(TPZCompMesh *aggmesh);
342 
343  static int main(TPZCompMesh &cmesh);
344 
351  virtual void EvaluateError(std::function<void(const TPZVec<REAL> &loc,TPZVec<STATE> &val,TPZFMatrix<STATE> &deriv)> func,
352  TPZVec<REAL> &errors, bool store_error) override;
353 
355  virtual void ComputeErrorFace(int errorid,
356  TPZVec<STATE> &errorL,
357  TPZVec<STATE> &errorR);
358 
360  virtual void Integrate(int variable, TPZVec<STATE> & value) override;
361 
362  void IntegrateInterface(int variable, TPZVec<REAL> & value);
363 
368  void EvaluateInterfaceJump(TPZSolVec &jump, int opt);
369 
371  public:
372 
373  int ComputeIntegrationOrder() const override;
374 
375 virtual int ClassId() const override;
376 
378  virtual void Write(TPZStream &buf, int withclassid) const override;
379 
381  virtual void Read(TPZStream &buf, void *context) override;
382 
383 };
384 
385 #endif
386 
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
bool CheckConsistencyOfMappedQsi(TPZCompElSide &Neighbor, TPZVec< REAL > &qsi, TPZVec< REAL > &NeighIntPoint)
Check consistency of mapped qsi performed by method TPZInterfaceElement::MapQsi by comparing the X co...
int64_t ConnectIndex(int i) const override
Its return the connects of the left and right element associates.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
void Normal(TPZFMatrix< REAL > &axes, TPZVec< REAL > &normal)
Returns normal based on already computed axes matrix.
Implements computational element and a side. Computational Element.
Definition: pzcompel.h:632
virtual void CreateGraphicalElement(TPZGraphMesh &graphmesh, int dimension) override
Interface elements does not have graphical representation.
TPZManVector< REAL, 3 > fCenterNormal
Normal to the face element.
TPZCompElSide fRightElSide
Element the right of the normal a interface.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
void GetConnects(TPZCompElSide &elside, TPZVec< TPZConnect *> &connects, TPZVec< int64_t > &connectindex)
Extract connects from element el.
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
void ComputeSideTransform(TPZCompElSide &Neighbor, TPZTransform<> &transf)
Contains declaration of TPZInterpolationSpace class which implements the interface for interpolated c...
void SetLeftRightElements(TPZCompElSide &left, TPZCompElSide &right)
Set neighbors.
TPZCompEl * CloneInterface(TPZCompMesh &aggmesh, int64_t &index, TPZCompElSide &left, TPZCompElSide &right) const
Method used in TPZAgglomerateElement::CreateAgglomerateMesh.
virtual void Integrate(int variable, TPZVec< STATE > &value) override
Integrate a variable over the element.
virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override
CalcStiff computes the element stiffness matrix and right hand side.
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
static int ExistInterfaces(TPZCompElSide &comp)
Verifies the existence of interfaces associates with the side of an element.
TPZCompElSide fLeftElSide
Element the left of the normal a interface.
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
void Print(std::ostream &out=std::cout) const override
Prints attributes of the object.
void VetorialProd(TPZVec< REAL > &ivet, TPZVec< REAL > &jvet, TPZVec< REAL > &kvet)
virtual void LoadSolution() override
Loads the solution within the internal data structure of the element.
virtual void InitializeIntegrationRule() override
Pointer to the integration rule.
virtual int IsInterface() override
TPZInterfaceElement()
Empty constructor.
void NeighbourSolution(TPZCompElSide &Neighbor, TPZVec< REAL > &qsi, TPZSolVec &sol, TPZGradSolVec &dsol, TPZFMatrix< REAL > &NeighborAxes)
Compute solution at neighbour element in a given master coordinate qsi. It returns the axes at which ...
int NRightConnects() const
Returns the number from connectivities of the element related to right neighbour. ...
~TPZInterfaceElement()
Destructor.
virtual int ClassId() const override
virtual void ComputeErrorFace(int errorid, TPZVec< STATE > &errorL, TPZVec< STATE > &errorR)
ComputeError computes the element error estimator.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
virtual void CalcResidual(TPZElementMatrix &ef) override
CalcResidual only computes the element residual.
int Dimension() const override
Returns the dimension from the element interface.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
TPZCompElSide & LeftElementSide()
Returns left neighbor.
virtual TPZCompEl * Clone(TPZCompMesh &mesh) const override
Makes a clone of this.
virtual TPZCompEl * ClonePatchEl(TPZCompMesh &mesh, std::map< int64_t, int64_t > &gl2lcConMap, std::map< int64_t, int64_t > &gl2lcElMap) const override
void IntegrateInterface(int variable, TPZVec< REAL > &value)
int NLeftConnects() const
Returns the number from connectivities of the element related to left neighbour.
void CenterNormal(TPZVec< REAL > &CenterNormal) const
Returns the normal of this interface which goes from left to right neighbors.
void DecreaseElConnected()
Informs the connects that this element is no longer connected to it.
void InitializeElementMatrix(TPZElementMatrix &ef)
TPZCompElSide & RightElementSide()
Returns right neighbor.
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
virtual void ComputeRequiredData(TPZVec< REAL > &intpointtemp, TPZVec< TPZTransform<> > &trvec, TPZVec< TPZMaterialData > &datavec)
void ComputeRequiredData(TPZMaterialData &data, TPZInterpolationSpace *elem, TPZVec< REAL > &IntPoint)
Compute and fill data with requested attributes for neighbouring element.
void ComputeCenterNormal(TPZVec< REAL > &normal)
Computes normal for linear geometric elements.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
Computes the contribution over an interface between two discontinuous elements. Computational Element...
void VolumeEls(TPZCompEl &thirdel)
Identifies the elements of left and right volume of the interface.
void SetCenterNormal(const TPZVec< REAL > &CenterNormal)
Set the normal to the given vector.
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 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.
virtual int Dimension() const =0
Returns the dimension of the element.
TPZCompEl * Element() const
Gives a pointer to the reference computational element.
Definition: pzcompel.h:675
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Definition: pzcompel.cpp:1137
void IncrementElConnected()
Informs the connects that this element is connected to it.
TPZCompEl * LeftElement() const
Returns the left element from the element interface.
static int main(TPZCompMesh &cmesh)
void ComputeNormal(TPZVec< REAL > &qsi, TPZVec< REAL > &normal)
Computes normal at qsi point.
virtual int NConnects() const override
Returns the number from connectivities of the element.
MElementType
Define the element types.
Definition: pzeltype.h:52
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
TPZCompEl * RightElement() const
Returns the right element from the element interface.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
int ComputeIntegrationOrder() const override
Returns the unique identifier for reading/writing objects to streams.
virtual void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> func, TPZVec< REAL > &errors, bool store_error) override
Performs an error estimate on the elemen.
static int FreeInterface(TPZCompMesh &cmesh)
void EvaluateInterfaceJump(TPZSolVec &jump, int opt)
MElementType Type() override
Type of the element.
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
void SetConnectIndex(int node, int64_t index) override
This function should not be called.
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const override
adds the connect indexes associated with base shape functions to the set
void InitMaterialData(TPZMaterialData &data, TPZInterpolationSpace *left)
Initialize a material data and its attributes based on element dimension, number of state variables a...
void MapQsi(TPZCompElSide &Neighbor, TPZVec< REAL > &qsi, TPZVec< REAL > &NeighIntPoint)
Maps qsi coordinate at this master element to qsi coordinate at neighbor master element.