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: " +
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
registerMooseObjectRenamed("MooseApp", SolutionInitialCondition, "06/30/2024 24:00", SolutionIC)
registerMooseObject("MooseApp", SolutionIC)
const std::set< SubdomainID > & meshBlockIDs() const
Return all of the SubdomainIDs for the mesh.
virtual bool blockRestricted() const
Returns true if this object has been restricted to a block.
const std::vector< SubdomainName > & blocks() const
Return the block names for this object.
SystemBase & _sys
The system object.
This is a template class that implements the workhorse compute and computeNodal methods.
static InputParameters validParams()
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 ...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
std::vector< SubdomainName > getSubdomainNames(const std::vector< SubdomainID > &subdomain_ids) const
Get the associated subdomainNames for the subdomain ids that are passed in.
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Class for reading an initial condition from a solution user object.
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
const SolutionUserObjectBase & _solution_object
SolutionUserObject containing the solution of interest.
std::set< SubdomainID > _exo_block_ids
Remapped IDs from the current mesh to the ExodusII mesh.
static InputParameters validParams()
const VariableName & _solution_object_var_name
The variable name extracted from the SolutionUserObject.
SolutionIC(const InputParameters ¶meters)
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.
MooseEnum getSolutionFileType() const
Get the type of file that was read.
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)
const std::string getMeshFileName() const
Return the name of the mesh file this object read the solution from.
const std::map< SubdomainID, SubdomainName > & getBlockIdsToNames() const
Get the map from block id to block name.
const std::map< SubdomainName, SubdomainID > & getBlockNamesToIds() const
Get the map from block name to block ID.