OGS
NonlinearSystem.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include "EquationSystem.h"
9#include "Types.h"
10
11namespace NumLib
12{
15
20template <NonlinearSolverTag NLTag>
22
28template <>
30{
31public:
35 virtual void assemble(std::vector<GlobalVector*> const& x,
36 std::vector<GlobalVector*> const& x_prev,
37 int const process_id) = 0;
38
41 virtual std::vector<GlobalIndexType>
42 getIndicesOfResiduumWithoutInitialCompensation() const = 0;
43
44 virtual void setReleaseNodalForces(GlobalVector const* /*r_neq*/,
45 int const /*process_id*/) = 0;
46
53 virtual void getResidual(GlobalVector const& x,
54 GlobalVector const& x_prev,
55 GlobalVector& res) const = 0;
56
61 virtual void getJacobian(GlobalMatrix& Jac) const = 0;
62
64 virtual void computeKnownSolutions(GlobalVector const& x,
65 int const process_id) = 0;
66
69 virtual void applyKnownSolutions(GlobalVector& x) const = 0;
70
74 virtual void applyKnownSolutionsNewton(
75 GlobalMatrix& Jac, GlobalVector& res, GlobalVector const& x,
76 GlobalVector& minus_delta_x) const = 0;
77
81 virtual void applyKnownSolutionsPETScSNES(GlobalMatrix& Jac,
82 GlobalVector& res,
83 GlobalVector& x) const = 0;
84
85 virtual void updateConstraints(GlobalVector& /*lower*/,
86 GlobalVector& /*upper*/,
87 int /*process_id*/) = 0;
88};
89
96template <>
98{
99public:
103 virtual void assemble(std::vector<GlobalVector*> const& x,
104 std::vector<GlobalVector*> const& x_prev,
105 int const process_id) = 0;
106
109 virtual std::vector<GlobalIndexType>
110 getIndicesOfResiduumWithoutInitialCompensation() const = 0;
111
112 virtual void setReleaseNodalForces(GlobalVector const* /*r_neq*/,
113 int const /*process_id*/) = 0;
114
117 virtual void getA(GlobalMatrix& A) const = 0;
118
121 virtual void getRhs(GlobalVector const& x_prev,
122 GlobalVector& rhs) const = 0;
123
127 virtual void getAandRhsNormalized(GlobalMatrix& A,
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
141 virtual void applyKnownSolutionsPicard(
143 MathLib::DirichletBCApplicationMode const mode) const = 0;
144
147 virtual MathLib::LinearSolverBehaviour linearSolverNeedsToCompute()
148 const = 0;
149};
150
152} // namespace NumLib
MathLib::EigenMatrix GlobalMatrix
MathLib::EigenVector GlobalVector
NonlinearSolverTag
Tag used to specify which nonlinear solver will be used.
Definition Types.h:13
DirichletBCApplicationMode
Definition LinAlgEnums.h:33