LCOV - code coverage report
Current view: top level - src/userobjects - InternalSideFluxBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose rdg: #32971 (54bef8) with base c6cf66 Lines: 36 37 97.3 %
Date: 2026-05-29 20:39:15 Functions: 8 8 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 "InternalSideFluxBase.h"
      11             : 
      12             : InputParameters
      13          80 : InternalSideFluxBase::validParams()
      14             : {
      15          80 :   InputParameters params = GeneralUserObject::validParams();
      16          80 :   params.addClassDescription("A base class for computing and caching internal side flux.");
      17          80 :   return params;
      18           0 : }
      19             : 
      20          43 : InternalSideFluxBase::InternalSideFluxBase(const InputParameters & parameters)
      21             :   : ThreadedGeneralUserObject(parameters),
      22          43 :     _cached_flux_elem_id(libMesh::invalid_uint),
      23          43 :     _cached_flux_neig_id(libMesh::invalid_uint),
      24          43 :     _cached_jacobian_elem_id(libMesh::invalid_uint),
      25          43 :     _cached_jacobian_neig_id(libMesh::invalid_uint)
      26             : {
      27          43 : }
      28             : 
      29             : void
      30         644 : InternalSideFluxBase::initialize()
      31             : {
      32         644 :   _cached_flux_elem_id = libMesh::invalid_uint;
      33         644 :   _cached_flux_neig_id = libMesh::invalid_uint;
      34         644 :   _cached_jacobian_elem_id = libMesh::invalid_uint;
      35         644 :   _cached_jacobian_neig_id = libMesh::invalid_uint;
      36         644 : }
      37             : 
      38             : void
      39         644 : InternalSideFluxBase::execute()
      40             : {
      41         644 : }
      42             : 
      43             : void
      44         564 : InternalSideFluxBase::finalize()
      45             : {
      46         564 : }
      47             : 
      48             : void
      49          80 : InternalSideFluxBase::threadJoin(const UserObject &)
      50             : {
      51          80 : }
      52             : 
      53             : const std::vector<Real> &
      54       72832 : InternalSideFluxBase::getFlux(unsigned int iside,
      55             :                               dof_id_type ielem,
      56             :                               dof_id_type ineig,
      57             :                               const std::vector<Real> & uvec1,
      58             :                               const std::vector<Real> & uvec2,
      59             :                               const RealVectorValue & dwave) const
      60             : {
      61       72832 :   if (_cached_flux_elem_id != ielem || _cached_flux_neig_id != ineig)
      62             :   {
      63       36416 :     _cached_flux_elem_id = ielem;
      64       36416 :     _cached_flux_neig_id = ineig;
      65             : 
      66       36416 :     calcFlux(iside, ielem, ineig, uvec1, uvec2, dwave, _flux);
      67             :   }
      68       72832 :   return _flux;
      69             : }
      70             : 
      71             : const DenseMatrix<Real> &
      72       40392 : InternalSideFluxBase::getJacobian(Moose::DGResidualType type,
      73             :                                   unsigned int iside,
      74             :                                   dof_id_type ielem,
      75             :                                   dof_id_type ineig,
      76             :                                   const std::vector<Real> & uvec1,
      77             :                                   const std::vector<Real> & uvec2,
      78             :                                   const RealVectorValue & dwave) const
      79             : {
      80       40392 :   if (_cached_jacobian_elem_id != ielem || _cached_jacobian_neig_id != ineig)
      81             :   {
      82        5049 :     _cached_jacobian_elem_id = ielem;
      83        5049 :     _cached_jacobian_neig_id = ineig;
      84             : 
      85        5049 :     calcJacobian(iside, ielem, ineig, uvec1, uvec2, dwave, _jac1, _jac2);
      86             :   }
      87             : 
      88       40392 :   if (type == Moose::Element)
      89       20196 :     return _jac1;
      90             :   else
      91       20196 :     return _jac2;
      92             : }

Generated by: LCOV version 1.14