11 static LoggerPtr postprocLogger(Logger::getLogger(
"material.pzPostProcMat"));
34 std::cout <<
"TPZPostProcMat:: Material Id = " <<
Id() <<
", it is being deleted. " << std::endl;
42 out <<
"\n Base material Data:\n";
44 out <<
"Dimension " <<
fDimension << std::endl;
46 out <<
"\n Post Process Variables\n";
47 for(int64_t i = 0; i < nVars; i++)
49 out <<
fVars[i].fName <<
" of size " <<
fVars[i].fNumEq <<
" and index " <<
fVars[i].fIndex << std::endl;
59 while(i < nVars && strcmp(
fVars[i].fName.c_str(), name.c_str()))i++;
63 PZError <<
"TPZPostProcMat::Variable " << name <<
" not found\n";
67 return fVars[i].fIndex;
76 while(i < nVars && var !=
fVars[i].fIndex)i++;
78 if(i >= nVars)
return -1;
80 return fVars[i].fNumEq;
86 for(i = 0; i < nVars; i++) size +=
fVars[i].fNumEq;
95 std::stringstream sout;
96 sout <<
">>> TPZPostProcMat::Solution() *** called for variable index = " << var;
105 while(i < nVars && var !=
fVars[i].fIndex)
107 offset +=
fVars[i].fNumEq;
111 if(i >= nVars)
return;
113 int64_t numeq =
fVars[i].fNumEq;
117 for(i = 0; i < numeq; i++)Solout[i] = data.
sol[0][offset+i];
127 int64_t nshape = phi.
Rows();
130 for(i = 0; i < nshape; i++)
131 for(j = 0; j < nshape; j++)
132 ek(i,j) += phi(i,0) * phi(j,0);
134 for(i = 0; i < nstate; i++)
136 int64_t eqOffset = i*nshape;
137 for(i_var = 0; i_var < nshape; i_var++)
138 ef(eqOffset+i_var,0) += (STATE)phi(i_var,0) * sol[i];
144 PZError <<
"Error at " << __PRETTY_FUNCTION__ <<
" TPZPostProcMat::Contribute(ef) should never be called\n";
150 PZError <<
"Error at " << __PRETTY_FUNCTION__ <<
" TPZPostProcMat::ContributeBC() should never be called\n";
167 return "TPZPostProcMat";
198 for(i = 0; i < n; i++)varIndexList[i] =
fVars[i].fIndex;
205 PZError <<
"Error at " << __PRETTY_FUNCTION__ <<
" TPZPostProcMat::SetPostProcessVarIndexList() without valid reference material to post process\n";
209 int64_t i, n = varIndexNames.
NElements(), k = 0;
213 for(i = 0; i < n; i++)
218 fVars[k].fIndex = varindex;
220 fVars[k].fName = varIndexNames[i];
236 return Hash(
"TPZPostProcVar");
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
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 ...
int ClassId() const override
Define the class id associated with the class.
int ClassId() const override
Unique identifier for serialization purposes.
TPZPostProcMat()
Default constructor.
TPZManVector< TPZPostProcVar, 20 > fVars
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.
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
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...
void SetPostProcessVarIndexList(TPZVec< std::string > &varIndexNames, TPZMaterial *pRefMat)
Informs the vector with all the variable indexes requested for post processing and the reference to t...
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...
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
void Read(TPZStream &buf, void *context) override
read objects from the stream
void SetAllRequirements(bool set)
Set all flags at once.
virtual int Dimension() const =0
Returns the integrable dimension of the material.
virtual ~TPZPostProcMat()
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...
virtual void FillDataRequirements(TPZMaterialData &data) override
Defining what parameters the material needs. In particular this material needs the evaluation of norm...
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
virtual int ClassId() const override
Unique identifier for serialization purposes.
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
virtual void Read(TPZStream &buf, void *context) override
Read the element data from a stream.
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...
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
returns the variable index associated with the name
virtual void Write(const bool val)
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
virtual void FillDataRequirements(TPZMaterialData &data)
Fill material data parameter with necessary requirements for the.
#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.
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...
virtual void Print(std::ostream &out=std::cout) override
print out the data associated with the material
int32_t Hash(std::string str)
void GetPostProcessVarIndexList(TPZVec< int > &varIndexList)
Returns a vector with all the variable indexes requested for post processing and an the total number ...
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
virtual int Dimension() const override
returns the integrable dimension of the material
virtual int NStateVariables() const override
returns the number of state variables associated with the material
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
virtual std::string Name() override
returns the name of the material
virtual int NSolutionVariables(int var) override
returns the number of variables associated with the variable indexed by var. var is obtained by calli...
TPZSolVec sol
vector of the solutions at the integration point
Implements an interface to register a class id and a restore function. Persistence.
#define PZError
Defines the output device to error messages and the DebugStop() function.
virtual void Read(bool &val)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.