https://mooseframework.inl.gov
SmoothCircleICLinearizedInterface.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
13 
16 {
18  params.addClassDescription(
19  "Circle with a smooth interface transformed using the linearized interface function");
20  params.addRequiredParam<Real>(
21  "bound_value", "Bound value used to keep variable between +/-bound. Must be positive.");
22  return params;
23 }
24 
26  const InputParameters & parameters)
27  : SmoothCircleIC(parameters), _bound(parameters.get<Real>("bound_value"))
28 {
29 }
30 
31 Real
33 {
34  // Transform bound into the order parameter space
35  const Real trans_bound = (1.0 + std::tanh(-_bound / std::sqrt(2.0))) / 2.0;
36 
37  // Get IC value for the order parameter
38  const Real trans_value = SmoothCircleIC::value(p);
39 
40  // Transform order parameter value into linearized interface variable
41  Real value = 0.0;
42 
43  if (trans_value < trans_bound)
44  value = -_bound;
45  else if (trans_value > 1.0 - trans_bound)
46  value = _bound;
47  else
48  value = std::sqrt(2.0) * std::atanh(2.0 * trans_value - 1.0);
49 
50  return value;
51 }
SmoothcircleIC creates a circle of a given radius centered at a given point in the domain...
SmoothCircleICLinearizedInterface creates a circle of a given radius centered at a given point in the...
registerMooseObject("PhaseFieldApp", SmoothCircleICLinearizedInterface)
SmoothCircleICLinearizedInterface(const InputParameters &parameters)
virtual Real value(const Point &p)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const Elem & get(const ElemType type_in)