NeoPZ
pzmultiphysicselement.h
Go to the documentation of this file.
1 
6 #ifndef PZMULTIPHYSICSELEMENTH
7 #define PZMULTIPHYSICSELEMENTH
8 
9 #include <iostream>
10 
11 #include "pzcompel.h"
12 #include "pzgeoelbc.h"
13 #include "pzfunction.h"
14 
16 
18 
19 protected:
20 
22  std::list<TPZOneShapeRestraint> fRestraints;
23 
26 
27 public:
30  {
31  }
38  TPZMultiphysicsElement(TPZCompMesh &mesh, TPZGeoEl *ref, int64_t &index) : TPZCompEl(mesh, ref, index)
39  {
40  }
41 
44 
47  {
48  TPZGeoEl *reference = Reference();
49  if (reference) {
50  reference->ResetReference();
51  }
52  }
53 
54  virtual void AddElement(TPZCompEl *cel, int64_t mesh) = 0;
55 
56  virtual void AddElement(const TPZCompElSide &cel, int64_t mesh) = 0;
57 
58  virtual TPZCompEl *Element(int64_t elindex) = 0;
59 
62 
63  virtual TPZCompEl *ReferredElement(int64_t mesh) = 0;
64 
65  virtual int64_t NMeshes() = 0;
66 
67  virtual void SetConnectIndexes(TPZVec<int64_t> &indexes) = 0;
68 
69  virtual void AffineTransform(TPZVec<TPZTransform<> > &trVec) const = 0;
70 
71  virtual void InitMaterialData(TPZVec<TPZMaterialData > &dataVec, TPZVec<int64_t> *indices = 0) = 0;
72 
73  virtual void ComputeRequiredData(TPZVec<REAL> &point, TPZVec<TPZTransform<> > &trvec, TPZVec<TPZMaterialData> &datavec, TPZVec<int64_t> indices);
74 
77  TPZVec<REAL> &qsi)
78  {
79 
80  }
87  virtual void EvaluateError( std::function<void(const TPZVec<REAL> &loc,TPZVec<STATE> &val,TPZFMatrix<STATE> &deriv)> func,
88  TPZVec<REAL> &errors, bool store_error ) override;
89 
90  virtual void EvaluateError(TPZFunction<STATE> &func,
91  TPZVec<STATE> &errors, bool store_error);
92 
93  virtual void CalcStiff(TPZElementMatrix &ek,TPZElementMatrix &ef) override = 0 ;
94 
95  virtual void CreateGraphicalElement(TPZGraphMesh &grmesh, int dimension) override =0 ;
96 
97  //virtual void CreateGraphicalElement(TPZGraphMesh &grmesh, std::set<int> dimension, std::set<int> dimension)=0;
98 
99  void CreateInterfaces();
100 
101  bool ExistsInterface(int side);
102 
104 
105  void RemoveInterfaces();
106 
107  void RemoveInterface(int side);
108 
110  virtual const TPZIntPoints &GetIntegrationRule() const override = 0 ;
111 
113  virtual TPZIntPoints &GetIntegrationRule() = 0;
114 
116  virtual void InitializeIntegrationRule() override = 0 ;
117 
118  virtual void PolynomialOrder(TPZVec<int> &order) const = 0;
119 
120  virtual int ComputeIntegrationOrder() const override;
121 
123  virtual void BuildCornerConnectList(std::set<int64_t> &connectindexes) const override
124  {
125  std::cout << "To Be Implemented\n";
126  DebugStop();
127  }
128 
129  virtual void TransferMultiphysicsElementSolution() override;
130 
135  virtual void SetActiveApproxSpaces(TPZManVector<int,5> & active_approx_space)
136  {
137 #ifdef PZDEBUG
138  if(fActiveApproxSpace.size()!= ElementVec().size()){
139  DebugStop();
140  }
141 #endif
142  fActiveApproxSpace = active_approx_space;
143 
144  }
145 
151  {
152  return fActiveApproxSpace;
153 
154  }
155 
156  virtual bool IsActiveApproxSpaces(int space_index)
157  {
158  return fActiveApproxSpace[space_index];
159  }
160 
161  virtual void Solution(TPZVec<REAL> &qsi,int var,TPZVec<STATE> &sol) override = 0 ;
162 
164  virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
165  {
166  fRestraints.push_back(restraint);
167  }
168 
170  virtual std::list<TPZOneShapeRestraint> GetShapeRestraints() const override
171  {
172  return fRestraints;
173  }
174 
175 };
176 
177 #endif
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
virtual ~TPZMultiphysicsElement()
Default destructor.
virtual void ComputeRequiredData(TPZVec< REAL > &point, TPZVec< TPZTransform<> > &trvec, TPZVec< TPZMaterialData > &datavec, TPZVec< int64_t > indices)
virtual void InitMaterialData(TPZVec< TPZMaterialData > &dataVec, TPZVec< int64_t > *indices=0)=0
Implements computational element and a side. Computational Element.
Definition: pzcompel.h:632
virtual void InitializeIntegrationRule() override=0
After adding the elements initialize the integration rule.
TPZMultiphysicsInterfaceElement * CreateInterface(int side)
virtual TPZCompEl * Element(int64_t elindex)=0
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
Add a shape restraint (meant to fit the pyramid to restraint.
Contains declaration of TPZCompEl class which defines the interface of a computational element...
virtual void AddElement(TPZCompEl *cel, int64_t mesh)=0
virtual int ComputeIntegrationOrder() const override
virtual void ComputeRequiredData(TPZMaterialData &data, TPZVec< REAL > &qsi)
Compute and fill data with requested attributes.
virtual int64_t NMeshes()=0
Definition of the retraint associated with the top of the pyramid.
Contains declaration of TPZGeoElBC class, it is a structure to help the construction of geometric ele...
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
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.
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
TPZManVector< int, 5 > fActiveApproxSpace
List of active approximation spaces.
virtual void AffineTransform(TPZVec< TPZTransform<> > &trVec) const =0
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
virtual TPZManVector< TPZCompElSide, 5 > & ElementVec()=0
Returns a reference to the element pointers vector.
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
virtual TPZCompEl * ReferredElement(int64_t mesh)=0
TPZMultiphysicsElement()
Default constructor.
virtual void Solution(TPZVec< REAL > &qsi, int var, TPZVec< STATE > &sol) override=0
Calculates the solution - sol - for the variable var at point qsi, where qsi is expressed in terms of...
virtual void CreateGraphicalElement(TPZGraphMesh &grmesh, int dimension) override=0
Creates corresponding graphical element(s) if the dimension matches graphical elements are used to ge...
virtual const TPZIntPoints & GetIntegrationRule() const override=0
Returns a reference to an integration rule suitable for integrating the interior of the element...
virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override=0
Computes the element stifness matrix and right hand side.
std::list< TPZOneShapeRestraint > fRestraints
list of restraints applied to one shape function
virtual void SetConnectIndexes(TPZVec< int64_t > &indexes)=0
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
virtual void SetActiveApproxSpaces(TPZManVector< int, 5 > &active_approx_space)
Set the active approximation spaces.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Definition: pzcompel.cpp:1137
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Definition: pzgeoel.h:431
Computes the contribution over an interface between two discontinuous elements. Computational Element...
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const override
adds the connect indexes associated with base shape functions to the set
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
virtual TPZManVector< int, 5 > & GetActiveApproxSpaces()
Set the active approximation spaces.
virtual void PolynomialOrder(TPZVec< int > &order) const =0
virtual std::list< TPZOneShapeRestraint > GetShapeRestraints() const override
Return a list with the shape restraints.
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
virtual bool IsActiveApproxSpaces(int space_index)
virtual void TransferMultiphysicsElementSolution() override
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
TPZMultiphysicsElement(TPZCompMesh &mesh, TPZGeoEl *ref, int64_t &index)
Constructor.