19 static LoggerPtr logger(Logger::getLogger(
"pz.material.poisson3d"));
100 out <<
"name of material : " <<
Name() <<
"\n";
101 out <<
"Laplace operator multiplier fK "<<
fK << endl;
102 out <<
"Convection coeficient fC " <<
fC << endl;
104 out <<
"Forcing vector fXf " <<
fXf << endl;
106 out <<
"Base Class properties :";
132 int phr = phi.
Rows();
143 STATE ConvDirAx[3] = {0.};
147 for(di=0; di<
fDim; di++) {
148 for(dj=0; dj<
fDim; dj++) {
149 delx = (delx<
fabs(jacinv(di,dj))) ?
fabs(jacinv(di,dj)) : delx;
160 ConvDirAx[0] = axes(0,0)*fConvDir[0]+axes(0,1)*fConvDir[1]+axes(0,2)*fConvDir[2];
161 ConvDirAx[1] = axes(1,0)*fConvDir[0]+axes(1,1)*fConvDir[1]+axes(1,2)*fConvDir[2];
164 ConvDirAx[0] = axes(0,0)*fConvDir[0]+axes(0,1)*fConvDir[1]+axes(0,2)*fConvDir[2];
165 ConvDirAx[1] = axes(1,0)*fConvDir[0]+axes(1,1)*fConvDir[1]+axes(1,2)*fConvDir[2];
166 ConvDirAx[2] = axes(2,0)*fConvDir[0]+axes(2,1)*fConvDir[1]+axes(2,2)*fConvDir[2];
169 PZError <<
"TPZMatPoisson3d::Contribute dimension error " << fDim << endl;
175 for(
int in = 0; in < phr; in++ ) {
178 for(kd = 0; kd<
fDim; kd++) dphiic += ConvDirAx[kd]*(STATE)dphi(kd,in);
179 ef(in, 0) += - (STATE)weight * fXfLoc * ( (STATE)phi(in,0) + (STATE)(0.5*delx*
fC)*
fSD*dphiic );
180 for(
int jn = 0; jn < phr; jn++ ) {
181 for(kd=0; kd<
fDim; kd++) {
182 ek(in,jn) += (STATE)weight * (
183 +
fK * (STATE)( dphi(kd,in) * dphi(kd,jn) )
184 - (STATE)(fC* dphi(kd,in) * phi(jn)) * ConvDirAx[kd]
185 + (STATE)(0.5 * delx * fC * dphi(kd,jn)) *
fSD * dphiic * ConvDirAx[kd]
192 if ( !ek.
VerifySymmetry() ) cout << __PRETTY_FUNCTION__ <<
"\nMATRIZ NAO SIMETRICA" << endl;
216 int numprimalshape = data.
phi.
Rows()-numdual;
225 REAL ratiok = 1./kreal;
226 for(i=0; i<numvec; i++)
230 for (j=0; j<numvec; j++) {
236 ek(i,j) += weight*ratiok*data.
phi(ishapeind,0)*data.
phi(jshapeind,0)*prod;
249 for(iloc=0; iloc<
fDim; iloc++)
251 divwq += axesvec(iloc,0)*data.
dphix(iloc,ishapeind);
253 for (j=0; j<numdual; j++) {
254 REAL fact = (-1.)*weight*data.
phi(numprimalshape+j,0)*divwq;
255 ek(i,numvec+j) += fact;
256 ek(numvec+j,i) += fact;
259 for(i=0; i<numdual; i++)
261 ef(numvec+i,0) += (STATE)((-1.)*weight*data.
phi(numprimalshape+i,0))*fXfLoc;
264 if (logger->isDebugEnabled())
266 std::stringstream sout;
267 sout<<
"Verificando termo fonte\n";
268 sout <<
" pto " <<data.
x << std::endl;
269 sout<<
" fpto " <<fXfLoc <<std::endl;
285 int newRows=ek.
Rows()+1;
286 int newCols=ek.
Cols()+1;
287 ek.
Resize( newRows, newCols );
307 int phr = phi.
Rows();
308 int nlinhaek=ek.
Rows();
309 int ncolek=ek.
Cols();
319 REAL ratiok = 1./kreal;
321 for(
int in = 0; in < phr; in++ ){
322 for(
int jn = 0; jn < phr; jn++ ) {
323 for(
int kd=0; kd<
fDim; kd++) {
324 ek(in,jn) += (STATE)weight * (
fK * (STATE)( dphi(kd,in) * dphi(kd,jn) ));
328 ek(in,ncolek-1) += (STATE)weight * phi(in);
329 ek(nlinhaek-1,in) += (STATE)weight * phi(in);
333 for(
int in = 0; in < phr; in++ ) {
334 for(
int jn = 0; jn < phr; jn++ ) {
335 for(
int kd=0; kd<
fDim; kd++) {
336 ef(in,0) += (STATE)weight * ( dphi(kd,in) * dsol[0](kd,jn) );
341 ef(phr,0)+=(STATE)weight * (sol[0]);
354 v2[0] = bc.
Val2()(0,0);
362 for(i=0; i<numvec; i++)
365 ef(i,0)+= (STATE)(
gBigNumber * phi(i,0) * weight) * v2[0];
366 for (j=0; j<numvec; j++) {
368 ek(i,j) +=
gBigNumber * phi(i,0) * phi(j,0) * weight;
375 for(in = 0 ; in < numvec; in++) {
376 ef(in,0) += (STATE)((-1.)* phi(in,0) * weight)*v2[0];
383 for(in = 0 ; in < numvec; in++) {
385 ef(in,0) += v2[0] * (STATE)(phi(in,0) * weight);
386 for (jn = 0; jn < numvec; jn++) {
388 ek(in,jn) += (STATE)(weight*phi(in,0)*phi(jn,0)) *bc.
Val1()(0,0);
398 if ( !ek.
VerifySymmetry( 1.e-3 ) ) cout << __PRETTY_FUNCTION__ <<
"\nMATRIZ NAO SIMETRICA" << endl;
417 int phr = phi.
Rows();
420 v2[0] = bc.
Val2()(0,0);
435 for(in = 0 ; in < phr; in++) {
436 ef(in,0) += (STATE)(
gBigNumber* phi(in,0) * weight) * v2[0];
437 for (jn = 0 ; jn < phr; jn++) {
438 ek(in,jn) +=
gBigNumber * phi(in,0) * phi(jn,0) * weight;
443 for(in = 0 ; in < phi.
Rows(); in++) {
444 ef(in,0) += v2[0] * (STATE)(phi(in,0) * weight);
448 for(in = 0 ; in < phi.
Rows(); in++) {
449 ef(in, 0) += v2[0] * (STATE)(phi(in, 0) * weight);
450 for (jn = 0 ; jn < phi.
Rows(); jn++) {
451 ek(in,jn) += bc.
Val1()(0,0) * (STATE)(phi(in,0) * phi(jn,0) * weight);
458 if (
fDim == 1)
PZError << __PRETTY_FUNCTION__ <<
" - ERROR! The normal vector is not available for 1D TPZInterpolatedElement\n";
460 normal[0] = axes(0,1);
464 normal[0] = axes(0,2);
465 normal[1] = axes(1,2);
466 normal[2] = axes(2,2);
468 REAL ConvNormal = 0.;
469 for(
id=0;
id<
fDim;
id++) ConvNormal +=
fC*
fConvDir[
id]*normal[
id];
470 if(ConvNormal > 0.) {
471 for(il=0; il<phr; il++) {
472 for(jl=0; jl<phr; jl++) {
473 ek(il,jl) += weight * ConvNormal * phi(il)*phi(jl);
478 if (ConvNormal < 0.) std::cout <<
"Boundary condition error: inflow detected in outflow boundary condition: ConvNormal = " << ConvNormal <<
"\n";
484 if ( !ek.
VerifySymmetry( 1.e-3 ) ) cout << __PRETTY_FUNCTION__ <<
"\nMATRIZ NAO SIMETRICA" << endl;
490 if(!strcmp(
"Solution",name.c_str()))
return 1;
491 if(!strcmp(
"Derivative",name.c_str()))
return 2;
492 if(!strcmp(
"KDuDx",name.c_str()))
return 3;
493 if(!strcmp(
"KDuDy",name.c_str()))
return 4;
494 if(!strcmp(
"KDuDz",name.c_str()))
return 5;
495 if(!strcmp(
"NormKDu",name.c_str()))
return 6;
496 if(!strcmp(
"MinusKGradU",name.c_str()))
return 7;
497 if(!strcmp(
"POrder",name.c_str()))
return 8;
498 if(!strcmp(
"Laplac",name.c_str()))
return 9;
499 if(!strcmp(
"Stress",name.c_str()))
return 10;
500 if(!strcmp(
"Flux",name.c_str()))
return 10;
501 if(!strcmp(
"Pressure",name.c_str()))
return 11;
503 if (!strcmp(
"ExactPressure", name.c_str()))
return 12;
504 if(!strcmp(
"ExactSolution",name.c_str()))
return 12;
505 if(!strcmp(
"ExactFlux",name.c_str()))
return 13;
506 if(!strcmp(
"Divergence",name.c_str()))
return 14;
507 if(!strcmp(
"ExactDiv",name.c_str()))
return 15;
509 if(!strcmp(
"PressureOmega1",name.c_str()))
return 16;
510 if(!strcmp(
"PressureOmega2",name.c_str()))
return 17;
511 if(!strcmp(
"FluxOmega1",name.c_str()))
return 18;
513 if(!strcmp(
"GradFluxX",name.c_str()))
return 19;
514 if(!strcmp(
"GradFluxY",name.c_str()))
return 20;
515 if(!strcmp(
"FluxL2",name.c_str()))
return 21;
516 if(!strcmp(
"OrdemP",name.c_str()))
return 99;
521 if(var == 1)
return 1;
522 if(var == 2)
return fDim;
523 if ((var == 3) || (var == 4) || (var == 5) || (var == 6))
return 1;
524 if (var == 7)
return fDim;
525 if (var == 8)
return 1;
526 if (var == 9)
return 1;
527 if (var==10)
return fDim;
528 if (var==11)
return 1;
530 if (var==12)
return 1;
531 if (var==13)
return fDim;
532 if (var==14)
return 1;
533 if (var==15)
return 1;
535 if (var==16)
return 1;
536 if (var==17)
return 1;
537 if (var==18)
return 3;
538 if (var==19)
return 3;
539 if (var==20)
return 3;
540 if (var==21)
return fDim;
552 int numbersol = data.
sol.
size();
553 if (numbersol != 1) {
559 #ifndef STATE_COMPLEX 582 Solout[0]=data.
sol[0][0];
583 Solout[1]=data.
sol[0][1];
584 Solout[2]=data.
sol[0][2];
594 for(
int k=0;k<
fDim;k++){
595 Solout[k]=data.
sol[0][k];
601 Solout[0]=data.
sol[0][2];
604 Solout[0]=data.
sol[0][0];
611 Solout[0]=pressure[0];
627 for(
int i=0; i<
fDim; i++){
628 val += data.
dsol[0](i,i);
638 Solout[0]=flux(fDim,0);
645 Solout[0]=data.
sol[0][2];
648 std::cout<<
"Pressao somente em Omega1"<<std::endl;
656 Solout[0]=data.
sol[0][0];
659 std::cout<<
"Pressao somente em omega2"<<std::endl;
666 Solout[0]=data.
sol[0][0];
667 Solout[1]=data.
sol[0][1];
674 Solout[0]=data.
dsol[0](0,0);
675 Solout[1]=data.
dsol[0](1,0);
676 Solout[2]=data.
dsol[0](2,0);
681 Solout[0]=data.
dsol[0](0,1);
682 Solout[1]=data.
dsol[0](1,1);
683 Solout[2]=data.
dsol[0](2,1);
687 std::cout<<
"Pressao somente em omega2"<<std::endl;
695 data.
sol[0][0] = data.
sol[0][2];
707 #ifndef STATE_COMPLEX 716 for(
id=0 ;
id<
fDim;
id++) {
719 Solout[id] = dsoldx(
id,0);
726 Solout[0] = dsoldx(0,0) * this->
fK;
732 Solout[0] = dsoldx(1,0) * this->
fK;
738 Solout[0] = dsoldx(2,0) * this->
fK;
744 for(
id=0 ;
id<
fDim;
id++){
745 val += (DSol(
id,0) * this->
fK) * (DSol(
id,0) * this->
fK);
747 Solout[0] =
sqrt(val);
755 for(
id=0 ;
id<
fDim;
id++) {
756 Solout[id] = -1. * this->
fK * dsoldx(
id,0);
762 Solout[0] = DSol(2,0);
783 if(logger->isDebugEnabled()){
784 std::stringstream sout;
786 sout <<
" Pto " << data.
x << std::endl;
787 sout<<
" pressao exata " <<u_exact <<std::endl;
788 sout<<
" pressao aprox " <<sol <<std::endl;
789 sout<<
" ---- "<<std::endl;
790 sout<<
" fluxo exato " <<du_exact(0,0)<<
", " << du_exact(1,0)<<std::endl;
791 sout<<
" fluxo aprox " <<dsol<<std::endl;
792 sout<<
" ---- "<<std::endl;
793 if(du_exact.
Rows()>
fDim) sout<<
" div exato " <<du_exact(2,0)<<std::endl;
794 sout<<
" div aprox " <<div<<std::endl;
802 REAL diffP =
abs(u_exact[0]-sol[0]);
803 values[0] = diffP*diffP;
806 for(
int id=0;
id<
fDim;
id++) {
807 REAL diffFlux =
abs(dsol[
id] - du_exact(
id,0));
808 values[1] += diffFlux*diffFlux;
812 REAL diffDiv =
abs(div[0] - du_exact(fDim,0));
813 values[2]=diffDiv*diffDiv;
815 values[3]= values[1]+values[2];
827 STATE fraq = dudxEF[0]/
fK;
828 fraq = fraq - du_exact(0,0);
829 REAL diff =
fabs(fraq);
830 values[3] = diff*diff;
834 fraq = fraq - du_exact(1,0);
836 values[4] = diff*diff;
840 fraq = fraq - du_exact(2,0);
842 values[5] = diff*diff;
851 diff =
fabs(sol[0] - u_exact[0]);
852 values[1] = diff*diff;
855 for(
id=0;
id<
fDim;
id++) {
856 diff =
fabs(dsol[
id] - du_exact(
id,0));
857 values[2] +=
abs(
fK)*diff*diff;
860 values[0] = values[1]+values[2];
864 int numbersol = leftu.
size();
865 for (
int is=0; is<numbersol ; is++) {
868 STATE
f = bc.
Val2()(0,0);
869 jump[is][0] = leftu[is][0] -
f;
890 vartocast =
fXf.real();
894 U+= sol[0] * FADREAL(weight * vartocast);
897 vartocast =
fK.real();
904 U+=vartocast*(dsol[0] * dsol[0])*FADREAL(weight/2.);
908 U+=vartocast*(dsol[0] * dsol[0] +
909 dsol[1] * dsol[1])*(weight/2.);
915 U+=vartocast*(dsol[0] * dsol[0] + dsol[1] * dsol[1] +
916 dsol[2] * dsol[2])*(weight/2.);
928 vartocast = bc.
Val2()(0,0).real();
930 vartocast = bc.
Val2()(0,0);
932 FADFADREAL solMinBC = sol[0] - FADREAL(vartocast);
938 U += (solMinBC * solMinBC) * FADREAL(weight *
gBigNumber / 2.);
942 U -= sol[0] * FADREAL(vartocast*weight);
946 vartocast = bc.
Val1()(0,0).real();
948 vartocast = bc.
Val1()(0,0);
951 U += ( solMinBC * FADREAL(vartocast) * solMinBC ) * FADREAL(weight / 2.);
974 int &LeftPOrder=dataleft.
p;
975 int &RightPOrder=dataright.
p;
977 REAL &faceSize=data.
HSize;
980 int nrowl = phiL.
Rows();
981 int nrowr = phiR.
Rows();
985 REAL ConvNormal = 0.;
986 for(
id=0;
id<
fDim;
id++) ConvNormal +=
fC *
fConvDir[
id] * normal[
id];
987 if(ConvNormal > 0.) {
988 for(il=0; il<nrowl; il++) {
989 for(jl=0; jl<nrowl; jl++) {
990 ek(il,jl) += weight * ConvNormal * phiL(il)*phiL(jl);
993 for(ir=0; ir<nrowr; ir++) {
994 for(jl=0; jl<nrowl; jl++) {
995 ek(ir+nrowl,jl) -= weight * ConvNormal * phiR(ir) * phiL(jl);
999 for(ir=0; ir<nrowr; ir++) {
1000 for(jr=0; jr<nrowr; jr++) {
1001 ek(ir+nrowl,jr+nrowl) -= weight * ConvNormal * phiR(ir) * phiR(jr);
1004 for(il=0; il<nrowl; il++) {
1005 for(jr=0; jr<nrowr; jr++) {
1006 ek(il,jr+nrowl) += weight * ConvNormal * phiL(il) * phiR(jr);
1013 STATE leftK, rightK;
1018 for(il=0; il<nrowl; il++) {
1019 REAL dphiLinormal = 0.;
1020 for(
id=0;
id<
fDim;
id++) {
1021 dphiLinormal += dphiL(
id,il)*normal[id];
1023 for(jl=0; jl<nrowl; jl++) {
1024 REAL dphiLjnormal = 0.;
1025 for(
id=0;
id<
fDim;
id++) {
1026 dphiLjnormal += dphiL(
id,jl)*normal[id];
1028 ek(il,jl) += (STATE)(weight * ( this->
fSymmetry * (0.5)*dphiLinormal*phiL(jl,0)-(0.5)*dphiLjnormal*phiL(il,0))) * leftK;
1033 for(ir=0; ir<nrowr; ir++) {
1034 REAL dphiRinormal = 0.;
1035 for(
id=0;
id<
fDim;
id++) {
1036 dphiRinormal += dphiR(
id,ir)*normal[id];
1038 for(jr=0; jr<nrowr; jr++) {
1039 REAL dphiRjnormal = 0.;
1040 for(
id=0;
id<
fDim;
id++) {
1041 dphiRjnormal += dphiR(
id,jr)*normal[id];
1043 ek(ir+nrowl,jr+nrowl) += (STATE)(weight * (this->
fSymmetry * ((-0.5) * dphiRinormal * phiR(jr) ) + (0.5) * dphiRjnormal * phiR(ir))) * rightK;
1048 for(il=0; il<nrowl; il++) {
1049 REAL dphiLinormal = 0.;
1050 for(
id=0;
id<
fDim;
id++) {
1051 dphiLinormal += dphiL(
id,il)*normal[id];
1053 for(jr=0; jr<nrowr; jr++) {
1054 REAL dphiRjnormal = 0.;
1055 for(
id=0;
id<
fDim;
id++) {
1056 dphiRjnormal += dphiR(
id,jr)*normal[id];
1058 ek(il,jr+nrowl) += (STATE)weight * ((STATE)
fSymmetry * ((STATE)((-0.5) * dphiLinormal * phiR(jr)) * leftK ) - (STATE)((0.5) * dphiRjnormal * phiL(il))* rightK );
1063 for(ir=0; ir<nrowr; ir++) {
1064 REAL dphiRinormal = 0.;
1065 for(
id=0;
id<
fDim;
id++) {
1066 dphiRinormal += dphiR(
id,ir)*normal[id];
1068 for(jl=0; jl<nrowl; jl++) {
1069 REAL dphiLjnormal = 0.;
1070 for(
id=0;
id<
fDim;
id++) {
1071 dphiLjnormal += dphiL(
id,jl)*normal[id];
1073 ek(ir+nrowl,jl) += (STATE)weight * (
1074 (STATE)(
fSymmetry * (0.5) * dphiRinormal * phiL(jl)) * rightK + (STATE)((0.5) * dphiLjnormal * phiR(ir)) * leftK
1080 if ( !ek.
VerifySymmetry() ) cout << __PRETTY_FUNCTION__ <<
"\nMATRIZ NAO SIMETRICA" << endl;
1091 REAL penalty =
fPenaltyConstant * (0.5 * (
abs(leftK)*LeftPOrder*LeftPOrder +
abs(rightK)*RightPOrder*RightPOrder)) / faceSize;
1096 for(il=0; il<nrowl; il++) {
1097 for(jl=0; jl<nrowl; jl++) {
1098 ek(il,jl) += weight * penalty * phiL(il,0) * phiL(jl,0);
1103 for(ir=0; ir<nrowr; ir++) {
1104 for(jr=0; jr<nrowr; jr++) {
1105 ek(ir+nrowl,jr+nrowl) += weight * penalty * phiR(ir,0) * phiR(jr,0);
1110 for(il=0; il<nrowl; il++) {
1111 for(jr=0; jr<nrowr; jr++) {
1112 ek(il,jr+nrowl) += -1.0 * weight * penalty * phiR(jr,0) * phiL(il,0);
1117 for(ir=0; ir<nrowr; ir++) {
1118 for(jl=0; jl<nrowl; jl++) {
1119 ek(ir+nrowl,jl) += -1.0 * weight * penalty * phiL(jl,0) * phiR(ir,0);
1127 REAL NormalFlux_i = 0.;
1128 REAL NormalFlux_j = 0.;
1131 for(il=0; il<nrowl; il++) {
1133 for(
id=0;
id<
fDim;
id++) {
1134 NormalFlux_i += dphiL(
id,il)*normal[id];
1136 for(jl=0; jl<nrowl; jl++) {
1138 for(
id=0;
id<
fDim;
id++) {
1139 NormalFlux_j += dphiL(
id,jl)*normal[id];
1141 ek(il,jl) += (STATE)(weight * ((1.)/penalty) * NormalFlux_i * NormalFlux_j) * leftK;
1146 for(ir=0; ir<nrowr; ir++) {
1148 for(
id=0;
id<
fDim;
id++) {
1149 NormalFlux_i += dphiR(
id,ir)*normal[id];
1151 for(jr=0; jr<nrowr; jr++) {
1153 for(
id=0;
id<
fDim;
id++) {
1154 NormalFlux_j += dphiR(
id,jr)*normal[id];
1156 ek(ir+nrowl,jr+nrowl) += (STATE)(weight * ((1.)/penalty) * NormalFlux_i * NormalFlux_j) * rightK;
1161 for(il=0; il<nrowl; il++) {
1163 for(
id=0;
id<
fDim;
id++) {
1164 NormalFlux_i += dphiL(
id,il)*normal[id];
1166 for(jr=0; jr<nrowr; jr++) {
1168 for(
id=0;
id<
fDim;
id++) {
1169 NormalFlux_j += dphiR(
id,jr)*normal[id];
1171 ek(il,jr+nrowl) += (STATE)((-1.) * weight * ((1.)/penalty) * NormalFlux_i * NormalFlux_j) * rightK;
1176 for(ir=0; ir<nrowr; ir++) {
1178 for(
id=0;
id<
fDim;
id++) {
1179 NormalFlux_i += dphiR(
id,ir)*normal[id];
1181 for(jl=0; jl<nrowl; jl++) {
1183 for(
id=0;
id<
fDim;
id++) {
1184 NormalFlux_j += dphiL(
id,jl)*normal[id];
1186 ek(ir+nrowl,jl) += (STATE)((-1.) * weight * ((1.)/penalty) * NormalFlux_i * NormalFlux_j) * leftK;
1202 int POrder= dataleft.
p;
1203 REAL faceSize=data.
HSize;
1207 nrowl = phiL.
Rows();
1208 REAL ConvNormal = 0.;
1209 for(
id=0;
id<
fDim;
id++) ConvNormal +=
fC*
fConvDir[
id]*normal[
id];
1214 for(il=0; il<nrowl; il++) {
1215 REAL dphiLinormal = 0.;
1216 for(
id=0;
id<
fDim;
id++) {
1217 dphiLinormal += dphiL(
id,il)*normal[id];
1220 for(jl=0; jl<nrowl; jl++) {
1221 REAL dphiLjnormal = 0.;
1222 for(
id=0;
id<
fDim;
id++) {
1223 dphiLjnormal += dphiL(
id,jl)*normal[id];
1225 ek(il,jl) += (STATE)(weight*(fSymmetry * dphiLinormal * phiL(jl,0) - dphiLjnormal * phiL(il,0)))*
fK;
1230 if(ConvNormal > 0.) {
1231 for(il=0; il<nrowl; il++) {
1232 for(jl=0; jl<nrowl; jl++) {
1233 ek(il,jl) += weight * ConvNormal * phiL(il)*phiL(jl);
1237 for(il=0; il<nrowl; il++) {
1238 ef(il,0) -= (STATE)(weight * ConvNormal * phiL(il)) * bc.
Val2()(0,0);
1245 for(il=0; il<nrowl; il++) {
1246 ef(il,0) += (STATE)(weight*phiL(il,0))*bc.
Val2()(0,0);
1251 if(ConvNormal > 0.) {
1252 for(il=0; il<nrowl; il++) {
1253 for(jl=0; jl<nrowl; jl++) {
1254 ek(il,jl) += weight * ConvNormal * phiL(il)*phiL(jl);
1259 if (ConvNormal < 0.) std::cout <<
"Boundary condition error: inflow detected in outflow boundary condition: ConvNormal = " << ConvNormal <<
"\n";
1264 PZError << __PRETTY_FUNCTION__ <<
" - Wrong boundary condition type\n";
1268 if ( !ek.
VerifySymmetry() ) cout << __PRETTY_FUNCTION__ <<
"\nMATRIZ NAO SIMETRICA" << endl;
1274 nrowl = phiL.
Rows();
1277 for(il=0; il<
fDim; il++) outflow +=
fC *
fConvDir[il] * normal[il];
1282 for(il=0; il<nrowl; il++) {
1283 ef(il,0) += (STATE)(weight * penalty * phiL(il,0)) * bc.
Val2()(0,0);
1284 for(jl=0; jl<nrowl; jl++) {
1285 ek(il,jl) += weight * penalty * phiL(il,0) * phiL(jl,0);
1293 for(il=0; il<nrowl; il++)
1295 for(jl=0; jl<nrowl; jl++)
1297 ek(il,jl) += weight * outflow * phiL(il,0) * phiL(jl,0);
1304 PZError <<
"TPZMatPoisson3d::Wrong boundary condition type\n";
1323 Solution(leftu,leftdudx,fake_axes,1,Lsol);
1324 Solution(leftu,leftdudx,fake_axes,2,Ldsol);
1326 Solution(rightu,rightdudx,fake_axes,1,Rsol);
1327 Solution(rightu,rightdudx,fake_axes,2,Rdsol);
1330 if ( (leftdudx.
Rows() != rightdudx.
Rows()) || (leftdudx.
Rows() != du_exact.
Rows()) ){
1331 PZError <<
"TPZMatPoisson3d::InterfaceErrors - Left and right matrices should have" 1333 <<
"same sizes in internal boundaries." 1339 STATE Ldsolnormal = 0., Rdsolnormal = 0., ExactDNormal = 0.;
1340 for(
int id = 0;
id <
fDim;
id++) {
1341 Ldsolnormal += Ldsol[id] * normal[id];
1342 Rdsolnormal += Rdsol[id] * normal[id];
1343 ExactDNormal += du_exact(
id, 0) * normal[id];
1352 aux = (Lsol[0] - Rsol[0]);
1355 aux *=
pow(elsize, (STATE(-1.)) *
gAlfa);
1356 REAL auxnorm =
abs(aux);
1357 values[1] = auxnorm * auxnorm;
1362 for(
int id=0;
id<
fDim;
id++) {
1364 aux = STATE(0.5) * (Ldsolnormal + Rdsolnormal);
1366 aux = aux - ExactDNormal;
1370 values[2] += auxnorm * auxnorm;
1373 values[0] = values[1]+values[2];
1385 STATE laplacU = (STATE)0;
1386 STATE divBetaU = (STATE)0;
1388 laplacU = dsol(1,0);
1389 divBetaU = (STATE)(this->
fC * this->
fConvDir[0]) * dsol(0,0);
1392 laplacU = dsol(2,0);
1393 divBetaU = (STATE)
fC * ( (STATE)
fConvDir[0] * dsol(0,0) + (STATE)
fConvDir[1] * dsol(1,0) );
1396 REAL result =
abs(-this->
fK * laplacU + divBetaU - (-fXfLoc));
1397 return (result*result);
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
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
virtual REAL ComputeSquareResidual(TPZVec< REAL > &X, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol) override
Compute square of residual of the differential equation at one integration point. ...
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
int ClassId() const override
Unique identifier for serialization purposes.
TPZManVector< REAL, 3 > normal
normal to the element at the integration point
virtual void ContributeBCHDiv(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc)
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
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.
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
Implements a vector class which allows to use external storage provided by the user. Utility.
clarg::argBool bc("-bc", "binary checkpoints", false)
STATE fSD
Multiplication value for the streamline diffusion term.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
REAL fPenaltyConstant
Constant multiplyer of penalty term, when required is set.
int Dimension() const override
Returns the integrable dimension of the material.
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to stiffness matrix and load vector at one integration point...
TPZMaterial & operator=(const TPZMaterial ©)
operator =
void GetParameters(STATE &diff, REAL &conv, TPZVec< REAL > &convdir)
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
virtual int NEvalErrors() override
Returns the number of norm errors. Default is 3: energy, L2 and H1.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
TPZFNMatrix< 9, REAL > jacinv
value of the inverse of the jacobian at the integration point
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
virtual ~TPZMatPoisson3d()
REAL val(STATE &number)
Returns value of the variable.
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux) override
Computes the value of the flux function to be used by ZZ error estimator.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Contains the TPZMatPoisson3d class.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
int p
maximum polinomial order of the shape functions
REAL fC
Variable which multiplies the convection term of the equation.
virtual int ClassId() const override
Unique identifier for serialization purposes.
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
virtual void Print(std::ostream &out=std::cout)
Prints out the data associated with the material.
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
TPZAutoPointer< TPZFunction< STATE > > & ForcingFunction()
Returns a procedure as source function for the material.
int64_t size() const
Returns the number of elements of the vector.
STATE fXf
Forcing function value.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
virtual void Write(const bool val)
STATE fK
Coeficient which multiplies the Laplacian operator.
virtual void SetParameters(STATE diff, REAL conv, TPZVec< REAL > &convdir)
virtual void ContributeHDiv(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
Compute the contribution at an integration point to the stiffness matrix of the HDiv formulation...
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
void InterfaceErrors(TPZVec< REAL > &, TPZVec< STATE > &leftu, TPZFMatrix< STATE > &leftdudx, TPZVec< STATE > &rightu, TPZFMatrix< STATE > &rightdudx, TPZVec< STATE > &, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values, TPZVec< STATE > normal, STATE elsize)
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunctionExact
Pointer to exact solution function, needed to calculate exact error.
TPZFNMatrix< 180 > fNormalVec
list of normal vectors
void ErrorsHdiv(TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values) override
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
This class defines the boundary condition for TPZMaterial objects.
int64_t Rows() const
Returns number of rows.
virtual void LocalNeumanContribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
int numberdualfunctions
number of dual function (e.g. pressure in HDiv approximations)
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
void SetNoPenalty()
Defines no penalty terms in ContributeInterface.
TPZFMatrix< STATE > & Val1()
virtual int VariableIndex(const std::string &name) override
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
REAL HSize
measure of the size of the element
virtual int HasForcingFunction()
Directive that gives true if the material has a forcing function.
virtual void ContributeBC(TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to the stiffness matrix and load vector at one BC integration point to mul...
virtual void Solution(TPZVec< TPZMaterialData > &datavec, int var, TPZVec< STATE > &Solout) override
Returns the solution associated with the var index based on the finite element approximation.
static STATE gAlfa
Using in InterfaceErrors.
EPenaltyType fPenaltyType
Penalty term definition.
static REAL gBigNumber
Big number to penalization method, used for Dirichlet conditions.
int32_t Hash(std::string str)
Contains TPZMatrix<TVar>class, root matrix class.
virtual void BCInterfaceJump(TPZVec< REAL > &x, TPZSolVec &leftu, TPZBndCond &bc, TPZSolVec &jump) override
Computes interface jump from element to Dirichlet boundary condition.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
virtual int VerifySymmetry(REAL tol=1.e-13) const
Checks if current matrix value is symmetric.
virtual void Errors(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values) override
Computes the error due to the difference between the interpolated flux and the flux computed based o...
virtual void Multiply(const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &res, int opt=0) const
It mutiplies itself by TPZMatrix<TVar>A putting the result in res.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
void SetNonSymmetric()
Set material elliptic term as the Baumann's formulation, i.e. the non-symmetrical formulation...
virtual void Print(std::ostream &out) override
Prints out the data associated with the material.
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
REAL fConvDir[3]
Direction of the convection operator.
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.
int fDim
Problem dimension.
Defines the interface for saving and reading data. Persistency.
TPZMatPoisson3d & operator=(const TPZMatPoisson3d ©)
int64_t NElements() const
Returns the number of elements of the vector.
TPZManVector< std::pair< int, int64_t > > fVecShapeIndex
correspondence between normal vector index and index of the shape functions
REAL fSymmetry
Symmetry coefficient of elliptic term.
TPZSolVec sol
vector of the solutions at the integration point
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...
#define PZError
Defines the output device to error messages and the DebugStop() function.
virtual void Read(bool &val)
virtual std::string Name() override
Returns the name of the material.