LCOV - code coverage report
Current view: top level - src/mfem/postprocessors - MFEMVectorL2Error.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 16 17 94.1 %
Date: 2026-05-29 20:35:17 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 "MFEMVectorL2Error.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : registerMooseObject("MooseApp", MFEMVectorL2Error);
      16             : 
      17             : InputParameters
      18        2466 : MFEMVectorL2Error::validParams()
      19             : {
      20        2466 :   InputParameters params = MFEMPostprocessor::validParams();
      21        4932 :   params.addClassDescription(
      22             :       "Computes L2 error $\\left\\Vert \\vec u_{ex} - \\vec u_{h}\\right\\Vert_{\\rm L2}$ for "
      23             :       "vector gridfunctions.");
      24        9864 :   params.addParam<MFEMVectorCoefficientName>("function",
      25             :                                              "The analytic solution to compare against.");
      26        7398 :   MFEMExecutedObject::addRequiredDependencyParam<VariableName>(
      27             :       params, "variable", "Name of the vector variable of which to find the norm of the error.");
      28        2466 :   return params;
      29           0 : }
      30             : 
      31         184 : MFEMVectorL2Error::MFEMVectorL2Error(const InputParameters & parameters)
      32             :   : MFEMPostprocessor(parameters),
      33         184 :     _vec_coeff(getVectorCoefficient("function")),
      34         552 :     _var(*getMFEMProblem().getGridFunction(getParam<VariableName>("variable")))
      35             : {
      36         184 : }
      37             : 
      38             : void
      39         182 : MFEMVectorL2Error::initialize()
      40             : {
      41         182 : }
      42             : 
      43             : void
      44         182 : MFEMVectorL2Error::execute()
      45             : {
      46         182 : }
      47             : 
      48             : PostprocessorValue
      49         186 : MFEMVectorL2Error::getValue() const
      50             : {
      51         186 :   return _var.ComputeL2Error(_vec_coeff);
      52             : }
      53             : 
      54             : #endif

Generated by: LCOV version 1.14