OGS
ODESystem.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "EquationSystem.h"
16#include "Types.h"
17
18namespace NumLib
19{
22
31template <ODESystemTag ODETag, NonlinearSolverTag NLTag>
33
38template <>
41{
42public:
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& x_prev,
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
85 {
86 return false;
87 }
88};
89
95template <>
98 : public ODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
99 NonlinearSolverTag::Picard>
100{
101public:
103 void preAssemble(const double t, double const dt,
104 GlobalVector const& x) override = 0;
105
114 virtual void assembleWithJacobian(const double t, double const dt,
115 std::vector<GlobalVector*> const& x,
116 std::vector<GlobalVector*> const& x_prev,
117 int const process_id, GlobalVector& b,
118 GlobalMatrix& Jac) = 0;
119};
120
122} // namespace NumLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
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 &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac)=0
virtual std::vector< NumLib::IndexValueVector< Index > > const * getKnownSolutions(double const, GlobalVector const &, int const) const
Definition ODESystem.h:71
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 &x_prev, 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< GlobalIndexType > getIndicesOfResiduumWithoutInitialCompensation() const
Definition ODESystem.h:54
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