95 out <<
"name of material : " <<
Name() <<
"\n";
96 out <<
"Dimesion of problem " <<
fDim << endl;
97 out <<
"Coeficient that multiply temporal derivative "<<
fRho << endl;
98 out <<
"Term of convection direction "<<
fConvDir << endl;
99 out <<
"Forcing vector f " <<
fXf << endl;
100 out <<
"Time step " <<
fTimeStep << endl;
101 out <<
"Base Class properties :";
113 int phr = phi.
Rows();
125 for(
int in = 0; in < phr; in++ ) {
127 ef(in, 0) +=
fTimeStep*weight*fXfLoc*phi(in,0);
129 for(
int jn = 0; jn < phr; jn++ )
131 ek(in,jn) += weight*
fRho*phi(in,0)*phi(jn,0);
143 for(
int in = 0; in < phr; in++) {
145 for(
int jn = 0; jn < phr; jn++)
147 ek(in,jn) += weight*
fRho*phi(in,0)*phi(jn,0);
156 for(di=0; di<
fDim; di++){
157 for(dj=0; dj<
fDim; dj++){
158 ConvDirAx[di] += axes(di,dj)*
fConvDir[dj];
163 for(
int in = 0; in < phr; in++) {
165 for(
int jn = 0; jn < phr; jn++)
167 ek(in,jn) += weight*
fRho*phi(in,0)*phi(jn,0);
183 std::cout<<
" This class uses only discontinuous functions"<<std::endl;
207 int nrowl = phiL.
Rows();
208 int nrowr = phiR.
Rows();
212 REAL ConvNormal = 0.;
213 for(
id=0;
id<
fDim;
id++) ConvNormal +=
fConvDir[
id]*normal[
id];
216 for(il=0; il<nrowl; il++)
218 for(jl=0; jl<nrowl; jl++)
220 ek(il,jl) += (-1.)*weight*(
fTimeStep*ConvNormal*phiL(il,0)*phiL(jl,0));
223 for(ir=0; ir<nrowr; ir++)
225 for(jl=0; jl<nrowl; jl++)
227 ek(ir+nrowl,jl) -= (-1.)*weight*(
fTimeStep*ConvNormal*phiR(ir,0)*phiL(jl,0));
231 for(ir=0; ir<nrowr; ir++)
233 for(jr=0; jr<nrowr; jr++)
235 ek(ir+nrowl,jr+nrowl) -= (-1.)*weight*(
fTimeStep*ConvNormal*phiR(ir,0)*phiR(jr,0));
238 for(il=0; il<nrowl; il++)
240 for(jr=0; jr<nrowr; jr++)
242 ek(il,jr+nrowl) += (-1.)*weight*(
fTimeStep*ConvNormal*phiL(il,0)*phiR(jr,0));
261 REAL ConvNormal = 0.;
263 for(
id=0;
id<
fDim;
id++) ConvNormal +=
fConvDir[
id]*normal[
id];
271 for(il=0; il<nrowl; il++){
272 for(jl=0; jl<nrowl; jl++)
274 ek(il,jl) += weight*
fTimeStep*ConvNormal*phiL(il)*phiL(jl);
279 for(il=0; il<nrowl; il++)
281 ef(il,0) -= weight*
fTimeStep*ConvNormal*bc.
Val2()(0,0)*phiL(il);
289 for(il=0; il<nrowl; il++) {
295 if(ConvNormal > 0.) {
296 for(il=0; il<nrowl; il++) {
297 for(jl=0; jl<nrowl; jl++) {
298 ek(il,jl) += weight*
fTimeStep*ConvNormal*phiL(il)*phiL(jl);
303 if (ConvNormal < 0.) std::cout <<
"Boundary condition error: inflow detected in outflow boundary condition: ConvNormal = " << ConvNormal <<
"\n";
308 PZError << __PRETTY_FUNCTION__ <<
" - Wrong boundary condition type\n";
315 if(!strcmp(
"Solution",name.c_str()))
return 1;
316 if(!strcmp(
"ConvDirGradU",name.c_str()))
return 2;
317 if(!strcmp(
"Derivative",name.c_str()))
return 3;
318 if(!strcmp(
"Flux",name.c_str()))
return 4;
319 if(!strcmp(
"ExactSolution",name.c_str()))
return 5;
325 if((var == 1) || (var == 2)|| (var == 5))
return 1;
326 if((var == 3) || (var == 4))
return fDim;
341 DSol_u = data.
dsol[0];
346 Solout[0] = Sol_u[0];
352 for(
id=0 ;
id<
fDim;
id++) {
355 Solout[0] +=
fConvDir[id]*dsoldx(
id,0);
362 for(
id=0 ;
id<
fDim;
id++) {
365 Solout[id] = dsoldx(
id,0);
372 for(
id=0 ;
id<
fDim;
id++) {
381 Solout[0] = ExactSol[0];
397 data.
dsol[0].Redim(dim,nstate);
409 diff =
fabs(sol[0] - u_exact[0]);
410 values[1] = diff*diff;
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
int ClassId() const override
Unique identifier for serialization purposes.
REAL fXf
Forcing function value.
TPZManVector< REAL, 3 > normal
normal to the element at the integration point
virtual ~TPZMatConvectionProblem()
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.
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)
TPZMatConvectionProblem & operator=(const TPZMatConvectionProblem ©)
virtual void resize(const int64_t newsize)
TPZMaterial & operator=(const TPZMaterial ©)
operator =
void SetInternalFlux(REAL flux)
void GetParameters(REAL &rho, TPZVec< REAL > &convdir)
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 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...
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
int Dimension() const override
Returns the integrable dimension of the material.
virtual int ClassId() const override
Unique identifier for serialization purposes.
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)
void SetParameters(REAL rho, TPZVec< REAL > &convdir)
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.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
REAL fRho
Coeficient which multiplies the temporal derivative.
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 std::string Name() override
Returns the name of the material.
TPZMatConvectionProblem()
virtual int VariableIndex(const std::string &name) override
#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.
Contains the TPZMatConvectionProblem class which implements a convection problem 2D with time depende...
This class defines the boundary condition for TPZMaterial objects.
int64_t Rows() const
Returns number of rows.
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout) override
It return a solution to multiphysics simulation.
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
int32_t Hash(std::string str)
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 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 BC integration point...
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 void Print(std::ostream &out) override
Prints out the data associated with the material.
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.
TPZSolVec sol
vector of the solutions at the integration point
int fDim
Problem dimension.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
#define PZError
Defines the output device to error messages and the DebugStop() function.
TPZVec< REAL > fConvDir
convection term (direction velocity)