OGS
ODESystem.h
Go to the documentation of this file.
1 
11 #pragma once
12 
15 
16 #include "EquationSystem.h"
17 #include "Types.h"
18 
19 namespace NumLib
20 {
23 
32 template <ODESystemTag ODETag, NonlinearSolverTag NLTag>
33 class ODESystem;
34 
39 template <>
42 {
43 public:
45  static const ODESystemTag ODETag =
47 
49  virtual void preAssemble(const double t, double const dt,
50  GlobalVector const& x) = 0;
51 
53  virtual void assemble(const double t, double const dt,
54  std::vector<GlobalVector*> const& x,
55  std::vector<GlobalVector*> const& xdot,
56  int const process_id, GlobalMatrix& M,
57  GlobalMatrix& K, GlobalVector& b) = 0;
58 
60 
63  virtual std::vector<NumLib::IndexValueVector<Index>> const*
64  getKnownSolutions(double const /*t*/, GlobalVector const& /*x*/,
65  int const /*process_id*/) const
66  {
67  return nullptr; // by default there are no known solutions
68  }
69 };
70 
76 template <>
79  : public ODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
80  NonlinearSolverTag::Picard>
81 {
82 public:
84  void preAssemble(const double t, double const dt,
85  GlobalVector const& x) override = 0;
86 
131  virtual void assembleWithJacobian(const double t, double const dt,
132  std::vector<GlobalVector*> const& x,
133  std::vector<GlobalVector*> const& xdot,
134  const double dxdot_dx, const double dx_dx,
135  int const process_id, GlobalMatrix& M,
136  GlobalMatrix& K, GlobalVector& b,
137  GlobalMatrix& Jac) = 0;
138 };
139 
141 } // namespace NumLib
Types.h
NumLib
Definition: ProjectData.h:35
NumLib::ODESystem
Definition: ODESystem.h:33
EquationSystem.h
NumLib::ODESystemTag
ODESystemTag
Tag used to specify the type of ODE.
Definition: Types.h:26
NumLib::ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >::Index
MathLib::MatrixVectorTraits< GlobalMatrix >::Index Index
Definition: ODESystem.h:59
NumLib::EquationSystem
Definition: EquationSystem.h:30
MathLib::MatrixVectorTraits
Definition: MatrixVectorTraits.h:19
NumLib::NonlinearSolverTag::Picard
@ Picard
IndexValueVector.h
NumLib::ODESystemTag::FirstOrderImplicitQuasilinear
@ FirstOrderImplicitQuasilinear
NumLib::NonlinearSolverTag::Newton
@ Newton
NumLib::ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >::getKnownSolutions
virtual std::vector< NumLib::IndexValueVector< Index > > const * getKnownSolutions(double const, GlobalVector const &, int const) const
Definition: ODESystem.h:64
MatrixVectorTraits.h