NeoPZ
pzcoupledtransportdarcyBC.h
Go to the documentation of this file.
1 
6 #ifndef MATCOUPLEDTRANSPDARCYBC
7 #define MATCOUPLEDTRANSPDARCYBC
8 
9 #include <iostream>
10 
11 #include "pzreal.h"
12 #include "pzbndcond.h"
13 #include "pzvec.h"
14 #include "pzmanvector.h"
15 #include "pzfmatrix.h"
17 
23 
24 // #warning THIS CLASS IS NOT THREADSAFE!!!
25 protected:
26 
28 
30  if (this->fMaterials[0]) return this->fMaterials[0];
31  if (this->fMaterials[1]) return this->fMaterials[1];
32  PZError << "Error! - " << __PRETTY_FUNCTION__ << std::endl;
33  exit (-1);
34  // the code will never reach this point
35  return 0;
36  }
37 
40 
41  public :
42 
44 
46 
49  if (eq == 0 || eq == 1) return this->fMaterials[eq];
50  else {
51  PZError << "Error! - " << __PRETTY_FUNCTION__ << std::endl;
52  exit (-1);
53  }
54  // the code will never reach this point
55  return 0;
56  }
57 
58  virtual int HasForcingFunction() override {
59  TPZBndCond * bc = this->GetCurrentMaterial();
60  if (bc) return bc->HasForcingFunction();
61  return 0;
62  }
63 
64  void SetMaterial(int eq, TPZBndCond * mat){
65  if (eq == 0 || eq == 1) this->fMaterials[eq] = mat;
66  else {
67  PZError << "Error! - " << __PRETTY_FUNCTION__ << std::endl;
68  exit (-1);
69  }
70  }
71 
73  int Dimension() const override {
74  return this->GetNonNullMaterial()->Dimension();
75  }
76 
77  virtual int NFluxes() override { return this->GetNonNullMaterial()->NFluxes(); }
78 
79  virtual int NStateVariables() const override { return this->GetNonNullMaterial()->NStateVariables(); }
80 
82  virtual int NEvalErrors() override {return this->GetNonNullMaterial()->NEvalErrors();}
83 
85  void Flux(TPZVec<REAL> &x, TPZVec<STATE> &Sol, TPZFMatrix<STATE> &DSol, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux) override {
86  flux.Fill(0.);
87  }
88 
89  void Print(std::ostream & out = std::cout) override {
90  out << " Boundary condition number = " << Id() << "\n";
91  }
92 
93  void Contribute(TPZMaterialData &data,
94  REAL weight,
96  TPZFMatrix<STATE> &ef) override;
97 
99  REAL weight,
100  TPZFMatrix<STATE> &ef) override
101  {
102  TPZBndCond::Contribute(data,weight,ef);
103  }
104 
106  REAL weight,
107  TPZFMatrix<STATE> &ek,
108  TPZFMatrix<STATE> &ef,
109  TPZBndCond &bc) override { }
110 
112  REAL weight,
113  TPZFMatrix<STATE> &ef,
114  TPZBndCond &bc) override
115  {
116  TPZBndCond::ContributeBC(data,weight,ef,bc);
117  }
118 
119 
121  TPZVec<STATE> &uexact,TPZFMatrix<STATE> &duexact,TPZVec<REAL> &val) override {
122  val.Fill(0.);
123  }
124 
125  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright,
126  REAL weight,
127  TPZFMatrix<STATE> &ek,
128  TPZFMatrix<STATE> &ef) override;
129 
130  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright,
131  REAL weight,
132  TPZFMatrix<STATE> &ef) override;
133 
134 
136  REAL weight,
137  TPZFMatrix<STATE> &ek,
138  TPZFMatrix<STATE> &ef,
139  TPZBndCond &bc) override {
140  //NOTHING TO BE DONE HERE
141  }
142 
144  REAL weight,
145  TPZFMatrix<STATE> &ef,
146  TPZBndCond &bc) override
147  {
148  TPZBndCond::ContributeBCInterface(data,dataleft,weight,ef,bc);
149  }
150 public:
151 virtual int ClassId() const override;
152 
153 };
154 
155 #endif
virtual int NFluxes() override
Returns the number of components which form the flux function.
Definition: pzbndcond.h:242
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...
int Dimension() const override
Returns the integrable dimension of the material.
virtual int NEvalErrors() override
Returns the number of norm errors. Default is 3: energy, L2 and H1.
Definition: pzbndcond.h:247
clarg::argBool bc("-bc", "binary checkpoints", false)
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...
Templated vector implementation.
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to stiffness matrix and load vector at one integration point...
virtual int NEvalErrors() override
Returns the number of norm errors. Default is 3: energy, L2 and H1.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
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...
Definition: pzbndcond.cpp:142
TPZBndCond * GetNonNullMaterial() const
void Flux(TPZVec< REAL > &x, TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux) override
Computes the value of the flux function to be used by ZZ error estimator.
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...
Definition: pzbndcond.cpp:166
virtual int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Definition: pzbndcond.h:244
void UpdateConvectionDir(TPZFMatrix< STATE > &dsol)
void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.
Contains TPZMatrixclass which implements full matrix (using column major representation).
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
Free store vector implementation.
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to residual vector at one BC integration point.
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to stiffness matrix and load vector at one BC integration point...
Definition: pzbndcond.cpp:230
void SetMaterial(int eq, TPZBndCond *mat)
void Print(std::ostream &out=std::cout) override
Prints out the data associated with the material.
virtual int HasForcingFunction()
Directive that gives true if the material has a forcing function.
Definition: TPZMaterial.h:472
virtual int NFluxes() override
Returns the number of components which form the flux function.
void UpdateConvectionDirInterface(TPZFMatrix< STATE > &dsolL, TPZFMatrix< STATE > &dsolR, TPZFMatrix< REAL > &phiL, TPZFMatrix< REAL > &phiR)
Implements two equations where the second one requires the solution of the first. ...
int Dimension() const override
Returns the integrable dimension of the material.
Definition: pzbndcond.h:240
virtual int HasForcingFunction() override
Directive that gives true if the material has a forcing function.
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to stiffness matrix and load vector at one BC integration point...
int Id() const
Definition: TPZMaterial.h:170
void Fill(const T &copy, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
Definition: pzvec.h:460
void Errors(TPZVec< REAL > &x, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, TPZVec< STATE > &uexact, TPZFMatrix< STATE > &duexact, TPZVec< REAL > &val) override
Computes the error due to the difference between the interpolated flux and the flux computed based o...
TPZCoupledTransportDarcyBC(TPZCoupledTransportDarcy *material, int id)
Contains the TPZCoupledTransportDarcy class which implements two equations to transport problem...
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15
void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to the stiffness matrix and load vector at one BC integration point...