LCOV - code coverage report
Current view: top level - src/userobjects - ADBoundaryFlux3EqnGhostBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 18 19 94.7 %
Date: 2026-05-29 20:41:18 Functions: 3 3 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 "ADBoundaryFlux3EqnGhostBase.h"
      11             : #include "ADNumericalFlux3EqnBase.h"
      12             : 
      13             : #include "libmesh/elem.h"
      14             : 
      15             : InputParameters
      16        4895 : ADBoundaryFlux3EqnGhostBase::validParams()
      17             : {
      18        4895 :   InputParameters params = ADBoundaryFluxBase::validParams();
      19             : 
      20        4895 :   params.addClassDescription("Computes boundary fluxes for the 1-D, variable-area Euler equations "
      21             :                              "using a numerical flux user object and a ghost cell solution");
      22             : 
      23        9790 :   params.addRequiredParam<UserObjectName>("numerical_flux", "Name of numerical flux user object");
      24        9790 :   params.addRequiredParam<Real>("normal", "Outward normal");
      25             : 
      26        4895 :   return params;
      27           0 : }
      28             : 
      29        2605 : ADBoundaryFlux3EqnGhostBase::ADBoundaryFlux3EqnGhostBase(const InputParameters & parameters)
      30             :   : ADBoundaryFluxBase(parameters),
      31        2605 :     _numerical_flux(getUserObject<ADNumericalFlux3EqnBase>("numerical_flux")),
      32        7815 :     _normal(getParam<Real>("normal"))
      33             : {
      34        2605 : }
      35             : 
      36             : void
      37      110878 : ADBoundaryFlux3EqnGhostBase::calcFlux(unsigned int iside,
      38             :                                       dof_id_type ielem,
      39             :                                       const std::vector<ADReal> & U1,
      40             :                                       const RealVectorValue & /*normal*/,
      41             :                                       std::vector<ADReal> & flux) const
      42             : {
      43      110878 :   const Elem * elem = _subproblem.mesh().elemPtr(ielem);
      44      110878 :   const Elem * side_elem = elem->build_side_ptr(iside).release();
      45      110878 :   const Point side_center_point = side_elem->vertex_average();
      46      110878 :   delete side_elem;
      47             : 
      48      110878 :   const std::vector<ADReal> U2 = getGhostCellSolution(U1, side_center_point);
      49      110878 :   flux = _numerical_flux.getFlux(iside, ielem, true, U1, U2, _normal);
      50      110878 : }

Generated by: LCOV version 1.14