17 STATE ni1 , STATE ni2 , STATE G12 , STATE G13 ,
21 fE1(E1), fE2(E2), fG12(G12), fG13(G13), fG23(G23),
22 fh(h),ff(f),fmi(1./(-1.+ni1*ni2)),fni1(ni1),fni2(ni2),
23 fRmat(6,6,0.),fRmatT(6,6,0.),
24 fKxxR(6,6,0.),fKyyR(6,6,0.),fKxyR(6,6,0.),fKyxR(6,6,0.),
25 fBx0R(6,6,0.),fXF(xf) {
28 TPZFMatrix<STATE> Kxx(6,6,0.),Kxy(6,6,0.),Kyx(6,6,0.),Kyy(6,6,0.),
29 Bx0(6,6,0.),B0x(6,6,0.),By0(6,6,0.),B0y(6,6,0.),B00(6,6,0.),
30 B0xR(6,6,0.),By0R(6,6,0.),B0yR(6,6,0.),B00R(6,6,0.);
31 TPZFMatrix<STATE> Kn1n1(6,6,0.),Kn1n2(6,6,0.),Kn2n1(6,6,0.),Kn2n2(6,6,0.),
32 Bn10(6,6,0.),B0n1(6,6,0.),Bn20(6,6,0.),B0n2(6,6,0.),B000(6,6,0.);
37 mi = 1./(-1.0 + ni1 * ni2);
52 Kxx(0,4) = -E1*f*h*mi;
53 Kxx(1,1) = G12*h/2. + h*Small/4.;
54 Kxx(1,3) = -f*G12*h/2.;
55 Kxx(2,2) = G13*h*k/2.;
56 Kxx(3,1) = -f*G12*h/2.;
57 Kxx(3,3) = f*f*G12*h/2. + G12*h*h*h/24.;
58 Kxx(4,0) = -E1*f*h*mi;
59 Kxx(4,4) = -E1*f*f*h*mi - E1*h*h*h*mi/12.;
61 Kyx(0,1) = G12*h/2. - h*Small/4.;
62 Kyx(0,3) = -f*G12*h/2.;
63 Kyx(1,0) = -E1*h*mi*ni2;
64 Kyx(1,4) = -E1*f*h*mi*ni2;
65 Kyx(3,0) = E1*f*h*mi*ni2;
66 Kyx(3,4) = E1*f*f*h*mi*ni2 + E1*h*h*h*mi*ni2/12.;
67 Kyx(4,1) = f*G12*h/2.;
68 Kyx(4,3) = -f*f*G12*h/2. - G12*h*h*h/24.;
72 Kyy(0,0) = G12*h/2. + h*Small/4.;
73 Kyy(0,4) = f*G12*h/2.;
76 Kyy(2,2) = G23*h*k/2.;
78 Kyy(3,3) = -E2*f*f*h*mi - E2*h*h*h*mi/12.;
79 Kyy(4,0) = f*G12*h/2.;
80 Kyy(4,4) = f*f*G12*h/2. + G12*h*h*h/24.;
82 B0x(4,2) = G13*h*k/2.;
83 B0x(5,1) = -h*Small/2.;
85 B0y(3,2) = -G23*h*k/2.;
86 B0y(5,0) = h*Small/2.;
93 B00(3,3) = G23*h*k/2.;
94 B00(4,4) = G13*h*k/2.;
124 PZError <<
"TPZPlaca.contr, inconsistent input data : phi.Cols() = " 125 << phi.
Cols() <<
" dphi.Cols + " << dphi.
Cols() <<
126 " phi.Rows = " << phi.
Rows() <<
" dphi.Rows = " <<
133 STATE Dax1n1, Dax1n2, Dax2n1, Dax2n2;
141 Bn10(6,6),B0n1(6,6),Bn20(6,6),B0n2(6,6),B000(6,6);
144 Kn1n1 =
fKxxR * Dax1n1 * Dax1n1 +
fKyyR * Dax1n2 * Dax1n2 +
145 fKxyR * Dax1n1 * Dax1n2 +
fKyxR * Dax1n1 * Dax1n2 ;
147 Kn2n1 =
fKxxR * Dax2n1 * Dax1n1 +
fKyyR * Dax2n2 * Dax1n2 +
148 fKyxR * Dax2n2 * Dax1n1 +
fKxyR * Dax2n1 * Dax1n2 ;
150 Kn1n2 =
fKxyR * Dax1n1 * Dax2n2 +
fKxxR * Dax1n1 * Dax2n1 +
151 fKyyR * Dax1n2 * Dax2n2 +
fKyxR * Dax1n2 * Dax2n1;
153 Kn2n2 =
fKyyR * Dax2n2 * Dax2n2 +
fKxxR * Dax2n1 * Dax2n1 +
154 fKxyR * Dax2n1 * Dax2n2 +
fKyxR * Dax2n2 * Dax2n1;
167 int nshape = phi.
Rows();
170 for(i=0; i<nshape; i++) {
171 STATE dphi_0i(dphi(0,i)),dphi_1i(dphi(1,i)),phi_i(phi(i,0));
175 for(
int k=0;k<6;k++){
179 Fun = (dphi_0i*(Kn1n1*dux)+
188 for(idf=0; idf<6; idf++) ef(6*i+idf,0) += weight*Fun(idf,0)*phi(i,0);
191 for(idf=0; idf<6; idf++) ef(6*i+idf,0) += weight*
fXF[
idf]*phi(i,0);
193 for(j=0; j<nshape; j++) {
194 STATE dphi_0j(dphi(0,j)),dphi_1j(dphi(1,j)),phi_j(phi(j,0));
195 KIJ = (STATE(weight))*(dphi_0i*dphi_0j*Kn1n1+
196 dphi_0i*dphi_1j*Kn1n2+
197 dphi_1i*dphi_0j*Kn2n1+
198 dphi_1i*dphi_1j*Kn2n2+
199 dphi_0i*phi_j *Bn10 +
200 dphi_1i*phi_j *Bn20 +
201 phi_i *dphi_0j*B0n1 +
202 phi_i *dphi_1j*B0n2 +
203 phi_i *phi_j *B000 );
204 for(idf=0; idf<6; idf++)
for(jdf=0; jdf<6; jdf++)
205 ek(i*6+idf,j*6+jdf) += KIJ(idf,jdf);
219 PZError <<
"TPZMat1dLin.apply_bc warning : this material didn't create the boundary condition!\n";
223 PZError <<
"TPZMat1dLin.aplybc, unknown boundary condition type :" <<
224 bc.
Type() <<
" boundary condition ignored\n";
228 int numnod = ek.
Rows()/numdof;
235 for(in=0 ; in<numnod ; ++in){
236 for(idf = 0;idf<r;idf++) {
239 for(jn=0 ; jn<numnod ; ++jn) {
240 for(idf = 0;idf<r;idf++) {
241 ek(in*r+idf,jn*r+idf) +=
gBigNumber*phi(in,0)*phi(jn,0)*weight;
248 for(in=0 ; in<numnod ; ++in){
249 for(idf = 0;idf<r;idf++) {
250 (ef)(in*r+idf,0) += phi(in,0)*bc.
Val2()(
idf,0)*weight;
256 for(in=0 ; in<numnod ; ++in){
257 for(idf = 0;idf<r;idf++) {
258 (ef)(in*r+idf,0) += phi(in,0)*bc.
Val2()(
idf,0)*weight;
260 for(jn=0 ; jn<numnod ; ++jn) {
261 for(idf = 0;idf<r;idf++) {
262 for(jdf = 0;jdf<r;jdf++) {
263 ek(in*r+idf,jn*r+jdf) += bc.
Val1()(
idf,jdf)*phi(in,0)*phi(jn,0)*weight;
274 PZError <<
"TPZPlaca::Flux is called\n";
286 if(!strcmp(name.c_str(),
"Deslocx"))
return 2;
287 if(!strcmp(name.c_str(),
"Deslocy"))
return 3;
288 if(!strcmp(name.c_str(),
"Deslocz"))
return 4;
289 if(!strcmp(name.c_str(),
"Mn1"))
return 5;
290 if(!strcmp(name.c_str(),
"Mn2"))
return 6;
291 if(!strcmp(name.c_str(),
"Mn1n2"))
return 7;
292 if(!strcmp(name.c_str(),
"Sign1"))
return 8;
293 if(!strcmp(name.c_str(),
"Sign2"))
return 9;
294 if(!strcmp(name.c_str(),
"Taun1n2"))
return 10;
295 if(!strcmp(name.c_str(),
"Taun1n3"))
return 11;
296 if(!strcmp(name.c_str(),
"Taun2n3"))
return 12;
297 if(!strcmp(name.c_str(),
"Displacement"))
return 13;
299 cout <<
"TPZPlaca name not found " << name << endl;
309 if(var == 2)
return 1;
310 if(var == 3)
return 1;
311 if(var == 4)
return 1;
312 if(var == 5)
return 1;
313 if(var == 6)
return 1;
314 if(var == 7)
return 1;
315 if(var == 8)
return 1;
316 if(var == 9)
return 1;
317 if(var == 10)
return 1;
318 if(var == 11)
return 1;
319 if(var == 12)
return 1;
320 if(var == 13)
return 3;
357 for(idf=0; idf<6; idf++) {
361 for(jdf=0; jdf<6; jdf++) {
362 Soln[
idf] +=
fRmat(idf,jdf)*Sol[jdf];
363 DSolnax(0,idf) +=
fRmat(idf,jdf)*DSol(0,jdf);
364 DSolnax(1,idf) +=
fRmat(idf,jdf)*DSol(1,jdf);
367 REAL Dax1n1, Dax1n2, Dax2n1, Dax2n2;
374 for(idf=0;idf<6;idf++) {
375 DSolnn(0,idf) = Dax1n1*DSolnax(0,idf)+Dax2n1*DSolnax(1,idf);
376 DSolnn(1,idf) = Dax1n2*DSolnax(0,idf)+Dax2n2*DSolnax(1,idf);
383 -
ff*DSolnn(0,4)-DSolnn(0,0));
399 Mn1n2 =
fG12*
fh*
fh*
fh*(DSolnn(1,4) - DSolnn(0,3))/24.;
400 Mn1n2 += (
ff*
fG12*
fh*(
ff*DSolnn(1,4) + DSolnn(1,0) -
401 ff*DSolnn(0,3) + DSolnn(0,1)))/2.;
409 Sign1 = -
fE1*
fmi*(
fni2*(-(
ff + z)*DSolnn(1,3) + DSolnn(1,1))+
410 (
ff + z)*DSolnn(0,4) + DSolnn(0,0));
418 Sign2=-
fE2*
fmi*(-(
ff + z)*DSolnn(1,3) + DSolnn(1,1) +
419 fni1*((
ff + z)*DSolnn(0,4) + DSolnn(0,0)));
427 Taun1n2=(
fG12*((
ff + z)*DSolnn(1,4) + DSolnn(1,0) -
428 (
ff + z)*DSolnn(0,3) + DSolnn(0,1)))/2.;
434 Taun1n3=
fG13*(Soln[4] + DSolnn(0,2))/2.;
440 Taun2n3=
fG23*(-Soln[3] + DSolnn(1,2))/2.;
459 for(i=0;i<6;i++) err(i,0) = u_exact[i] - u[i];
462 dxerr(i,0) = du_exact(0,i) - dudx(0,i);
463 dyerr(i,0) = du_exact(1,i) - dudx(1,i);
467 err.Transpose(&errt);
468 dxerr.Transpose(&dxerrt);
473 ENERGY = dxerrt * (
fKxxR * dxerr) + dyerrt * (
fKyyR * dyerr);
474 ENERGY += dxerrt * (
fKxyR * dyerr) + dyerrt * (
fKyxR * dxerr);
475 ENERGY += errt * (
fB0xR * dxerr) + dxerrt * (
fBx0R * err);
476 ENERGY += errt * (
fB0yR * dyerr) + dyerrt * (
fBy0R * err);
477 ENERGY += errt * (
fB00R * err);
478 values[0] = ENERGY(0,0);
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 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...
TPZFMatrix< STATE > fBy0R
virtual int NFluxes() override
Returns the number of components which form the flux function.
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
clarg::argBool bc("-bc", "binary checkpoints", false)
Contains the TPZPlaca class.
TPZFMatrix< STATE > fKyyR
Templated vector implementation.
TPZFMatrix< STATE > fKxxR
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
TPZFMatrix< STATE > fB0xR
clarg::argBool h("-h", "help message", false)
TPZFMatrix< STATE > fKxyR
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...
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
TPZPlaca(int num, STATE h, STATE f, STATE E1, STATE E2, STATE ni1, STATE ni2, STATE G12, STATE G13, STATE G23, TPZFMatrix< STATE > &naxes, TPZVec< STATE > &xf)
TPZFMatrix< STATE > fBx0R
This abstract class defines the behaviour which each derived class needs to implement.
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 int VariableIndex(const std::string &name) override
This class defines the boundary condition for TPZMaterial objects.
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...
TPZFMatrix< STATE > fB0yR
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
int64_t Rows() const
Returns number of rows.
virtual int NSolutionVariables(int var) override
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
TPZFMatrix< STATE > & Val1()
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
TPZFMatrix< STATE > fRmatT
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &fl) override
Computes the value of the flux function to be used by ZZ error estimator.
static REAL gBigNumber
Big number to penalization method, used for Dirichlet conditions.
int32_t Hash(std::string str)
int ClassId() const override
Unique identifier for serialization purposes.
TPZFMatrix< STATE > fnaxes
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
void Print(std::ostream &out) override
Prints out the data associated with the material.
virtual int ClassId() const override
Define the class id associated with the class.
TPZFMatrix< STATE > fKyxR
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
int64_t Cols() const
Returns number of cols.
void(* fExactFunction)(TPZFMatrix< REAL > &axes, TPZVec< REAL > &x, TPZFMatrix< STATE > &uexact, TPZFMatrix< STATE > &duexact)
TPZFMatrix< STATE > fB00R
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.
TPZMaterial * Material() const
TPZFMatrix< STATE > fRmat