LCOV - code coverage report
Current view: top level - src/postprocessors - NekUsrWrkBoundaryIntegral.C (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: ddd5f2 Lines: 15 16 93.8 %
Date: 2026-06-07 19:35:24 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         122 : NekUsrWrkBoundaryIntegral::validParams()
      27             : {
      28         122 :   InputParameters params = NekSidePostprocessor::validParams();
      29         244 :   params.addRequiredParam<unsigned int>("usrwrk_slot", "Slot in nrs->usrwrk to integrate (zero-indexed)");
      30         122 :   params.addClassDescription("Integral of usrwrk over a boundary in the NekRS mesh");
      31         122 :   return params;
      32           0 : }
      33             : 
      34          41 : NekUsrWrkBoundaryIntegral::NekUsrWrkBoundaryIntegral(const InputParameters & parameters)
      35             :   : NekSidePostprocessor(parameters),
      36          82 :     _usrwrk_slot(getParam<unsigned int>("usrwrk_slot"))
      37             : {
      38          41 :   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          40 : }
      42             : 
      43             : Real
      44          40 : NekUsrWrkBoundaryIntegral::getValue() const
      45             : {
      46             :   auto integrals =
      47          40 :       nekrs::usrwrkSideIntegral(_usrwrk_slot * nekrs::fieldOffset(), _boundary, _pp_mesh);
      48          40 :   return std::accumulate(integrals.begin(), integrals.end(), 0.0);
      49          40 : }
      50             : 
      51             : #endif

Generated by: LCOV version 1.14