LCOV - code coverage report
Current view: top level - src/postprocessors - NekUsrWrkBoundaryIntegral.C (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: be601f Lines: 14 15 93.3 %
Date: 2025-07-15 20:50:38 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /********************************************************************/
       2             : /*                  SOFTWARE COPYRIGHT NOTIFICATION                 */
       3             : /*                             Cardinal                             */
       4             : /*                                                                  */
       5             : /*                  (c) 2021 UChicago Argonne, LLC                  */
       6             : /*                        ALL RIGHTS RESERVED                       */
       7             : /*                                                                  */
       8             : /*                 Prepared by UChicago Argonne, LLC                */
       9             : /*               Under Contract No. DE-AC02-06CH11357               */
      10             : /*                With the U. S. Department of Energy               */
      11             : /*                                                                  */
      12             : /*             Prepared by Battelle Energy Alliance, LLC            */
      13             : /*               Under Contract No. DE-AC07-05ID14517               */
      14             : /*                With the U. S. Department of Energy               */
      15             : /*                                                                  */
      16             : /*                 See LICENSE for full restrictions                */
      17             : /********************************************************************/
      18             : 
      19             : #ifdef ENABLE_NEK_COUPLING
      20             : 
      21             : #include "NekUsrWrkBoundaryIntegral.h"
      22             : 
      23             : registerMooseObject("CardinalApp", NekUsrWrkBoundaryIntegral);
      24             : 
      25             : InputParameters
      26          50 : NekUsrWrkBoundaryIntegral::validParams()
      27             : {
      28          50 :   InputParameters params = NekSidePostprocessor::validParams();
      29         100 :   params.addRequiredParam<unsigned int>("usrwrk_slot", "Slot in nrs->usrwrk to integrate (zero-indexed)");
      30          50 :   params.addClassDescription("Integral of usrwrk over a boundary in the NekRS mesh");
      31          50 :   return params;
      32           0 : }
      33             : 
      34          17 : NekUsrWrkBoundaryIntegral::NekUsrWrkBoundaryIntegral(const InputParameters & parameters)
      35             :   : NekSidePostprocessor(parameters),
      36          34 :     _usrwrk_slot(getParam<unsigned int>("usrwrk_slot"))
      37             : {
      38          17 :   if (_usrwrk_slot >= _nek_problem->nUsrWrkSlots())
      39           1 :     mooseError("'usrwrk_slot' must be less than number of allocated usrwrk slots: ",
      40           1 :       _nek_problem->nUsrWrkSlots());
      41          16 : }
      42             : 
      43             : Real
      44          16 : NekUsrWrkBoundaryIntegral::getValue() const
      45             : {
      46          16 :   auto integrals = nekrs::usrwrkSideIntegral(_usrwrk_slot, _boundary, _pp_mesh);
      47          16 :   return std::accumulate(integrals.begin(), integrals.end(), 0.0);
      48             : }
      49             : 
      50             : #endif

Generated by: LCOV version 1.14