LCOV - code coverage report
Current view: top level - src/fvinterpolationmethods - FVGeometricAverage.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 15 18 83.3 %
Date: 2026-05-29 20:35:17 Functions: 4 5 80.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 "FVGeometricAverage.h"
      11             : 
      12             : registerMooseObject("MooseApp", FVGeometricAverage);
      13             : 
      14             : InputParameters
      15        4217 : FVGeometricAverage::validParams()
      16             : {
      17        4217 :   InputParameters params = FVInterpolationMethod::validParams();
      18        4217 :   params.addClassDescription("Linear interpolation that uses the geometric weighting on FaceInfo.");
      19        4217 :   return params;
      20           0 : }
      21             : 
      22         578 : FVGeometricAverage::FVGeometricAverage(const InputParameters & params)
      23         578 :   : FVInterpolationMethod(params)
      24             : {
      25         578 : }
      26             : 
      27             : Real
      28           2 : FVGeometricAverage::interpolate(const FaceInfo & face,
      29             :                                 const Real elem_value,
      30             :                                 const Real neighbor_value) const
      31             : {
      32           2 :   const Real gc = face.gC();
      33           2 :   return gc * elem_value + (1.0 - gc) * neighbor_value;
      34             : }
      35             : 
      36             : FVAdvectedInterpolationMethod::AdvectedSystemContribution
      37    10835151 : FVGeometricAverage::advectedInterpolate(const FaceInfo & face,
      38             :                                         Real /*elem_value*/,
      39             :                                         Real /*neighbor_value*/,
      40             :                                         const VectorValue<Real> * /*elem_grad*/,
      41             :                                         const VectorValue<Real> * /*neighbor_grad*/,
      42             :                                         Real /*mass_flux*/) const
      43             : {
      44    10835151 :   AdvectedSystemContribution result;
      45    10835151 :   const Real gc = face.gC();
      46    10835151 :   result.weights_matrix = std::make_pair(gc, 1.0 - gc);
      47    21670302 :   return result;
      48             : }
      49             : 
      50             : Real
      51           0 : FVGeometricAverage::advectedInterpolateValue(const FaceInfo & face,
      52             :                                              Real elem_value,
      53             :                                              Real neighbor_value,
      54             :                                              const VectorValue<Real> *,
      55             :                                              const VectorValue<Real> *,
      56             :                                              Real) const
      57             : {
      58           0 :   return interpolate(face, elem_value, neighbor_value);
      59             : }

Generated by: LCOV version 1.14