22 static LoggerPtr logger(Logger::getLogger(
"pz.material"));
92 int nref = datavec.
size();
93 for(
int i = 0; i<nref; i++ )
95 datavec[i].SetAllRequirements(
true);
96 datavec[i].fNeedsNeighborSol =
false;
97 datavec[i].fNeedsNeighborCenter =
false;
98 datavec[i].fNeedsNormal =
false;
104 out << __PRETTY_FUNCTION__ << std::endl;
105 out << std::endl <<
"Material Id = " <<
fId << std::endl;
108 out <<
"Big number " <<
gBigNumber << std::endl;
111 out <<
"Has no forcing function\n";
114 out <<
"Forcing function\n";
118 out <<
"Has no exact forcing function\n";
121 out <<
"Forcing function exact\n";
125 out <<
"Has no time dependent forcing function\n";
128 out <<
"Time dependent forcing function\n";
132 out <<
"No time dependent forcing function exact\n";
135 out <<
"Time dependent forcing function exact\n";
142 if(!strcmp(name.c_str(),
"state"))
return 0;
143 if(!strcmp(name.c_str(),
"State"))
return 0;
144 if(!strcmp(name.c_str(),
"Solution"))
return 0;
145 if(!strcmp(name.c_str(),
"GradState"))
return 1;
146 if(!strcmp(name.c_str(),
"POrder"))
return 99;
147 if(!strcmp(name.c_str(),
"Error"))
return 100;
148 if(!strcmp(name.c_str(),
"TrueError"))
return 101;
149 if(!strcmp(name.c_str(),
"EffectivityIndex"))
return 102;
151 if(!strcmp(name.c_str(),
"L2Error"))
return 103;
152 if(!strcmp(name.c_str(),
"SemiH1Error"))
return 104;
153 if(!strcmp(name.c_str(),
"H1Error"))
return 105;
155 if(!strcmp(name.c_str(),
"L2ErrorPerArea"))
return 106;
156 if(!strcmp(name.c_str(),
"SemiH1ErrorPerArea"))
return 107;
157 if(!strcmp(name.c_str(),
"H1ErrorPerArea"))
return 108;
158 if(!strcmp(name.c_str(),
"dudxErrorPerArea"))
return 109;
159 if(!strcmp(name.c_str(),
"dudyErrorPerArea"))
return 110;
160 if(!strcmp(name.c_str(),
"ContDisc"))
return 111;
161 if(!strcmp(name.c_str(),
"MaterialId"))
return 98;
168 std::stringstream sout;
169 sout <<
"Variable " << name <<
" not found";
182 if(index == 99 || index == 98)
return 1;
183 if(index == 100)
return 1;
184 if(index == 101)
return 1;
185 if(index == 102)
return 1;
186 if (index == 103)
return 1;
187 if (index == 104)
return 1;
188 if (index == 105)
return 1;
189 if (index == 106)
return 1;
190 if (index == 107)
return 1;
191 if (index == 108)
return 1;
192 if (index == 109)
return 1;
193 if (index == 110)
return 1;
194 if (index == 111)
return 1;
195 PZError <<
"TPZMaterial::NSolutionVariables called index = " << index <<
"\n";
202 if (numbersol != 1) {
209 int nvec = datavec.
size();
212 for (
int iv=0; iv<nvec; iv++) {
220 Solution(datavec[dataindex], var, Solout);
228 this->
Solution(data,dataleftvec,datarightvec, var, Solout);
233 this->
Solution(data,dataleftvec,datarightvec, var, Solout, left, ritgh);
239 Solout[0] = this->
Id();
245 Solout[0] = Sol[0].real();
246 Solout[1] = Sol[0].imag();
248 else if(var == 99 || var == 100 || var == 101 || var == 102) {
249 PZError <<
"TPZMaterial var = "<< var <<
" the element should treat this case\n";
250 Solout[0] = Sol[0].real();
257 if(var == 0) Solout = Sol;
258 else if(var == 99 || var == 100 || var == 101 || var == 102) {
259 PZError <<
"TPZMaterial var = "<< var <<
" the element should treat this case\n";
264 int64_t nsol = Sol.
size();
266 int64_t dim = axes.
Rows();
267 for (int64_t is=0; is<nsol; is++) {
268 for (int64_t d=0; d<dim; d++) {
269 for (int64_t jco=0; jco<3; jco++) {
270 Solout[jco+3*is] += axes(d,jco)*DSol(d,is);
283 return new TPZBndCond(reference,
id,typ,val1,val2);
287 PZError <<
"TPZMaterial::SetData is called.\n";
292 PZError <<
"TPZMaterial::NewMaterial is called.\n";
307 int nref=datavec.
size();
310 for (
int ir = 0; ir < nref; ir++) {
311 int nphis=datavec[ir].phi.Rows();
312 if (datavec[ir].phi.Rows()) {
318 this->
Contribute(datavec[onemat], weight, ek,ef);
328 int nref=datavec.
size();
340 std::map<int, TPZMaterial * >::iterator matit;
341 matit = matvec.find(matid);
342 if(matit != matvec.end())
return;
344 matvec[matid] = newmat;
356 int pmax = elPMaxOrder;
357 int integrationorder = 2*pmax;
359 integrationorder = order+pmax;
361 return integrationorder;
371 for (
int ip = 0; ip < elPMaxOrder.
size(); ip++) {
372 if (elPMaxOrder[ip] > pmax) pmax = elPMaxOrder[ip];
374 int integrationorder = 2 * pmax;
376 integrationorder = order + pmax;
379 return integrationorder;
383 return Hash(
"TPZMaterial");
bool fLinearContext
Defines whether the equation context is linear solver or non linear.
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
int fNumLoadCases
Defines the number of load cases generated by this material.
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)
bool fNeedsNeighborCenter
TPZAutoPointer< TPZFunction< STATE > > fBCForcingFunction
Pointer to bc forcing function, it is a variable boundary condition at differential equation...
virtual void resize(const int64_t newsize)
virtual void Print(std::ostream &out)
Print a brief statement.
virtual TPZMaterial * NewMaterial()
To create another material of the same type.
Templated vector implementation.
TPZMaterial & operator=(const TPZMaterial ©)
operator =
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
void SetAllRequirements(bool set)
Set all flags at once.
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
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.
This class implements a simple vector storage scheme for a templated class T. Utility.
TPZMaterial()
Default constructor.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)=0
It computes a contribution to the stiffness matrix and load vector at one integration point...
virtual void Print(std::ostream &out=std::cout)
Prints out the data associated with the material.
int fPostProcIndex
indicates which solution should be used for post processing
This abstract class defines the behaviour which each derived class needs to implement.
static TPZAutoPointer< TPZSavable > GetAutoPointer(const int64_t &objId)
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
TPZAutoPointer< TPZFunction< STATE > > fTimedependentBCForcingFunction
Pointer to time dependent bc forcing function, it is a variable boundary condition at differential eq...
int64_t size() const
Returns the number of elements of the vector.
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 IntegrationRuleOrder(int elPMaxOrder) const
Gets the order of the integration rule necessary to integrate an element with polinomial order p...
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual void Write(const bool val)
virtual void FillDataRequirements(TPZMaterialData &data)
Fill material data parameter with necessary requirements for the.
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunctionExact
Pointer to exact solution function, needed to calculate exact error.
This class defines the boundary condition for TPZMaterial objects.
TPZVec< void(*)(const TPZVec< REAL > &, TPZVec< STATE > &) > GFORCINGVEC
Extern variable - Vector of force values.
int64_t Rows() const
Returns number of rows.
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
virtual ~TPZMaterial()
Default destructor.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc)=0
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
static REAL gBigNumber
Big number to penalization method, used for Dirichlet conditions.
int32_t Hash(std::string str)
TPZAutoPointer< TPZFunction< STATE > > fTimedependentFunctionExact
Pointer to time dependent exact solution function, needed to calculate exact error.
int ClassId() const override
Unique identifier for serialization purposes.
virtual TPZBndCond * CreateBC(TPZMaterial *reference, int id, int typ, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
Creates an object TPZBndCond derived of TPZMaterial.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
virtual void Clone(std::map< int, TPZMaterial * > &matvec)
Creates a copy of the material object and put it in the vector which is passed on.
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.
Contains the TPZIntPoints class which defines integration rules.
Defines the interface for saving and reading data. Persistency.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
void SetLinearContext(bool IsLinear)
Sets fLinearContext attribute.
Defines the interface of a computational element. Computational Element.
TPZSolVec sol
vector of the solutions at the integration point
virtual int PolynomialOrder() const
Polynomial order of this function. In case of non-polynomial function it can be a reasonable approxim...
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
#define PZError
Defines the output device to error messages and the DebugStop() function.
virtual void Read(bool &val)
virtual void SetData(std::istream &data)
Reads data of the material from a istream (file data)
TPZAutoPointer< TPZFunction< STATE > > fTimeDependentForcingFunction
Pointer to time dependent forcing function, it is the right member at differential equation...