19 REAL TPZShapeTriang::gTrans2dT[6][2][2] = {
20 { { 1., 0.},{ 0., 1.} },
21 { { 0., 1.},{ 1., 0.} },
22 { { 0., 1.},{-1.,-1.} },
23 { {-1.,-1.},{ 0., 1.} },
24 { {-1.,-1.},{ 1., 0.} },
25 { { 1., 0.},{-1.,-1.} }
28 REAL TPZShapeTriang::gVet2dT[6][2] = { {0.,0.},{0.,0.},{0.,1.},{1.,0.},{1.,0.},{0.,1.} };
30 REAL TPZShapeTriang::gRibTrans2dT1d[3][2] = { {2.,1.},{-1.,1.},{-1.,-2.} };
32 REAL TPZShapeTriang::gVet1dT[3] = {-1.,0.,1.};
37 phi(0,0) = 1.-pt[0]-pt[1];
61 phi(is,0) = phi(is1,0)*phi(is2,0);
62 dphi(0,is) = dphi(0,is1)*phi(is2,0)+phi(is1,0)*dphi(0,is2);
63 dphi(1,is) = dphi(1,is1)*phi(is2,0)+phi(is1,0)*dphi(1,is2);
68 phi(is,0) = phi(is1,0)*phi(is2,0)*phi(is3,0);
69 dphi(0,is) = dphi(0,is1)*phi(is2,0)*phi(is3,0)+phi(is1,0)*dphi(0,is2)*phi(is3,0)+phi(is1,0)*phi(is2,0)*dphi(0,is3);
70 dphi(1,is) = dphi(1,is1)*phi(is2,0)*phi(is3,0)+phi(is1,0)*dphi(1,is2)*phi(is3,0)+phi(is1,0)*phi(is2,0)*dphi(1,is3);
73 REAL mult[] = {1.,1.,1.,4.,4.,4.,27.};
74 for(is=3;is<NSides; is++)
76 phi(is,0) *= mult[is];
77 dphi(0,is) *= mult[is];
78 dphi(1,is) *= mult[is];
86 ShapeCorner(pt,phi,dphi);
87 if (order[0] < 2 && order[1] < 2 && order[2] < 2 && order[3] < 3)
return;
92 for(is=0; is<NCornerNodes; is++)
94 phiblend(is,0) = phi(is,0);
95 for(d=0; d<Dimension; d++)
97 dphiblend(d,is) = dphi(d,is);
100 ShapeGenerating(pt,phiblend,dphiblend);
104 for (
int rib = 0; rib < 3; rib++) {
106 ProjectPoint2dTriangToRib(rib,pt,out);
110 ids[1] =
id[(rib+1)%3];
111 int ord2 = order[rib]-1;
118 for (
int i = 0; i < ord2; i++) {
119 phi(shape,0) = phiblend(rib+3,0)*phin(i,0);
120 for(
int xj=0;xj<2;xj++) {
121 dphi(xj,shape) = dphiblend(xj,rib+3)* phin( i, 0)+
122 phiblend(rib+3, 0 )* dphin(xj,i);
128 if (order[3] < 3)
return;
129 int ord = order[3]-2;
130 int nsh = (ord*(ord+1))/2;
133 ShapeInternal(pt,order[3]-2, phin, dphin,GetTransformId2dT(
id));
136 for(
int i=0;i<nsh;i++) {
137 phi(shape,0) = phiblend(6,0)*phin(i,0);
138 for(
int d=0;d<2;d++) {
139 dphi(d,shape) = dphiblend(d,6)* phin(i,0) +
140 phiblend(6,0)*dphin(d,i);
148 if(side<0 || side>6)
PZError <<
"TPZShapeTriang::SideShape. Bad paramenter side.\n";
149 else if(side==6)
Shape(pt,
id,order,phi,dphi);
161 int64_t nsides = TPZTriangle::NSides;
166 int nshape = NCornerNodes;
168 for (
int is = NCornerNodes; is < nsides; is++)
170 nshape += NConnectShapeF(is,order[is-NCornerNodes]);
173 if (nshape!=shapeorders.
Rows())
180 for (
int side = 0; side < nsides; side++)
186 if(side >= NCornerNodes) nshape = NConnectShapeF(side,order[side-NCornerNodes]);
188 if(side >= NCornerNodes) sideorder = order[side-NCornerNodes];
191 SideShapeOrder(side,
id, sideorder, locshapeorders);
193 int nlin = locshapeorders.
Rows();
194 int ncol = locshapeorders.
Cols();
196 for (
int il = 0; il<nlin; il++)
198 for (
int jc = 0; jc<ncol; jc++)
200 shapeorders(linha, jc) = locshapeorders(il, jc);
214 if(shapeorders.
Rows() != 1)
218 shapeorders(0,0) = 1;
219 shapeorders(0,1) = 0;
220 shapeorders(0,2) = 0;
224 int nshape = (order-2)*(order-1)/2;
228 for (
int i=3; i<=order; i++) {
229 for (
int j=0; j<nsh; j++) {
230 shapeorders(ish,0) = i;
231 shapeorders(ish,1) = i;
239 int nshape = order-1;
240 if (shapeorders.
Rows() != nshape) {
243 for (
int ioy = 0; ioy < order-1; ioy++)
245 shapeorders(ioy,0) = ioy+2;
254 if((order - 2 ) <= 0)
return;
255 int numshape = ((order-2)*(order-1))/2;
261 if (phi.
Rows() < numshape || dphi.
Cols() < numshape) {
262 PZError <<
"\nTPZCompEl::Shape2dTriangleInternal phi or dphi resized\n";
270 TPZShapeLinear::fOrthogonal(out[0],numshape,phi0,dphi0);
271 TPZShapeLinear::fOrthogonal(out[1],numshape,phi1,dphi1);
275 for (
int iplusj=0;iplusj<(order - 2);iplusj++) {
276 for (
int j=0;j<=iplusj;j++) {
278 phi(index,0) = phi0(i,0)*phi1(j,0);
279 dphi(0,index) = 2.0*dphi0(0,i)*phi1(j,0);
280 dphi(1,index) = 2.0*phi0(i,0)*dphi1(0,j);
289 if(order < 0)
return;
291 int numshape = (ord1*(ord1+1))/2;
293 TransformPoint2dT(triangle_transformation_index,x,out);
295 out[0] = 2.*out[0]-1.;
296 out[1] = 2.*out[1]-1.;
298 if (phi.
Rows() < numshape || dphi.
Cols() < numshape) {
299 PZError <<
"\nTPZCompEl::Shape2dTriangleInternal phi or dphi resized\n";
307 TPZShapeLinear::fOrthogonal(out[0],numshape,phi0,dphi0);
308 TPZShapeLinear::fOrthogonal(out[1],numshape,phi1,dphi1);
311 for (
int iplusj=0;iplusj<ord1;iplusj++) {
312 for (
int j=0;j<=iplusj;j++) {
314 phi(index,0) = phi0(i,0)*phi1(j,0);
315 dphi(0,index) = 2.*dphi0(0,i)*phi1(j,0);
316 dphi(1,index) = 2.*phi0(i,0)*dphi1(0,j);
320 TransformDerivative2dT(triangle_transformation_index,numshape,dphi);
325 void TPZShapeTriang::ShapeInternal(
int side,
TPZVec<REAL> &x,
int order,
327 if (side < 3 || side > 6) {
343 ShapeInternal(x, order, phi, dphi);
347 std::cout << __PRETTY_FUNCTION__ <<
" Wrong side parameter side " << side << std::endl;
356 void TPZShapeTriang::ProjectPoint2dTriangToRib(
int rib,
TPZVec<REAL> &in, REAL &out) {
358 out = gRibTrans2dT1d[rib][0]*in[0]+gRibTrans2dT1d[rib][1]*in[1]+gVet1dT[rib];
363 trans.
Mult()(0,0) = gTrans2dT[trans_id][0][0];
364 trans.
Mult()(0,1) = gTrans2dT[trans_id][0][1];
365 trans.
Mult()(1,0) = gTrans2dT[trans_id][1][0];
366 trans.
Mult()(1,1) = gTrans2dT[trans_id][1][1];
367 trans.
Sum()(0,0) =gVet2dT[trans_id][0];
368 trans.
Sum()(1,0) =gVet2dT[trans_id][1];
373 void TPZShapeTriang::TransformDerivativeFromRibToTriang(
int rib,
int num,
TPZFMatrix<REAL> &dphi) {
375 for (
int j = 0;j<num;j++) {
377 dphi(1,j) = gRibTrans2dT1d[rib][1]*dphi(0,j);
378 dphi(0,j) = gRibTrans2dT1d[rib][0]*dphi(0,j);
385 id0 = (
id[0] <
id[1]) ? 0 : 1;
386 minid = (
id[2] <
id[id0]) ? 2 : id0;
390 if (
id[id0] <
id[id1]) {
392 if (minid == 0)
return 0;
393 if (minid == 1)
return 2;
394 if (minid == 2)
return 4;
398 if (minid == 0)
return 1;
399 if (minid == 1)
return 3;
400 if (minid == 2)
return 5;
408 out[0] = gTrans2dT[transid][0][0]*in[0]+gTrans2dT[transid][0][1]*in[1]+gVet2dT[transid][0];
409 out[1] = gTrans2dT[transid][1][0]*in[0]+gTrans2dT[transid][1][1]*in[1]+gVet2dT[transid][1];
419 in(0,i) = gTrans2dT[transid][0][0]*aux[0]+gTrans2dT[transid][1][0]*aux[1];
420 in(1,i) = gTrans2dT[transid][0][1]*aux[0]+gTrans2dT[transid][1][1]*aux[1];
424 int TPZShapeTriang::NConnectShapeF(
int side,
int order) {
435 return (order-2) < 0 ? 0 : ((order-2)*(order-1))/2;
437 PZError <<
"TPZShapeTriang::NConnectShapeF, bad parameter iconnect " << side << endl;
443 int in,
res=NCornerNodes;
444 for(in=NCornerNodes;in<NSides;in++)
446 res += NConnectShapeF(in,order[in-NCornerNodes]);
Implements a vector class which allows to use external storage provided by the user. Utility.
static void ShapeInternal(TPZVec< REAL > &x, int ord, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi, int transformation_index)
Computes the values of the orthogonal shapefunctions before multiplying them by the corner shapefunct...
groups all classes dedicated to the computation of shape functions
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
#define DebugStop()
Returns a message to user put a breakpoint in.
Free store vector implementation.
int64_t Rows() const
Returns number of rows.
void Shape(TPZVec< REAL > &pt, TPZVec< int > orders, TPZVec< TPZTransform< REAL > > &transvec, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
Contains TPZShapePoint class which implements the shape function associated with a point...
Implements generic class which holds a matrix of objects. Matrix.
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 declaration of TPZFlopCounter class and TPZCounter struct.
static int GetTransformId1d(TPZVec< int64_t > &id)
Computes the id of the transformation which will be applied on the parameter of the element ...
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
#define PZError
Defines the output device to error messages and the DebugStop() function.
Implements the shape functions of a linear (1D) element. Shape.