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 "InitialConditionInterface.h" 11 : #include "InputParameters.h" 12 : #include "MooseEnum.h" 13 : 14 : InputParameters 15 449505 : InitialConditionInterface::validParams() 16 : { 17 449505 : InputParameters params = emptyInputParameters(); 18 : 19 449505 : MooseEnum stateEnum("CURRENT=0 OLD=1 OLDER=2", "CURRENT"); 20 449505 : params.addParam<MooseEnum>( 21 : "state", 22 : stateEnum, 23 : "This parameter is used to set old state solutions at the start of simulation. If specifying " 24 : "multiple states at the start of simulation, use one IC object for each state being " 25 : "specified. The states are CURRENT=0 OLD=1 OLDER=2. States older than 2 are not currently " 26 : "supported. When the user only specifies current state, the solution is copied to the old " 27 : "and older states, as expected. This functionality is mainly used for dynamic simulations " 28 : "with explicit time integration schemes, where old solution states are used in the velocity " 29 : "and acceleration approximations."); 30 : 31 899010 : return params; 32 449505 : } 33 : 34 33402 : InitialConditionInterface::InitialConditionInterface(const InputParameters & parameters) 35 33402 : : _my_state(parameters.get<MooseEnum>("state")) 36 : { 37 33402 : } 38 : 39 30056 : InitialConditionInterface::~InitialConditionInterface() {} 40 : 41 : unsigned short 42 2351644 : InitialConditionInterface::getState() const 43 : { 44 2351644 : return _my_state; 45 : }