20 STATE eppz,STATE vxy,STATE vyz,STATE vzx,
21 STATE gxy,STATE gyz,STATE gzx) :
23 fKXX(3,3,0.),fKYY(3,3,0.),fKZZ(3,3,0.),
24 fKXY(3,3,0.),fKYX(3,3,0.),fKXZ(3,3,0.),
25 fKZX(3,3,0.),fKYZ(3,3,0.),
26 fKZY(3,3,0.),fXf(3,1,0.)
47 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKXX(i,j) = 0.;
52 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKXY(i,j) = 0.;
56 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKXZ(i,j) = 0.;
60 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKYX(i,j) = 0.;
64 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKYY(i,j) = 0.;
69 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKYZ(i,j) = 0.;
73 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKZX(i,j) = 0.;
77 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKZY(i,j) = 0.;
81 for(i=0; i<3; i++)
for(j=0; j<3; j++)
fKZZ(i,j) = 0.;
95 out <<
"name of material : " <<
Name() <<
"\n";
96 out <<
"properties : \n";
97 out <<
"Eppx = " <<
fEppx <<
"\tEppy = " <<
fEppy <<
"\tEppz = " <<
fEppz << endl;
98 out <<
"vxy = " <<
fVxy <<
"\tvyx = " <<
fVyx << endl;
99 out <<
"vzx = " <<
fVzx <<
"\tvxz = " <<
fVxz << endl;
100 out <<
"vxy = " <<
fVxy <<
"\tvyx = " <<
fVyx << endl;
101 out <<
"gxy = " <<
fGxy <<
"\tgyz = " <<
fGyz <<
"\tgzx = " <<
fGzx << endl;
102 out <<
"numnomvar = " <<
fNumNom << endl;
103 out <<
"\n>>>>>>>>>>>>>> MATRIZES KIJ <<<<<<<<<<<<<<<<<<\n\n";
128 for (
int r=0; r<axes.Rows(); r++) {
129 for (
int c=0; c<axes.Cols(); c++) {
130 axes(r,c) = data.
axes(r,c);
134 int phr = phi.
Rows();
139 for(i=0; i<3; i++)
fXf(i,0) = res[i];
153 axes.Transpose(&newaxes);
154 newaxes = Rt*newaxes;
166 MatrizesK <<
"\n>>>>>>>>>>>>>> MATRIZES KIJ <<<<<<<<<<<<<<<<<<\n\n";
167 kxx.Print(
"KXX",MatrizesK);
168 kxy.Print(
"KXY",MatrizesK);
169 kxz.Print(
"KXZ",MatrizesK);
170 kyx.Print(
"KYX",MatrizesK);
171 kyy.Print(
"KYY",MatrizesK);
172 kyz.Print(
"KYZ",MatrizesK);
173 kzx.Print(
"KZX",MatrizesK);
174 kzy.Print(
"KZY",MatrizesK);
175 kzz.Print(
"KZZ",MatrizesK);
177 for(
int in = 0; in < phr; in++ ) {
178 ef(3*in, 0) += weight * phi(in, 0) *
fXf(0,0);
179 ef(3*in+1, 0) += weight * phi(in, 0) *
fXf(1,0);
180 ef(3*in+2, 0) += weight * phi(in, 0) *
fXf(2,0);
181 for(
int jn = 0; jn < phr; jn++ ) {
184 REAL dphin0 = newaxes(0,0)*dphi(0,in)+newaxes(0,1)*dphi(1,in)+newaxes(0,2)*dphi(2,in);
185 REAL dphin1 = newaxes(1,0)*dphi(0,in)+newaxes(1,1)*dphi(1,in)+newaxes(1,2)*dphi(2,in);
186 REAL dphin2 = newaxes(2,0)*dphi(0,in)+newaxes(2,1)*dphi(1,in)+newaxes(2,2)*dphi(2,in);
188 REAL dphjn0 = newaxes(0,0)*dphi(0,jn)+newaxes(0,1)*dphi(1,jn)+newaxes(0,2)*dphi(2,jn);
189 REAL dphjn1 = newaxes(1,0)*dphi(0,jn)+newaxes(1,1)*dphi(1,jn)+newaxes(1,2)*dphi(2,jn);
190 REAL dphjn2 = newaxes(2,0)*dphi(0,jn)+newaxes(2,1)*dphi(1,jn)+newaxes(2,2)*dphi(2,jn);
195 ek(3*in+k,3*jn+l) += weight * ( dphin0*dphjn0*kxx(k,l) +
196 dphin0*dphjn1*kxy(k,l) +
197 dphin0*dphjn2*kxz(k,l) +
198 dphin1*dphjn0*kyx(k,l) +
199 dphin1*dphjn1*kyy(k,l) +
200 dphin1*dphjn2*kyz(k,l) +
201 dphin2*dphjn0*kzx(k,l) +
202 dphin2*dphjn1*kzy(k,l) +
203 dphin2*dphjn2*kzz(k,l)
218 const STATE BIGNUMBER = 1.e12;
220 int phr = phi.
Rows();
223 v2[0] = bc.
Val2()(0,0);
224 v2[1] = bc.
Val2()(1,0);
225 v2[2] = bc.
Val2()(2,0);
229 for(in = 0 ; in < phr; in++) {
230 ef(3*in,0) += BIGNUMBER * v2[0] * phi(in,0) * weight;
231 ef(3*in+1,0) += BIGNUMBER * v2[1] * phi(in,0) * weight;
232 ef(3*in+2,0) += BIGNUMBER * v2[2] * phi(in,0) * weight;
233 for (jn = 0 ; jn < phi.
Rows(); jn++) {
235 ek(3*in+k,3*jn+k) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
242 for(in = 0 ; in < phi.
Rows(); in++) {
243 ef(3*in,0) += v2[0] * phi(in,0) * weight;
244 ef(3*in+1,0) += v2[1] * phi(in,0) * weight;
245 ef(3*in+2,0) += v2[2] * phi(in,0) * weight;
250 for(in = 0 ; in < phi.
Rows(); in++) {
251 ef(3*in, 0) += v2[0] * phi(in, 0) * weight;
252 ef(3*in+1, 0) += v2[1] * phi(in, 0) * weight;
253 ef(3*in+2, 0) += v2[2] * phi(in, 0) * weight;
254 for (jn = 0 ; jn < phi.
Rows(); jn++) {
257 ek(3*in+k,3*jn+l) += bc.
Val1()(k,l) * phi(in,0) * phi(jn,0) * weight;
268 if(
"DisplacX" == name)
return 0;
269 if(!strcmp(
"DisplacX",name.c_str()))
return 0;
270 if(!strcmp(
"DisplacY",name.c_str()))
return 1;
271 if(!strcmp(
"DisplacZ",name.c_str()))
return 2;
272 if(!strcmp(
"DisplacN0",name.c_str()))
return 3;
273 if(!strcmp(
"DisplacN1",name.c_str()))
return 4;
274 if(!strcmp(
"DisplacN2",name.c_str()))
return 5;
275 if(!strcmp(
"GlobDisplac",name.c_str()))
return 6;
276 if(!strcmp(
"FiberDisplac",name.c_str()))
return 7;
277 if(!strcmp(
"Tension",name.c_str()))
return 8;
278 if(!strcmp(
"Tensor",name.c_str()))
return 9;
279 if(!strcmp(
"SigX",name.c_str()))
return 10;
280 if(!strcmp(
"SigY",name.c_str()))
return 11;
281 if(!strcmp(
"SigZ",name.c_str()))
return 12;
282 if(!strcmp(
"TauXY",name.c_str()))
return 13;
283 if(!strcmp(
"TauXZ",name.c_str()))
return 14;
284 if(!strcmp(
"TauYZ",name.c_str()))
return 15;
287 cout <<
"TPZMatOrthotropic::VariableIndex Error\n";
293 if(var > -1 && var < 6)
return 1;
294 if(var == 6 || var == 7)
return 3;
295 if(var == 8)
return 6;
296 if(var == 9)
return 9;
297 if(var > 9 && var < 16)
return 1;
298 cout <<
"TPZMatOrthotropic::NSolutionVariables Error\n";
304 for (
int r=0; r<axes.Rows(); r++) {
305 for (
int c=0; c<axes.Cols(); c++) {
306 axes(r,c) = axespar(r,c);
332 if(var==3 || var==4 || var==5 || var==7){
333 cout <<
"TPZMatOrthotropic::Solution not implemented\n";
342 Solout[0] = SolN(0,0);
347 Solout[0] = SolN(1,0);
352 Solout[0] = SolN(2,0);
357 Solout[0] = SolN(0,0);
358 Solout[1] = SolN(1,0);
359 Solout[2] = SolN(2,0);
363 if(var > 7 && var < 16) {
365 TPZFMatrix<STATE> axest(3,3,0.),floc_axt(3,3,0.),grdUGdn(3,3,0.),grdUlocdn(3,3,0.);
366 axes.Transpose(&axest);
368 grdUGdn = floc_axt*DSol;
370 grdUGdn.Transpose(&grdUGdnT);
374 FibStrain = ((STATE)0.5)*(grdULdnT + grdULdn);
376 STATE epsx = FibStrain(0,0);
377 STATE epsy = FibStrain(1,1);
378 STATE epsz = FibStrain(2,2);
379 STATE epsxy = FibStrain(0,1);
380 STATE epsyz = FibStrain(1,2);
381 STATE epszx = FibStrain(2,0);
387 STATE TauXY = 2.*
fGxy*epsxy;
388 STATE TauYZ = 2.*
fGyz*epsyz;
389 STATE TauZX = 2.*
fGzx*epszx;
395 Tensor(0,1) = Tensor(1,0) = TauXY;
396 Tensor(1,2) = Tensor(2,1) = TauYZ;
397 Tensor(2,0) = Tensor(0,2) = TauZX;
435 Solout[0] = SigGlob(0,0);
436 Solout[1] = SigGlob(1,1);
437 Solout[2] = SigGlob(2,2);
438 Solout[3] = SigGlob(0,1);
439 Solout[4] = SigGlob(1,2);
440 Solout[5] = SigGlob(2,0);
447 Solout[0] = SigGlob(0,0);
448 Solout[1] = SigGlob(0,1);
449 Solout[2] = SigGlob(2,0);
450 Solout[3] = SigGlob(0,1);
451 Solout[4] = SigGlob(1,1);
452 Solout[5] = SigGlob(1,2);
453 Solout[6] = SigGlob(2,0);
454 Solout[7] = SigGlob(1,2);
455 Solout[8] = SigGlob(2,2);
473 STATE
dx = du_exact(0,0)*axes(0,0)+du_exact(1,0)*axes(0,1);
474 STATE dy = du_exact(0,0)*axes(1,0)+du_exact(1,0)*axes(1,1);
475 STATE parc1 =
fabs(dx-dudx(0,0));
476 STATE parc2 =
fabs(dy-dudx(1,0));
478 values[1] =
pow(
fabs(u[0] - u_exact[0]),(STATE)2.0);
480 values[2] =
pow(parc1,(STATE)2.)+
pow(parc2,(STATE)2.);
482 values[0] = values[1]+values[2];
486 values[1] =
pow(sol[0] - u_exact[0],(STATE)2.0);
488 values[2] =
pow(dsol[0] - du_exact(0,0),(STATE)2.0);
489 if(dudx.
Rows()>1) values[2] +=
pow(dsol[1] - du_exact(1,0),(STATE)2.0);
490 if(dudx.
Rows()>2) values[2] +=
pow(dsol[2] - du_exact(2,0),(STATE)2.0);
492 values[0] = values[1]+values[2];
503 STATE norm2 = naxes(0,0)*naxes(0,0)+naxes(0,1)*naxes(0,1)+naxes(0,2)*naxes(0,2);
504 if(norm2 == 0.){
PZError <<
"TPZMatOrthotropic::Normalize: Eixo nulo nao e valido (eixo 1)\n"; exit(-1);}
505 for(i=0;i<3;i++) naxes(0,i) /=
sqrt(norm2);
506 norm2 = naxes(1,0)*naxes(1,0)+naxes(1,1)*naxes(1,1)+naxes(1,2)*naxes(1,2);
507 if(norm2 == 0.){
PZError <<
"TPZMatOrthotropic::Normalize: Eixo nulo nao e valido (eixo 2)\n"; exit(-1);}
508 for(i=0;i<3;i++) naxes(1,i) /=
sqrt(norm2);
509 norm2 = naxes(2,0)*naxes(2,0)+naxes(2,1)*naxes(2,1)+naxes(2,2)*naxes(2,2);
510 if(norm2 != 0.)
for(i=0;i<3;i++) naxes(2,i) /=
sqrt(norm2);
512 STATE componente_K = naxes(0,0)*naxes(1,1) - naxes(0,1)*naxes(1,0);
513 STATE componente_J = -naxes(0,0)*naxes(1,2) + naxes(0,2)*naxes(1,0);
514 STATE componente_I = naxes(0,1)*naxes(1,2) - naxes(0,2)*naxes(1,1);
516 if(componente_I == 0. && componente_J == 0. && componente_K == 0.){
517 PZError <<
"TPZMatOrthotropic::Normalize: Os dois primeiros eixos nao devem ser paralelos\n";
518 PZError <<
"Programa abortado\n";
523 norm2 = componente_I*componente_I+componente_J*componente_J+componente_K*componente_K;
525 naxes(2,0) = componente_I/norm2;
526 naxes(2,1) = componente_J/norm2;
527 naxes(2,2) = componente_K/norm2;
529 naxes(1,2) = naxes(2,0)*naxes(0,1) - naxes(2,1)*naxes(0,0);
530 naxes(1,1) = -naxes(2,0)*naxes(0,2) + naxes(2,2)*naxes(0,0);
531 naxes(1,0) = naxes(2,1)*naxes(0,2) - naxes(2,2)*naxes(0,1);
532 naxes.
Print(
" * * * Eixos das fibras * * *");
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
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 void Print(std::ostream &out) override
Prints out the data associated with the material.
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
virtual std::string Name() override
Returns the name of the material.
clarg::argBool bc("-bc", "binary checkpoints", false)
void Normalize(TPZFMatrix< STATE > &naxes)
Verifies the consistency of the axles.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
TPZMatOrthotropic(int nummat, TPZFMatrix< STATE > naxes, STATE eppx, STATE eppy, STATE eppz, STATE vxy, STATE vyz, STATE vzx, STATE gxy, STATE gyz, STATE gzx)
TPZFMatrix< STATE > fLocAxs
Contains the TPZMatOrthotropic class.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
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.
This abstract class defines the behaviour which each derived class needs to implement.
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...
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 ~TPZMatOrthotropic()
expr_ dx(i) *cos(expr_.val())
Contains TPZMatrixclass which implements full matrix (using column major representation).
This class defines the boundary condition for TPZMaterial objects.
Free store vector implementation.
int64_t Rows() const
Returns number of rows.
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
ofstream MatrizesK("MatrizesK.out")
Output file to write stiffness matrix.
TPZFMatrix< STATE > & Val1()
Contains TPZMatrix<TVar>class, root matrix class.
virtual int VariableIndex(const std::string &name) override
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
virtual void ContributeBC(TPZMaterialData &data, 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...
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
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.
int64_t Cols() const
Returns number of cols.
virtual void Print(std::ostream &out) const
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
void Transpose(TPZMatrix< TVar > *const T) const override
It makes *T the transpose of current matrix.
#define PZError
Defines the output device to error messages and the DebugStop() function.
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 Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override