14 static LoggerPtr logger(Logger::getLogger(
"pz.specialmaps.quadratictetra"));
33 T qsi = par[0], eta = par[1], zeta = par[2];
35 phi(0,0) = (zeta + eta + qsi -1.) * (2.*zeta + 2.*eta + 2.*qsi - 1.);
38 phi(1,0) = qsi * (2.*qsi - 1.);
39 phi(2,0) = eta * (2.*eta - 1.);
40 phi(3,0) = zeta * (2.*zeta - 1.);
41 phi(4,0) = -4.*qsi * (qsi + eta + zeta -1.);
42 phi(5,0) = 4.*qsi * eta;
43 phi(6,0) = -4.*eta * (qsi + eta + zeta -1.);
44 phi(7,0) = -4.*zeta * (qsi + eta + zeta -1.);
45 phi(8,0) = 4.*qsi * zeta;
46 phi(9,0) = 4.*eta * zeta;
48 dphi(0,0) = -3. + 4.*qsi + 4.*eta + 4.*zeta;
49 dphi(1,0) = -3. + 4.*qsi + 4.*eta + 4.*zeta;
50 dphi(2,0) = -3. + 4.*qsi + 4.*eta + 4.*zeta;
51 dphi(0,1) = -1. + 4.*qsi;
55 dphi(1,2) = -1. + 4.*eta;
59 dphi(2,3) = -1. + 4.*zeta;
60 dphi(0,4) = -4.*(2.*qsi + eta + zeta - 1.);
67 dphi(1,6) = -4.*(qsi + eta + zeta - 1.)-4.*eta;
71 dphi(2,7) = -4.*(qsi + eta + zeta - 1.)-4.*zeta;
87 int space = nodes.
Rows();
88 for (
int i=0; i<3; i++) {
91 for(
int j = 0; j < NNodes; j++) {
92 for(
int i = 0; i < space; i++) {
93 x[i] += phi(j,0)*nodes.
GetVal(i,j);
103 int nrow = nodes.
Rows();
104 int ncol = nodes.
Cols();
106 if(nrow != 3 || ncol != 10){
107 std::cout <<
"Objects of incompatible lengths, gradient cannot be computed." << std::endl;
108 std::cout <<
"nodes matrix must be 3x10." << std::endl;
115 TShape(loc,phi,dphi);
116 for(
int i = 0; i < NNodes; i++)
118 for(
int j = 0; j < 3; j++)
120 gradx(j,0) += nodes.
GetVal(j,i)*dphi(0,i);
121 gradx(j,1) += nodes.
GetVal(j,i)*dphi(1,i);
122 gradx(j,2) += nodes.
GetVal(j,i)*dphi(2,i);
197 for (
int i=0; i<3; i++) {
198 scale[i] = size[i]/3.;
199 shift[i] = size[i]/2.+lowercorner[i];
202 for (
int i=0; i<NCornerNodes; i++) {
203 ParametricDomainNodeCoord(i,
co);
205 for (
int j=0; j<3; j++) {
206 co[j] = shift[j]+scale[j]*
co[j]+(rand()*0.2/RAND_MAX)-0.1;
209 gmesh.
NodeVec()[nodeindexes[i]].Initialize(
co, gmesh);
214 int nsides = gel->
NSides();
215 for (
int is=0; is<nsides; is++) {
222 for (
int i=0; i<3; i++) {
223 co[i] += (0.2*rand())/RAND_MAX - 0.1;
virtual ~TPZQuadraticTetra()
Destructor.
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
int AllocateNewElement()
Makes more room for new elements.
void SetCoord(const TPZVec< REAL > &x)
Sets all coordinates into the current node. It gets the dim values from x.
TPZGeoNode * NodePtr(int i) const
Returns a pointer to the ith node of the element.
Contains the TPZChangeEl class. It is a special map.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
static void X(const TPZFMatrix< REAL > &coord, TPZVec< T > &par, TPZVec< T > &result)
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...
groups all classes dedicated to the computation of shape functions
static void GradX(const TPZFMatrix< REAL > &nodes, TPZVec< T > &loc, TPZFMatrix< T > &gradx)
Compute gradient of X mapping from element nodes and local parametric coordinates.
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
int ClassId() const override
Define the class id associated with the class.
This class implements a simple vector storage scheme for a templated class T. Utility.
virtual int NSides() const =0
Returns the number of connectivities of the element.
static void TShape(const TPZVec< T > ¶m, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Contains declaration of TPZGeoElMapped class which implements a geometric element using its ancestral...
int Zero() override
Makes Zero all the elements.
Groups all classes defining the structure of the master element.
Implements a generic geometric element which is refined according to a generic refinement pattern...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
TPZGeoEl * Element(int64_t iel)
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
int64_t Rows() const
Returns number of rows.
REAL co[8][3]
Coordinates of the eight nodes.
int32_t Hash(std::string str)
static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec< REAL > &lowercorner, TPZVec< REAL > &size)
Creates a geometric element according to the type of the father element.
virtual int NNodes() const =0
Returns the number of nodes of the element.
virtual void SetSideDefined(int side)=0
Flags the side as defined, this means no neighbouring element was found.
This class implements a geometric mesh for the pz environment. Geometry.
Contains the implementation of the TPZNodeRep methods.
static TPZGeoEl * ChangeToQuadratic(TPZGeoMesh *Mesh, int64_t ElemIndex)
Turns an linear geoelement to quadratic.
int64_t Cols() const
Returns number of cols.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Contains the implementation of the TPZGeoElRefPattern methods.
void GetCoordinates(TPZVec< REAL > &co)
Fill the coordinates of the node.
Groups all classes which model the geometry.
Contains the TPZQuadraticTetra class which defines a tetrahedral geometric element with quadratic map...
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.
int ClassId() const override
Implements an interface to register a class id and a restore function. Persistence.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...