https://mooseframework.inl.gov
Loading...
Searching...
No Matches
src
mfem
postprocessors
MFEMVectorL2Error.C
Go to the documentation of this file.
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
MFEMVectorL2Error::validParams
()
19
{
20
InputParameters
params =
MFEMPostprocessor::validParams
();
21
params.
addClassDescription
(
22
"Computes L2 error $\\left\\Vert \\vec u_{ex} - \\vec u_{h}\\right\\Vert_{\\rm L2}$ for "
23
"vector gridfunctions."
);
24
params.
addParam
<MFEMVectorCoefficientName>(
"function"
,
25
"The analytic solution to compare against."
);
26
MFEMExecutedObject::addRequiredDependencyParam<VariableName>(
27
params,
"variable"
,
"Name of the vector variable of which to find the norm of the error."
);
28
return
params;
29
}
30
31
MFEMVectorL2Error::MFEMVectorL2Error
(
const
InputParameters
& parameters)
32
:
MFEMPostprocessor
(parameters),
33
_vec_coeff(getVectorCoefficient(
"function"
)),
34
_var(*getMFEMProblem().getGridFunction(getParam<VariableName>(
"variable"
)))
35
{
36
}
37
38
PostprocessorValue
39
MFEMVectorL2Error::getValue
()
const
40
{
41
return
_var
.ComputeL2Error(
_vec_coeff
);
42
}
43
44
#endif
MFEMProblem.h
registerMooseObject
registerMooseObject("MooseApp", MFEMVectorL2Error)
MFEMVectorL2Error.h
PostprocessorValue
Real PostprocessorValue
various MOOSE typedefs
Definition
MooseTypes.h:230
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition
InputParameters.h:68
InputParameters::addParam
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
Definition
InputParameters.h:1841
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Definition
InputParameters.C:81
MFEMPostprocessor
Postprocessor for MFEM results.
Definition
MFEMPostprocessor.h:22
MFEMPostprocessor::validParams
static InputParameters validParams()
Definition
MFEMPostprocessor.C:15
MFEMVectorL2Error
Compute the L2 error for a vector variable.
Definition
MFEMVectorL2Error.h:20
MFEMVectorL2Error::validParams
static InputParameters validParams()
Definition
MFEMVectorL2Error.C:18
MFEMVectorL2Error::_var
mfem::GridFunction & _var
Definition
MFEMVectorL2Error.h:33
MFEMVectorL2Error::getValue
virtual PostprocessorValue getValue() const override final
Get the L2 Error.
Definition
MFEMVectorL2Error.C:39
MFEMVectorL2Error::MFEMVectorL2Error
MFEMVectorL2Error(const InputParameters ¶meters)
Definition
MFEMVectorL2Error.C:31
MFEMVectorL2Error::_vec_coeff
mfem::VectorCoefficient & _vec_coeff
Definition
MFEMVectorL2Error.h:32
Generated on Mon Sep 28 2026 20:29:23 for https://mooseframework.inl.gov by
1.9.8