Line data Source code
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 "ComponentPhysicsInterface.h" 11 : 12 : InputParameters 13 550 : ComponentPhysicsInterface::validParams() 14 : { 15 550 : auto params = ActionComponent::validParams(); 16 550 : params.addParam<std::vector<PhysicsName>>( 17 : "physics", {}, "Physics object(s) active on the Component"); 18 550 : return params; 19 0 : } 20 : 21 176 : ComponentPhysicsInterface::ComponentPhysicsInterface(const InputParameters & params) 22 176 : : ActionComponent(params), _physics_names(getParam<std::vector<PhysicsName>>("physics")) 23 : { 24 : // Adding ActionComponents must be done after adding Physics 25 308 : for (const auto & physics_name : getParam<std::vector<PhysicsName>>("physics")) 26 132 : _physics.push_back(getMooseApp().actionWarehouse().getPhysics<PhysicsBase>(physics_name)); 27 : 28 176 : addRequiredTask("init_component_physics"); 29 176 : } 30 : 31 : void 32 168 : ComponentPhysicsInterface::addPhysics() 33 : { 34 296 : for (auto physics : _physics) 35 : { 36 128 : if (_verbose) 37 60 : mooseInfoRepeated("Adding Physics '" + physics->name() + "' on component '" + name() + 38 80 : "' on blocks '" + Moose::stringify(_blocks) + "'"); 39 128 : physics->addComponent(*this); 40 : } 41 168 : }