OGS
ODESystem.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include "EquationSystem.h"
16 #include "Types.h"
17 
18 namespace NumLib
19 {
22 
31 template <ODESystemTag ODETag, NonlinearSolverTag NLTag>
32 class ODESystem;
33 
38 template <>
41 {
42 public:
44  static const ODESystemTag ODETag =
46 
48  virtual void preAssemble(const double t, double const dt,
49  GlobalVector const& x) = 0;
50 
53  virtual std::vector<GlobalIndexType>
55  {
56  return {};
57  }
58 
60  virtual void assemble(const double t, double const dt,
61  std::vector<GlobalVector*> const& x,
62  std::vector<GlobalVector*> const& xdot,
63  int const process_id, GlobalMatrix& M,
64  GlobalMatrix& K, GlobalVector& b) = 0;
65 
67 
70  virtual std::vector<NumLib::IndexValueVector<Index>> const*
71  getKnownSolutions(double const /*t*/, GlobalVector const& /*x*/,
72  int const /*process_id*/) const
73  {
74  return nullptr; // by default there are no known solutions
75  }
76 
77  virtual void updateConstraints(GlobalVector& /*lower*/,
78  GlobalVector& /*upper*/,
79  int const /*process_id*/){};
80 };
81 
87 template <>
90  : public ODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
91  NonlinearSolverTag::Picard>
92 {
93 public:
95  void preAssemble(const double t, double const dt,
96  GlobalVector const& x) override = 0;
97 
142  virtual void assembleWithJacobian(const double t, double const dt,
143  std::vector<GlobalVector*> const& x,
144  std::vector<GlobalVector*> const& xdot,
145  int const process_id, GlobalMatrix& M,
146  GlobalMatrix& K, GlobalVector& b,
147  GlobalMatrix& Jac) = 0;
148 };
149 
151 } // namespace NumLib
Global vector based on Eigen vector.
Definition: EigenVector.h:28
void preAssemble(const double t, double const dt, GlobalVector const &x) override=0
Calls process' pre-assembly with the provided state (t, dt, x).
virtual void assembleWithJacobian(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac)=0
virtual void updateConstraints(GlobalVector &, GlobalVector &, int const)
Definition: ODESystem.h:77
virtual void assemble(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)=0
Assemble M, K and b at the provided state (t, x).
virtual std::vector< NumLib::IndexValueVector< Index > > const * getKnownSolutions(double const, GlobalVector const &, int const) const
Definition: ODESystem.h:71
virtual void preAssemble(const double t, double const dt, GlobalVector const &x)=0
Calls process' pre-assembly with the provided state (t, dt, x).
virtual std::vector< GlobalIndexType > getIndicesOfResiduumWithoutInitialCompensation() const
Definition: ODESystem.h:54
ODESystemTag
Tag used to specify the type of ODE.
Definition: Types.h:27
static const double t