NeoPZ
TPZMultiphysicsInterfaceEl.h
Go to the documentation of this file.
1 
8 #ifndef TPZMULTIPHYSICSINTERFACEELH
9 #define TPZMULTIPHYSICSINTERFACEELH
10 
11 #include <iostream>
12 
13 #include "pzcompel.h"
14 #include "pzmultiphysicselement.h"
15 
16 
22 
23 protected:
24 
27 
30 
33 
36 
39 
40 
41 public:
44 
46  TPZMultiphysicsInterfaceElement(TPZCompMesh &mesh, TPZGeoEl *ref, int64_t &index, TPZCompElSide left, TPZCompElSide right);
47 
50 
52  TPZMultiphysicsInterfaceElement(TPZCompMesh &mesh, const TPZMultiphysicsInterfaceElement &copy, std::map<int64_t,int64_t> & gl2lcConMap,
53  std::map<int64_t,int64_t> & gl2lcElMap);
54 
56  virtual TPZCompEl *Clone(TPZCompMesh &mesh) const override
57  {
58  return new TPZMultiphysicsInterfaceElement(mesh,*this);
59  }
60 
73  std::map<int64_t,int64_t> & gl2lcConMap,
74  std::map<int64_t,int64_t> & gl2lcElMap) const override
75  {
76  return new TPZMultiphysicsInterfaceElement(mesh,*this,gl2lcConMap,gl2lcElMap);
77  }
78 
80  void IncrementElConnected();
81 
84 
91 
98  void MapQsi(TPZManVector<TPZCompElSide> &Neighbor, TPZVec<REAL> &qsi, TPZVec<REAL> &NeighIntPoint);
99 
103  void SetLeftRightElement(const TPZCompElSide &leftel, const TPZCompElSide &rightel);
104 
108  void SetLeftRightElementIndices(const TPZVec<int64_t> &lefindices, const TPZVec<int64_t> &rightindices);
109 
113  void GetLeftRightElement(TPZCompElSide &leftel, TPZCompElSide &rightel);
114 
120  virtual void SetConnectIndex(int inode, int64_t index) override
121  {
122  fConnectIndexes[inode] = index;
123  }
124 
126  virtual int NConnects() const override;
127 
132  virtual int64_t ConnectIndex(int i) const override;
133 
134 
136  virtual int Dimension() const override
137  {
138  return Reference()->Dimension();
139  }
140 
144  void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override;
145 
149  void CalcStiff(TPZElementMatrix &ef);
150 
154  void CreateIntegrationRule();
155 
159  const TPZIntPoints & GetIntegrationRule() const override;
160 
161  virtual int ComputeIntegrationOrder() const override;
162 
164  virtual void ComputeRequiredData(TPZVec<REAL> &intpointtemp, TPZVec<TPZTransform<> > &trvec, TPZVec<TPZMaterialData> &datavec);
165 
168 
171 
172 
175  {
176  return fLeftElSide;
177  }
178 
181  return fRightElSide.Element();
182  }
183 
186  return fLeftElSide.Element();
187  }
188 
189  void ComputeCenterNormal(TPZVec<REAL> &normal) const;
190 
191  // void ComputeNormal(TPZVec<REAL> &qsi, TPZVec<REAL> &normal);
192 
197  virtual void Print(std::ostream &out = std::cout) const override;
198 
200  void InitMaterialData(TPZMaterialData &center_data, TPZVec<TPZMaterialData> &data_left, TPZVec<TPZMaterialData> &data_right);
201 
203  void InitMaterialData(TPZMaterialData &data);
204 
206  virtual void ComputeRequiredData(TPZMaterialData &data, TPZVec<REAL> &point);
207 
210 
211  void ComputeSideTransform(TPZCompElSide &Neighbor, TPZTransform<> &transf);
212 
215  {
216  return fRightElSide;
217  }
218 
219  virtual int nmeshes()
220  {
221  if (fLeftElSide) {
222  TPZMultiphysicsElement *mfcel = dynamic_cast<TPZMultiphysicsElement *>(fLeftElSide.Element());
223  if(mfcel)
224  {
225  return mfcel->NMeshes();
226  }
227  }
228  if (fRightElSide) {
229  TPZMultiphysicsElement *mfcel = dynamic_cast<TPZMultiphysicsElement *>(fRightElSide.Element());
230  if (mfcel) {
231  return mfcel->NMeshes();
232  }
233  }
234  return 1;
235  }
236 
238  virtual void BuildCornerConnectList(std::set<int64_t> &connectindexes) const override
239  {
240  TPZCompEl *left = fLeftElSide.Element();
241  TPZCompEl *right = fRightElSide.Element();
242  left->BuildCornerConnectList(connectindexes);
243  right->BuildCornerConnectList(connectindexes);
244  }
245 
254  virtual void Solution(TPZVec<REAL> &qsi,int var,TPZVec<STATE> &sol) override;
255 
256  virtual void CreateGraphicalElement(TPZGraphMesh &grmesh, int dimension) override;
257 
259  virtual int NumberOfCompElementsInsideThisCompEl() override {
260 
261  if (fLeftElSide) {
262  TPZMultiphysicsElement *mfcel = dynamic_cast<TPZMultiphysicsElement *>(fLeftElSide.Element());
263  if(mfcel)
264  {
265  return mfcel->NMeshes();
266  }
267  }
268  if (fRightElSide) {
269  TPZMultiphysicsElement *mfcel = dynamic_cast<TPZMultiphysicsElement *>(fRightElSide.Element());
270  if (mfcel) {
271  return mfcel->NMeshes();
272  }
273  }
274  return 0;
275 
276  }
277 
278  public:
279 virtual int ClassId() const override;
280 
281 void EvaluateError(std::function<void(const TPZVec<REAL> &loc,TPZVec<STATE> &val,TPZFMatrix<STATE> &deriv)> fp,
282  TPZVec<REAL> &/*errors*/, bool store_error) override {
283 // LOGPZ_WARN(logger, "EvaluateError is called.");
284 // DebugStop();
285  }
286 
287 
288 };
289 
290 #endif
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const override
adds the connect indexes associated with base shape functions to the set
virtual int Dimension() const override
Dimension of the element.
void IncrementElConnected()
Informs the connect that this element is connected to it.
virtual int NConnects() const override
Returns the number of nodes of the element.
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const =0
adds the connect indexes associated with base shape functions to the set
Implements computational element and a side. Computational Element.
Definition: pzcompel.h:632
TPZCompEl * LeftElement() const
Returns the left element from the element interface.
virtual void Solution(TPZVec< REAL > &qsi, int var, TPZVec< STATE > &sol) override
Calculates the solution - sol - for the variable var at point qsi, where qsi is expressed in terms of...
virtual int64_t ConnectIndex(int i) const override
Returns the index of the ith connectivity of the element.
TPZCompElSide Left() const
access function to the left element
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
const TPZIntPoints & GetIntegrationRule() const override
Contains declaration of TPZCompEl class which defines the interface of a computational element...
TPZManVector< int64_t, 3 > fRightElIndices
indices of the Right Element Vector
TPZManVector< int64_t, 20 > fConnectIndexes
indexes of the connects
virtual int64_t NMeshes()=0
virtual void Print(std::ostream &out=std::cout) const override
Prints element data.
Contains the declaration of the TPZMultiphysicsElement class. This class is abstract.
void MapQsi(TPZManVector< TPZCompElSide > &Neighbor, TPZVec< REAL > &qsi, TPZVec< REAL > &NeighIntPoint)
Maps qsi coordinate at this master element to qsi coordinate at neighbor master element.
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
virtual void ComputeRequiredData(TPZVec< REAL > &intpointtemp, TPZVec< TPZTransform<> > &trvec, TPZVec< TPZMaterialData > &datavec)
Compute and fill data with requested attributes for each of the compels in fElementVec.
virtual TPZCompEl * Clone(TPZCompMesh &mesh) const override
Method for creating a copy of the element.
virtual void SetConnectIndex(int inode, int64_t index) override
Set the index i to node inode.
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
virtual void CreateGraphicalElement(TPZGraphMesh &grmesh, int dimension) override
Creates corresponding graphical element(s) if the dimension matches graphical elements are used to ge...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
void GetLeftRightElement(TPZCompElSide &leftel, TPZCompElSide &rightel)
virtual int ComputeIntegrationOrder() const override
void SetLeftRightElement(const TPZCompElSide &leftel, const TPZCompElSide &rightel)
virtual TPZCompEl * ClonePatchEl(TPZCompMesh &mesh, std::map< int64_t, int64_t > &gl2lcConMap, std::map< int64_t, int64_t > &gl2lcElMap) const override
Method for creating a copy of the element in a patch mesh.
void SetLeftRightElementIndices(const TPZVec< int64_t > &lefindices, const TPZVec< int64_t > &rightindices)
void InitMaterialData(TPZMaterialData &center_data, TPZVec< TPZMaterialData > &data_left, TPZVec< TPZMaterialData > &data_right)
Initialize the material data structures.
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
void ComputeSideTransform(TPZManVector< TPZCompElSide > &Neighbor, TPZManVector< TPZTransform<> > &transf)
Compute the transform of a paramenter point in the multiphysic interface element to a parameter point...
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
TPZManVector< int64_t, 3 > fLeftElIndices
indices of the Left Element Vector
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Definition: pzcompel.cpp:1137
void ComputeCenterNormal(TPZVec< REAL > &normal) const
Computes the contribution over an interface between two discontinuous elements. Computational Element...
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
TPZCompElSide fRightElSide
Element vector the right of the normal a interface.
TPZCompEl * RightElement() const
Returns the right element from the element interface.
void InitializeElementMatrix(TPZElementMatrix &ek, TPZElementMatrix &ef)
Initialize the structure of the stiffness matrix.
TPZMultiphysicsInterfaceElement()
Default constructor.
virtual int NumberOfCompElementsInsideThisCompEl() override
Return the size of the elementvec in multiphysics, if it is not multiphysics, just return 1...
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
TPZCompElSide Right() const
Access function to the right element.
virtual ~TPZMultiphysicsInterfaceElement()
Default destructor.
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
virtual int ClassId() const override
Define the class id associated with the class.
void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> fp, TPZVec< REAL > &, bool store_error) override
Performs an error estimate on the elemen.
TPZCompElSide fLeftElSide
Element vector the left of the normal a interface.