LCOV - code coverage report
Current view: top level - src/postprocessors - ShaftConnectedComponentPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 24 26 92.3 %
Date: 2025-07-30 13:02:48 Functions: 5 5 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 "ShaftConnectedComponentPostprocessor.h"
      11             : #include "ADShaftConnectableUserObjectInterface.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", ShaftConnectedComponentPostprocessor);
      14             : 
      15             : InputParameters
      16         138 : ShaftConnectedComponentPostprocessor::validParams()
      17             : {
      18         138 :   InputParameters params = GeneralPostprocessor::validParams();
      19         276 :   MooseEnum quantity("torque inertia");
      20         276 :   params.addRequiredParam<MooseEnum>("quantity", quantity, "Quantity to get");
      21         276 :   params.addRequiredParam<UserObjectName>("shaft_connected_component_uo",
      22             :                                           "Shaft-connected component user object");
      23         138 :   params.addClassDescription("Gets torque or moment of inertia for a shaft-connected component.");
      24         138 :   return params;
      25         138 : }
      26             : 
      27          46 : ShaftConnectedComponentPostprocessor::ShaftConnectedComponentPostprocessor(
      28          46 :     const InputParameters & parameters)
      29             :   : GeneralPostprocessor(parameters),
      30             : 
      31          46 :     _quantity(getParam<MooseEnum>("quantity").getEnum<Quantity>()),
      32          46 :     _component_uo(
      33          92 :         getUserObject<ADShaftConnectableUserObjectInterface>("shaft_connected_component_uo"))
      34             : {
      35          46 : }
      36             : 
      37             : void
      38         514 : ShaftConnectedComponentPostprocessor::initialize()
      39             : {
      40         514 : }
      41             : 
      42             : void
      43         514 : ShaftConnectedComponentPostprocessor::execute()
      44             : {
      45         514 : }
      46             : 
      47             : Real
      48         514 : ShaftConnectedComponentPostprocessor::getValue() const
      49             : {
      50         514 :   switch (_quantity)
      51             :   {
      52         505 :     case Quantity::TORQUE:
      53         505 :       return MetaPhysicL::raw_value(_component_uo.getTorque());
      54             :       break;
      55           9 :     case Quantity::INERTIA:
      56           9 :       return MetaPhysicL::raw_value(_component_uo.getMomentOfInertia());
      57             :       break;
      58           0 :     default:
      59           0 :       mooseError("Invalid 'quantity' parameter.");
      60             :   }
      61             : }

Generated by: LCOV version 1.14