LCOV - code coverage report
Current view: top level - src/auxkernels - OpenMCAuxKernel.C (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: ddd5f2 Lines: 16 19 84.2 %
Date: 2026-06-07 19:35:24 Functions: 5 12 41.7 %
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_OPENMC_COUPLING
      20             : 
      21             : #include "OpenMCAuxKernel.h"
      22             : 
      23             : template <typename ComputeValueType>
      24             : InputParameters
      25        9499 : OpenMCAuxKernelTempl<ComputeValueType>::validParams()
      26             : {
      27        9499 :   InputParameters params = AuxKernelTempl<ComputeValueType>::validParams();
      28        9499 :   params += TallyInterface::validParams();
      29        9499 :   return params;
      30           0 : }
      31             : 
      32             : template <typename ComputeValueType>
      33        4763 : OpenMCAuxKernelTempl<ComputeValueType>::OpenMCAuxKernelTempl(const InputParameters & parameters)
      34        4763 :   : AuxKernelTempl<ComputeValueType>(parameters), TallyInterface(this, parameters)
      35             : {
      36        4763 :   if (this->isNodal())
      37           2 :     mooseError("This auxkernel can only be used with elemental variables!");
      38        4761 : }
      39             : 
      40             : template <typename ComputeValueType>
      41             : bool
      42           0 : OpenMCAuxKernelTempl<ComputeValueType>::mappedElement()
      43             : {
      44             :   OpenMCCellAverageProblem::cellInfo cell_info =
      45    24471616 :       _openmc_problem->elemToCellInfo(this->_current_elem->id());
      46           0 :   return !(cell_info.first == OpenMCCellAverageProblem::UNMAPPED);
      47             : }
      48             : 
      49             : template <typename ComputeValueType>
      50             : void
      51          54 : OpenMCAuxKernelTempl<ComputeValueType>::errorCoupledConstMonomial(const std::string & param_name)
      52             : {
      53          54 :   if (this->isCoupled(param_name))
      54             :   {
      55          50 :     if (this->getFieldVar(param_name, 0)->feType() != FEType(libMesh::CONSTANT, libMesh::MONOMIAL))
      56          12 :       this->paramError(param_name,
      57             :                        "Only CONSTANT MONOMIAL shape functions are supported. Please "
      58             :                        "ensure that '" +
      59             :                            param_name + "' is of type MONOMIAL and order CONSTANT.");
      60             :   }
      61             :   else
      62           4 :     this->paramError(param_name, param_name + " is uncoupled!");
      63          44 : }
      64             : 
      65             : // Explicitly instantiates the three versions of the OpenMCAuxKernelTempl class
      66             : template class OpenMCAuxKernelTempl<Real>;
      67             : template class OpenMCAuxKernelTempl<RealVectorValue>;
      68             : template class OpenMCAuxKernelTempl<RealEigenVector>;
      69             : 
      70             : #endif

Generated by: LCOV version 1.14