21 TPZShapeDisc::TPZShapeDisc(){
29 TPZShapeDisc::~TPZShapeDisc(){
44 const REAL b = 2.*(x - x0)/L;
53 (-3*
pow(b,2))/4. + (5*
pow(b,4))/8.,
54 (3*b)/8. - (5*
pow(b,3))/4. + (7*
pow(b,5))/8.,
55 (15*
pow(b,2))/16. - (35*
pow(b,4))/16. + (21*
pow(b,6))/16.,
56 (-5*b)/16. + (35*
pow(b,3))/16. - (63*
pow(b,5))/16. + (33*
pow(b,7))/16.,
57 (-35*
pow(b,2))/32. + (315*
pow(b,4))/64. - (231*
pow(b,6))/32. + (429*
pow(b,8))/128.,
58 (35*b)/128. - (105*
pow(b,3))/32. + (693*
pow(b,5))/64. - (429*
pow(b,7))/32. + (715*
pow(b,9))/128.,
59 (315*
pow(b,2))/256. - (1155*
pow(b,4))/128. + (3003*
pow(b,6))/128. - (6435*
pow(b,8))/256. + (2431*
pow(b,10))/256.,
60 (-63*b)/256. + (1155*
pow(b,3))/256. - (3003*
pow(b,5))/128. + (6435*
pow(b,7))/128. - (12155*
pow(b,9))/256. + (4199*
pow(b,11))/256.,
61 (-693*
pow(b,2))/512. + (15015*
pow(b,4))/1024. - (15015*
pow(b,6))/256. + (109395*
pow(b,8))/1024. - (46189*
pow(b,10))/512. + (29393*
pow(b,12))/1024.,
62 (231*b)/1024. - (3003*
pow(b,3))/512. + (45045*
pow(b,5))/1024. - (36465*
pow(b,7))/256. + (230945*
pow(b,9))/1024. - (88179*
pow(b,11))/512. + (52003*
pow(b,13))/1024.,
63 (3003*
pow(b,2))/2048. - (45045*
pow(b,4))/2048. + (255255*
pow(b,6))/2048. - (692835*
pow(b,8))/2048. + (969969*
pow(b,10))/2048. - (676039*
pow(b,12))/2048. + (185725*
pow(b,14))/2048.,
64 (-429*b)/2048. + (15015*
pow(b,3))/2048. - (153153*
pow(b,5))/2048. + (692835*
pow(b,7))/2048. - (1616615*
pow(b,9))/2048. + (2028117*
pow(b,11))/2048. - (1300075*
pow(b,13))/2048. + (334305*
pow(b,15))/2048.,
65 (-6435*
pow(b,2))/4096. + (255255*
pow(b,4))/8192. - (969969*
pow(b,6))/4096. + (14549535*
pow(b,8))/16384. - (7436429*
pow(b,10))/4096. + (16900975*
pow(b,12))/8192. -(5014575*
pow(b,14))/4096. + (9694845*
pow(b,16))/32768.
69 0,1,b,-0.5 + (3*
pow(b,2))/2.,(-3*b)/2. + (5*
pow(b,3))/2.,0.375 - (15*
pow(b,2))/4. + (35*
pow(b,4))/8.,(15*b)/8. - (35*
pow(b,3))/4. + (63*
pow(b,5))/8.,
70 -0.3125 + (105*
pow(b,2))/16. - (315*
pow(b,4))/16. + (231*
pow(b,6))/16.,(-35*b)/16. + (315*
pow(b,3))/16. - (693*
pow(b,5))/16. + (429*
pow(b,7))/16.,
71 0.2734375 - (315*
pow(b,2))/32. + (3465*
pow(b,4))/64. - (3003*
pow(b,6))/32. + (6435*
pow(b,8))/128.,
72 (315*b)/128. - (1155*
pow(b,3))/32. + (9009*
pow(b,5))/64. - (6435*
pow(b,7))/32. + (12155*
pow(b,9))/128.,
73 -0.24609375 + (3465*
pow(b,2))/256. - (15015*
pow(b,4))/128. + (45045*
pow(b,6))/128. - (109395*
pow(b,8))/256. + (46189*
pow(b,10))/256.,
74 (-693*b)/256. + (15015*
pow(b,3))/256. - (45045*
pow(b,5))/128. + (109395*
pow(b,7))/128. - (230945*
pow(b,9))/256. + (88179*
pow(b,11))/256.,
75 0.2255859375 - (9009*
pow(b,2))/512. + (225225*
pow(b,4))/1024. - (255255*
pow(b,6))/256. + (2078505*
pow(b,8))/1024. - (969969*
pow(b,10))/512. + (676039*
pow(b,12))/1024.,
76 (3003*b)/1024. - (45045*
pow(b,3))/512. + (765765*
pow(b,5))/1024. - (692835*
pow(b,7))/256. + (4849845*
pow(b,9))/1024. - (2028117*
pow(b,11))/512. + (1300075*
pow(b,13))/1024.,
77 -0.20947265625 + (45045*
pow(b,2))/2048. - (765765*
pow(b,4))/2048. + (4849845*
pow(b,6))/2048. - (14549535*
pow(b,8))/2048. + (22309287*
pow(b,10))/2048. - (16900975*
pow(b,12))/2048. +
78 (5014575*
pow(b,14))/2048.,(-6435*b)/2048. + (255255*
pow(b,3))/2048. - (2909907*
pow(b,5))/2048. + (14549535*
pow(b,7))/2048. - (37182145*
pow(b,9))/2048. + (50702925*
pow(b,11))/2048. -
79 (35102025*
pow(b,13))/2048. + (9694845*
pow(b,15))/2048. };
81 const REAL dbdx = 2./L;
84 if(degree < 0 || n > 1){
87 phi.
Redim(degree+1,1);
88 dphi.
Redim(n,degree+1);
89 for(
int i = 0; i < degree+1; i++){
91 dphi(0,i) = dshapes[i]*dbdx;
103 PZError <<
"TPZShapeDisc::Polynomial the degree of the polynomial cannot be minus, aborting\n";
106 phi.
Redim(degree+1,1);
107 dphi.
Redim(n,degree+1);
110 if(degree == 0)
return;
118 for(p = 2;p <
degree; p++) {
119 phi(p,0) = phi(p-1,0)*
val;
121 dphi(0,p) = dphi(0,p-1)*val+phi(p-1,0)/C;
122 for(ideriv=2; ideriv<=n; ideriv++) {
123 dphi(ideriv-1,p) = val*dphi(ideriv-1,p-1)+(ideriv/C)*dphi(ideriv-2,p-1);
135 PZError <<
"TPZShapeDisc::Polynomial the degree of the polynomial cannot be minus, aborting\n";
138 phi.
Redim(degree+1,1);
139 dphi.
Redim(n,degree+1);
142 if(degree == 0)
return;
150 for(p = 2;p <
degree; p++) {
151 phi(p,0) = phi(p-1,0)*
val;
153 dphi(0,p) = dphi(0,p-1)*val + phi(p-1,0)* 1.0;
154 for(ideriv=2; ideriv<=n; ideriv++) {
155 dphi(ideriv-1,p) = val*dphi(ideriv-1,p-1)+(ideriv)*dphi(ideriv-2,p-1);
168 phi.
Redim(degree+1,1);
169 dphi.
Redim(n,degree+1);
171 TPZShapeLinear::Legendre(x, degree+1, phi, dphi, n);
174 for(
int ord = 0; ord < degree+1; ord++)
175 for (
int ideriv = 0; ideriv < n; ideriv++){
176 val = dphi(ideriv, ord) /
pow(C, ideriv+1);
177 dphi.
Put(ideriv, ord, val);
189 phi.
Redim(degree+1,1);
190 dphi.
Redim(n,degree+1);
192 TPZShapeLinear::Chebyshev(x, degree+1, phi, dphi);
204 phi.
Redim(degree+1,1);
205 dphi.
Redim(n,degree+1);
207 TPZShapeLinear::Legendre(x, degree+1, phi, dphi, n);
214 TPZShapeDisc::Shape0D(C,X0,X,degree,phi,dphi);
218 TPZShapeDisc::Shape1D(C,X0,X,degree,phi,dphi);
222 if(type == ETensorial || type == EOrdemTotal){
223 TPZShapeDisc::Shape2D(C,X0,X,degree,phi,dphi,type);
226 TPZShapeDisc::Shape2DFull(C,X0,X,degree,phi,dphi,type);
231 TPZShapeDisc::Shape3D(C,X0,X,degree,phi,dphi,type);
235 PZError <<
"\nFATAL ERROR at " << __PRETTY_FUNCTION__ <<
"\n";
247 if(type == ETensorial ||type == EOrdemTotal){
248 TPZShapeDisc::Shape2D(C,X0,X,degree,phi,dphi,type);
251 std::cout<<
"Not implement"<<std::endl;
265 PZError <<
"TPZShapeDisc::Polynomial the degree of the polynomial cannot be minus, aborting\n";
270 for(
int i=0;i<cap;i++) phi.
PutVal(i,0,1.0);
280 fOrthogonal(C,x0,x,degree,phi,dphi,1);
299 fOrthogonal(C,x0,x,degree,phix,dphix,1);
300 fOrthogonal(C,y0,y,degree,phiy,dphiy,1);
302 int i, j, ix, iy, counter=0, num = degree+1;
304 int nshape = NShapeF(degree,2,type);
307 dphi.
Redim(2,nshape);
311 if(type==EOrdemTotal)
319 for(i = 0; i <=
degree; i++)
321 for(j = 0; j <= i; j++)
326 phi(counter,0) = phix(ix,0)*phiy(iy,0);
327 dphi(0,counter) = dphix(0,ix)*phiy(iy,0);
328 dphi(1,counter) = phix(ix,0)*dphiy(0,iy);
350 phi(counter,0) = phix(ix,0)*phiy(iy,0);
351 dphi(0,counter) = dphix(0,ix)*phiy(iy,0);
352 dphi(1,counter) = phix(ix,0)*dphiy(0,iy);
359 phi(counter,0) = phix(ix,0)*phiy(iy,0);
360 dphi(0,counter) = dphix(0,ix)*phiy(iy,0);
361 dphi(1,counter) = phix(ix,0)*dphiy(0,iy);
367 phi(counter,0) = phix(ix,0)*phiy(iy,0);
368 dphi(0,counter) = dphix(0,ix)*phiy(iy,0);
369 dphi(1,counter) = phix(ix,0)*dphiy(0,iy);
374 if(counter != nshape) {
375 PZError <<
"TPZShapeDisc::Shape2D wrong shape count\n";
379 dphi0[0] = dphi(0,0);
380 dphi0[1] = dphi(1,0);
381 phi(0,0) = phi(nshape-1,0);
382 dphi(0,0) = dphi(0,nshape-1);
383 dphi(1,0) = dphi(1,nshape-1);
385 phi(nshape-1,0) = phi0;
386 dphi(0,nshape-1) = dphi0[0];
387 dphi(1,nshape-1) = dphi0[1];
401 fOrthogonal(C,x0,x,degree,phix,dphix,1);
402 fOrthogonal(C,y0,y,degree,phiy,dphiy,1);
403 fOrthogonal(C,z0,z,degree,phiz,dphiz,1);
405 int i,j,k,nshape = 0,num=degree+1, counter=0;
407 nshape = NShapeF(degree,3,type);
410 dphi.
Redim(3,nshape);
417 if(i+j > degree && type == EOrdemTotal)
break;
419 if(i+j+k > degree && type == EOrdemTotal)
break;
420 phi(counter,0) = phix(i,0)*phiy(j,0)*phiz(k,0);
421 dphi(0, counter) = dphix(0,i)*phiy(j,0)*phiz(k,0);
422 dphi(1, counter ) = phix(i,0)*dphiy(0,j)*phiz(k,0);
423 dphi(2, counter ) = phix(i,0)*phiy(j,0)*dphiz(0,k);
431 dphi0[0] = dphi(0,0);
432 dphi0[1] = dphi(1,0);
433 dphi0[2] = dphi(2,0);
434 phi(0) = phi(nshape-1);
435 dphi(0,0) = dphi(0,nshape-1);
436 dphi(1,0) = dphi(1,nshape-1);
437 dphi(2,0) = dphi(2,nshape-1);
439 phi(nshape-1) = phi0;
440 dphi(0,nshape-1) = dphi0[0];
441 dphi(1,nshape-1) = dphi0[1];
442 dphi(2,nshape-1) = dphi0[2];
455 TPZFNMatrix<30> phix(degree+1,1),phiy(degree+1,1),dphix(3,degree+1),dphiy(3,degree+1);
457 fOrthogonal(C,x0,x,degree,phix,dphix,3);
458 fOrthogonal(C,y0,y,degree,phiy,dphiy,3);
460 int i,j,counter=0,num = degree+1;
462 int nshape = NShapeF(degree,2,type);
465 dphi.
Redim(8,nshape);
472 if(i+j > degree && type == EOrdemTotalFull)
break;
473 phi(counter,0) = phix(i,0)*phiy(j,0);
474 dphi(0,counter) = dphix(0,i)* phiy(j,0);
475 dphi(1,counter) = phix(i,0)*dphiy(0,j);
476 dphi(2,counter) = dphix(1,i)* phiy(j,0)+ phix(i,0)*dphiy(1,j);
477 dphi(3,counter) = dphix(2,i)* phiy(j,0)+dphix(0,i)*dphiy(1,j);
478 dphi(4,counter) = dphix(1,i)*dphiy(0,j)+ phix(i,0)*dphiy(2,j);
479 dphi(5,counter) = dphix(1,i)* phiy(j,0);
480 dphi(6,counter) = phix(i,0)*dphiy(1,j);
481 dphi(7,counter) = dphix(0,i)*dphiy(0,j);
485 if(counter != nshape) {
486 PZError <<
"TPZShapeDisc::Shape2D wrong shape count\n";
490 for(i=0; i<8; i++) dphi0[i] = dphi(i,0);
491 phi(0) = phi(nshape-1);
492 for(i=0; i<8; i++) dphi(i,0) = dphi(i,nshape-1);
494 phi(nshape-1) = phi0;
495 for(i=0; i<8; i++) dphi(i,nshape-1) = dphi0[i];
507 if(type == ETensorial || type == ETensorialFull)
return (degree+1)*(degree+1);
508 else return (degree+1)*(degree+2)/2;
511 if(type == ETensorial || type == ETensorialFull)
return (degree+1)*(degree+1)*(degree+1);
512 for(i=0;i<(degree+1);i++) sum += (i+1)*(i+2)/2;
516 PZError <<
"TPZShapeDisc::NShapeF case does not exists\n";
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
groups all classes dedicated to the computation of shape functions
void degree(int root, int adj_num, int adj_row[], int adj[], int mask[], int deg[], int *iccsze, int ls[], int node_num)
REAL val(STATE &number)
Returns value of the variable.
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
int Zero() override
Makes Zero all the elements.
#define DebugStop()
Returns a message to user put a breakpoint in.
void Shape(TPZVec< REAL > &pt, TPZVec< int > orders, TPZVec< TPZTransform< REAL > > &transvec, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
virtual int Put(const int64_t row, const int64_t col, const TVar &value)
Put values with bounds checking if DEBUG variable is defined.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
Contains the declaration of the shape function discontinuous.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
Implements the shape functions discontinuous elements. Shape.
int PutVal(const int64_t row, const int64_t col, const TVar &value) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
#define PZError
Defines the output device to error messages and the DebugStop() function.