https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PolycrystalColoringICLinearizedInterface.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("Sets up polycrystal initial conditions from user objects for "
19 "transformed linearized interface");
20 params.addRequiredParam<Real>(
21 "bound_value", "Bound value used to keep variable between +/-bound. Must be positive.");
22
23 return params;
24}
25
27 const InputParameters & parameters)
28 : PolycrystalColoringIC(parameters), _bound(parameters.get<Real>("bound_value"))
29{
30}
31
32Real
34{
35 // Transform bound into the order parameter space
36 const Real trans_bound = (1.0 + std::tanh(-_bound / std::sqrt(2.0))) / 2.0;
37
38 // Get IC value for the order parameter
39 const Real trans_value = PolycrystalColoringIC::value(p);
40
41 Real value = 0.0;
42 if (trans_value < trans_bound)
43 value = -_bound;
44 else if (trans_value > 1.0 - trans_bound)
45 value = _bound;
46 else
47 value = std::sqrt(2.0) * std::atanh(2.0 * trans_value - 1.0);
48
49 return value;
50}
const Real p
registerMooseObject("PhaseFieldApp", PolycrystalColoringICLinearizedInterface)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
PolycrystalColoringICLinearizedInterface creates a polycrystal initial condition from a user object w...
PolycrystalColoringICLinearizedInterface(const InputParameters &parameters)
PolycrystalColoringIC creates a polycrystal initial condition.
static InputParameters validParams()
virtual Real value(const Point &p) override