www.mooseframework.org
SpecifiedSmoothSuperellipsoidIC.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 #include "MooseRandom.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<SmoothSuperellipsoidBaseIC>();
15  params.addClassDescription("Multiple smooth superellipsoids with manually specified center "
16  "points; semiaxes a,b,c; and exponents n");
17  params.addRequiredParam<std::vector<Real>>("x_positions",
18  "The x-coordinate for each superellipsoid center");
19  params.addRequiredParam<std::vector<Real>>("y_positions",
20  "The y-coordinate for each superellipsoid center");
21  params.addRequiredParam<std::vector<Real>>("z_positions",
22  "The z-coordinate for each superellipsoid center");
23  params.addRequiredParam<std::vector<Real>>("as", "Semiaxis a for each superellipsoid");
24  params.addRequiredParam<std::vector<Real>>("bs", "Semiaxis b for each superellipsoid");
25  params.addRequiredParam<std::vector<Real>>("cs", "Semiaxis c for each superellipsoid");
26  params.addRequiredParam<std::vector<Real>>("ns", "Exponent n for each superellipsoid");
27 
28  return params;
29 }
30 
32  : SmoothSuperellipsoidBaseIC(parameters),
33  _x_positions(getParam<std::vector<Real>>("x_positions")),
34  _y_positions(getParam<std::vector<Real>>("y_positions")),
35  _z_positions(getParam<std::vector<Real>>("z_positions")),
36  _input_as(getParam<std::vector<Real>>("as")),
37  _input_bs(getParam<std::vector<Real>>("bs")),
38  _input_cs(getParam<std::vector<Real>>("cs")),
39  _input_ns(getParam<std::vector<Real>>("ns"))
40 {
41 }
42 
43 void
45 {
46  _centers.resize(_x_positions.size());
47 
48  for (unsigned int circ = 0; circ < _x_positions.size(); ++circ)
49  {
50  _centers[circ](0) = _x_positions[circ];
51  _centers[circ](1) = _y_positions[circ];
52  _centers[circ](2) = _z_positions[circ];
53  }
54 }
55 
56 void
58 {
59  _as.resize(_input_as.size());
60  _bs.resize(_input_bs.size());
61  _cs.resize(_input_cs.size());
62 
63  for (unsigned int circ = 0; circ < _input_as.size(); ++circ)
64  {
65  _as[circ] = _input_as[circ];
66  _bs[circ] = _input_bs[circ];
67  _cs[circ] = _input_cs[circ];
68  }
69 }
70 
71 void
73 {
74  _ns.resize(_input_ns.size());
75 
76  for (unsigned int circ = 0; circ < _input_ns.size(); ++circ)
77  _ns[circ] = _input_ns[circ];
78 }
SmoothSuperellipsoidBaseIC is the base class for all initial conditions that create superellipsoids...
InputParameters validParams< SmoothSuperellipsoidBaseIC >()
SpecifiedSmoothSuperellipsoidIC(const InputParameters &parameters)
InputParameters validParams< SpecifiedSmoothSuperellipsoidIC >()