26 Solout[0] = gEul.Pressure(Sol);
37 if(index == 1)
return 1;
38 if(index == 2)
return 1;
39 if(index == 3)
return 2;
43 if(!strcmp(name.c_str(),
"pressure"))
return 1;
44 if(!strcmp(name.c_str(),
"density"))
return 2;
45 if(!strcmp(name.c_str(),
"velocity"))
return 3;
65 int numbersol = data.
sol.
size();
80 if(fState == 0)
return;
82 PZError <<
"TPZMat1dLin.apply_bc warning : this material didn't create the boundary condition!\n";
86 PZError <<
"TPZEuler.aplybc, unknown boundary condition type :" <<
87 bc.
Type() <<
" boundary condition ignored\n";
92 int numdof = NStateVariables();
93 int numnod = ek.
Rows()/numdof;
98 REAL normal[2] = {axes(0,1),-axes(0,0)};
109 for(in=0 ; in<numnod ; ++in){
110 for(idf = 0;idf<r;idf++) {
111 (ef)(in*r+idf,0) += gBigNumber*phi(in,0)*bc.
Val2()(
idf,0)*weight;
113 for(jn=0 ; jn<numnod ; ++jn) {
114 for(idf = 0;idf<r;idf++) {
115 ek(in*r+idf,jn*r+idf) += gBigNumber*phi(in,0)*phi(jn,0)*weight;
122 for(in=0 ; in<numnod ; ++in){
123 for(idf = 0;idf<r;idf++) {
124 (ef)(in*r+idf,0) += phi(in,0)*bc.
Val2()(
idf,0)*weight;
130 for(in=0 ; in<numnod ; ++in){
131 for(idf = 0;idf<r;idf++) {
132 (ef)(in*r+idf,0) += phi(in,0)*bc.
Val2()(
idf,0)*weight;
134 for(jn=0 ; jn<numnod ; ++jn) {
135 for(idf = 0;idf<r;idf++) {
136 for(jdf = 0;jdf<r;jdf++) {
137 ek(in*r+idf,jn*r+jdf) += bc.
Val1()(
idf,jdf)*phi(in,0)*phi(jn,0)*weight;
143 gEul.JacobFlux(sol,A,B);
144 for(in=0; in<numnod; in++) {
145 for(idf=0; idf<4; idf++) {
152 for(jn=0; jn<numnod; jn++) {
153 for(jdf=0; jdf<4; jdf++) {
154 ek(4*in+idf,4*jn+jdf) += weight*fDeltaT*
155 (phi(in,0)*A(idf,jdf)*phi(jn,0)*normal[0]
156 + phi(in,0)*B(idf,jdf)*phi(jn,0)*normal[1]);
179 int numbersol = data.
sol.
size();
180 if (numbersol != 1) {
194 int nshape = phi.
Rows();
197 for(in=0; in<nshape; in++) {
198 dphix[0] = dphi(0,in)*axes(0,0)+dphi(1,in)*axes(1,0);
199 dphix[1] = dphi(1,in)*axes(0,1)+dphi(1,in)*axes(1,1);
200 dphi(0,in) = dphix[0];
201 dphi(1,in) = dphix[1];
204 if(fState == 0 && ! fForcingFunction) {
205 cout <<
"TPZEuler failed to suply initial conditions\n";
210 fForcingFunction->Execute(x,force);
211 for(in=0; in<nshape; in++) {
212 for(idf=0; idf<4; idf++) {
213 ef(4*in+idf) += weight*phi(in,0)*gBigNumber*force[
idf];
214 for(jn=0; jn<nshape; jn++) {
215 ek(4*in+idf,4*jn+idf) += weight*phi(in,0)*phi(jn,0)*gBigNumber;
231 TPZFMatrix<STATE> KXX(4,4),KXY(4,4),KYX(4,4),KYY(4,4),A(4,4),B(4,4);
233 REAL jacdet = daxesdksi(0,0)*daxesdksi(1,1)-daxesdksi(0,1)*daxesdksi(1,0);
234 jacinv(0,0) = daxesdksi(1,1)/jacdet;
235 jacinv(1,1) = daxesdksi(0,0)/jacdet;
236 jacinv(0,1) = -daxesdksi(0,1)/jacdet;
237 jacinv(1,0) = -daxesdksi(1,0)/jacdet;
238 gEul.MatrixDiff(sol,axes,jacinv,KXX,KXY,KYX,KYY);
239 gEul.JacobFlux(sol,A,B);
240 for(in=0; in<nshape; in++) {
241 for(idf=0; idf<4; idf++) {
242 ef(4*in+idf) += weight*phi(in,0)*sol[
idf];
256 for(jn=0; jn<nshape; jn++) {
257 for(jdf=0; jdf<4;jdf++) {
259 ek(4*in+idf,4*jn+jdf) += fDeltaT*weight*(
260 dphi(0,in)*KXX(idf,jdf)*dphi(0,jn)
261 +dphi(0,in)*KXY(idf,jdf)*dphi(1,jn)
262 +dphi(1,in)*KYX(idf,jdf)*dphi(0,jn)
263 +dphi(1,in)*KYY(idf,jdf)*dphi(1,jn)
265 -dphi(0,in)*A(idf,jdf)*phi(jn)
266 -dphi(1,in)*B(idf,jdf)*phi(jn)
269 ek(4*in+idf,4*jn+idf) += weight*phi(in,0)*phi(jn,0);
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
static TEulerDiffusivity gEul
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Computes contribution to the stiffness matrix and right hand side at an integration point...
Contains the TPZEuler class which implements a a linear scalar convection equation.
TPZEuler(TPZEuler ©)
Copy constructor.
TPZFNMatrix< 9, REAL > jacinv
value of the inverse of the jacobian at the integration point
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
virtual int ClassId() const override
Define the class id associated with the class.
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.
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
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...
#define DebugStop()
Returns a message to user put a breakpoint in.
This class defines the boundary condition for TPZMaterial objects.
This class implements a linear scalar convection equation with modified SUPG difusion.
int64_t Rows() const
Returns number of rows.
Implements a numerical diffusivity coeficient for the SUPG method. Analysis: Solving process Analysis...
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
TPZFMatrix< STATE > & Val1()
int32_t Hash(std::string str)
virtual void SetData(std::istream &data) override
Reads data of the material from a istream (file data)
virtual void Print(std::ostream &out=std::cout) override
Print out the data associated with the material.
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.
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
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 Dimension() const override
Returns the integrable dimension of the material.
TPZSolVec sol
vector of the solutions at the integration point
#define PZError
Defines the output device to error messages and the DebugStop() function.
TPZMaterial * Material() const
virtual void SetData(std::istream &data)
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.