24 PZError <<
"TPZMaterial::SetData is called.\n";
37 Solout[1] = Sol[0]*fConvect[1];
41 if(index == 1)
return 2;
45 if(!strcmp(name.c_str(),
"flux"))
return 1;
68 STATE sconvect[2] = {1.,1.};
69 if(convectax[0] < 0.) sconvect[0] = -1.;
70 if(convectax[1] < 0.) sconvect[1] = -1.;
73 delax[0] =
sqrt(daxesdksi(0,0)*daxesdksi(0,0)+daxesdksi(1,0)*daxesdksi(1,0));
74 delax[1] =
sqrt(daxesdksi(0,1)*daxesdksi(0,1)+daxesdksi(1,1)*daxesdksi(1,1));
75 int nshape = phi.
Rows();
77 for(in=0; in<nshape; in++) {
78 for(jn=0; jn<nshape; jn++) {
80 delax[0]*sconvect[0]*dphi(0,in)*(convectax[0]*dphi(0,jn)+convectax[1]*dphi(1,jn))
81 +delax[1]*sconvect[1]*dphi(1,in)*(convectax[0]*dphi(0,jn)+convectax[1]*dphi(1,jn))
83 -dphi(0,in)*convectax[0]*phi(jn,0)
84 -dphi(1,in)*convectax[1]*phi(jn,0)
95 PZError <<
"TPZMat1dLin.apply_bc warning : this material didn't create the boundary condition!\n";
99 PZError <<
"TPZMat1dLin.aplybc, unknown boundary condition type :" <<
100 bc.
Type() <<
" boundary condition ignored\n";
104 int numnod = ek.
Rows()/numdof;
111 for(in=0 ; in<numnod ; ++in){
112 for(idf = 0;idf<r;idf++) {
115 for(jn=0 ; jn<numnod ; ++jn) {
116 for(idf = 0;idf<r;idf++) {
117 ek(in*r+idf,jn*r+idf) +=
gBigNumber*phi(in,0)*phi(jn,0)*weight;
124 for(in=0 ; in<numnod ; ++in){
125 for(idf = 0;idf<r;idf++) {
126 (ef)(in*r+idf,0) += phi(in,0)*bc.
Val2()(
idf,0)*weight;
132 for(in=0 ; in<numnod ; ++in){
133 for(idf = 0;idf<r;idf++) {
134 (ef)(in*r+idf,0) += phi(in,0)*bc.
Val2()(
idf,0)*weight;
136 for(jn=0 ; jn<numnod ; ++jn) {
137 for(idf = 0;idf<r;idf++) {
138 for(jdf = 0;jdf<r;jdf++) {
139 ek(in*r+idf,jn*r+jdf) += bc.
Val1()(
idf,jdf)*phi(in,0)*phi(jn,0)*weight;
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 SetData(std::istream &data) override
Reads data of the material from a istream (file data)
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
TPZLinearConvection(TPZLinearConvection ©)
Copy constructor.
TPZFNMatrix< 9, REAL > jacinv
value of the inverse of the jacobian at the integration point
virtual int Dimension() const override
Returns the integrable dimension of the material.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
Implements a linear scalar convection equation with modified SUPG difusion.
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
virtual int ClassId() const override
Define the class id associated with the class.
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...
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 void Print(std::ostream &out=std::cout) override
Print out the data associated with the material.
This class defines the boundary condition for TPZMaterial objects.
int64_t Rows() const
Returns number of rows.
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
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
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
TPZFMatrix< STATE > & Val1()
static REAL gBigNumber
Big number to penalization method, used for Dirichlet conditions.
int32_t Hash(std::string str)
int ClassId() const override
Unique identifier for serialization purposes.
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 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 NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
Contains the TPZLinearConvection class which implements a linear scalar convection equation...
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
#define PZError
Defines the output device to error messages and the DebugStop() function.
TPZMaterial * Material() const