NeoPZ
pzgeopoint.h
Go to the documentation of this file.
1 
6 #ifndef TPZGEOPOINTH
7 #define TPZGEOPOINTH
8 
9 #include <map> // for map, operator==
10 #include <sstream> // for basic_stringbuf<>::int_type, basic_stringbu...
11 #include "pzeltype.h" // for MElementType
12 #include "pzmatrix.h" // for TPZFMatrix, TPZMatrix, TPZFNMatrix
13 #include "pznoderep.h" // for TPZNodeRep
14 #include "pznoderep.h.h" // for TPZNodeRep::TPZNodeRep<N, Topology>
15 #include "pzreal.h" // for REAL
16 #include "tpzpoint.h" // for TPZPoint
17 class TPZGeoEl;
18 class TPZGeoMesh;
19 template <class T> class TPZVec;
20 
21 
33 namespace pzgeom {
34 
39  class TPZGeoPoint : public TPZNodeRep<1, pztopology::TPZPoint> {
40 
41  public:
42  enum {NNodes = 1};
43 
44  int ClassId() const override;
45  void Read(TPZStream &buf, void *context) override;
46 
47  void Write(TPZStream &buf, int withclassid) const override;
48 
50  struct TMem {
51  };
52 
54 
57  TPZNodeRep<NNodes, pztopology::TPZPoint>(nodeindexes)
58  {
59  }
60 
63  {
64  }
65 
68  std::map<int64_t,int64_t> & gl2lcNdMap) : TPZRegisterClassId(&TPZGeoPoint::ClassId),
69  TPZNodeRep<NNodes, pztopology::TPZPoint>(cp,gl2lcNdMap)
70  {
71  }
72 
76  {
77  }
78 
82  {
83  }
84 
85  static bool IsLinearMapping(int side)
86  {
87  return true;
88  }
89 
91  static std::string TypeName() { return "Point";}
92 
93  template<class T>
94  static void X(const TPZFMatrix<REAL> &nodes,TPZVec<T> &loc,TPZVec<T> &result);
95 
96  template<class T>
97  static void GradX(const TPZFMatrix<REAL> &nodes,TPZVec<T> &loc, TPZFMatrix<T> &gradx);
98 
99  // static TPZGeoEl *CreateBCGeoEl(TPZGeoEl *gel, int side,int bc);
100 
101  public:
102 
104  /* @param gmesh mesh in which the element should be inserted
105  @param matid material id of the element
106  @param lowercorner (in/out) on input lower corner o the cube where the element should be created, on exit position of the next cube
107  @param size (in) size of space where the element should be created
108  */
109  static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec<REAL> &lowercorner, TPZVec<REAL> &size);
110 
112  // static TPZGeoEl *CreateGeoElement(TPZGeoMesh &mesh, MElementType type,
113  // TPZVec<int64_t>& nodeindexes,
114  // int matid, int64_t& index);
115  };
116 
117  template<class T>
118  inline void TPZGeoPoint::X(const TPZFMatrix<REAL> &coord,TPZVec<T> &loc,TPZVec<T> &result){
119  for (int i=0;i<coord.Rows();i++){
120  result[i] = coord.GetVal(i,0);
121  }
122  }
123 
124  template<class T>
125  inline void TPZGeoPoint::GradX(const TPZFMatrix<REAL> &nodes,TPZVec<T> &loc, TPZFMatrix<T> &gradx){
126  gradx.Resize(3,0);
127  }
128 
129 
130 };
131 
132 #endif
133 
Auxiliar structure to accellerate computations.
Definition: pzgeopoint.h:50
pztopology::TPZPoint Top
Definition: pzgeopoint.h:53
TPZGeoPoint()
Empty constructor.
Definition: pzgeopoint.h:62
TPZGeoPoint(const TPZGeoPoint &cp, TPZGeoMesh &)
Copy constructor with given mesh.
Definition: pzgeopoint.h:80
static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec< REAL > &lowercorner, TPZVec< REAL > &size)
create an example element based on the topology
Definition: pzgeopoint.cpp:49
TPZGeoPoint(const TPZGeoPoint &cp)
Copy constructor.
Definition: pzgeopoint.h:74
static bool IsLinearMapping(int side)
Definition: pzgeopoint.h:85
Defines the topology of a point. Topology It has a one side (the same element).
Definition: tpzpoint.h:34
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: pzgeopoint.cpp:78
Contains the TPZPoint class which defines the topology of a point.
static void GradX(const TPZFMatrix< REAL > &nodes, TPZVec< T > &loc, TPZFMatrix< T > &gradx)
Definition: pzgeopoint.h:125
Defines enum MElementType and contains the implementation of MElementType_NNodes(...) functions.
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
TPZPoint()
Default constructor.
Definition: tpzpoint.h:47
Groups all classes defining the structure of the master element.
Definition: PrismExtend.cpp:15
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
Contains the TPZNodeRep class which implements ... Clase intermediaria que guarda.
static void X(const TPZFMatrix< REAL > &nodes, TPZVec< T > &loc, TPZVec< T > &result)
Definition: pzgeopoint.h:118
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: pzgeopoint.cpp:74
TPZGeoPoint(TPZVec< int64_t > &nodeindexes)
Constructor with list of nodes.
Definition: pzgeopoint.h:56
Implements ... Geometry Topology.
Definition: pznoderep.h:40
Contains TPZMatrix<TVar>class, root matrix class.
Implements the geometry of a point element. Geometry.
Definition: pzgeopoint.h:39
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
TPZGeoPoint(const TPZGeoPoint &cp, std::map< int64_t, int64_t > &gl2lcNdMap)
Constructor with node map.
Definition: pzgeopoint.h:67
Contains the implementation of the TPZNodeRep methods.
int ClassId() const override
Define the class id associated with the class.
Definition: pzgeopoint.cpp:70
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Definition: pzfmatrix.cpp:1016
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
Groups all classes which model the geometry.
Definition: pzgeopoint.cpp:18
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
Definition: pzfmatrix.h:566
static std::string TypeName()
Returns the type name of the element.
Definition: pzgeopoint.h:91