66 out <<
m_d << std::endl;
67 out <<
m_dim << std::endl;
71 return "TPZMixedDarcyFlow";
75 int ndata = datavec.
size();
76 for (
int idata=0; idata < ndata ; idata++) {
77 datavec[idata].SetAllRequirements(
false);
78 datavec[idata].fNeedsSol =
true;
83 int ndata = datavec.
size();
84 for (
int idata=0; idata < ndata ; idata++) {
85 datavec[idata].SetAllRequirements(
false);
86 datavec[idata].fNeedsSol =
true;
114 x_spatial(0,0) = datavec[0].x[0];
115 STATE
val = x_spatial(0,0);
116 REAL r =
Norm(x_spatial);
119 auto &div_phi = datavec[qb].divphi;
120 REAL div_q = datavec[qb].divsol[0][0];
122 int nphi_q = datavec[qb].fVecShapeIndex.
NElements();
123 int nphi_p = phi_ps.
Rows();
125 int first_p = nphi_q + first_q;
128 STATE p = datavec[pb].sol[0][0];
146 for (
int i = 0; i < 3; i++) {
147 for (
int j = 0; j < 3; j++) {
152 for (
int iq = 0; iq < nphi_q; iq++)
155 v_i = datavec[qb].fVecShapeIndex[iq].first;
156 s_i = datavec[qb].fVecShapeIndex[iq].second;
158 STATE kappa_inv_q_dot_phi_q_i = 0.0;
159 for (
int i = 0; i < 3; i++) {
160 phi_q_i(i,0) = phi_qs(s_i,0) * datavec[qb].fNormalVec(i,v_i);
161 kappa_inv_q_dot_phi_q_i += kappa_inv_q(i,0)*phi_q_i(i,0);
164 ef(iq + first_q) += -1.0 * weight * ( kappa_inv_q_dot_phi_q_i - p * div_phi(iq,0));
166 for (
int jq = 0; jq < nphi_q; jq++)
169 v_j = datavec[qb].fVecShapeIndex[jq].first;
170 s_j = datavec[qb].fVecShapeIndex[jq].second;
172 kappa_inv_phi_q_j.Zero();
173 for (
int i = 0; i < 3; i++) {
174 for (
int j = 0; j < 3; j++) {
175 kappa_inv_phi_q_j(i,0) +=
m_kappa_inv(i,j) * phi_qs(s_j,0) * datavec[qb].fNormalVec(j,v_j);
179 STATE kappa_inv_phi_q_j_dot_phi_q_i = 0.0;
180 for (
int j = 0; j < 3; j++) {
181 kappa_inv_phi_q_j_dot_phi_q_i += kappa_inv_phi_q_j(j,0)*phi_q_i(j,0);
184 ek(iq + first_q,jq + first_q) += weight * kappa_inv_phi_q_j_dot_phi_q_i;
187 for (
int jp = 0; jp < nphi_p; jp++)
189 ek(iq + first_q, jp + first_p) += weight * ( - div_phi(iq,0) ) * phi_ps(jp,0);
194 for (
int ip = 0; ip < nphi_p; ip++)
204 ef(ip + first_p) += -1.0 * weight * (force) * phi_ps(ip,0);
206 for (
int jq = 0; jq < nphi_q; jq++)
208 ek(ip + first_p, jq + first_q) += -1.0 * weight * div_phi(jq,0) * phi_ps(ip,0);
217 this->
Contribute(datavec, weight, ekfake, ef);
230 int nphi_q = phi_qs.
Rows();
240 x_spatial(0,0) = datavec[0].x[0];
241 REAL r =
Norm(x_spatial);
260 bc_data[0] = bc.
Val2()(0,0);
265 STATE p_D = bc_data[0];
266 for (
int iq = 0; iq < nphi_q; iq++)
268 ef(iq + first_q) += -1.0 * weight * p_D * phi_qs(iq,0);
276 for (
int iq = 0; iq < nphi_q; iq++)
278 REAL qn_N = bc_data[0], qn = q[0];
279 ef(iq + first_q) += -1.0 * weight *
gBigNumber * (qn - qn_N) * phi_qs(iq,0);
281 for (
int jq = 0; jq < nphi_q; jq++)
284 ek(iq + first_q,jq + first_q) += -1.0 * weight * gBigNumber * phi_qs(jq,0) * phi_qs(iq,0);
292 default: std::cout <<
"This BC doesn't exist." << std::endl;
305 if(!strcmp(
"q",name.c_str()))
return 1;
306 if(!strcmp(
"p",name.c_str()))
return 2;
307 if(!strcmp(
"div_q",name.c_str()))
return 3;
308 if(!strcmp(
"kappa",name.c_str()))
return 4;
313 if(var == 1)
return 3;
314 if(var == 2)
return 1;
315 if(var == 3)
return 1;
328 q = datavec[qb].sol[0];
329 p = datavec[pb].sol[0];
330 REAL div_q = datavec[qb].divsol[0][0];
334 x_spatial(0,0) = datavec[0].x[0];
335 REAL r =
Norm(x_spatial);
350 for (
int i=0; i < 3; i++)
368 for (
int i = 0; i < this->
Dimension(); i++) {
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Boundary contribute without jacobian matrix.
TPZFNMatrix< 9, REAL > m_kappa
Absolute permeability.
clarg::argBool bc("-bc", "binary checkpoints", false)
REAL m_d
Dimensional factor.
TPZMaterial & operator=(const TPZMaterial ©)
operator =
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
This class implements a simple vector storage scheme for a templated class T. Utility.
REAL val(STATE &number)
Returns value of the variable.
void FillDataRequirements(TPZVec< TPZMaterialData > &datavec) override
fill requirements for volumetric contribute methods multiphsycis mesh
void Print(std::ostream &out) override
print all material information
int NSolutionVariables(int var) override
size of the current variable (1 -> scalar, 3-> vector, 9 -> Tensor )
TPZFMatrix< STATE > & Val2(int loadcase=0)
std::string Name() override
print material name
int VariableIndex(const std::string &name) override
Variable index based on variable naming.
This abstract class defines the behaviour which each derived class needs to implement.
virtual int NStateVariables() const override
return the number of state variables associated with each trial function
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...
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
void Read(TPZStream &buf, void *context) override
write class from disk
#define DebugStop()
Returns a message to user put a breakpoint in.
This class defines the boundary condition for TPZMaterial objects.
int64_t Rows() const
Returns number of rows.
TPZMixedDarcyFlow()
default constructor
void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Volumetric contribute with jacobian matrix.
TPZMixedDarcyFlow & operator=(const TPZMixedDarcyFlow &other)
assignment operator
virtual int ClassId() const override
unique class identifier
void FillBoundaryConditionDataRequirement(int type, TPZVec< TPZMaterialData > &datavec) override
fill requirements for boundary contribute methods multiphsycis mesh
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.
~TPZMixedDarcyFlow()
default desconstructor
virtual void Write(TPZStream &buf, int withclassid) const override
write class in disk
int m_dim
Material dimension.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
TPZFNMatrix< 9, REAL > m_kappa_inv
Inver of absolute permeability.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
virtual void Print(std::ostream &out) const
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
TPZMaterial * NewMaterial() override
return a material object from a this object
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
int Dimension() const override
return the euclidean dimension of the weak statement
void Solution(TPZVec< TPZMaterialData > &datavec, int var, TPZVec< STATE > &Solout) override
Postprocess required variables multiphysics.