LCOV - code coverage report
Current view: top level - src/mfem/postprocessors - MFEML2Error.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33358 (34476d) with base 4fcf7b Lines: 16 17 94.1 %
Date: 2026-07-17 19:50:30 Functions: 5 5 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             : #ifdef MOOSE_MFEM_ENABLED
      11             : 
      12             : #include "MFEML2Error.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : registerMooseObject("MooseApp", MFEML2Error);
      16             : 
      17             : InputParameters
      18        3050 : MFEML2Error::validParams()
      19             : {
      20        3050 :   InputParameters params = MFEMPostprocessor::validParams();
      21        6100 :   params.addClassDescription(
      22             :       "Computes L2 error $\\left\\Vert u_{ex} - u_{h}\\right\\Vert_{\\rm L2}$ for "
      23             :       "gridfunctions using H1 or L2 elements.");
      24       12200 :   params.addParam<MFEMScalarCoefficientName>("function",
      25             :                                              "The analytic solution to compare against.");
      26        9150 :   MFEMExecutedObject::addRequiredDependencyParam<VariableName>(
      27             :       params, "variable", "Name of the variable of which to find the norm of the error.");
      28        3050 :   return params;
      29           0 : }
      30             : 
      31         476 : MFEML2Error::MFEML2Error(const InputParameters & parameters)
      32             :   : MFEMPostprocessor(parameters),
      33         476 :     _coeff(getScalarCoefficient("function")),
      34        1428 :     _var(*getMFEMProblem().getGridFunction(getParam<VariableName>("variable")))
      35             : {
      36         476 : }
      37             : 
      38             : void
      39         942 : MFEML2Error::initialize()
      40             : {
      41         942 : }
      42             : 
      43             : void
      44         942 : MFEML2Error::execute()
      45             : {
      46         942 : }
      47             : 
      48             : PostprocessorValue
      49         946 : MFEML2Error::getValue() const
      50             : {
      51         946 :   return _var.ComputeL2Error(_coeff);
      52             : }
      53             : 
      54             : #endif

Generated by: LCOV version 1.14