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 
52  virtual void assemble(const double t, double const dt,
53  std::vector<GlobalVector*> const& x,
54  std::vector<GlobalVector*> const& xdot,
55  int const process_id, GlobalMatrix& M,
56  GlobalMatrix& K, GlobalVector& b) = 0;
57 
59 
62  virtual std::vector<NumLib::IndexValueVector<Index>> const*
63  getKnownSolutions(double const /*t*/, GlobalVector const& /*x*/,
64  int const /*process_id*/) const
65  {
66  return nullptr; // by default there are no known solutions
67  }
68 
69  virtual void updateConstraints(GlobalVector& /*lower*/,
70  GlobalVector& /*upper*/,
71  int const /*process_id*/){};
72 };
73 
79 template <>
82  : public ODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
83  NonlinearSolverTag::Picard>
84 {
85 public:
87  void preAssemble(const double t, double const dt,
88  GlobalVector const& x) override = 0;
89 
134  virtual void assembleWithJacobian(const double t, double const dt,
135  std::vector<GlobalVector*> const& x,
136  std::vector<GlobalVector*> const& xdot,
137  const double dxdot_dx, const double dx_dx,
138  int const process_id, GlobalMatrix& M,
139  GlobalMatrix& K, GlobalVector& b,
140  GlobalMatrix& Jac) = 0;
141 };
142 
144 } // namespace NumLib
Global vector based on Eigen vector.
Definition: EigenVector.h:26
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, const double dxdot_dx, const double dx_dx, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac)=0
virtual void updateConstraints(GlobalVector &, GlobalVector &, int const)
Definition: ODESystem.h:69
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:63
virtual void preAssemble(const double t, double const dt, GlobalVector const &x)=0
Calls process' pre-assembly with the provided state (t, dt, x).
ODESystemTag
Tag used to specify the type of ODE.
Definition: Types.h:27