36 out <<
"name of material : " <<
Name() <<
"\n";
37 out <<
"properties : \n";
59 for(
int in = 0; in < phr; in++ ) {
60 ef(in, 0) += weight *
fXf*phi(in,0);
61 for(
int jn = 0; jn < phr; jn++ ) {
62 ek(in,jn) += weight * ( dphi(2,in) * dphi(2,jn) );
75 PZError <<
"TPZBiHarminic::ContributeBC - It should never be called.";
80 if(!strcmp(
"Displacement6",name.c_str()))
return 0;
81 if(!strcmp(
"Solution",name.c_str()))
return 1;
82 if(!strcmp(
"Derivate",name.c_str()))
return 2;
83 if(!strcmp(
"POrder",name.c_str()))
return 10;
84 cout <<
"TPZBiharmonic::VariableIndex Error\n";
89 if(var == 0)
return 6;
90 if(var == 1)
return 1;
91 if(var == 2)
return 2;
92 if(var == 10)
return 1;
100 if(var == 0 || var == 1) Solout[0] = Sol[0];
104 for(
id=0 ;
id < DSol.
Rows();
id++) {
105 Solout[id] = DSol(
id,0);
124 values[1] = (sol[0] - u_exact[0])*(sol[0] - u_exact[0]);
128 for(
int id=0;
id<2;
id++) {
129 values[2] += (dsol[id] - du_exact(
id,0))*(dsol[
id] - du_exact(
id,0));
132 values[3] = (dsol[2] - du_exact(2,0))*(dsol[2] - du_exact(2,0));
135 values[0] = values[1]+values[2];
137 values[5] = (dsol[5] - du_exact(5,0))*(dsol[5] - du_exact(5,0));
139 values[6] = (dsol[6] - du_exact(6,0))*(dsol[6] - du_exact(6,0));
141 values[7] = (dsol[7] - du_exact(7,0))*(dsol[7] - du_exact(7,0));
143 values[4] = values[5]+values[6]+values[7]+values[0];
155 int LeftPOrder=dataleft.
p;
156 int RightPOrder=dataright.
p;
157 REAL faceSize=data.
HSize;
159 int nrowl = phiL.
Rows();
160 int nrowr = phiR.
Rows();
170 for(il=0; il<nrowl; il++) {
171 REAL dphiLinormal = 0.;
172 for(
id=0;
id<2;
id++) {
173 dphiLinormal += dphiL(3+
id,il)*normal[id];
175 for(jl=0; jl<nrowl; jl++) {
176 REAL dphiLjnormal = 0.;
177 for(
id=0;
id<2;
id++) {
178 dphiLjnormal += dphiL(3+
id,jl)*normal[id];
181 ek(il,jl) += weight*0.5*(+
gLambda1*dphiLinormal*phiL(jl,0) + dphiLjnormal*phiL(il,0));
184 for(ir=0; ir<nrowr; ir++) {
185 REAL dphiRinormal = 0.;
186 for(
id=0;
id<2;
id++) {
187 dphiRinormal += dphiR(3+
id,ir)*normal[id];
189 for(jr=0; jr<nrowr; jr++) {
190 REAL dphiRjnormal = 0.;
191 for(
id=0;
id<2;
id++) {
192 dphiRjnormal += dphiR(3+
id,jr)*normal[id];
194 ek(ir+nrowl,jr+nrowl) += weight*0.5*(
195 -
gLambda1*dphiRinormal*phiR(jr,0) - dphiRjnormal*phiR(ir,0)
199 for(il=0; il<nrowl; il++) {
200 REAL dphiLinormal = 0.;
201 for(
id=0;
id<2;
id++) {
202 dphiLinormal += dphiL(3+
id,il)*normal[id];
204 for(jr=0; jr<nrowr; jr++) {
205 REAL dphiRjnormal = 0.;
206 for(
id=0;
id<2;
id++) {
207 dphiRjnormal += dphiR(3+
id,jr)*normal[id];
209 ek(il,jr+nrowl) += weight*0.5*(
210 -
gLambda1*dphiLinormal*phiR(jr,0) + dphiRjnormal*phiL(il,0)
214 for(ir=0; ir<nrowr; ir++) {
215 REAL dphiRinormal = 0.;
216 for(
id=0;
id<2;
id++) {
217 dphiRinormal += dphiR(3+
id,ir)*normal[id];
219 for(jl=0; jl<nrowl; jl++) {
220 REAL dphiLjnormal = 0.;
221 for(
id=0;
id<2;
id++) {
222 dphiLjnormal += dphiL(3+
id,jl)*normal[id];
224 ek(ir+nrowl,jl) += weight*0.5*(
225 +
gLambda1*dphiRinormal*phiL(jl,0) - dphiLjnormal*phiR(ir,0)
231 for(il=0; il<nrowl; il++) {
232 REAL dphiLinormal = 0.;
233 for(
id=0;
id<2;
id++) {
234 dphiLinormal += dphiL(
id,il)*normal[id];
236 for(jl=0; jl<nrowl; jl++) {
237 REAL dphiLjnormal = 0.;
238 for(
id=0;
id<2;
id++) {
239 dphiLjnormal += dphiL(
id,jl)*normal[id];
242 ek(il,jl) += weight*0.5*(
243 - dphiLinormal*dphiL(2,jl) -
gLambda2*dphiLjnormal*dphiL(2,il)
247 for(ir=0; ir<nrowr; ir++) {
248 REAL dphiRinormal = 0.;
249 for(
id=0;
id<2;
id++) {
250 dphiRinormal += dphiR(
id,ir)*normal[id];
252 for(jr=0; jr<nrowr; jr++) {
253 REAL dphiRjnormal = 0.;
254 for(
id=0;
id<2;
id++) {
255 dphiRjnormal += dphiR(
id,jr)*normal[id];
257 ek(ir+nrowl,jr+nrowl) += weight*0.5*(
258 + dphiRinormal*dphiR(2,jr) +
gLambda2*dphiRjnormal*dphiR(2,ir)
262 for(il=0; il<nrowl; il++) {
263 REAL dphiLinormal = 0.;
264 for(
id=0;
id<2;
id++) {
265 dphiLinormal += dphiL(
id,il)*normal[id];
267 for(jr=0; jr<nrowr; jr++) {
268 REAL dphiRjnormal = 0.;
269 for(
id=0;
id<2;
id++) {
270 dphiRjnormal += dphiR(
id,jr)*normal[id];
272 ek(il,jr+nrowl) += weight*0.5*(
273 - dphiLinormal*dphiR(2,jr) +
gLambda2*dphiRjnormal*dphiL(2,il)
277 for(ir=0; ir<nrowr; ir++) {
278 REAL dphiRinormal = 0.;
279 for(
id=0;
id<2;
id++) {
280 dphiRinormal += dphiR(
id,ir)*normal[id];
282 for(jl=0; jl<nrowl; jl++) {
283 REAL dphiLjnormal = 0.;
284 for(
id=0;
id<2;
id++) {
285 dphiLjnormal += dphiL(
id,jl)*normal[id];
287 ek(ir+nrowl,jl) += weight*0.5*(
288 + dphiRinormal*dphiL(2,jl) -
gLambda2*dphiLjnormal*dphiR(2,ir)
294 for(il=0; il<nrowl; il++) {
295 REAL dphiLinormal = 0.;
296 for(
id=0;
id<2;
id++) {
297 dphiLinormal += dphiL(
id,il)*normal[id];
299 for(jl=0; jl<nrowl; jl++) {
300 REAL dphiLjnormal = 0.;
301 for(
id=0;
id<2;
id++) {
302 dphiLjnormal += dphiL(
id,jl)*normal[id];
305 ek(il,jl) += weight*(
306 alpha * phiL(jl,0)*phiL(il,0) +
307 betta * dphiLinormal*dphiLjnormal
311 for(ir=0; ir<nrowr; ir++) {
312 REAL dphiRinormal = 0.;
313 for(
id=0;
id<2;
id++) {
314 dphiRinormal += dphiR(
id,ir)*normal[id];
316 for(jr=0; jr<nrowr; jr++) {
317 REAL dphiRjnormal = 0.;
318 for(
id=0;
id<2;
id++) {
319 dphiRjnormal += dphiR(
id,jr)*normal[id];
321 ek(ir+nrowl,jr+nrowl) += weight*(
322 alpha * phiR(jr,0)*phiR(ir,0) +
323 betta * dphiRinormal*dphiRjnormal
327 for(il=0; il<nrowl; il++) {
328 REAL dphiLinormal = 0.;
329 for(
id=0;
id<2;
id++) {
330 dphiLinormal += dphiL(
id,il)*normal[id];
332 for(jr=0; jr<nrowr; jr++) {
333 REAL dphiRjnormal = 0.;
334 for(
id=0;
id<2;
id++) {
335 dphiRjnormal += dphiR(
id,jr)*normal[id];
337 ek(il,jr+nrowl) += weight*(
338 - alpha * phiR(jr,0)*phiL(il,0)
339 - betta * dphiLinormal*dphiRjnormal
343 for(ir=0; ir<nrowr; ir++) {
344 REAL dphiRinormal = 0.;
345 for(
id=0;
id<2;
id++) {
346 dphiRinormal += dphiR(
id,ir)*normal[id];
348 for(jl=0; jl<nrowl; jl++) {
349 REAL dphiLjnormal = 0.;
350 for(
id=0;
id<2;
id++) {
351 dphiLjnormal += dphiL(
id,jl)*normal[id];
353 ek(ir+nrowl,jl) += weight*(
354 - alpha * phiL(jl,0)*phiR(ir,0)
355 - betta * dphiRinormal*dphiLjnormal
371 REAL faceSize=data.
HSize;
380 for(il=0; il<nrowl; il++) {
382 REAL dphiLinormal = 0.;
383 for(
id=0;
id<2;
id++) {
384 dphiLinormal += dphiL(3+
id,il)*normal[id];
388 ef(il,0) += +
gLambda1*weight*dphiLinormal*bc.
Val2()(0,0)
389 + alpha * weight*bc.
Val2()(0,0)*phiL(il) ;
391 for(jl=0; jl<nrowl; jl++) {
392 REAL dphiLjnormal = 0.;
393 for(
id=0;
id<2;
id++) {
394 dphiLjnormal += dphiL(3+
id,jl)*normal[id];
396 ek(il,jl) += weight*(+
gLambda1*dphiLinormal*phiL(jl,0)+ dphiLjnormal*phiL(il,0));
401 for(il=0; il<nrowl; il++) {
402 REAL dphiLinormal = 0.;
403 for(
id=0;
id<2;
id++) {
404 dphiLinormal += dphiL(
id,il)*normal[id];
408 ef(il,0) += -
gLambda2*weight*bc.
Val2()(1,0)*dphiL(2,il)
409 + betta * weight*bc.
Val2()(1,0)*dphiLinormal ;
411 for(jl=0; jl<nrowl; jl++) {
412 REAL dphiLjnormal = 0.;
413 for(
id=0;
id<2;
id++) {
414 dphiLjnormal += dphiL(
id,jl)*normal[id];
416 ek(il,jl) += weight*(- dphiLinormal*dphiL(2,jl) -
gLambda2*dphiLjnormal*dphiL(2,il) );
421 for(il=0; il<nrowl; il++) {
422 REAL dphiLinormal = 0.;
423 for(
id=0;
id<2;
id++) {
424 dphiLinormal += dphiL(
id,il)*normal[id];
426 for(jl=0; jl<nrowl; jl++) {
427 REAL dphiLjnormal = 0.;
428 for(
id=0;
id<2;
id++) {
429 dphiLjnormal += dphiL(
id,jl)*normal[id];
431 ek(il,jl) += weight*(
432 alpha * phiL(jl,0)*phiL(il,0) +
433 betta * dphiLinormal*dphiLjnormal
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
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...
int ClassId() const override
Unique identifier for serialization purposes.
TPZManVector< REAL, 3 > normal
normal to the element at the integration point
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
Contains the TPZBiharmonic class which implements a discontinuous Galerkin formulation for the bi-har...
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual int ClassId() const override
Unique identifier for serialization purposes.
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
Implements discontinuous Galerkin formulation for the bi-harmonic equation.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Implements integral over element's volume.
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
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...
virtual void Print(std::ostream &out) override
Prints out the data associated with the material.
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 ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Implements boundary conditions for continuous Galerkin.
Contains TPZMatrixclass which implements full matrix (using column major representation).
This class defines the boundary condition for TPZMaterial objects.
int64_t Rows() const
Returns number of rows.
REAL HSize
measure of the size of the element
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to stiffness matrix and load vector at one BC integration point...
int32_t Hash(std::string str)
Contains TPZMatrix<TVar>class, root matrix class.
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
Compute the error due to the difference between the interpolated flux and the flux computed based on ...
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.
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
virtual ~TPZBiharmonic()
Destructor.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
TPZBiharmonic(int nummat, REAL f)
Inicialisation of biharmonic material.
virtual int VariableIndex(const std::string &name) override
virtual std::string Name() override
Returns the name of the material.
#define PZError
Defines the output device to error messages and the DebugStop() function.