https://mooseframework.inl.gov
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"
11 #include "SolutionUserObjectBase.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");
28  params.addClassDescription(
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 
42 Real
44 {
46 }
const SolutionUserObjectBase & _solution_object
SolutionUserObject containing the solution of interest.
const VariableName & _solution_object_var_name
The variable name extracted from the SolutionUserObject.
registerMooseObjectRenamed("MooseApp", ScalarSolutionInitialCondition, "06/30/2024 24:00", ScalarSolutionIC)
User object that reads an existing solution from an input file and uses it in the current simulation...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Class for reading an initial condition from a solution user object.
virtual Real value() override
The value of the variable.
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...
InitialConditions are objects that set the initial value of variables.
static InputParameters validParams()
Real scalarValue(Real t, const std::string &var_name) const
Returns a value of a global variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ScalarSolutionIC(const InputParameters &parameters)
static InputParameters validParams()
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...
registerMooseObject("MooseApp", ScalarSolutionIC)