21 static LoggerPtr logger(Logger::getLogger(
"pz.specialmaps.quadraticcube"));
37 T qsi = par[0], eta = par[1], zeta = par[2];
39 phi(0,0) = 1./8.*((-1. + eta)*(-1. + qsi)*(-1. + zeta)*(2. + eta + qsi + zeta));
40 phi(1,0) = -1./8.*((-1. + eta)*(1. + qsi)*(-1. + zeta)*(2. + eta - qsi + zeta));
41 phi(2,0) = -1./8.*((1. + eta)*(1. + qsi)*(-2. + eta + qsi - zeta)*(-1. + zeta));
42 phi(3,0) = 1./8.*((1. + eta)*(-1. + qsi)*(-2. + eta - qsi - zeta)*(-1. + zeta));
44 phi(4,0) = -1./8.*((-1. + eta)*(-1. + qsi)*(2. + eta + qsi - zeta)*(1. + zeta));
45 phi(5,0) = 1./8.*((-1. + eta)*(1. + qsi)*(2. + eta - qsi - zeta)*(1. + zeta));
46 phi(6,0) = 1./8.*((1. + eta)*(1. + qsi)*(1. + zeta)*(-2. + eta + qsi + zeta));
47 phi(7,0) = -1./8.*((1. + eta)*(-1. + qsi)*(1. + zeta)*(-2. + eta - qsi + zeta));
49 phi(8,0) = -1./4.*((-1. + eta)*(-1. + qsi*qsi)*(-1. + zeta));
50 phi(9,0) = 1./4.*((-1. + eta*eta)*(1. + qsi)*(-1. + zeta));
51 phi(10,0) = 1./4.*((1. + eta)*(-1. + qsi*qsi)*(-1. + zeta));
52 phi(11,0) = -1./4.*((-1. + eta*eta)*(-1. + qsi)*(-1. + zeta));
54 phi(12,0) = -1./4.*((-1. + eta)*(-1. + qsi)*(-1. + zeta*zeta));
55 phi(13,0) = 1./4.*((-1. + eta)*(1. + qsi)*(-1. + zeta*zeta));
56 phi(14,0) = -1./4.*((1. + eta)*(1. + qsi)*(-1. + zeta*zeta));
57 phi(15,0) = 1./4.*((1. + eta)*(-1. + qsi)*(-1. + zeta*zeta));
59 phi(16,0) = 1./4.*((-1. + eta)*(-1. + qsi*qsi)*(1. + zeta));
60 phi(17,0) = -1./4.*((-1. + eta*eta)*(1. + qsi)*(1. + zeta));
61 phi(18,0) = -1./4.*((1. + eta)*(-1. + qsi*qsi)*(1. + zeta));
62 phi(19,0) = 1./4.*((-1. + eta*eta)*(-1. + qsi)*(1. + zeta));
65 dphi(0,0) = 1./8.*((-1. + eta)*(-1. + zeta)*(1. + eta + 2.*qsi + zeta));
66 dphi(1,0) = 1./8.*((-1. + qsi)*(-1. + zeta)*(1. + 2.*eta + qsi + zeta));
67 dphi(2,0) = 1./8.*((-1. + eta)*(-1. + qsi)*(1. + eta + qsi + 2.*zeta));
69 dphi(0,1) = -1./8.*((-1. + eta)*(-1. + zeta)*(1. + eta - 2.*qsi + zeta));
70 dphi(1,1) = 1./8.*((1. + qsi)*(-1. - 2.*eta + qsi - zeta)*(-1. + zeta));
71 dphi(2,1) = -1./8.*((-1. + eta)*(1. + qsi)*(1. + eta - qsi + 2.*zeta));
73 dphi(0,2) = 1./8.*((1. + eta)*(-1. + zeta)*(1. - eta - 2.*qsi + zeta));
74 dphi(1,2) = 1./8.*((1. + qsi)*(-1. + zeta)*(1. - 2.*eta - qsi + zeta));
75 dphi(2,2) = -1./8.*((1. + eta)*(1. + qsi)*(-1. + eta + qsi - 2.*zeta));
77 dphi(0,3) = 1./8.*((1. + eta)*(-1. + eta - 2.*qsi - zeta)*(-1. + zeta));
78 dphi(1,3) = -1./8.*((-1. + qsi)*(-1. + zeta)*(1. - 2.*eta + qsi + zeta));
79 dphi(2,3) = 1./8.*((1. + eta)*(-1. + qsi)*(-1. + eta - qsi - 2.*zeta));
81 dphi(0,4) = -1./8.*((-1. + eta)*(1. + eta + 2.*qsi - zeta)*(1. + zeta));
82 dphi(1,4) = -1./8.*((-1. + qsi)*(1. + 2.*eta + qsi - zeta)*(1. + zeta));
83 dphi(2,4) = -1./8.*((-1. + eta)*(-1. + qsi)*(1. + eta + qsi - 2.*zeta));
85 dphi(0,5) = 1./8.*((-1. + eta)*(1. + eta - 2.*qsi - zeta)*(1. + zeta));
86 dphi(1,5) = -1./8.*((1. + qsi)*(1. + zeta)*(-1. - 2.*eta + qsi + zeta));
87 dphi(2,5) = 1./8.*((-1. + eta)*(1. + qsi)*(1. + eta - qsi - 2.*zeta));
89 dphi(0,6) = 1./8.*((1. + eta)*(1. + zeta)*(-1. + eta + 2.*qsi + zeta));
90 dphi(1,6) = 1./8.*((1. + qsi)*(1. + zeta)*(-1. + 2.*eta + qsi + zeta));
91 dphi(2,6) = 1./8.*((1. + eta)*(1. + qsi)*(-1. + eta + qsi + 2.*zeta));
93 dphi(0,7) = -1./8.*((1. + eta)*(1. + zeta)*(-1. + eta - 2.*qsi + zeta));
94 dphi(1,7) = 1./8.*((-1. + qsi)*(1. - 2.*eta + qsi - zeta)*(1. + zeta));
95 dphi(2,7) = 1./8.*((1. + eta)*(-1. + qsi)*(1. - eta + qsi - 2.*zeta));
97 dphi(0,8) = -1./2.*((-1. + eta)*qsi*(-1. + zeta));
98 dphi(1,8) = -1./4.*((-1. + qsi*qsi)*(-1. + zeta));
99 dphi(2,8) = -1./4.*((-1. + eta)*(-1. + qsi*qsi));
101 dphi(0,9) = 1./4.*((-1. + eta*eta)*(-1. + zeta));
102 dphi(1,9) = 1./2.*(eta*(1. + qsi)*(-1. + zeta));
103 dphi(2,9) = 1./4.*((-1. + eta*eta)*(1. + qsi));
105 dphi(0,10) = 1./2.*((1. + eta)*qsi*(-1. + zeta));
106 dphi(1,10) = 1./4.*((-1. + qsi*qsi)*(-1. + zeta));
107 dphi(2,10) = 1./4.*((1. + eta)*(-1. + qsi*qsi));
109 dphi(0,11) = -1./4.*((-1. + eta*eta)*(-1. + zeta));
110 dphi(1,11) = -1./2.*(eta*(-1. + qsi)*(-1. + zeta));
111 dphi(2,11) = -1./4.*((-1. + eta*eta)*(-1. + qsi));
113 dphi(0,12) = -1./4.*((-1. + eta)*(-1. + zeta*zeta));
114 dphi(1,12) = -1./4.*((-1. + qsi)*(-1. + zeta*zeta));
115 dphi(2,12) = -1./2.*((-1. + eta)*(-1. + qsi)*zeta);
117 dphi(0,13) = 1./4.*((-1. + eta)*(-1. + zeta*zeta));
118 dphi(1,13) = 1./4.*((1. + qsi)*(-1. + zeta*zeta));
119 dphi(2,13) = 1./2.*((-1. + eta)*(1. + qsi)*zeta);
121 dphi(0,14) = -1./4.*((1. + eta)*(-1. + zeta*zeta));
122 dphi(1,14) = -1./4.*((1. + qsi)*(-1. + zeta*zeta));
123 dphi(2,14) = -1./2.*((1. + eta)*(1. + qsi)*zeta);
125 dphi(0,15) = 1./4.*((1. + eta)*(-1. + zeta*zeta));
126 dphi(1,15) = 1./4.*((-1. + qsi)*(-1. + zeta*zeta));
127 dphi(2,15) = 1./2.*((1. + eta)*(-1. + qsi)*zeta);
129 dphi(0,16) = 1./2.*((-1. + eta)*qsi*(1. + zeta));
130 dphi(1,16) = 1./4.*((-1. + qsi*qsi)*(1. + zeta));
131 dphi(2,16) = 1./4.*((-1. + eta)*(-1. + qsi*qsi));
133 dphi(0,17) = -1./4.*((-1. + eta*eta)*(1. + zeta));
134 dphi(1,17) = -1./2.*(eta*(1. + qsi)*(1. + zeta));
135 dphi(2,17) = -1./4.*((-1. + eta*eta)*(1. + qsi));
137 dphi(0,18) = -1./2.*((1. + eta)*qsi*(1. + zeta));
138 dphi(1,18) = -1./4.*((-1. + qsi*qsi)*(1. + zeta));
139 dphi(2,18) = -1./4.*((1. + eta)*(-1. + qsi*qsi));
141 dphi(0,19) = 1./4.*((-1. + eta*eta)*(1. + zeta));
142 dphi(1,19) = 1./2.*(eta*(-1. + qsi)*(1. + zeta));
143 dphi(2,19) = 1./4.*((-1. + eta*eta)*(-1. + qsi));
152 TShape(loc,phi,dphi);
153 int space = nodes.
Rows();
155 for(
int i = 0; i < space; i++) {
157 for(
int j = 0; j < NNodes; j++) {
158 x[i] += phi(j,0)*nodes.
GetVal(i,j);
169 int nrow = nodes.
Rows();
170 int ncol = nodes.
Cols();
172 if(nrow != 3 || ncol != 20){
173 std::cout <<
"Objects of incompatible lengths, gradient cannot be computed." << std::endl;
174 std::cout <<
"nodes matrix must be 3x20." << std::endl;
181 TShape(loc,phi,dphi);
182 for(
int i = 0; i < NNodes; i++)
184 for(
int j = 0; j < 3; j++)
186 gradx(j,0) += nodes.
GetVal(j,i)*dphi(0,i);
187 gradx(j,1) += nodes.
GetVal(j,i)*dphi(1,i);
188 gradx(j,2) += nodes.
GetVal(j,i)*dphi(2,i);
242 for (
int i=0; i<3; i++) {
243 scale[i] = size[i]/3.;
244 shift[i] = size[i]/2.+lowercorner[i];
247 for (
int i=0; i<NCornerNodes; i++) {
248 ParametricDomainNodeCoord(i,
co);
250 for (
int j=0; j<3; j++) {
251 co[j] = shift[j]+scale[j]*
co[j]+(rand()*0.2/RAND_MAX)-0.1;
254 gmesh.
NodeVec()[nodeindexes[i]].Initialize(
co, gmesh);
259 int nsides = gel->
NSides();
260 for (
int is=0; is<nsides; is++) {
267 for (
int i=0; i<3; i++) {
268 co[i] += (0.2*rand())/RAND_MAX - 0.1;
429 int TPZQuadraticCube::ClassId()
const{
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.
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...
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
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.
Contains the TPZQuadraticCube class which defines a cube geometric element with quadratic map...
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 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...