https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ScalarSolutionIC.C
Go to the documentation of this file.
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 "ScalarSolutionIC.h"
12#include "MooseMesh.h"
13
16 ScalarSolutionInitialCondition,
17 "06/30/2024 24:00",
19
22{
24 params.addRequiredParam<UserObjectName>("solution_uo",
25 "The SolutionUserObject to extract data from.");
26 params.addRequiredParam<VariableName>(
27 "from_variable", "The name of the variable in the file that is to be extracted");
29 "Sets the initial condition from a scalar variable stored in an Exodus file, "
30 "retrieved by a SolutionUserObject");
31
32 return params;
33}
34
36 : ScalarInitialCondition(parameters),
37 _solution_object(getUserObject<SolutionUserObjectBase>("solution_uo")),
38 _solution_object_var_name(getParam<VariableName>("from_variable"))
39{
40}
41
42Real
registerMooseObjectRenamed("MooseApp", ScalarSolutionInitialCondition, "06/30/2024 24:00", ScalarSolutionIC)
registerMooseObject("MooseApp", ScalarSolutionIC)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
InitialConditions are objects that set the initial value of variables.
static InputParameters validParams()
Class for reading an initial condition from a solution user object.
const SolutionUserObjectBase & _solution_object
SolutionUserObject containing the solution of interest.
ScalarSolutionIC(const InputParameters &parameters)
const VariableName & _solution_object_var_name
The variable name extracted from the SolutionUserObject.
virtual Real value() override
The value of the variable.
static InputParameters validParams()
User object that reads an existing solution from an input file and uses it in the current simulation.
Real scalarValue(Real t, const std::string &var_name) const
Returns a value of a global variable.