LCOV - code coverage report
Current view: top level - src/postprocessors - ElementHDivSemiError.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 18 19 94.7 %
Date: 2025-08-08 20:01:16 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 "ElementHDivSemiError.h"
      11             : #include "Function.h"
      12             : 
      13             : registerMooseObject("MooseApp", ElementHDivSemiError);
      14             : 
      15             : InputParameters
      16       28854 : ElementHDivSemiError::validParams()
      17             : {
      18       28854 :   InputParameters params = ElementVectorL2Error::validParams();
      19       28854 :   params.addClassDescription("Returns the H(div)-seminorm of the difference between a pair of "
      20             :                              "computed and analytical vector-valued solutions.");
      21       28854 :   params.addRequiredParam<FunctionName>("function",
      22             :                                         "The vector analytical solution to compare against");
      23       28854 :   params.addRequiredCoupledVar("variable", "The vector FE solution");
      24       28854 :   params.suppressParameter<FunctionName>("function_x");
      25       28854 :   params.suppressParameter<FunctionName>("function_y");
      26       28854 :   params.suppressParameter<FunctionName>("function_z");
      27       28854 :   params.suppressParameter<std::vector<VariableName>>("var_x");
      28       28854 :   params.suppressParameter<std::vector<VariableName>>("var_y");
      29       28854 :   params.suppressParameter<std::vector<VariableName>>("var_z");
      30       28854 :   return params;
      31           0 : }
      32             : 
      33         168 : ElementHDivSemiError::ElementHDivSemiError(const InputParameters & parameters)
      34         168 :   : ElementVectorL2Error(parameters), _u_var(*getVectorVar("variable", 0)), _div_u(_u_var.divSln())
      35             : {
      36         168 : }
      37             : 
      38             : Real
      39      513216 : ElementHDivSemiError::computeQpIntegral()
      40             : {
      41      513216 :   Real diff = _div_u[_qp] - _func.div(_t, _q_point[_qp]);
      42      513216 :   return diff * diff;
      43             : }

Generated by: LCOV version 1.14