www.mooseframework.org
SpecifiedSmoothCircleIC.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<SmoothCircleBaseIC>();
15  params.addClassDescription(
16  "Multiple smooth circles with manually specified radii and center points");
17  params.addRequiredParam<std::vector<Real>>("x_positions",
18  "The x-coordinate for each circle center");
19  params.addRequiredParam<std::vector<Real>>("y_positions",
20  "The y-coordinate for each circle center");
21  params.addRequiredParam<std::vector<Real>>("z_positions",
22  "The z-coordinate for each circle center");
23  params.addRequiredParam<std::vector<Real>>("radii", "The radius for each circle");
24 
25  return params;
26 }
27 
28 SpecifiedSmoothCircleIC::SpecifiedSmoothCircleIC(const InputParameters & parameters)
29  : SmoothCircleBaseIC(parameters),
30  _x_positions(getParam<std::vector<Real>>("x_positions")),
31  _y_positions(getParam<std::vector<Real>>("y_positions")),
32  _z_positions(getParam<std::vector<Real>>("z_positions")),
33  _input_radii(getParam<std::vector<Real>>("radii"))
34 {
35 }
36 
37 void
39 {
40  _radii.resize(_input_radii.size());
41 
42  for (unsigned int circ = 0; circ < _input_radii.size(); ++circ)
43  _radii[circ] = _input_radii[circ];
44 }
45 
46 void
48 {
49  _centers.resize(_x_positions.size());
50 
51  for (unsigned int circ = 0; circ < _x_positions.size(); ++circ)
52  {
53  _centers[circ](0) = _x_positions[circ];
54  _centers[circ](1) = _y_positions[circ];
55  _centers[circ](2) = _z_positions[circ];
56  }
57 }
std::vector< Real > _input_radii
InputParameters validParams< SpecifiedSmoothCircleIC >()
std::vector< Real > _radii
SpecifiedSmoothCircleIC(const InputParameters &parameters)
std::vector< Point > _centers
std::vector< Real > _x_positions
SmoothcircleBaseIC is the base class for all initial conditions that create circles.
InputParameters validParams< SmoothCircleBaseIC >()
std::vector< Real > _z_positions
std::vector< Real > _y_positions