LCOV - code coverage report
Current view: top level - src/postprocessors - ShaftConnectedComponentPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 24 26 92.3 %
Date: 2026-05-29 20:41:18 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         174 : ShaftConnectedComponentPostprocessor::validParams()
      17             : {
      18         174 :   InputParameters params = GeneralPostprocessor::validParams();
      19         348 :   MooseEnum quantity("torque inertia");
      20         348 :   params.addRequiredParam<MooseEnum>("quantity", quantity, "Quantity to get");
      21         348 :   params.addRequiredParam<UserObjectName>("shaft_connected_component_uo",
      22             :                                           "Shaft-connected component user object");
      23         174 :   params.addClassDescription("Gets torque or moment of inertia for a shaft-connected component.");
      24         174 :   return params;
      25         174 : }
      26             : 
      27          58 : ShaftConnectedComponentPostprocessor::ShaftConnectedComponentPostprocessor(
      28          58 :     const InputParameters & parameters)
      29             :   : GeneralPostprocessor(parameters),
      30             : 
      31          58 :     _quantity(getParam<MooseEnum>("quantity").getEnum<Quantity>()),
      32          58 :     _component_uo(
      33         116 :         getUserObject<ADShaftConnectableUserObjectInterface>("shaft_connected_component_uo"))
      34             : {
      35          58 : }
      36             : 
      37             : void
      38         196 : ShaftConnectedComponentPostprocessor::initialize()
      39             : {
      40         196 : }
      41             : 
      42             : void
      43         196 : ShaftConnectedComponentPostprocessor::execute()
      44             : {
      45         196 : }
      46             : 
      47             : Real
      48         196 : ShaftConnectedComponentPostprocessor::getValue() const
      49             : {
      50         196 :   switch (_quantity)
      51             :   {
      52         147 :     case Quantity::TORQUE:
      53         147 :       return MetaPhysicL::raw_value(_component_uo.getTorque());
      54             :       break;
      55          49 :     case Quantity::INERTIA:
      56          49 :       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