OGS
ODESystem.h
Go to the documentation of this file.
1
10
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
59 virtual void setReleaseNodalForces(GlobalVector const* /*r_neq*/,
60 int const /*process_id*/)
61 {
62 }
63
65 virtual void assemble(const double t, double const dt,
66 std::vector<GlobalVector*> const& x,
67 std::vector<GlobalVector*> const& x_prev,
68 int const process_id, GlobalMatrix& M,
69 GlobalMatrix& K, GlobalVector& b) = 0;
70
72
75 virtual std::vector<NumLib::IndexValueVector<Index>> const*
76 getKnownSolutions(double const /*t*/, GlobalVector const& /*x*/,
77 int const /*process_id*/) const
78 {
79 return nullptr; // by default there are no known solutions
80 }
81
82 virtual void updateConstraints(GlobalVector& /*lower*/,
83 GlobalVector& /*upper*/,
84 int const /*process_id*/){};
85
90 {
91 return false;
92 }
93};
94
100template <>
103 : public ODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
104 NonlinearSolverTag::Picard>
105{
106public:
108 void preAssemble(const double t, double const dt,
109 GlobalVector const& x) override = 0;
110
119 virtual void assembleWithJacobian(const double t, double const dt,
120 std::vector<GlobalVector*> const& x,
121 std::vector<GlobalVector*> const& x_prev,
122 int const process_id, GlobalVector& b,
123 GlobalMatrix& Jac) = 0;
124};
125
127} // namespace NumLib
MathLib::EigenMatrix GlobalMatrix
MathLib::EigenVector GlobalVector
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:76
virtual void updateConstraints(GlobalVector &, GlobalVector &, int const)
Definition ODESystem.h:82
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).
static const ODESystemTag ODETag
A tag indicating the type of ODE.
Definition ODESystem.h:44
ODESystemTag
Tag used to specify the type of ODE.
Definition Types.h:27
@ FirstOrderImplicitQuasilinear
Definition Types.h:34