www.mooseframework.org
SpecifiedSmoothSuperellipsoidIC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "MooseRandom.h"
12 
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<SmoothSuperellipsoidBaseIC>();
20  params.addClassDescription("Multiple smooth superellipsoids with manually specified center "
21  "points; semiaxes a,b,c; and exponents n");
22  params.addRequiredParam<std::vector<Real>>("x_positions",
23  "The x-coordinate for each superellipsoid center");
24  params.addRequiredParam<std::vector<Real>>("y_positions",
25  "The y-coordinate for each superellipsoid center");
26  params.addRequiredParam<std::vector<Real>>("z_positions",
27  "The z-coordinate for each superellipsoid center");
28  params.addRequiredParam<std::vector<Real>>("as", "Semiaxis a for each superellipsoid");
29  params.addRequiredParam<std::vector<Real>>("bs", "Semiaxis b for each superellipsoid");
30  params.addRequiredParam<std::vector<Real>>("cs", "Semiaxis c for each superellipsoid");
31  params.addRequiredParam<std::vector<Real>>("ns", "Exponent n for each superellipsoid");
32 
33  return params;
34 }
35 
37  : SmoothSuperellipsoidBaseIC(parameters),
38  _x_positions(getParam<std::vector<Real>>("x_positions")),
39  _y_positions(getParam<std::vector<Real>>("y_positions")),
40  _z_positions(getParam<std::vector<Real>>("z_positions")),
41  _input_as(getParam<std::vector<Real>>("as")),
42  _input_bs(getParam<std::vector<Real>>("bs")),
43  _input_cs(getParam<std::vector<Real>>("cs")),
44  _input_ns(getParam<std::vector<Real>>("ns"))
45 {
46 }
47 
48 void
50 {
51  _centers.resize(_x_positions.size());
52 
53  for (unsigned int circ = 0; circ < _x_positions.size(); ++circ)
54  {
55  _centers[circ](0) = _x_positions[circ];
56  _centers[circ](1) = _y_positions[circ];
57  _centers[circ](2) = _z_positions[circ];
58  }
59 }
60 
61 void
63 {
64  _as.resize(_input_as.size());
65  _bs.resize(_input_bs.size());
66  _cs.resize(_input_cs.size());
67 
68  for (unsigned int circ = 0; circ < _input_as.size(); ++circ)
69  {
70  _as[circ] = _input_as[circ];
71  _bs[circ] = _input_bs[circ];
72  _cs[circ] = _input_cs[circ];
73  }
74 }
75 
76 void
78 {
79  _ns.resize(_input_ns.size());
80 
81  for (unsigned int circ = 0; circ < _input_ns.size(); ++circ)
82  _ns[circ] = _input_ns[circ];
83 }
registerMooseObject("PhaseFieldApp", SpecifiedSmoothSuperellipsoidIC)
SmoothSuperellipsoidBaseIC is the base class for all initial conditions that create superellipsoids...
SpecifiedSmoothSuperellipsoidIC creates multiple SmoothSuperellipsoids (number = size of x_positions)...
InputParameters validParams< SmoothSuperellipsoidBaseIC >()
SpecifiedSmoothSuperellipsoidIC(const InputParameters &parameters)
InputParameters validParams< SpecifiedSmoothSuperellipsoidIC >()