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