23 "The SolutionUserObject to extract data from.");
25 "from_variable",
"The name of the variable in the file that is to be extracted");
26 params.
addParam<std::vector<SubdomainName>>(
28 "The name(s) of the subdomain(s) in the solution file providing the data. If not specified, " 29 "will default to the block restriction specified by the 'block' parameter.");
31 "Sets the initial condition from a field variable stored in an Exodus file, " 32 "retrieved by a SolutionUserObject");
39 _solution_object_var_name(getParam<VariableName>(
"from_variable"))
53 const auto blocks_to_check =
55 ? getParam<std::vector<SubdomainName>>(
"from_subdomains")
58 for (
auto & blk_name : blocks_to_check)
60 auto it = block_names_to_ids_from.find(blk_name);
61 if (it != block_names_to_ids_from.end())
69 if (block_ids_to_names_from.find(blk_id) != block_ids_to_names_from.end() &&
70 block_ids_to_names_from.find(blk_id)->second.empty())
75 "' does not exist in the file '",
84 "Source subdomain block restriction is not supported if the solution file type is " 85 "not Exodus. Current file type: " +
registerMooseObjectRenamed("MooseApp", SolutionInitialCondition, "06/30/2024 24:00", SolutionIC)
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
virtual Real value(const Point &p) override
The value of the variable at a point.
User object that reads an existing solution from an input file and uses it in the current simulation...
Class for reading an initial condition from a solution user object.
This is a template class that implements the workhorse compute and computeNodal methods.
MooseEnum getSolutionFileType() const
Get the type of file that was read.
static InputParameters validParams()
registerMooseObject("MooseApp", SolutionIC)
virtual bool blockRestricted() const
Returns true if this object has been restricted to a block.
const VariableName & _solution_object_var_name
The variable name extracted from the SolutionUserObject.
const SolutionUserObjectBase & _solution_object
SolutionUserObject containing the solution of interest.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const std::string getMeshFileName() const
Return the name of the mesh file this object read the solution from.
SystemBase & _sys
The system object.
static InputParameters validParams()
std::set< SubdomainID > _exo_block_ids
Remapped IDs from the current mesh to the ExodusII mesh.
SolutionIC(const InputParameters ¶meters)
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
std::vector< SubdomainName > getSubdomainNames(const std::vector< SubdomainID > &subdomain_ids) const
Get the associated subdomainNames for the subdomain ids that are passed in.
const std::vector< SubdomainName > & blocks() const
Return the block names for this object.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::map< SubdomainName, SubdomainID > & getBlockNamesToIds() const
Get the map from block name to block ID.
const std::set< SubdomainID > & meshBlockIDs() const
Return all of the SubdomainIDs for the mesh.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const std::map< SubdomainID, SubdomainName > & getBlockIdsToNames() const
Get the map from block id to block name.
Real pointValue(Real t, const Point &p, const unsigned int local_var_index, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns a value at a specific location and variable (see SolutionFunction)
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.