OGS
NumericalStabilization.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <Eigen/Core>
15#include <variant>
16#include <vector>
17
18#include "BaseLib/Error.h"
20
21namespace NumLib
22{
34struct NoStabilization final
35{
36};
37
53{
54public:
55 IsotropicDiffusionStabilization(double const cutoff_velocity,
56 double const tuning_parameter,
57 std::vector<double>&& element_sizes);
58
59 double computeArtificialDiffusion(std::size_t const element_id,
60 double const velocity_norm) const;
61
62private:
65 double const cutoff_velocity_;
66
68 double const tuning_parameter_ = 0.5;
69
72 std::vector<double> const element_sizes_;
73};
74
160class FullUpwind final
161{
162public:
163 explicit FullUpwind(double const cutoff_velocity)
164 : cutoff_velocity_(cutoff_velocity)
165 {
166 }
167
168 double getCutoffVelocity() const { return cutoff_velocity_; }
169
170private:
173 double const cutoff_velocity_;
174};
175
177{
178public:
180 {
181#ifdef USE_PETSC
182 OGS_FATAL(
183 "FluxCorrectedTransport scheme is not implemented to work with MPI "
184 "parallelization.");
185#endif
186 }
187
189 const double t, const double dt, std::vector<GlobalVector*> const& x,
190 std::vector<GlobalVector*> const& x_prev, int const process_id,
191 const MathLib::MatrixSpecifications& matrix_specification,
193};
194
198} // namespace NumLib
#define OGS_FATAL(...)
Definition Error.h:26
Global vector based on Eigen vector.
Definition EigenVector.h:25
void calculateFluxCorrectedTransport(const double t, const double dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, const MathLib::MatrixSpecifications &matrix_specification, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
FullUpwind(double const cutoff_velocity)
double computeArtificialDiffusion(std::size_t const element_id, double const velocity_norm) const
IsotropicDiffusionStabilization(double const cutoff_velocity, double const tuning_parameter, std::vector< double > &&element_sizes)
double const tuning_parameter_
The tuning parameter in the range [0,1].
std::variant< NoStabilization, IsotropicDiffusionStabilization, FullUpwind, FluxCorrectedTransport > NumericalStabilization