NeoPZ
pztransientmat.h
Go to the documentation of this file.
1 
6 #ifndef TRANSIENTMATH
7 #define TRANSIENTMATH
8 
9 #include "TPZMaterial.h"
10 
19 template<class TBASEMAT>
20 class TPZTransientMaterial : public TBASEMAT {
21 
22 public:
23  public:
24 int ClassId() const override;
25 
27  TPZTransientMaterial(int nummat, int dim, REAL TimeStep);
28 
31 
34 
36  void SetExplicit();
37 
39  void SetImplicit();
40 
41  virtual void Contribute(TPZMaterialData &data,
42  REAL weight,
44  TPZFMatrix<STATE> &ef) override;
45 
46  virtual void ContributeBC(TPZMaterialData &data,
47  REAL weight,
50  TPZBndCond &bc) override;
51 
52  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright,
53  REAL weight,
55  TPZFMatrix<STATE> &ef) override;
56 
57  virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft,
58  REAL weight,
61  TPZBndCond &bc) override;
62 
64  void SetLastState();
65 
67  void SetCurrentState();
68 
70  void SetMassMatrix();
71 
73  void SetFluxOnly();
74 
76  void SetTimeStep(REAL TimeStep);
77 
79  REAL TimeStep();
80 
86  virtual bool NeedsSolutionToContribute(){
87  return true;
88  }
89 
95  virtual bool NeedsXCoord(){
96  return (this->fStep != ELast);
97  }
98 
99 protected:
100 
102 
104 
105  enum STEPS{ENone = -1, ELast = 0, ECurrent = 1, EMassMatrix = 2, EFluxOnly = 3};
106 
108 
109  REAL fTimeStep;
110 
111  virtual void ContributeSolutionRhs(TPZVec<STATE> &sol, TPZFMatrix<REAL> &phi, REAL weight, TPZFMatrix<STATE> &ef);
112 
113  virtual void ContributeTangent(TPZVec<STATE> &sol, TPZFMatrix<REAL> &phi, REAL weight, TPZFMatrix<STATE> &ek);
114 };
115 
116 template<class TBASEMAT>
118  this->fStep = ELast;
119 }
120 
121 template<class TBASEMAT>
123  this->fStep = ECurrent;
124 }
125 
126 template<class TBASEMAT>
128  this->fStep = EMassMatrix;
129 }
130 
131 template<class TBASEMAT>
133  this->fStep = EFluxOnly;
134 }
135 
136 template<class TBASEMAT>
138  this->fTimeStep = TimeStep;
139 }
140 
141 template<class TBASEMAT>
143  return this->fTimeStep;
144 }
145 
146 #endif
clarg::argBool bc("-bc", "binary checkpoints", false)
void SetTimeStep(REAL TimeStep)
Define time step DeltaT.
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
virtual void ContributeTangent(TPZVec< STATE > &sol, TPZFMatrix< REAL > &phi, REAL weight, TPZFMatrix< STATE > &ek)
TPZTransientMaterial(int nummat, int dim, REAL TimeStep)
Class constructor.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
int ClassId() const override
void SetLastState()
Set material to compute only Integral[- un/deltaT * v, Omega].
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
Implements an implicit Euler time integrator. The Material Classes Material.
void SetMassMatrix()
Set material to compute ek = Integral[phi_i phi_j, Omega]/deltaT.
virtual bool NeedsSolutionToContribute()
Indicates if the material requires the solution to compute Contribute.
ETemporalScheme fTemporalIntegrator
~TPZTransientMaterial()
Default destructor.
void SetExplicit()
Sets integral scheme as an explicit Euler.
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
virtual bool NeedsXCoord()
Indicates if the material requires the global coordinate X to compute Contribute. ...
virtual void ContributeSolutionRhs(TPZVec< STATE > &sol, TPZFMatrix< REAL > &phi, REAL weight, TPZFMatrix< STATE > &ef)
void SetFluxOnly()
Set material to compute ef = Linear Form - Bilinear Form(u) = F -ku.
REAL TimeStep()
Returns time step value.
void SetCurrentState()
Set material to compute Integral[un+1/deltaT * v, Omega] + Bilinear Form = Linear Form...