include/meltpooldg/level_set/utilities.hpp Source File

Developer Documentation: include/meltpooldg/level_set/utilities.hpp Source File
Developer Documentation
utilities.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cmath>
5{
11 template <typename number>
12 inline number
13 smooth_heaviside_from_distance_value(const number x /*distance*/)
14 {
15 if (x > 0)
17 else if (x < -2.)
18 return 0;
19 else if (x < -1.)
20 {
21 const number x2 = x * x;
22 return (0.125 * (5. * x + x2) +
23 0.03125 * (-3. - 2. * x) * std::sqrt(-7. - 12. * x - 4. * x2) -
24 0.0625 * std::asin(std::sqrt(2.) * (x + 1.5)) + 23. * 0.03125 -
25 dealii::numbers::PI / 64.);
26 }
27 else
28 {
29 const number x2 = x * x;
30 return (0.125 * (3. * x + x2) -
31 0.03125 * (-1. - 2. * x) * std::sqrt(1. - 4. * x - 4. * x2) +
32 0.0625 * std::asin(std::sqrt(2.) * (x + 0.5)) + 15. * 0.03125 -
33 dealii::numbers::PI / 64.);
34 }
35 }
36} // namespace MeltPoolDG::LevelSet
This operation solves the reinitialization problem for a CG- or DG-FEM-based discrete level-set field...
Definition advection_DG_operation.hpp:20
number smooth_heaviside_from_distance_value(const number x)
Definition utilities.hpp:13