LCOV - code coverage report
Current view: top level - src/components - FileMeshPhysicsComponent.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 18 19 94.7 %
Date: 2025-07-30 13:02:48 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          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 "FileMeshPhysicsComponent.h"
      11             : #include "PhysicsBase.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", FileMeshPhysicsComponent);
      14             : 
      15             : InputParameters
      16          54 : FileMeshPhysicsComponent::validParams()
      17             : {
      18          54 :   InputParameters params = FileMeshComponent::validParams();
      19             : 
      20          54 :   params.addClassDescription(
      21             :       "Component using a mesh from a file with one or more Physics active on it.");
      22         108 :   params.addParam<std::vector<PhysicsName>>("physics", "Physics object(s) active on the Component");
      23          54 :   return params;
      24           0 : }
      25             : 
      26          27 : FileMeshPhysicsComponent::FileMeshPhysicsComponent(const InputParameters & parameters)
      27          27 :   : FileMeshComponent(parameters)
      28             : {
      29          27 : }
      30             : 
      31             : void
      32          27 : FileMeshPhysicsComponent::addRelationshipManagers(Moose::RelationshipManagerType /*in_rm_type*/)
      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.
      37          27 :   addRelationshipManagersFromParameters(PhysicsBase::validParams());
      38          27 : }
      39             : 
      40             : void
      41          27 : FileMeshPhysicsComponent::init()
      42             : {
      43          27 :   FileMeshComponent::init();
      44             : 
      45             :   // Before this point, we did not have a problem, so we could not retrieve the physics
      46          81 :   for (const auto & physics_name : getParam<std::vector<PhysicsName>>("physics"))
      47          27 :     _physics.push_back(_app.actionWarehouse().getPhysics<PhysicsBase>(physics_name));
      48             : 
      49          54 :   for (auto physics : _physics)
      50          27 :     physics->addBlocks(getSubdomainNames());
      51          27 : }

Generated by: LCOV version 1.14