Line data Source code
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 : 10 : #include "SmoothSuperellipsoidIC.h" 11 : 12 : registerMooseObject("PhaseFieldApp", SmoothSuperellipsoidIC); 13 : 14 : InputParameters 15 34 : SmoothSuperellipsoidIC::validParams() 16 : { 17 34 : InputParameters params = SmoothSuperellipsoidBaseIC::validParams(); 18 34 : params.addClassDescription("Superellipsoid with a smooth interface"); 19 68 : params.addRequiredParam<Real>("x1", "The x coordinate of the superellipsoid center"); 20 68 : params.addRequiredParam<Real>("y1", "The y coordinate of the superellipsoid center"); 21 68 : params.addParam<Real>("z1", 0.0, "The z coordinate of the superellipsoid center"); 22 68 : params.addRequiredParam<Real>("a", "Semiaxis a of the superellipsoid"); 23 68 : params.addRequiredParam<Real>("b", "Semiaxis b of the superellipsoid"); 24 68 : params.addParam<Real>("c", 1.0, "Semiaxis c of the superellipsoid"); 25 68 : params.addRequiredParam<Real>("n", "Exponent n of the superellipsoid"); 26 34 : return params; 27 0 : } 28 : 29 18 : SmoothSuperellipsoidIC::SmoothSuperellipsoidIC(const InputParameters & parameters) 30 : : SmoothSuperellipsoidBaseIC(parameters), 31 18 : _x1(parameters.get<Real>("x1")), 32 18 : _y1(parameters.get<Real>("y1")), 33 18 : _z1(parameters.get<Real>("z1")), 34 18 : _a(parameters.get<Real>("a")), 35 18 : _b(parameters.get<Real>("b")), 36 18 : _c(parameters.get<Real>("c")), 37 18 : _n(parameters.get<Real>("n")), 38 36 : _center(_x1, _y1, _z1) 39 : { 40 18 : } 41 : 42 : void 43 15 : SmoothSuperellipsoidIC::computeSuperellipsoidCenters() 44 : { 45 15 : _centers = {_center}; 46 15 : } 47 : 48 : void 49 15 : SmoothSuperellipsoidIC::computeSuperellipsoidSemiaxes() 50 : { 51 15 : _as = {_a}; 52 15 : _bs = {_b}; 53 15 : _cs = {_c}; 54 15 : } 55 : 56 : void 57 15 : SmoothSuperellipsoidIC::computeSuperellipsoidExponents() 58 : { 59 15 : _ns = {_n}; 60 15 : }