NeoPZ
TPZMixedDarcyFlow.h
Go to the documentation of this file.
1 //
2 // TPZMixedDarcyFlow.h
3 // HDiv
4 //
5 // Created by Omar Durán on 3/29/19.
6 //
7 
8 #ifndef TPZMixedDarcyFlow_h
9 #define TPZMixedDarcyFlow_h
10 
11 #include <stdio.h>
12 #include "TPZMaterial.h"
13 #include "pzbndcond.h"
14 #include "pzfmatrix.h"
15 #include "pzaxestools.h"
16 
18 
19 private:
20 
23 
26 
28  REAL m_d;
29 
31  int m_dim;
32 
33 public:
34 
37 
40 
42  TPZMixedDarcyFlow(int mat_id, int dim);
43 
46 
48  TPZMaterial * NewMaterial() override;
49 
52 
54  int Dimension() const override;
55 
57  void SetDimension(int dim) { m_dim = dim; }
58 
60  virtual int NStateVariables() const override;
61 
63  void Print(std::ostream & out) override;
64 
66  std::string Name() override;
67 
69  void FillDataRequirements(TPZVec<TPZMaterialData> &datavec) override;
70 
72  void FillBoundaryConditionDataRequirement(int type, TPZVec<TPZMaterialData> &datavec) override;
73 
75  virtual int ClassId() const override;
76 
78  virtual void Write(TPZStream &buf, int withclassid) const override;
79 
81  void Read(TPZStream &buf, void *context) override;
82 
84  void ContributeBC(TPZMaterialData &data,REAL weight,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override {
85  DebugStop();
86  }
87 
89  void ContributeBC(TPZMaterialData &data,REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override {
90  DebugStop();
91  }
92 
94  void Contribute(TPZMaterialData &data,REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override {
95  DebugStop();
96  }
97 
99  void Contribute(TPZMaterialData &data,REAL weight,TPZFMatrix<STATE> &ef) override {
100  DebugStop();
101  }
102 
104  void Contribute(TPZVec<TPZMaterialData> &datavec,REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override;
105 
107  void Contribute(TPZVec<TPZMaterialData> &datavec,REAL weight,TPZFMatrix<STATE> &ef) override;
108 
110  void ContributeBC(TPZVec<TPZMaterialData> &datavec,REAL weight,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override;
111 
113  void ContributeBC(TPZVec<TPZMaterialData> &datavec,REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override;
114 
116  int VariableIndex(const std::string &name) override;
117 
119  int NSolutionVariables(int var) override;
120 
122  void Solution(TPZVec<TPZMaterialData> &datavec, int var, TPZVec<STATE> &Solout) override;
123 
125  void SetPermeability(REAL kappa){
126  int n_data = m_kappa.Rows();
127  m_kappa.Zero();
128  m_kappa_inv.Zero();
129  for (int i = 0; i < 3; i++) {
130  m_kappa(i,i) = kappa;
131  m_kappa_inv(i,i) = 1.0/kappa;
132  }
133  }
134 
137 
138  if (kappa.Rows() != 3 && kappa.Cols() != 3) {
139  DebugStop();
140  }
141 
142  m_kappa = kappa;
143  m_kappa.Inverse(m_kappa_inv, ELU);
144  }
145 
147  void SetDimensionalFactor(REAL d){
148  m_d = d;
149  }
150 
151 };
152 
153 #endif /* TPZMixedDarcyFlow_h */
void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Boundary contribute without jacobian matrix.
TPZFNMatrix< 9, REAL > m_kappa
Absolute permeability.
void SetPermeability(REAL kappa)
:: JV document me please
clarg::argBool bc("-bc", "binary checkpoints", false)
REAL m_d
Dimensional factor.
int Inverse(TPZFMatrix< TVar > &Inv, DecomposeType dec)
It makes Inv =[this]. IMPORTANT OBSERVATION –> The original matrix (calling object) no is more equal...
Definition: pzmatrix.cpp:1929
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
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 )
std::string Name() override
print material name
int VariableIndex(const std::string &name) override
Variable index based on variable naming.
void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
Volumetric contribute.
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
virtual int NStateVariables() const override
return the number of state variables associated with each trial function
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
int Zero() override
Makes Zero all the elements.
Definition: pzfmatrix.h:651
void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Boundary contribute.
Contains TPZMatrixclass which implements full matrix (using column major representation).
void Read(TPZStream &buf, void *context) override
write class from disk
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
Definition: pzmatrix.h:52
void SetPermeability(TPZFNMatrix< 9, REAL > &kappa)
:: JV document me please
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
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
~TPZMixedDarcyFlow()
default desconstructor
virtual void Write(TPZStream &buf, int withclassid) const override
write class in disk
int m_dim
Material dimension.
TPZFNMatrix< 9, REAL > m_kappa_inv
Inver of absolute permeability.
void SetDimension(int dim)
Sets material dimension.
void SetDimensionalFactor(REAL d)
:: JV document me please
Contains declaration of the TPZAxesTools class which implements verifications over axes...
int64_t Cols() const
Returns number of cols.
Definition: pzmatrix.h:809
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
TPZMaterial * NewMaterial() override
return a material object from a this object
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.