18 static LoggerPtr logger(Logger::getLogger(
"pz.specialmaps.quadraticpyramid"));
32 T qsi = par[0], eta = par[1], zeta = par[2];
34 if(
fabs(check) < 1.E-6)
105 phi(0,0) = ((1 + eta + qsi)*(-1 + eta + zeta)*(-1 + qsi + zeta))/(4.*(-1 + zeta));
106 phi(1,0) = -((1 + eta - qsi)*(1 + qsi - zeta)*(-1 + eta + zeta))/(4.*(-1 + zeta));
107 phi(2,0) = -((-1 + eta + qsi)*(1 + eta - zeta)*(1 + qsi - zeta))/(4.*(-1 + zeta));
108 phi(3,0) = ((-1 + eta - qsi)*(1 + eta - zeta)*(-1 + qsi + zeta))/(4.*(-1 + zeta));
109 phi(4,0) = zeta*(-1 + 2*zeta);
110 phi(5,0) = ((-1 + eta + zeta)*(-1 - qsi + zeta)*(-1 + qsi + zeta))/(2.*(-1 + zeta));
111 phi(6,0) = ((-1 - eta + zeta)*(-1 + eta + zeta)*(-1 - qsi + zeta))/(2.*(-1 + zeta));
112 phi(7,0) = ((qsi*qsi - (-1 + zeta)*(-1 + zeta))*(1 + eta - zeta))/(2.*(-1 + zeta));
113 phi(8,0) = ((-(eta*eta) + (-1 + zeta)*(-1 + zeta))*(-1 + qsi + zeta))/(2.*(-1 + zeta));
114 phi(9,0) = -((zeta*(-1 + eta + zeta)*(-1 + qsi + zeta))/(-1 + zeta));
115 phi(10,0) = -((zeta*(-1 + eta + zeta)*(-1 - qsi + zeta))/(-1 + zeta));
116 phi(11,0) = ((1 + eta - zeta)*(1 + qsi - zeta)*zeta)/(1 - zeta);
117 phi(12,0) = -((zeta*(-1 - eta + zeta)*(-1 + qsi + zeta))/(-1 + zeta));
120 dphi(0,0) = ((-1 + eta + zeta)*(eta + 2*qsi + zeta))/(4.*(-1 + zeta));
121 dphi(1,0) = ((-1 + qsi + zeta)*(2*eta + qsi + zeta))/(4.*(-1 + zeta));
122 dphi(2,0) = -(eta*eta*qsi + eta*(qsi + qsi*qsi - (-1 + zeta)*(-1 + zeta)) - (1 + qsi)*((-1 + zeta)*(-1 + zeta)))/(4.*((-1 + zeta)*(-1 + zeta)));
124 dphi(0,1) = -((-1 + eta + zeta)*(eta - 2*qsi + zeta))/(4.*(-1 + zeta));
125 dphi(1,1) = ((1 + qsi - zeta)*(-2*eta + qsi - zeta))/(4.*(-1 + zeta));
126 dphi(2,1) = (eta*eta*qsi + eta*(qsi - qsi*qsi + (-1 + zeta)*(-1 + zeta)) - (-1 + qsi)*((-1 + zeta)*(-1 + zeta)))/(4.*((-1 + zeta)*(-1 + zeta)));
128 dphi(0,2) = -((1 + eta - zeta)*(eta + 2*qsi - zeta))/(4.*(-1 + zeta));
129 dphi(1,2) = -((1 + qsi - zeta)*(2*eta + qsi - zeta))/(4.*(-1 + zeta));
130 dphi(2,2) = (eta*eta*qsi + eta*(-qsi + qsi*qsi - (-1 + zeta)*(-1 + zeta)) - (-1 + qsi)*((-1 + zeta)*(-1 + zeta)))/(4.*((-1 + zeta)*(-1 + zeta)));
132 dphi(0,3) = ((1 + eta - zeta)*(eta - 2*qsi - zeta))/(4.*(-1 + zeta));
133 dphi(1,3) = ((2*eta - qsi - zeta)*(-1 + qsi + zeta))/(4.*(-1 + zeta));
134 dphi(2,3) = (-(eta*eta*qsi) + eta*(qsi + qsi*qsi - (-1 + zeta)*(-1 + zeta)) + (1 + qsi)*((-1 + zeta)*(-1 + zeta)))/(4.*((-1 + zeta)*(-1 + zeta)));
138 dphi(2,4) = -1 + 4*zeta;
140 dphi(0,5) = -((qsi*(-1 + eta + zeta))/(-1 + zeta));
141 dphi(1,5) = (-(qsi*qsi) + (-1 + zeta)*(-1 + zeta))/(2.*(-1 + zeta));
142 dphi(2,5) = (-2 + eta + (eta*(qsi*qsi))/((-1 + zeta)*(-1 + zeta)) + 2*zeta)/2.;
144 dphi(0,6) = (eta*eta - (-1 + zeta)*(-1 + zeta))/(2.*(-1 + zeta));
145 dphi(1,6) = (eta*(1 + qsi - zeta))/(-1 + zeta);
146 dphi(2,6) = -1 + qsi*(-0.5 - (eta*eta)/(2.*((-1 + zeta)*(-1 + zeta)))) + zeta;
148 dphi(0,7) = (qsi*(1 + eta - zeta))/(-1 + zeta);
149 dphi(1,7) = (qsi*qsi - (-1 + zeta)*(-1 + zeta))/(2.*(-1 + zeta));
150 dphi(2,7) = -1 + eta*(-0.5 - (qsi*qsi)/(2.*((-1 + zeta)*(-1 + zeta)))) + zeta;
152 dphi(0,8) = (-(eta*eta) + (-1 + zeta)*(-1 + zeta))/(2.*(-1 + zeta));
153 dphi(1,8) = -((eta*(-1 + qsi + zeta))/(-1 + zeta));
154 dphi(2,8) = (-2 + qsi + (eta*eta*qsi)/((-1 + zeta)*(-1 + zeta)) + 2*zeta)/2.;
156 dphi(0,9) = -((zeta*(-1 + eta + zeta))/(-1 + zeta));
157 dphi(1,9) = -((zeta*(-1 + qsi + zeta))/(-1 + zeta));
158 dphi(2,9) = 1 - qsi + eta*(-1 + qsi/((-1 + zeta)*(-1 + zeta))) - 2*zeta;
160 dphi(0,10) = (zeta*(-1 + eta + zeta))/(-1 + zeta);
161 dphi(1,10) = ((1 + qsi - zeta)*zeta)/(-1 + zeta);
162 dphi(2,10) = 1 + qsi + eta*(-1 - qsi/((-1 + zeta)*(-1 + zeta))) - 2*zeta;
164 dphi(0,11) = (zeta*(-1 - eta + zeta))/(-1 + zeta);
165 dphi(1,11) = (zeta*(-1 - qsi + zeta))/(-1 + zeta);
166 dphi(2,11) = 1 + eta + qsi + (eta*qsi)/((-1 + zeta)*(-1 + zeta)) - 2*zeta;
168 dphi(0,12) = ((1 + eta - zeta)*zeta)/(-1 + zeta);
169 dphi(1,12) = (zeta*(-1 + qsi + zeta))/(-1 + zeta);
170 dphi(2,12) = 1 + eta - qsi - (eta*qsi)/((-1 + zeta)*(-1 + zeta)) - 2*zeta;
180 TShape(loc,phi,dphi);
181 int space = nodes.
Rows();
183 for(
int i = 0; i < space; i++) {
185 for(
int j = 0; j < NNodes; j++) {
186 x[i] += phi(j,0)*nodes.
GetVal(i,j);
197 int nrow = nodes.
Rows();
198 int ncol = nodes.
Cols();
200 if(nrow != 3 || ncol != 13){
201 std::cout <<
"Objects of incompatible lengths, gradient cannot be computed." << std::endl;
202 std::cout <<
"nodes matrix must be 3x13." << std::endl;
209 TShape(loc,phi,dphi);
210 for(
int i = 0; i < NNodes; i++)
212 for(
int j = 0; j < 3; j++)
214 gradx(j,0) += nodes.
GetVal(j,i)*dphi(0,i);
215 gradx(j,1) += nodes.
GetVal(j,i)*dphi(1,i);
216 gradx(j,2) += nodes.
GetVal(j,i)*dphi(2,i);
272 for (
int i=0; i<3; i++) {
273 scale[i] = size[i]/3.;
274 shift[i] = size[i]/2.+lowercorner[i];
277 for (
int i=0; i<NCornerNodes; i++) {
278 ParametricDomainNodeCoord(i,
co);
280 for (
int j=0; j<3; j++) {
281 co[j] = shift[j]+scale[j]*
co[j]+(rand()*0.2/RAND_MAX)-0.1;
284 gmesh.
NodeVec()[nodeindexes[i]].Initialize(
co, gmesh);
289 int nsides = gel->
NSides();
290 for (
int is=0; is<nsides; is++) {
297 for (
int i=0; i<3; i++) {
298 co[i] += (0.2*rand())/RAND_MAX - 0.1;
413 int TPZQuadraticPyramid::ClassId()
const{
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
int AllocateNewElement()
Makes more room for new elements.
Contains the TPZQuadraticPyramid class which defines a pyramid geometric element with quadratic map...
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.
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
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
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.
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.
static TPZGeoEl * ChangeToQuadratic(TPZGeoMesh *Mesh, int64_t ElemIndex)
Turns an linear geoelement to quadratic.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Contains the TPZGeoBlend class which implements a blending map from curved boundaries to the interior...
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.
Implements ... Geometry Topology.
int32_t Hash(std::string str)
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.
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 TPZShapePiram class which implements the shape functions of a pyramid element.
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.
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.
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...