NeoPZ
tpzpoint.cpp
Go to the documentation of this file.
1 
6 #include "tpzpoint.h"
7 #include "pzquad.h"
8 #include "pzeltype.h"
9 
10 #ifdef _AUTODIFF
11 #include "fad.h"
12 #endif
13 
14 namespace pztopology {
15  int TPZPoint::fPermutations[1][1]={
16  {0}
17  };
18  template<class T>
20  {
21  phi(0,0) = (T)1.;
22  }
23 
24  template<class T>
25  void TPZPoint::BlendFactorForSide(const int &side, const TPZVec<T> &xi, T &blendFactor,
26  TPZVec<T> &corrFactorDxi){
27  std::ostringstream sout;
28  sout<<"This method should not be called for a point element. Aborting..."<<std::endl;
29 
30  PZError<<std::endl<<sout.str()<<std::endl;
31  DebugStop();
32  }
33 
35  {
36  return new IntruleType(order);
37  }
38 
39 
41  {
42  return EPoint;
43  }
44 
46  {
47  switch(side) {
48  case 0:
49  return EPoint;
50  default:
51  return ENoType;
52  }
53  }
54 
56  {return 0;}
57 
58  template<class T>
59  bool TPZPoint::CheckProjectionForSingularity(const int &side, const TPZVec<T> &xiInterior) {
60  return true;
61  }
62  template<class T>
63  void TPZPoint::MapToSide(int side, TPZVec<T> &InternalPar, TPZVec<T> &SidePar, TPZFMatrix<T> &JacToSide) {
64  SidePar.Resize(0); JacToSide.Resize(0,0);
65  }
66 
68  {
69 
70  if(node > NCornerNodes)
71  {
72  DebugStop();
73  }
74  nodeCoord.Resize(Dimension, 0.);
75  switch (node) {
76  case (0):
77  {
78  return;
79  break;
80  }
81  default:
82  {
83  DebugStop();
84  break;
85  }
86  }
87  }
88 
96  {
97  return 0;
98  }
99 
107  {
108  return 0;
109  }
110 
118 // void TPZPoint::GetSideHDivPermutation(int side, TPZVec<int64_t> &id, TPZVec<int> &permgather)
119 // {
120 // permgather[0] = 0;
121 // return;
122 // }
123  void TPZPoint::ComputeDirections(int side, TPZFMatrix<REAL> &gradx, TPZFMatrix<REAL> &directions, TPZVec<int> &sidevectors)
124  {
125  directions.Redim(3, 0);
126  sidevectors.Resize(0);
127  }
128 
129  int TPZPoint::ClassId() const{
130  return Hash("TPZPoint");
131  }
132 
133  void TPZPoint::Read(TPZStream& buf, void* context) {
134 
135  }
136 
137  void TPZPoint::Write(TPZStream& buf, int withclassid) const {
138 
139  }
140 
141 }
142 
143 /**********************************************************************************************************************
144  * The following are explicit instantiation of member function template of this class, both with class T=REAL and its
145  * respective FAD<REAL> version. In other to avoid potential errors, always declare the instantiation in the same order
146  * in BOTH cases. @orlandini
147  **********************************************************************************************************************/
148 template bool pztopology::TPZPoint::CheckProjectionForSingularity<REAL>(const int &side, const TPZVec<REAL> &xiInterior);
149 
150 template void pztopology::TPZPoint::MapToSide<REAL>(int side, TPZVec<REAL> &InternalPar, TPZVec<REAL> &SidePar, TPZFMatrix<REAL> &JacToSide);
151 
152 template void pztopology::TPZPoint::BlendFactorForSide<REAL>(const int &, const TPZVec<REAL> &, REAL &, TPZVec<REAL> &);
153 
154 template void pztopology::TPZPoint::TShape<REAL>(const TPZVec<REAL> &loc,TPZFMatrix<REAL> &phi,TPZFMatrix<REAL> &dphi);
155 
156 template void pztopology::TPZPoint::ComputeHDivDirections<REAL>(TPZFMatrix<REAL> &gradx, TPZFMatrix<REAL> &directions);
157 #ifdef _AUTODIFF
158 
159 template bool pztopology::TPZPoint::CheckProjectionForSingularity<Fad<REAL>>(const int &side, const TPZVec<Fad<REAL>> &xiInterior);
160 
161 template void pztopology::TPZPoint::MapToSide<Fad<REAL> >(int side, TPZVec<Fad<REAL> > &InternalPar, TPZVec<Fad<REAL> > &SidePar, TPZFMatrix<Fad<REAL> > &JacToSide);
162 
163 template void pztopology::TPZPoint::BlendFactorForSide<Fad<REAL>>(const int &, const TPZVec<Fad<REAL>> &, Fad<REAL> &,
164  TPZVec<Fad<REAL>> &);
165 template void pztopology::TPZPoint::TShape<Fad<REAL>>(const TPZVec<Fad<REAL>> &loc,TPZFMatrix<Fad<REAL>> &phi,TPZFMatrix<Fad<REAL>> &dphi);
166 
167 template void pztopology::TPZPoint::ComputeHDivDirections<Fad<REAL>>(TPZFMatrix<Fad<REAL>> &gradx, TPZFMatrix<Fad<REAL>> &directions);
168 #endif
TPZInt1Point IntruleType
Typedef to numerical integration rule.
Definition: tpzpoint.h:221
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
Definition: tpzpoint.cpp:19
static MElementType Type()
Returns the type of the element as specified in file pzeltype.h.
Definition: tpzpoint.cpp:40
Contains the TPZInt1d, TPZIntTriang, TPZIntQuad, TPZIntCube3D, TPZIntTetra3D, TPZIntPyram3D and TPZIn...
int ClassId() const override
Define the class id associated with the class.
Definition: tpzpoint.cpp:129
static void ParametricDomainNodeCoord(int node, TPZVec< REAL > &nodeCoord)
Definition: tpzpoint.cpp:67
Contains the TPZPoint class which defines the topology of a point.
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
Definition: tpzpoint.cpp:34
Definition: fad.h:54
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
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
Definition: pzvec.h:373
Groups all classes defining the structure of the master element.
Definition: PrismExtend.cpp:15
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: tpzpoint.cpp:137
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
static int NBilinearSides()
Definition: tpzpoint.cpp:55
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Definition: pzfmatrix.h:616
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
static void MapToSide(int side, TPZVec< T > &InternalPar, TPZVec< T > &SidePar, TPZFMatrix< T > &JacToSide)
Definition: tpzpoint.cpp:63
static bool CheckProjectionForSingularity(const int &side, const TPZVec< T > &xiInterior)
Definition: tpzpoint.cpp:59
MElementType
Define the element types.
Definition: pzeltype.h:52
static void BlendFactorForSide(const int &side, const TPZVec< T > &xi, T &blendFactor, TPZVec< T > &corrFactorDxi)
Definition: tpzpoint.cpp:25
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
static void ComputeDirections(int side, TPZFMatrix< REAL > &gradx, TPZFMatrix< REAL > &directions, TPZVec< int > &sidevectors)
Definition: tpzpoint.cpp:123
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: tpzpoint.cpp:133
static int fPermutations[1][1]
Valid permutations between nodes.
Definition: tpzpoint.h:273
static int GetTransformId(TPZVec< int64_t > &id)
Method which identifies the transformation based on the IDs of the corner nodes.
Definition: tpzpoint.cpp:95
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15