OGS
NonlinearSystem.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "EquationSystem.h"
15#include "Types.h"
16
17namespace NumLib
18{
21
26template <NonlinearSolverTag NLTag>
28
34template <>
36{
37public:
41 virtual void assemble(std::vector<GlobalVector*> const& x,
42 std::vector<GlobalVector*> const& x_prev,
43 int const process_id) = 0;
44
47 virtual std::vector<GlobalIndexType>
49
56 virtual void getResidual(GlobalVector const& x,
57 GlobalVector const& x_prev,
58 GlobalVector& res) const = 0;
59
64 virtual void getJacobian(GlobalMatrix& Jac) const = 0;
65
67 virtual void computeKnownSolutions(GlobalVector const& x,
68 int const process_id) = 0;
69
72 virtual void applyKnownSolutions(GlobalVector& x) const = 0;
73
78 GlobalMatrix& Jac, GlobalVector& res, GlobalVector const& x,
79 GlobalVector& minus_delta_x) const = 0;
80
85 GlobalVector& res,
86 GlobalVector& x) const = 0;
87
88 virtual void updateConstraints(GlobalVector& /*lower*/,
89 GlobalVector& /*upper*/,
90 int /*process_id*/) = 0;
91};
92
99template <>
101{
102public:
106 virtual void assemble(std::vector<GlobalVector*> const& x,
107 std::vector<GlobalVector*> const& x_prev,
108 int const process_id) = 0;
109
112 virtual std::vector<GlobalIndexType>
114
117 virtual void getA(GlobalMatrix& A) const = 0;
118
121 virtual void getRhs(GlobalVector const& x_prev,
122 GlobalVector& rhs) const = 0;
123
128 GlobalVector& rhs) const = 0;
129
131 virtual void computeKnownSolutions(GlobalVector const& x,
132 int const process_id) = 0;
133
136 virtual void applyKnownSolutions(GlobalVector& x) const = 0;
137
142 GlobalVector& x) const = 0;
143
147 const = 0;
148};
149
151} // namespace NumLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
virtual void applyKnownSolutionsNewton(GlobalMatrix &Jac, GlobalVector &res, GlobalVector const &x, GlobalVector &minus_delta_x) const =0
virtual std::vector< GlobalIndexType > getIndicesOfResiduumWithoutInitialCompensation() const =0
virtual void updateConstraints(GlobalVector &, GlobalVector &, int)=0
virtual void assemble(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id)=0
virtual void getJacobian(GlobalMatrix &Jac) const =0
virtual void getResidual(GlobalVector const &x, GlobalVector const &x_prev, GlobalVector &res) const =0
virtual void applyKnownSolutions(GlobalVector &x) const =0
virtual void computeKnownSolutions(GlobalVector const &x, int const process_id)=0
Pre-compute known solutions and possibly store them internally.
virtual void applyKnownSolutionsPETScSNES(GlobalMatrix &Jac, GlobalVector &res, GlobalVector &x) const =0
virtual void applyKnownSolutionsPicard(GlobalMatrix &A, GlobalVector &rhs, GlobalVector &x) const =0
virtual MathLib::LinearSolverBehaviour linearSolverNeedsToCompute() const =0
virtual void getA(GlobalMatrix &A) const =0
virtual std::vector< GlobalIndexType > getIndicesOfResiduumWithoutInitialCompensation() const =0
virtual void computeKnownSolutions(GlobalVector const &x, int const process_id)=0
Pre-compute known solutions and possibly store them internally.
virtual void applyKnownSolutions(GlobalVector &x) const =0
virtual void assemble(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id)=0
virtual void getAandRhsNormalized(GlobalMatrix &A, GlobalVector &rhs) const =0
virtual void getRhs(GlobalVector const &x_prev, GlobalVector &rhs) const =0
NonlinearSolverTag
Tag used to specify which nonlinear solver will be used.
Definition Types.h:20