NeoPZ
TPZGeoElement.h
Go to the documentation of this file.
1 
6 #ifndef TPZGEOELEMENTH
7 #define TPZGEOELEMENTH
8 
9 #include "pzgeoelrefless.h"
10 
11 class TPZGeoElSide;
12 class TPZCompMesh;
13 class TPZCompEl;
14 template<class T,int N>
15 class TPZStack;
16 
21 template <class TGeo, class TRef>
22 class TPZGeoElement : public TPZGeoElRefLess<TGeo> {
23 
24  int64_t fSubEl[TRef::NSubEl];
25 public:
26  typedef TGeo TGeoLoc;
27 
28 public:
30  TPZGeoElement();
32  TPZGeoElement(int64_t id,TPZVec<int64_t> &nodeindexes,int matind,TPZGeoMesh &mesh);
34  TPZGeoElement(TPZVec<int64_t> &nodeindices,int matind,TPZGeoMesh &mesh);
36  TPZGeoElement(TGeo &geo, int matind, TPZGeoMesh &mesh);
38  TPZGeoElement(TPZVec<int64_t> &nodeindices,int matind,TPZGeoMesh &mesh,int64_t &index);
39 
41  TPZGeoElement(TPZGeoMesh &DestMesh, const TPZGeoElement &cp);
42 
50  TPZGeoElement ( TPZGeoMesh &DestMesh,
51  const TPZGeoElement &cp,
52  std::map<int64_t,int64_t> &gl2lcNdIdx,
53  std::map<int64_t,int64_t> &gl2lcElIdx );
55  virtual ~TPZGeoElement(){};
56 
57  public:
58 int ClassId() const override;
59 
60 
61  void Read(TPZStream &str, void *context) override;
62 
63  void Write(TPZStream &str, int withclassid) const override;
64 
65  virtual TPZGeoEl * Clone(TPZGeoMesh &DestMesh) const override;
66 
70  virtual TPZGeoEl * ClonePatchEl(TPZGeoMesh &DestMesh,
71  std::map<int64_t,int64_t> &gl2lcNdIdx,
72  std::map<int64_t,int64_t> &gl2lcElIdx) const override;
73 
75  int HasSubElement() const override {return fSubEl[0]!=-1;}
76 
77  void SetSubElement(int id, TPZGeoEl *el) override;
78 
79 
81  REAL RefElVolume() override;
82 
84  void MidSideNodeIndex(int side,int64_t &index) const override;
85 
87  int NSubElements() const override;
88 
90  int NSideSubElements(int side) const override;
91 
93  TPZGeoEl *SubElement(int is) const override;
94 
97  TPZGeoElSide SideSubElement(int side,int position);
98 
99  TPZTransform<> GetTransform(int side,int son) override;
100 
101  virtual int FatherSide(int side, int son) override {
102  return TRef::FatherSide(side,son);
103  }
104 
106  virtual void Divide(TPZVec<TPZGeoEl *> &pv) override;
107 
108  virtual void GetSubElements2(int side, TPZStack<TPZGeoElSide> &subel) const override;
109 
110  virtual void ResetSubElements() override;
111 
114  TPZVec<int64_t>& nodeindexes,
115  int matid,
116  int64_t& index) override
117  {
118  return this->Mesh()->CreateGeoElement(type,nodeindexes,matid,index,0);
119  }
120 
121 
122 
123 };
124 
125 template <class TGeo, class TRef>
127  return Hash("TPZGeoElement") ^ TPZGeoElRefLess<TGeo>::ClassId() << 1 ^ TRef().ClassId() << 2;
128 }
129 #endif
TPZGeoEl * SubElement(int is) const override
Returns a pointer to the subelement is.
REAL RefElVolume() override
Volume of the master element.
virtual void ResetSubElements() override
Reset all subelements to NULL.
int HasSubElement() const override
Returns 1 if the element has subelements.
Definition: TPZGeoElement.h:75
TPZTransform GetTransform(int side, int son) override
Contains declaration of TPZGeoElRefLess class which implements the mapping between the master element...
virtual int FatherSide(int side, int son) override
void Read(TPZStream &str, void *context) override
read objects from the stream
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
Definition: pzgmesh.cpp:1296
Implements a generic geometric element with a uniform refinement pattern. Geometry.
Definition: TPZGeoElement.h:22
void Write(TPZStream &str, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Definition: pzgeoelside.h:83
Implements the mapping between the master element and deformed element. Geometry. ...
int NSubElements() const override
Returns the number of subelements of the element independent of the fact hether the element has alrea...
TPZGeoMesh * Mesh() const
Returns the mesh to which the element belongs.
Definition: pzgeoel.h:220
virtual TPZGeoEl * ClonePatchEl(TPZGeoMesh &DestMesh, std::map< int64_t, int64_t > &gl2lcNdIdx, std::map< int64_t, int64_t > &gl2lcElIdx) const override
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index) override
Creates a geometric element according to the type of the father element.
virtual void Divide(TPZVec< TPZGeoEl *> &pv) override
Divides the element and puts the resulting elements in the vector.
virtual TPZGeoEl * Clone(TPZGeoMesh &DestMesh) const override
virtual int ClassId() const override
Define the class id associated with the class.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
virtual ~TPZGeoElement()
Default destructor.
Definition: TPZGeoElement.h:55
void MidSideNodeIndex(int side, int64_t &index) const override
Returns the midside node index along a side of the element.
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
MElementType
Define the element types.
Definition: pzeltype.h:52
This class implements a stack object. Utility.
Definition: pzcheckmesh.h:14
void SetSubElement(int id, TPZGeoEl *el) override
Sets the subelement of index i.
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
int64_t fSubEl[TRef::NSubEl]
Definition: TPZGeoElement.h:24
TPZGeoElement()
Default constructor.
int ClassId() const override
Define the class id associated with the class.
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
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
TPZGeoElSide SideSubElement(int side, int position)
Return a pointer and a side of the subelement of the element at the side and the indicated position...
virtual void GetSubElements2(int side, TPZStack< TPZGeoElSide > &subel) const override
This method will return a partition of the side of the current element as the union of sub elements/...
int NSideSubElements(int side) const override
Returns the number of subelements as returned by GetSubElements2(side)