63 int ndata = datavec.
size();
64 for (
int idata=0; idata < ndata ; idata++) {
65 datavec[idata].SetAllRequirements(
false);
66 datavec[idata].fNeedsSol =
true;
72 int ndata = datavec.
size();
73 for (
int idata=0; idata < ndata ; idata++) {
74 datavec[idata].SetAllRequirements(
false);
75 datavec[idata].fNeedsSol =
true;
101 int nphi_p = phi.
Rows();
111 for (
int ip = 0; ip < nphi_p; ip++) {
113 STATE dp_dot_dphi_i = 0.0;
114 for (
int i = 0; i < dim; i++) {
115 dp_dot_dphi_i += dpdx[i]*dphix(i,ip);
118 ef(ip,0) += weight * (dp_dot_dphi_i - f[0] * phi(ip,0));
120 for (
int jp = 0; jp < nphi_p; jp++) {
122 STATE dphi_j_dot_dphi_i = 0.0;
123 for (
int i = 0; i < this->
Dimension(); i++) {
124 dphi_j_dot_dphi_i += dphix(i,jp)*dphix(i,ip);
127 ek(ip,jp) += weight * dphi_j_dot_dphi_i;
143 int nphi_p = phi.
Rows();
151 for (
int ip = 0; ip < nphi_p; ip++) {
153 STATE dp_dot_dphi_i = 0.0;
154 for (
int i = 0; i < this->
Dimension(); i++) {
155 dp_dot_dphi_i += dpdx[i]*dphix(i,ip);
158 ef(ip,0) += weight * (dp_dot_dphi_i - f[0] * phi(ip,0));
171 int nphi_p = phi.
Rows();
174 bc_data[0] = bc.
Val2()(0,0);
182 STATE p_D = bc_data[0];
183 for(
int ip = 0 ; ip < nphi_p; ip++) {
184 ef(ip,0) += weight *
gBigNumber * ( p[0] - p_D ) * phi(ip,0);
190 STATE q_N = bc_data[0];
191 for(
int ip = 0 ; ip < nphi_p; ip++) {
192 ef(ip,0) += weight * q_N * phi(ip,0);
197 PZError << __PRETTY_FUNCTION__ <<
" at line " << __LINE__ <<
" - Error! boundary condition not implemented\n";
211 int nphi_p = phi.
Rows();
214 bc_data[0] = bc.
Val2()(0,0);
223 STATE p_D = bc_data[0];
224 for(
int ip = 0 ; ip < nphi_p; ip++) {
225 ef(ip,0) += weight *
gBigNumber * ( p[0] - p_D ) * phi(ip,0);
226 for (
int jp = 0 ; jp < nphi_p; jp++) {
227 ek(ip,jp) += gBigNumber * phi(ip,0) * phi(jp,0) * weight;
234 STATE q_N = bc_data[0];
235 for(
int ip = 0 ; ip < nphi_p; ip++) {
236 ef(ip,0) += weight * q_N * phi(ip,0);
241 PZError << __PRETTY_FUNCTION__ <<
" at line " << __LINE__ <<
" - Error! boundary condition not implemented\n";
280 if(!strcmp(
"q",name.c_str()))
return 1;
281 if(!strcmp(
"p",name.c_str()))
return 2;
282 if(!strcmp(
"q_exact",name.c_str()))
return 3;
283 if(!strcmp(
"p_exact",name.c_str()))
return 4;
284 if(!strcmp(
"f_exact",name.c_str()))
return 5;
291 if(var == 2)
return 1;
293 if(var == 4)
return 1;
294 if(var == 5)
return 1;
305 for (
int i=0; i < this->
Dimension(); i++)
307 Solout[i] = -data.
dsol[0][i];
313 Solout[0] = data.
sol[0][0];
324 for (
int i=0; i < this->
Dimension(); i++)
366 STATE p_error = u[0] - u_exact[0];
367 error[0] = p_error*p_error;
370 for(
int i = 0; i < this->
Dimension(); i++) {
371 STATE d_error = du(i,0) - du_exact(i,0);
372 error[1] += d_error*d_error;
virtual void Write(TPZStream &buf, int withclassid) const override
write class in disk
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
int VariableIndex(const std::string &name) override
Variable index based on variable naming.
void Print(std::ostream &out) override
print all material information
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
void Errors(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &du, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &error) override
Compute errors, no comments!!!
Implements a vector class which allows to use external storage provided by the user. Utility.
clarg::argBool bc("-bc", "binary checkpoints", false)
int NEvalErrors() override
Number of errors being computed = { 0-> h1, 1 ->L2 primal, 2 L2 dual}.
virtual int NStateVariables() const override
return the number of state variables associated with each trial function
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
void SetAllRequirements(bool set)
Set all flags at once.
TPZPrimalPoisson & operator=(const TPZPrimalPoisson &other)
assignment operator
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
void FillBoundaryConditionDataRequirement(int type, TPZMaterialData &data) override
fill requirements for bounadry contribute methods
This class implements a simple vector storage scheme for a templated class T. Utility.
TPZMaterial * NewMaterial() override
return a material object from a this object
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Boundary contribute with jacobian matrix.
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.
This abstract class defines the behaviour which each derived class needs to implement.
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.
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...
void FillDataRequirements(TPZMaterialData &data) override
fill requirements for volumetric contribute methods
#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.
virtual int HasForcingFunctionExact()
Directive that gives true if the material has a function exact.
int64_t Rows() const
Returns number of rows.
virtual int HasForcingFunction()
Directive that gives true if the material has a forcing function.
static REAL gBigNumber
Big number to penalization method, used for Dirichlet conditions.
std::string Name() override
print material name
int32_t Hash(std::string str)
int ClassId() const override
Unique identifier for serialization purposes.
void Read(TPZStream &buf, void *context) override
write class from disk
virtual int ClassId() const override
unique class identifier
int Dimension() const override
return the euclidean dimension of the weak statement
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout) override
Postprocess required variables.
void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Volumetric contribute with jacobian matrix.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
This material consider exactly just laplace equation (i.e. coefficient equal to 1) ...
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.
Defines the interface for saving and reading data. Persistency.
~TPZPrimalPoisson()
default desconstructor
TPZSolVec sol
vector of the solutions at the integration point
TPZPrimalPoisson()
default constructor
int NSolutionVariables(int var) override
size of the current variable (1 -> scalar, 3-> vector, 9 -> Tensor )
#define PZError
Defines the output device to error messages and the DebugStop() function.