LCOV - code coverage report
Current view: top level - src/userobjects - InterfaceQpValueUserObject.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 22 25 88.0 %
Date: 2025-07-17 01:28:37 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 "InterfaceQpValueUserObject.h"
      11             : 
      12             : registerMooseObject("MooseApp", InterfaceQpValueUserObject);
      13             : 
      14             : InputParameters
      15       14648 : InterfaceQpValueUserObject::validParams()
      16             : {
      17       14648 :   InputParameters params = InterfaceQpUserObjectBase::validParams();
      18       14648 :   params.addRequiredCoupledVar("var", "The variable name");
      19       14648 :   params.addCoupledVar("var_neighbor", "The neighbor variable name");
      20       14648 :   params.addClassDescription(
      21             :       "Computes the variable value, rate or increment across an "
      22             :       "interface. The value, rate or increment is computed according to the provided "
      23             :       "interface_value_type parameter");
      24       14648 :   return params;
      25           0 : }
      26             : 
      27         195 : InterfaceQpValueUserObject::InterfaceQpValueUserObject(const InputParameters & parameters)
      28             :   : InterfaceQpUserObjectBase(parameters),
      29         195 :     _u(_value_type > 0 ? coupledDot("var") : coupledValue("var")),
      30         195 :     _u_neighbor(
      31         390 :         parameters.isParamSetByUser("var_neighbor")
      32         648 :             ? (_value_type > 0 ? coupledNeighborValueDot("var_neighbor")
      33         279 :                                : coupledNeighborValue("var_neighbor"))
      34         564 :             : (_value_type > 0 ? coupledNeighborValueDot("var") : coupledNeighborValue("var")))
      35             : 
      36             : {
      37         195 : }
      38             : 
      39             : Real
      40        6042 : InterfaceQpValueUserObject::computeRealValue(const unsigned int qp)
      41             : {
      42             :   /* civet complains about fall through, let's fix this using some extra code */
      43        6042 :   switch (_value_type)
      44             :   {
      45        4906 :     case 0: /*value*/
      46        4906 :       return computeInterfaceValueType(_u[qp], _u_neighbor[qp]);
      47         568 :     case 1: /*rate*/
      48         568 :       return computeInterfaceValueType(_u[qp], _u_neighbor[qp]);
      49         568 :     case 2: /*increment*/
      50         568 :       return computeInterfaceValueType(_u[qp] * _dt, _u_neighbor[qp] * _dt);
      51           0 :     default:
      52           0 :       mooseError("InterfaceQpValueUserObject::computeRealValue the supplied "
      53             :                  "value type has not been implemented");
      54             :   }
      55             :   mooseError("InterfaceQpValueUserObject::computeRealValue if we are here something is wrong");
      56             : }

Generated by: LCOV version 1.14