11 int IntegrationOrder) :
57 int numbersol = data.
sol.
size();
69 for(
int i = 0; i < nvars; i++){
70 solloc[i] = data.
sol[0][i+nvars];
75 const int nshape = data.
phi.
Rows();
76 for(
int i = 0; i < nshape; i++){
77 for(
int j = 0; j < nshape; j++){
78 for(
int ivi = 0; ivi < nvars; ivi++){
79 const int posI = nvars*i+ivi;
80 const int posJ = nvars*j+ivi;
81 ek(posI, posJ) += weight*
fScale*data.
phi(i,0)*data.
phi(j,0);
84 for(
int ivi = 0; ivi < nvars; ivi++){
85 const int posI = nvars*i+ivi;
86 ef(posI,0) += (STATE)weight*(STATE)
fScale*(STATE)data.
phi(i,0)*solloc[ivi];
99 int numbersol = data.
sol.
size();
100 if (numbersol != 1) {
105 const int vecFuncSize = data.
phi.
Rows();
106 const int nshape = data.
phi.
Cols();
107 if(nvariables != vecFuncSize)
118 for(
int i = 0; i < nshape; i++){
119 for(
int j = 0; j < nshape; j++){
120 for(
int ivi = 0; ivi < nvariables; ivi++){
121 ek(i,j) += weight*
fScale*data.
phi(ivi,i)*data.
phi(ivi,j);
124 for(
int ivi = 0; ivi < nvariables; ivi++){
125 ef(i,0) += (STATE)weight*(STATE)
fScale*(STATE)data.
phi(ivi,i)*solloc[ivi];
134 const int phr = phi.
Rows();
141 for(iv = 0; iv < nvars; iv++){
142 for(in = 0 ; in < phr; in++) {
144 for (jn = 0 ; jn < phr; jn++) {
154 for(iv = 0; iv < nvars; iv++){
155 for(in = 0 ; in < phr; in++) {
156 ef(nvars*in+iv,0) += bc.
Val2()(iv,0) * (STATE)
fScale * (STATE)phi(in,0) * (STATE)weight;
163 std::cout << __PRETTY_FUNCTION__ <<
" at line " << __LINE__ <<
" not implemented\n";
170 if(!strcmp(
"Solution",name.c_str()))
return ESolution;
171 if(!strcmp(
"Derivative",name.c_str()))
return EDerivative;
189 for (
int i=0; i<Sol.
size(); i++) {
196 for (
int i=0; i<
fDim; i++) {
197 Solout[i] = DSol(i,0);
236 STATE diff = (u[0] - u_exact[0]);
238 values[1] = std::real(diff*std::conj(diff));
241 for(
id=0;
id<
fDim;
id++) {
242 diff = (gradu(
id) - du_exact(
id,0));
243 values[2] += std::real(diff*std::conj(diff));
246 values[1] = diff*diff;
250 for(
id=0;
id<
fDim;
id++) {
251 diff = (gradu(
id) - du_exact(
id,0));
252 values[2] += diff*diff;
255 values[0] = values[1]+values[2];
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
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.
int fDim
Problem dimension.
TPZL2Projection(int id, int dim, int nstate, TPZVec< STATE > &sol, int IntegrationOrder=-1)
Class constructor.
virtual void ContributeVecShape(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
int ClassId() const override
Unique identifier for serialization purposes.
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
virtual int VariableIndex(const std::string &name) override
It returns the variable index associated with the name.
Implements a vector class which allows to use external storage provided by the user. Utility.
virtual void Errors(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &, 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...
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...
int fIntegrationOrder
Order for setting the integration rule.
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
It returns the solution associated with the var index based on the finite element approximation...
REAL fScale
Scale factor applied to the stiffness matrix and right hand side.
int fNStateVars
Number of state variables.
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
void SetIsReferred(bool val)
Define if material is referred or not.
MShapeFunctionType fShapeType
Contains the TPZL2Projection class which implements an L2 projection to constant solution values...
REAL val(STATE &number)
Returns value of the variable.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
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 int ClassId() const override
Unique identifier for serialization purposes.
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...
virtual int NEvalErrors()
Returns the number of norm errors. Default is 3: energy, L2 and H1.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
virtual int IntegrationRuleOrder(int elPMaxOrder) const override
Get the order of the integration rule necessary to integrate an element with polinomial order p...
#define DebugStop()
Returns a message to user put a breakpoint in.
This class defines the boundary condition for TPZMaterial objects.
virtual int NStateVariables() const override
Returns number of state variables.
int64_t Rows() const
Returns number of rows.
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...
virtual int NFunctions() const
number of values returned by this function
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.
int32_t Hash(std::string str)
TPZVec< STATE > fSol
Constant solution vector.
~TPZL2Projection()
Default destructor.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
bool fIsReferred
Argument defining this material is a referred material.
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.
int64_t Cols() const
Returns number of cols.
Contains the TPZIntPoints class which defines integration rules.
int64_t NElements() const
Returns the number of elements of the vector.
TPZSolVec sol
vector of the solutions at the integration point
Implements an L2 projection to constant solution values.