11#include "libmesh/utility.h"
20 params.
addParam<RealVectorValue>(
"point", RealVectorValue(0, 0, 0),
"A point on the plane.");
22 "normal", RealVectorValue(0, 1, 0),
"The normal vector to the plane.");
23 params.
addParam<Real>(
"epsilon", 0.01,
"The interface thickness.");
29 _point(getParam<RealVectorValue>(
"point")),
30 _normal(getParam<RealVectorValue>(
"normal")),
31 _epsilon(getParam<Real>(
"epsilon"))
39 const Real distance_from_orgin = -unit_normal *
_point;
40 const Real
x = -(unit_normal *
p + distance_from_orgin) /
_epsilon;
42 return 1.0 / (1 + std::exp(
x));
49 const Real distance_from_orgin = -unit_normal *
_point;
50 const Real
x = -(unit_normal *
p + distance_from_orgin) /
_epsilon;
57 x_prime = -unit_normal(i) /
_epsilon;
58 output(i) = -(x_prime * std::exp(
x)) / Utility::pow<2>(std::exp(
x) + 1);
const std::vector< double > x
registerMooseObject("LevelSetApp", LevelSetOlssonPlane)
static InputParameters validParams()
Implementation of a level set function to represent a plane.
const Real & _epsilon
The interface thickness.
const RealVectorValue & _point
A point on the plane.
LevelSetOlssonPlane(const InputParameters ¶meters)
static InputParameters validParams()
virtual RealGradient gradient(Real, const Point &p) const override
const RealVectorValue & _normal
The normal vector to the plane.
virtual Real value(Real, const Point &p) const override
static constexpr std::size_t dim