OGS
NumericalStabilization.cpp
Go to the documentation of this file.
1
12
13#include "BaseLib/ConfigTree.h"
14#include "BaseLib/Error.h"
15#include "MeshLib/Mesh.h"
17
18namespace NumLib
19{
20
22 double const cutoff_velocity,
23 double const tuning_parameter,
24 std::vector<double>&& element_sizes)
25 : cutoff_velocity_(cutoff_velocity),
26 tuning_parameter_(tuning_parameter),
27 element_sizes_(std::move(element_sizes))
28{
29 if (tuning_parameter_ < 0 || tuning_parameter_ > 1.0)
30 {
32 "The tuning parameter value {:g} for "
33 "IsotropicDiffusion stabilization is out of range [0, 1]",
35 }
36}
37
39 std::size_t const element_id, double const velocity_norm) const
40{
41 if (velocity_norm < cutoff_velocity_)
42 {
43 return 0.0;
44 }
45 return 0.5 * tuning_parameter_ * velocity_norm * element_sizes_[element_id];
46}
47} // namespace NumLib
#define OGS_FATAL(...)
Definition Error.h:26
Definition of the Mesh class.
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].