https://mooseframework.inl.gov
FileMeshPhysicsComponent.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 
11 #include "PhysicsBase.h"
12 
13 registerMooseObject("ThermalHydraulicsApp", FileMeshPhysicsComponent);
14 
17 {
19 
20  params.addClassDescription(
21  "Component using a mesh from a file with one or more Physics active on it.");
22  params.addParam<std::vector<PhysicsName>>("physics", "Physics object(s) active on the Component");
23  return params;
24 }
25 
27  : FileMeshComponent(parameters)
28 {
29 }
30 
31 void
33 {
34  // TODO: We ll just add late relationship managers
35  // At this point in the setup, we do not have a problem, so we cannot retrieve a Physics. We can
36  // send the default ghosting for the physics, but that's it.
38 }
39 
40 void
42 {
44 
45  // Before this point, we did not have a problem, so we could not retrieve the physics
46  for (const auto & physics_name : getParam<std::vector<PhysicsName>>("physics"))
47  _physics.push_back(_app.actionWarehouse().getPhysics<PhysicsBase>(physics_name));
48 
49  for (auto physics : _physics)
50  physics->addBlocks(getSubdomainNames());
51 }
std::vector< PhysicsBase * > _physics
Physics that creates the equations on this component.
RelationshipManagerType
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Create a component with user-selected Physics active on it.
static InputParameters validParams()
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
Adds relationship managers for the component.
Loads a mesh from an ExodusII file without adding physics.
virtual void init() override
Initializes the component.
virtual void init()
Initializes the component.
Definition: Component.h:290
const T & getParam(const std::string &name) const
ActionWarehouse & actionWarehouse()
static InputParameters validParams()
registerMooseObject("ThermalHydraulicsApp", FileMeshPhysicsComponent)
MooseApp & _app
T * getPhysics(const std::string &name) const
void addClassDescription(const std::string &doc_string)
void addRelationshipManagersFromParameters(const InputParameters &moose_object_pars)
Method to add a relationship manager for the objects being added to the system.
Definition: Component.C:158
static InputParameters validParams()
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition: Component.C:307
FileMeshPhysicsComponent(const InputParameters &parameters)