21 static LoggerPtr logger(Logger::getLogger(
"pz.material"));
53 out << __PRETTY_FUNCTION__ << std::endl;
59 if(!strcmp(name.c_str(),
"state"))
return 0;
60 if(!strcmp(name.c_str(),
"State"))
return 0;
61 if(!strcmp(name.c_str(),
"Solution"))
return 0;
70 if(index == 0)
return 3;
89 this->
Solution(data,dataleftvec,datarightvec, var, Solout);
94 this->
Solution(data,dataleftvec,datarightvec, var, Solout, left, right);
99 if(var == 0) Solout = Sol;
103 for(
int i=0; i<
fDim; i++){
131 int nref=datavec.
size();
148 if (fDim < 1 || fDim >3) {
160 if (fDim < 1 || fDim >3) {
184 std::cout <<
"Please implement this extension\n";
196 for(
int iq=0; iq<phrq; iq++)
202 for(
int id=0;
id<3;
id++){
206 for (
int i=0; i<3; i++) {
207 ff += ivec(i,0)*force[i];
210 ef(iq,0) += weight*ff*phiQ(ishapeind,0);
212 for (
int jq=0; jq<phrq; jq++)
218 for(
int id=0;
id<3;
id++){
223 REAL prod1 = ivec(0,0)*jvec(0,0) + ivec(1,0)*jvec(1,0) + ivec(2,0)*jvec(2,0);
224 ek(iq,jq) += weight*phiQ(ishapeind,0)*phiQ(jshapeind,0)*prod1;
234 int phrq = phiQ.
Rows();
251 for(
int iq=0; iq<phrq; iq++)
254 ef(iq,0) += STATE(-1.)*v2*phiQ(iq,0)*weight;
260 for(
int iq=0; iq<phrq; iq++)
263 for (
int jq=0; jq<phrq; jq++) {
265 ek(iq,jq)+=
gBigNumber*phiQ(iq,0)*phiQ(jq,0)*weight;
271 for(
int iq = 0; iq < phrq; iq++) {
273 ef(iq,0) += v2*phiQ(iq,0)*weight;
274 for (
int jq = 0; jq < phrq; jq++) {
275 ek(iq,jq) += weight*bc.
Val1()(0,0)*phiQ(iq,0)*phiQ(jq,0);
294 if(logger->isDebugEnabled()){
295 std::stringstream sout;
297 sout <<
" Pto " << data.
x << std::endl;
298 sout<<
" ---- "<<std::endl;
299 sout<<
" fluxo exato " <<du_exact(0,0)<<
", " << du_exact(1,0)<<std::endl;
300 sout<<
" fluxo aprox " <<dsol<<std::endl;
301 sout<<
" ---- "<<std::endl;
302 if(du_exact.
Rows()>
fDim) sout<<
" div exato " <<du_exact(2,0)<<std::endl;
303 sout<<
" div aprox " <<div<<std::endl;
310 for(
int id=0;
id<
fDim;
id++) {
311 REAL diffFlux =
fabs(dsol[
id] - du_exact(
id,0));
312 values[0] += diffFlux*diffFlux;
316 REAL diffDiv =
fabs(div[0] - du_exact(fDim,0));
317 values[1]=diffDiv*diffDiv;
319 values[2]= values[0]+values[1];
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
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.
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
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 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...
Templated vector implementation.
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout) override
Returns the solution associated with the var index based on the finite element approximation.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
Declarates the TPZBlock<REAL>class which implements block matrices.
virtual ~TPZVecL2()
Default destructor.
REAL val(STATE &number)
Returns value of the variable.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
void ErrorsHdiv(TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values) override
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
int fNState
Number of state variables.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
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 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.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
This abstract class defines the behaviour which each derived class needs to implement.
virtual void Write(const bool val)
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZFNMatrix< 180 > fNormalVec
list of normal vectors
#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.
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
TPZFMatrix< STATE > & Val1()
TPZVecL2()
Default constructor.
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
virtual int HasForcingFunction()
Directive that gives true if the material has a forcing function.
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)
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
int ClassId() const override
Unique identifier for serialization purposes.
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.
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.
virtual void Print(std::ostream &out=std::cout) override
Prints out the data associated with the material.
Contains the TPZIntPoints class which defines integration rules.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
virtual int ClassId() const override
Unique identifier for serialization purposes.
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
TPZManVector< std::pair< int, int64_t > > fVecShapeIndex
correspondence between normal vector index and index of the shape functions
TPZVecL2 & operator=(const TPZVecL2 &mat)
Defines the interface of a computational element. Computational Element.
TPZSolVec sol
vector of the solutions at the integration point
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...
int fDim
Problem dimension.
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...
virtual void Read(bool &val)