42 out <<
"name of material : " <<
Name() <<
"\n";
43 out <<
"fK "<<
fK << std::endl;
44 out <<
"Convection vector " <<
fConvDir[0] <<
"\t" <<
fConvDir[1] << std::endl;
45 out <<
"fXf " <<
fXf << std::endl;
46 out <<
"fSD " <<
fSD << std::endl;
47 out <<
"Base Class properties :";
62 const int nshape = phi.
Rows();
64 STATE FVal = this->
fXf;
74 for(
int in = 0; in < nshape; in++ ) {
75 const REAL gradVBeta = this->fConvDir[0] * dphi(0,in) + this->fConvDir[1] * dphi(1,in);
76 ef(in, 0) += weight * FVal * ( phi(in,0) + this->
fSD*(0.5*h/normaConveccao)*gradVBeta );
77 for(
int jn = 0; jn < nshape; jn++ ) {
78 ek(in,jn) += weight * (
79 +
fK * ( dphi(0,in) * dphi(0,jn) + dphi(1,in) * dphi(1,jn) )
80 - ( (dphi(0,in) * phi(jn)) * fConvDir[0] + (dphi(1,in) * phi(jn)) * fConvDir[1] )
81 + this->
fSD*(0.5*h/normaConveccao)*(
82 (fConvDir[0]*dphi(0,jn))*(fConvDir[0]*dphi(0,in)) +
83 (fConvDir[1]*dphi(1,jn))*(fConvDir[1]*dphi(1,in)) )
93 const int nshape = phi.
Rows();
94 STATE v2 = bc.
Val2()(0,0);
104 for(
int in = 0 ; in < nshape; in++) {
105 ef(in,0) += weight *
gBigNumber* phi(in,0) * v2;
106 for (
int jn = 0 ; jn < nshape; jn++) {
107 ek(in,jn) += weight *
gBigNumber * phi(in,0) * phi(jn,0);
112 for(
int in = 0 ; in < nshape; in++) {
113 ef(in,0) += weight * v2 * phi(in,0);
118 normal[0] = axes(0,1);
119 normal[1] = axes(1,1);
121 REAL ConvNormal = 0.;
122 for(
int id = 0;
id < 2;
id++) ConvNormal +=
fConvDir[
id]*normal[
id];
124 for(
int il = 0; il < nshape; il++){
125 for(
int jl = 0; jl < nshape; jl++){
126 ek(il,jl) += weight * ConvNormal * phi(il)*phi(jl);
131 if (ConvNormal < 0.) std::cout <<
"Boundary condition error: inflow detected in outflow boundary condition: ConvNormal = " << ConvNormal <<
"\n";
139 if(!strcmp(
"Solution",name.c_str()))
return 1;
140 if(!strcmp(
"Derivative",name.c_str()))
return 2;
145 if(var == 1)
return 1;
146 if(var == 2)
return 2;
155 Solout[0] = data.
sol[0][0];
161 for(
int id = 0 ;
id < 2;
id++) {
162 Solout[id] = dsoldx(
id,0);
176 values[1] = (u[0] - u_exact[0])*(u[0] - u_exact[0]);
179 for(
int i = 0; i < 2; i++){
180 values[2] += (dudx(i,0) - du_exact(i,0))*(dudx(i,0) - du_exact(i,0));
183 values[0] = values[1]+values[2];
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.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
void
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
Implements a vector class which allows to use external storage provided by the user. Utility.
clarg::argBool bc("-bc", "binary checkpoints", false)
REAL fConvDir[2]
Convection vector.
virtual std::string Name() override
Returns the name of the material.
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
void Errors(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, 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...
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
clarg::argBool h("-h", "help message", false)
STATE fK
Coeficient which multiplies the Laplacian operator.
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.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
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.
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.
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 ClassId() const override
Define the class id associated with the class.
This class defines the boundary condition for TPZMaterial objects.
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
virtual void Print(std::ostream &out) override
Prints out the data associated with the material.
int64_t Rows() const
Returns number of rows.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
REAL HSize
measure of the size of the element
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.
virtual int Dimension() const override
Returns the integrable dimension of the material.
int32_t Hash(std::string str)
virtual ~TPZLinearConvecDiff()
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.
int64_t Cols() const
Returns number of cols.
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...
Convecção-difusão linear 2D.
STATE fXf
Forcing function value.
STATE fSD
Multiplication value for the streamline diffusion term.
TPZSolVec sol
vector of the solutions at the integration point
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...