18 #include "libmesh/parallel_object.h" 102 template <
typename T>
111 template <
typename T>
141 std::shared_ptr<ClosuresBase>
getClosures(
const std::string &
name)
const;
152 const VariableName &
name,
154 Real scaling_factor = 1.0);
166 const VariableName &
name,
168 const std::vector<SubdomainName> & subdomain_names,
169 Real scaling_factor = 1.0);
180 const std::string & var_type,
181 const VariableName &
name,
191 const std::vector<SubdomainName> & block_names);
193 const std::string & func_name,
194 const std::vector<SubdomainName> & block_names);
199 const std::string &
name,
274 template <
typename T>
289 template <
typename T>
310 template <
typename T>
321 logError(
"Trying to declare '",
name,
"', but it was already declared.");
412 std::map<VariableName, VariableInfo>
_vars;
424 std::map<std::string, ICInfo>
_ics;
491 template <
typename T>
497 return dynamic_cast<T *>((it->second).get()) !=
nullptr;
502 template <
typename T>
508 return *dynamic_cast<T *>((it->second).get());
512 "' does not exist in the simulation. Use hasComponent or " 513 "checkComponnetByName before calling getComponent.");
Keeps the error and warning messages.
virtual void run()
Run the simulation.
Specialization of FEProblem to run with component subsystem.
bool _implicit_time_integration
true if using implicit time integration scheme
std::shared_ptr< ClosuresBase > getClosures(const std::string &name) const
Get a pointer to a closures object.
void setDeclared()
Mark the data as declared.
virtual void setupMesh()
Perform mesh setup actions such as setting up the coordinate system(s) and creating ghosted elements...
Interface for handling names.
void setupInitialConditionObjects()
void mooseError(Args &&... args)
Main class for simulation (the driver of the simulation)
void identifyLoops()
Identifies the component loops.
std::map< std::string, ICInfo > _ics
virtual void controlDataIntegrityCheck()
Check the integrity of the control data.
bool _check_jacobian
True if checking jacobian.
FEProblemBase & _fe_problem
Pointer to FEProblem representing this simulation.
THMMesh & _thm_mesh
THM mesh.
void addFileOutputter(const std::string &name)
bool getVectorValuedVelocity()
Is velocity output as vector-valued field.
virtual void addClosures(const std::string &type, const std::string &name, InputParameters params)
Add a closures object into this simulation.
void printComponentLoops() const
Prints the component loops.
ICInfo(const std::string &type, const InputParameters ¶ms)
Interface class for logging errors and warnings.
virtual void couplingMatrixIntegrityCheck() const
Check integrity of coupling matrix used by the preconditioner.
void addFunctionIC(const VariableName &var_name, const std::string &func_name, const std::vector< SubdomainName > &block_names)
void addRelationshipManagers()
Add additional relationship managers to run the simulation.
virtual void initSimulation()
Initialize this simulation.
Base class for closures implementations.
std::map< std::string, ControlDataValue * > _control_data
Control data created in the control logic system.
static std::map< VariableName, int > _component_variable_order_map
Component variable order map; see setComponentVariableOrder for more info.
void addSimVariable(bool nl, const VariableName &name, libMesh::FEType fe_type, Real scaling_factor=1.0)
Queues a variable of type MooseVariableScalar to be added to the nonlinear or aux system...
void checkVariableNameLength(const std::string &name) const
Reports an error if the variable name is too long.
bool hasComponent(const std::string &name) const
Find out if simulation has a component with the given name.
Concrete definition of a parameter value for a specified type.
libMesh::FEType _flow_fe_type
finite element type for the flow in the simulation
virtual void initComponents()
Initialize this simulation's components.
bool getDeclared()
Get the declared state.
bool hasControlData(const std::string &name)
Query if control data with name 'name' exists.
std::map< VariableName, VariableInfo > _vars
variables for this simulation (name and info about the var)
ThermalHydraulicsApp & getApp()
Get the ThermalHydraulicsApp.
void logError(Args &&... args) const
Logs an error.
std::vector< OutputName > _outputters_file
Factory & _thm_factory
The Factory associated with the MooseApp.
void setupInitialConditionsFromFile()
Setup reading initial conditions from a specified file, see 'initial_from_file' and 'initial_from_fil...
virtual void integrityCheck() const
Check the integrity of the simulation.
std::vector< OutputName > getOutputsVector(const std::string &key) const
Gets the vector of output names corresponding to a 1-word key string.
InputParameters _params
Input parameters.
void setControl(THMControl *ctrl)
Set the pointer to the control object that declared this control data.
void setCheckJacobian(bool state)
Enable Jacobian checking.
const T & getComponentByName(const std::string &name) const
Get component by its name.
Base class for THM components.
ControlData< T > * declareControlData(const std::string &name, THMControl *ctrl)
Declare control data of type T and name 'name', if it does not exist it will be created.
virtual void addMooseObjects()
Add component MOOSE objects.
std::vector< std::shared_ptr< Component > > _components
List of components in this simulation.
bool _output_vector_velocity
Flag indicating if velocity is output as vector-valued field.
std::map< std::string, std::string > _component_name_to_loop_name
Map of component name to component loop name.
std::map< std::string, std::shared_ptr< Component > > _comp_by_name
Map of components by their names.
void addConstantScalarIC(const VariableName &var_name, Real value)
const InputParameters & _thm_pars
"Global" of this simulation
void addScreenOutputter(const std::string &name)
virtual void setupQuadrature()
Sets up quadrature rules.
std::map< std::string, std::shared_ptr< ClosuresBase > > _closures_by_name
Map of closures by their names.
bool hasClosures(const std::string &name) const
Return whether the simulation has a closures object.
std::string _var_type
Type (class) of the variable.
void addSimInitialCondition(const std::string &type, const std::string &name, InputParameters params)
const libMesh::FEType & getFlowFEType() const
Gets the FE type for the flow in this simulation.
void addComponentScalarIC(const VariableName &var_name, const std::vector< Real > &value)
virtual void buildMesh()
Create mesh for this simulation.
std::vector< VariableName > sortAddedComponentVariables() const
Returns a sorted list of the variables added by components.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void addComponent(const std::string &type, const std::string &name, InputParameters params)
Add a component into this simulation.
Simulation(FEProblemBase &fe_problem, const InputParameters ¶ms)
bool _nl
True if the variable is a nonlinear (solution) variable; otherwise, aux.
ControlData< T > * getControlData(const std::string &name)
Get control data of type T and name 'name', if it does not exist it will be created.
static void setComponentVariableOrder(const VariableName &var, int index)
Sets a component variable order index.
const bool & getImplicitTimeIntegrationFlag()
Gets the flag indicating whether an implicit time integration scheme is being used.
void setVectorValuedVelocity(bool vector_velocity)
Set if velocity is being output as a vector-valued field.
std::map< std::string, THM::FlowModelID > _loop_name_to_model_id
Map of loop name to model type.
virtual void addVariables()
Add variables involved in this simulation.
std::vector< OutputName > _outputters_screen
void setupCoordinateSystem()
Sets the coordinate system for each subdomain.
std::map< dof_id_type, std::vector< dof_id_type > > _sparsity_elem_augmentation
Additional sparsity pattern that needs to be added into the Jacobian matrix.
void setupEquations()
Setup equations to be solved in this simulation.
const std::vector< std::shared_ptr< Component > > & getComponents()
Return list of components available in the simulation.
ThermalHydraulicsApp & _thm_app
The application this is associated with.
void addConstantIC(const VariableName &var_name, Real value, const std::vector< SubdomainName > &block_names)
std::vector< OutputName > _outputters_all
bool hasInitialConditionsFromFile() const
Are initial conditions specified from a file.
virtual void augmentSparsity(const dof_id_type &elem_id1, const dof_id_type &elem_id2)
Hint how to augment sparsity pattern between two elements.
void setupCriticalHeatFluxTable()
Setup ctirical heat flux table user object.
void addControl(const std::string &type, const std::string &name, InputParameters params)
Add a control.
bool hasComponentOfType(const std::string &name) const
Find out if simulation has a component with the given name and specified type.
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...