18 static LoggerPtr logger(Logger::getLogger(
"pz.specialmaps.quadraticquad"));
32 T qsi = par[0], eta = par[1];
34 phi(0,0) = -0.25*(-1. + eta)*(-1. + qsi)*(1. + eta + qsi);
35 phi(1,0) = 0.25*(-1. + eta)*(1. + eta - qsi)*(1. + qsi);
36 phi(2,0) = 0.25*( 1. + qsi)*(1. + eta)*(qsi + eta - 1.);
37 phi(3,0) = -0.25*( 1. + eta)*(-1. + eta - qsi)*(-1. + qsi);
39 phi(4,0) = 0.5*(-1. + eta)*(-1. + qsi)*( 1. + qsi);
40 phi(5,0) = -0.5*(-1. + eta)*( 1. + eta)*( 1. + qsi);
41 phi(6,0) = -0.5*( 1. + eta)*(-1. + qsi)*( 1. + qsi);
42 phi(7,0) = 0.5*(-1. + eta)*( 1. + eta)*(-1. + qsi);
44 dphi(0,0) = -0.25*(-1. + eta)*(eta + 2.*qsi);
45 dphi(1,0) = -0.25*(-1. + qsi)*(2.*eta + qsi);
46 dphi(0,1) = 0.25*(-1. + eta)*(eta - 2.*qsi);
47 dphi(1,1) = 0.25*(2.*eta - qsi)*(1. + qsi);
48 dphi(0,2) = 0.25*(1. + eta)*(eta + 2.*qsi);
49 dphi(1,2) = 0.25*(1. + qsi)*(2.*eta + qsi);
50 dphi(0,3) = -0.25*(1. + eta)*(eta - 2.*qsi);
51 dphi(1,3) = -0.25*(2.*eta - qsi)*(-1. + qsi);
53 dphi(0,4) = (-1. + eta)*qsi;
54 dphi(1,4) = 0.5*(-1. + qsi)*(1. + qsi);
55 dphi(0,5) = -0.5*(-1. + eta)*(1. + eta);
56 dphi(1,5) = -eta*(1. + qsi);
57 dphi(0,6) = -(1. + eta)*qsi;
58 dphi(1,6) = -0.5*(-1. + qsi)*(1. + qsi);
59 dphi(0,7) = 0.5*(-1. + eta)*(1. + eta);
60 dphi(1,7) = eta*(-1. + qsi);
70 int space = nodes.
Rows();
72 for(
int i = 0; i < space; i++) {
74 for(
int j = 0; j < NNodes; j++) {
75 x[i] += phi(j,0)*nodes.
GetVal(i,j);
86 int nrow = nodes.
Rows();
87 int ncol = nodes.
Cols();
89 if(nrow != 3 || ncol != 8){
90 std::cout <<
"Objects of incompatible lengths, gradient cannot be computed." << std::endl;
91 std::cout <<
"nodes matrix must be 3x8." << std::endl;
99 for(
int i = 0; i < NNodes; i++)
101 for(
int j = 0; j < 3; j++)
103 gradx(j,0) += nodes.
GetVal(j,i)*dphi(0,i);
104 gradx(j,1) += nodes.
GetVal(j,i)*dphi(1,i);
161 for (
int i=0; i<3; i++) {
162 scale[i] = size[i]/3.;
163 shift[i] = size[i]/2.+lowercorner[i];
166 for (
int i=0; i<NCornerNodes; i++) {
167 ParametricDomainNodeCoord(i,
co);
169 for (
int j=0; j<3; j++) {
170 co[j] = shift[j]+scale[j]*
co[j]+(rand()*0.2/RAND_MAX)-0.1;
173 gmesh.
NodeVec()[nodeindexes[i]].Initialize(
co, gmesh);
178 int nsides = gel->
NSides();
179 for (
int is=0; is<nsides; is++) {
186 for (
int i=0; i<3; i++) {
187 co[i] += (0.2*rand())/RAND_MAX - 0.1;
259 int TPZQuadraticQuad::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...
Contains the TPZQuadraticQuad class which defines a quadrilateral geometric element with quadratic ma...
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.
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.
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
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...