19 static LoggerPtr logger(Logger::getLogger(
"pz.material.tpzmattest3d"));
46 std::stringstream sout;
47 sout <<
" Name of material : " <<
Name() <<
"properties: " ;
49 sout <<
" Common properties: " ;
67 for(
int in = 0; in < phr; in++ )
69 ef(in, 0) += weight *
fXf(0,0) * phi(in, 0);
70 for(
int jn = 0; jn < phr; jn++ )
72 ek(in,jn) += weight * phi(in,0) * phi(jn,0);
78 for(
int in = 0; in < phr; in++ )
80 ef(in, 0) += weight *
fXf(0,0) * phi(in, 0);
81 for(
int jn = 0; jn < phr; jn++ )
83 ek(in,jn) += weight * ( dphi(0,in) * dphi(0,jn) + dphi(1,in) * dphi(1,jn) );
84 if(dphi.
Rows() == 3) ek(in,jn) += weight * dphi(2,in) * dphi(2,jn);
98 v2[0] = bc.
Val2()(0,0);
104 for(in = 0 ; in < phr; in++)
106 ef(in,0) +=
gBigNumber * v2[0] * phi(in,0) * weight;
107 for (jn = 0 ; jn < phr; jn++)
109 ek(in,jn) +=
gBigNumber * phi(in,0) * phi(jn,0) * weight;
116 for(in = 0 ; in < phi.
Rows(); in++)
118 ef(in,0) += v2[0] * phi(in,0) * weight;
124 for(in = 0 ; in < phi.
Rows(); in++)
126 ef(in, 0) += v2[0] * phi(in, 0) * weight;
127 for (jn = 0 ; jn < phi.
Rows(); jn++)
130 ek(in,jn) += bc.
Val1()(0,0) * phi(in,0) * phi(jn,0) * weight;
140 if(!strcmp(
"Displacement6",name.c_str()))
return 0;
141 if(!strcmp(
"Solution",name.c_str()))
return 1;
142 if(!strcmp(
"Derivate",name.c_str()))
return 2;
148 if(var == 0 || var == 1 || var == 2 || var == 10)
return 1;
156 if(var == 0 || var == 1) Solout[0] = Sol[0];
159 Solout[0] = DSol(0,0);
160 Solout[1] = DSol(1,0);
161 if(DSol.
Rows()>2) Solout[2] = DSol(2,0);
171 LOGPZ_WARN( logger,
"ERROR - Not Implemented yet!");
184 STATE
dx = du_exact(0,0)*axes(0,0)+du_exact(1,0)*axes(0,1);
185 STATE dy = du_exact(0,0)*axes(1,0)+du_exact(1,0)*axes(1,1);
186 STATE parc1 =
fabs(dx-dudx(0,0));
187 STATE parc2 =
fabs(dy-dudx(1,0));
189 values[1] =
pow(
fabs(u[0] - u_exact[0]),(STATE)2.0);
191 values[2] =
pow(parc1,(STATE)2.)+
pow(parc2,(STATE)2.);
193 values[0] = values[1]+values[2];
197 values[1] =
pow(sol[0] - u_exact[0],(STATE)2.0);
199 values[2] =
pow(dsol[0] - du_exact(0,0),(STATE)2.0);
200 if(dudx.
Rows()>1) values[2] +=
pow(dsol[1] - du_exact(1,0),(STATE)2.0);
201 if(dudx.
Rows()>2) values[2] +=
pow(dsol[2] - du_exact(2,0),(STATE)2.0);
203 values[0] = values[1]+values[2];
231 buf.
Read( &classid,1 );
234 std::stringstream sout;
235 sout <<
"Error restoring object " << __PRETTY_FUNCTION__
236 <<
" waiting for ClassId() = " <<
ClassId()
237 <<
" restored : " << classid;
250 buf.
Write( &classid,1 );
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 int ClassId() const override
Define the class id associated with the class.
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...
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 the object data structure.
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
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
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 std::string Name() override
Returns the name of the material.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
Declarates the TPZBlock<REAL>class which implements block matrices.
#define LOGPZ_WARN(A, B)
Define log for warnings.
static int geq3
Cedric : para testes no programa main 3dmaterial.c.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
void SetMaterial(TPZFMatrix< STATE > &xfin)
Set the flow.
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...
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
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 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...
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
expr_ dx(i) *cos(expr_.val())
virtual void Write(const bool val)
Contains TPZMatrixclass which implements full matrix (using column major representation).
Implements a three dimensional linear material for test.
Contains the TPZMaterialTest3D class. Three-dimensional test.
This class defines the boundary condition for TPZMaterial objects.
virtual int Dimension() const override
Returns the integrable dimension of the material.
int64_t Rows() const
Returns number of rows.
TPZFMatrix< STATE > & Val1()
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
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.
TPZMaterialTest3D()
Default empty constructor.
int ClassId() const override
Unique identifier for serialization purposes.
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.
void Read(TPZStream &buf, void *context) override
read objects from the stream
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.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
TPZFMatrix< STATE > fXf
Source.
virtual void Print(std::ostream &out) const
Defines the interface for saving and reading data. Persistency.
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
virtual void Read(TPZStream &buf, void *context) override
read objects from the stream
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual ~TPZMaterialTest3D()
Destructor.
Implements an interface to register a class id and a restore function. Persistence.
virtual void Read(bool &val)
virtual void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.