34 PZError <<
"TPZMat2dLin.contr, inconsistent input data : phi.Cols() = " 35 << phi.
Cols() <<
" dphi.Cols + " << dphi.
Cols()
36 <<
" phi.Rows = " << phi.
Rows() <<
" dphi.Rows = " << dphi.
Rows() <<
"\n";
42 fForcingFunction->Execute(x,xfloat);
44 for(i=0; i<fXf.Rows(); i++) fXf(i,0) = xfloat[i];
48 for(
int in=0 ; in < phi.
Rows() ; ++in)
50 for(ic=0; ic< r; ic++)
52 ef(in*r+ic, 0) += (STATE)(weight*phi(in,0))*fXf(ic,0);
54 for(
int jn=0 ; jn<phi.
Rows() ; ++jn)
56 for(ic=0; ic<r; ic++)
for(jc=0; jc<r; jc++)
58 REAL dphix = dphi(0,in)*axes(0,0)+axes(1,0)*dphi(1,in);
59 REAL dphiy = dphi(0,in)*axes(0,1)+axes(1,1)*dphi(1,in);
60 REAL dphjx = dphi(0,jn)*axes(0,0)+axes(1,0)*dphi(1,jn);
61 REAL dphjy = dphi(0,jn)*axes(0,1)+axes(1,1)*dphi(1,jn);
62 ek(in*r+ic,jn*r+jc) += (STATE)(weight*phi(in,0)*phi(jn,0))*fK00(ic,jc) +
63 ((STATE)(dphix*dphjx)*fKxx(ic,jc) +
64 (STATE)(dphiy*dphjy)*fKyy(ic,jc) +
65 (STATE)(dphix*phi(jn,0))*fKx0(ic,jc) +
66 (STATE)(dphiy*phi(jn,0))*fKy0(ic,jc) +
67 (STATE)(phi(in,0)*dphjx)*fK0x(ic,jc) +
68 (STATE)(phi(in,0)*dphjy)*fK0y(ic,jc) ) * (STATE)weight;
80 PZError <<
"TPZMat1dLin.apply_bc warning : this material didn't create the boundary condition!\n";
84 PZError <<
"TPZMat1dLin.aplybc, unknown boundary condition type :" <<
85 bc.
Type() <<
" boundary condition ignored\n";
89 int numnod = ek.
Rows()/r;
95 for(in=0 ; in<numnod ; ++in){
96 for(idf = 0;idf<r;idf++) {
97 (ef)(in*r+idf,0) += (STATE)(weight*gBigNumber*phi(in,0))*bc.
Val2()(
idf,0);
99 for(jn=0 ; jn<numnod ; ++jn) {
100 for(idf = 0;idf<r;idf++) {
101 ek(in*r+idf,jn*r+idf) += gBigNumber*phi(in,0)*phi(jn,0)*weight;
108 for(in=0 ; in<numnod ; ++in){
109 for(idf = 0;idf<r;idf++) {
110 (ef)(in*r+idf,0) += (STATE)(weight*phi(in,0))*bc.
Val2()(
idf,0);
116 for(in=0 ; in<numnod ; ++in){
117 for(idf = 0;idf<r;idf++) {
118 (ef)(in*r+idf,0) += (STATE)(weight*phi(in,0))*bc.
Val2()(
idf,0);
120 for(jn=0 ; jn<numnod ; ++jn) {
121 for(idf = 0;idf<r;idf++) {
122 for(jdf = 0;jdf<r;jdf++) {
123 ek(in*r+idf,jn*r+jdf) += bc.
Val1()(
idf,jdf)*(STATE)(phi(in,0)*phi(jn,0)*weight);
130 for(in=0; in<numnod; in++) {
131 for(idf=0; idf<r; idf++) {
132 for(jdf=0; jdf<r; jdf++) {
133 ef(in*r+idf,0) += (fKx0(idf,jdf)*(STATE)axes(0,1)-fKy0(idf,jdf)*(STATE)axes(0,0))*(STATE)(phi(in,0)*weight);
144 PZError <<
"TPZMat2dLin::Flux is called\n";
148 out <<
"Material type TPZMat2dLin -- number = " << Id() <<
"\n";
149 out <<
"Matrix Kxx -> "; fKxx.Print(
"fKxx",out);
150 out <<
"Matrix Kyy -> "; fKyy.Print(
"fKyy",out);
151 out <<
"Matrix Kxy -> "; fKxy.Print(
"fKxy",out);
152 out <<
"Matrix Kyx -> "; fKyx.Print(
"fKyx",out);
153 out <<
"Matrix Kx0 -> "; fKx0.Print(
"fKx0",out);
154 out <<
"Matrix K0x -> "; fK0x.Print(
"fK0x",out);
155 out <<
"Matrix Ky0 -> "; fKy0.Print(
"fKy0",out);
156 out <<
"Matrix K0y -> "; fK0y.Print(
"fK0y",out);
157 out <<
"Matrix K00 -> "; fK00.Print(
"fK00",out);
158 out <<
"Matrix xf -> "; fXf.Print(
"fXf",out);
162 if(!strcmp(name.c_str(),
"displacement"))
return 1;
163 if(!strcmp(name.c_str(),
"Solution"))
return 1;
164 if(!strcmp(
"Derivate",name.c_str()))
return 2;
165 if(!strcmp(
"Pressure",name.c_str()))
return 3;
170 if(index == 1)
return 3;
171 if(index == 2)
return 2;
172 if(index == 3)
return 1;
180 #ifndef STATE_COMPLEX 182 for (
int i = 0; i<Sol.
size(); i++) {
186 for (
int i=0; i<Sol.
size(); i++) {
187 Solout[i] = Sol[i].real();
190 }
else if(var == 1) {
192 #ifndef STATE_COMPLEX 195 Solout[0] = Sol[0].real();
197 }
else if(var == 2) {
198 #ifndef STATE_COMPLEX 199 Solout[0] = DSol(0,0);
200 Solout[1] = DSol(1,0);
202 Solout[0] = DSol(0,0).real();
203 Solout[1] = DSol(1,0).real();
206 }
else if(var == 3) {
208 #ifndef STATE_COMPLEX 211 Solout[0] = Sol[0].real();
221 STATE
dx = dudx(0,0)*(STATE)axes(0,0)+dudx(1,0)*(STATE)axes(1,0);
222 STATE dy = dudx(0,0)*(STATE)axes(0,1)+dudx(1,0)*(STATE)axes(1,1);
224 STATE parc1 = dx-du_exact(0,0) ;
225 STATE parc2 = dy-du_exact(1,0) ;
226 values[0] =
abs(parc1*parc1 + parc2*parc2);
228 values[1] =
pow((REAL)
fabs(u[0] - u_exact[0]),(REAL)2.0);
247 REAL cosa =
cos(angle);
248 REAL sina =
sin(angle);
249 fKxx(0,0) = cosa*cosa;
250 fKxy(0,0) = cosa*sina;
251 fKyy(0,0) = sina*sina;
252 fKyx(0,0) = cosa*sina;
259 int nstate = fKxx.Rows();
275 if (logger->isDebugEnabled())
277 std::stringstream sout;
278 sout << __PRETTY_FUNCTION__ <<
" before write material ";
284 if (logger->isDebugEnabled())
286 std::stringstream sout;
287 sout << __PRETTY_FUNCTION__ <<
" after write material ";
void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
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
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
clarg::argBool bc("-bc", "binary checkpoints", false)
Templated vector implementation.
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
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...
Contains the TPZMatPoisson3d class.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
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...
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
virtual int ClassId() const override
returns the unique identifier for reading/writing objects to streams
TPZBndCond * OutflowFlux(TPZMaterial *&reference, int bc)
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 Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
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...
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
expr_ dx(i) *cos(expr_.val())
virtual int NSolutionVariables(int index) override
Returns the number of variables associated with the variable indexed by var.
virtual TPZMaterial * NewMaterial() override
Creates a copy of the material object.
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
This class defines the boundary condition for TPZMaterial objects.
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
int64_t Rows() const
Returns number of rows.
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
TPZFMatrix< STATE > & Val1()
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...
void ConvectionDiffusion(REAL angle, REAL diff)
Contains the TPZMat2dLin class which implements a bi-dimensional linear problem.
void Print(std::ostream &out=std::cout) override
Prints out the data associated with the material.
int32_t Hash(std::string str)
static REAL angle
Angle in radians to test.
int ClassId() const override
Unique identifier for serialization purposes.
virtual TPZBndCond * CreateBC(TPZMaterial *reference, int id, int typ, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
Creates an object TPZBndCond derived of TPZMaterial.
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &fl) override
Computes the value of the flux function to be used by ZZ error estimator.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
Implements a bi-dimensional linear problem.
int64_t Cols() const
Returns number of cols.
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Defines the interface for saving and reading data. Persistency.
virtual int NFluxes() override
Returns the number of components which form the flux function.
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
Implements an interface to register a class id and a restore function. Persistence.
#define PZError
Defines the output device to error messages and the DebugStop() function.
TPZMaterial * Material() const