NeoPZ
tpzcube.h
Go to the documentation of this file.
1 
6 #ifndef PZTOPOLOGYTPZCUBE_H
7 #define PZTOPOLOGYTPZCUBE_H
8 
9 
10 #include "pzfmatrix.h"
11 #include "pzstack.h"
12 #include "pztrnsform.h"
13 #include "pzeltype.h"
14 #include "pznumeric.h"
15 #include "pzaxestools.h"
16 
17 #ifdef _AUTODIFF
18 #include "fadType.h"
19 #endif
20 
21 class TPZIntPoints;
22 class TPZIntCube3D;
23 class TPZGraphElQ3dd;
24 
25 class TPZCompEl;
26 class TPZGeoEl;
27 class TPZCompMesh;
28 #include "TPZTopologyUtils.h"
30 namespace pztopology {
38  class TPZCube : public TPZSavable {
39  public:
40  friend void pztopology::GetPermutation<TPZCube>(const int permute, TPZVec<int> &permutation);
42  enum {NSides = 27, NCornerNodes = 8, Dimension = 3, NFaces = 6, NPermutations = 48};
43 
44  int ClassId() const override;
45  void Read(TPZStream &buf, void *context) override;
46  void Write(TPZStream &buf, int withclassid) const override;
47 
50  }
51 
53  virtual ~TPZCube() {
54  }
55 
60  static int SideDimension(int side);
61 
63  static void LowerDimensionSides(int side,TPZStack<int> &smallsides);
65  static void LowerDimensionSides(int side,TPZStack<int> &smallsides, int DimTarget);
66 
72  static void HigherDimensionSides(int side, TPZStack<int> &high);
73 
75  static int NSideNodes(int side);
77  static int SideNodeLocId(int side, int node);
78 
80  static int NumSides();
82  static int NumSides(int dimension);
83 
85  static int NContainedSides(int side);
87  static int ContainedSideLocId(int side, int c);
88 
90  static void Shape(TPZVec<REAL> &loc,TPZFMatrix<REAL> &phi,TPZFMatrix<REAL> &dphi){
91  TShape(loc, phi, dphi);
92  }
94  template<class T>
95  static void TShape(const TPZVec<T> &loc,TPZFMatrix<T> &phi,TPZFMatrix<T> &dphi);
104  template<class T>
105  static void BlendFactorForSide(const int &side, const TPZVec<T> &xi, T &blendFactor,
106  TPZVec<T> &corrFactorDxi);
113  static void CenterPoint(int side, TPZVec<REAL> &center);
114 
116  static bool IsInParametricDomain(const TPZVec<REAL> &pt, REAL tol = pztopology::gTolerance);
117 
118  #ifdef _AUTODIFF
119 
120  static bool IsInParametricDomain(const TPZVec<Fad<REAL>> &pt, REAL tol = pztopology::gTolerance){
121  TPZVec<REAL> xi(pt.size());
122  for(int i = 0; i < pt.size(); i++) xi[i]= pt[i].val();
123  return IsInParametricDomain(xi,tol);
124  }
125  #endif
126 
128  static void RandomPoint(TPZVec<REAL> &pt);
129 
137  template<class T>
138  static bool CheckProjectionForSingularity(const int &side, const TPZVec<T> &xiInterior);
139 
140  template<class T>
141  static void MapToSide(int side, TPZVec<T> &InternalPar, TPZVec<T> &SidePar, TPZFMatrix<T> &JacToSide);
142 
143  static void ParametricDomainNodeCoord(int node, TPZVec<REAL> &nodeCoord);
144 
151  static MElementType Type();// { return ECube;}
152 
154  static MElementType Type(int side);
155 
167  static TPZTransform<> SideToSideTransform(int sidefrom, int sideto);
168 
174  static TPZTransform<> TransformSideToElement(int side);
180  static TPZTransform<> TransformElementToSide(int side);
181 
187  static int GetTransformId(TPZVec<int64_t> &id);
188 
195  static int GetTransformId(int side, TPZVec<int64_t> &id);
196 
207  static TPZIntPoints *CreateSideIntegrationRule(int side, int order);
208 
213 
223  static void GetSideHDivPermutation(int transformationid, TPZVec<int> &permgather);
224 
226  static constexpr REAL RefElVolume(){return 8.0;}
227 
228  /* Given side and gradx the method returns directions needed for Hdiv space */
229  static void ComputeDirections(int side, TPZFMatrix<REAL> &gradx, TPZFMatrix<REAL> &directions, TPZVec<int> &sidevectors);
230 
232  template <class TVar>
233  static void ComputeHDivDirections(TPZFMatrix<TVar> &gradx, TPZFMatrix<TVar> &directions);
234 
236 
237  static void GetSideHDivDirections(TPZVec<int> &sides, TPZVec<int> &dir, TPZVec<int> &bilinearounao, TPZVec<int> &sidevectors);
238 
254  template <class TVar>
255  static void ComputeHCurlDirections(TPZFMatrix<TVar> &gradx, TPZFMatrix<TVar> &directions, const TPZVec<int> &transformationIds);
259  static int NBilinearSides();
260 
262  static int FaceNodes[6][4]; //protected
263 
264 
266  static int SideNodes[12][2]; //PROTECTED
267 
268  protected:
276  static int ShapeFaceId[6][2];
277 
279  static int fPermutations[48][27];
280 
284  };
285 
286 }
287 
288 #endif
static int bilinearounao[81]
Definition: tpzcube.cpp:405
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
Definition: tpzcube.cpp:721
TPZGraphElQ3dd GraphElType
Typedef to graphical element type.
Definition: tpzcube.h:212
TPZIntCube3D IntruleType
Typedef to numerical integration rule.
Definition: tpzcube.h:210
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
Definition: tpzcube.cpp:535
Handles the numerical integration for three-dimensional problems using cube elements. Numerical Integration.
Definition: pzquad.h:246
static int fPermutations[48][27]
Valid permutations between nodes.
Definition: tpzcube.h:279
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
Definition: tpzcube.cpp:567
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
int ClassId() const override
Define the class id associated with the class.
Definition: tpzcube.cpp:1727
To export a graphical three dimensional discontinuous element. Post processing.
Definition: pzgraphelq3dd.h:20
Definition: fad.h:54
Defines enum MElementType and contains the implementation of MElementType_NNodes(...) functions.
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: tpzcube.cpp:1731
static void ParametricDomainNodeCoord(int node, TPZVec< REAL > &nodeCoord)
Definition: tpzcube.cpp:1035
static int NBilinearSides()
Definition: tpzcube.cpp:523
static void MapToSide(int side, TPZVec< T > &InternalPar, TPZVec< T > &SidePar, TPZFMatrix< T > &JacToSide)
Definition: tpzcube.cpp:1018
static int SideNodes[12][2]
Nodes over lines sides (1d)
Definition: tpzcube.h:266
static void ComputeHCurlDirections(TPZFMatrix< TVar > &gradx, TPZFMatrix< TVar > &directions, const TPZVec< int > &transformationIds)
Definition: tpzcube.cpp:1623
static TPZTransform TransformElementToSide(int side)
Returns the transformation which projects a point from the interior of the element to the side...
Definition: tpzcube.cpp:644
static MElementType Type()
Returns the type of the element as specified in file pzeltype.h.
Definition: tpzcube.cpp:891
static REAL gTolerance
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
Defines the topology of the hexahedron element. Topology Sides 0 to 7 are vertices, sides 8 to 19 are lines, 20 to 25 are quadrilaterals and side 26 is the hexahedra (cube).
Definition: tpzcube.h:38
static const double tol
Definition: pzgeoprism.cpp:23
Groups all classes defining the structure of the master element.
Definition: PrismExtend.cpp:15
TPZCube()
Default constructor.
Definition: tpzcube.h:49
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom to the side sideto...
Definition: tpzcube.cpp:596
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
static void ComputeHDivDirections(TPZFMatrix< TVar > &gradx, TPZFMatrix< TVar > &directions)
Compute the directions of the HDiv vectors.
static int SideDimension(int side)
Returns the dimension of the side.
Definition: tpzcube.cpp:588
Contains TPZMatrixclass which implements full matrix (using column major representation).
static void GetSideHDivDirections(TPZVec< int > &sides, TPZVec< int > &dir, TPZVec< int > &bilinearounao)
Definition: tpzcube.cpp:1586
virtual ~TPZCube()
Default destructor.
Definition: tpzcube.h:53
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: tpzcube.cpp:1735
static void CenterPoint(int side, TPZVec< REAL > &center)
Returns the barycentric coordinates in the master element space of the original element.
Definition: tpzcube.cpp:578
static int ShapeFaceId[6][2]
Ids of the shape face.
Definition: tpzcube.h:276
static void RandomPoint(TPZVec< REAL > &pt)
Generates a random point in the master domain.
Definition: tpzcube.cpp:635
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: tpzcube.cpp:429
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
Definition: tpzcube.cpp:552
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
Definition: tpzcube.cpp:872
A simple stack.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
Definition: tpzcube.cpp:1000
static void ComputeDirections(int side, TPZFMatrix< REAL > &gradx, TPZFMatrix< REAL > &directions, TPZVec< int > &sidevectors)
Definition: tpzcube.cpp:1455
static int NumSides()
Returns number of connects of the element (27) ???
Definition: tpzcube.cpp:936
static int GetTransformId(TPZVec< int64_t > &id)
Method which identifies the transformation based on the IDs of the corner nodes.
Definition: tpzcube.cpp:1114
MElementType
Define the element types.
Definition: pzeltype.h:52
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
Definition: tpzcube.cpp:562
static bool CheckProjectionForSingularity(const int &side, const TPZVec< T > &xiInterior)
Definition: tpzcube.cpp:1013
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
static constexpr REAL RefElVolume()
Volume of the master element.
Definition: tpzcube.h:226
Contains declaration of the TPZAxesTools class which implements verifications over axes...
Contains the TPZTransform<> class which implements an affine transformation between points in paramet...
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
static void GetSideHDivPermutation(int transformationid, TPZVec< int > &permgather)
Identifies the permutation of the nodes needed to make neighbouring elements compatible in terms of o...
Definition: tpzcube.cpp:1185
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
static int NContainedSides(int side)
Returns the number of connectivities associated with a side.
Definition: tpzcube.cpp:941
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
Contains declaration of the TPZNumeric class which implements several methods to calculation.
static void BlendFactorForSide(const int &side, const TPZVec< T > &xi, T &blendFactor, TPZVec< T > &corrFactorDxi)
Definition: tpzcube.cpp:482
static void Shape(TPZVec< REAL > &loc, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
Definition: tpzcube.h:90
static int FaceNodes[6][4]
Nodes over quadrilateral sides (2d - faces).
Definition: tpzcube.h:262
static int ContainedSideLocId(int side, int c)
Returns the local connect number of the connect "c" along side "side".
Definition: tpzcube.cpp:965