https://mooseframework.inl.gov
Loading...
Searching...
No Matches
src
mfem
postprocessors
MFEMComplexVectorL2Error.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 "
MFEMComplexVectorL2Error.h
"
13
#include "
MFEMProblem.h
"
14
15
registerMooseObject
(
"MooseApp"
,
MFEMComplexVectorL2Error
);
16
17
InputParameters
18
MFEMComplexVectorL2Error::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
"complex vector gridfunctions."
);
24
params.
addParam
<MFEMVectorCoefficientName>(
25
"function_real"
,
"The real part of the analytic solution to compare against."
);
26
params.
addParam
<MFEMVectorCoefficientName>(
27
"function_imag"
,
"The imaginary part of the analytic solution to compare against."
);
28
MFEMExecutedObject::addRequiredDependencyParam<VariableName>(
29
params,
"variable"
,
"Name of the vector variable of which to find the norm of the error."
);
30
return
params;
31
}
32
33
MFEMComplexVectorL2Error::MFEMComplexVectorL2Error
(
const
InputParameters
& parameters)
34
:
MFEMPostprocessor
(parameters),
35
_vec_coeff_real(getVectorCoefficient(
"function_real"
)),
36
_vec_coeff_imag(getVectorCoefficient(
"function_imag"
)),
37
_var(*getMFEMProblem().getComplexGridFunction(getParam<VariableName>(
"variable"
)))
38
{
39
}
40
41
PostprocessorValue
42
MFEMComplexVectorL2Error::getValue
()
const
43
{
44
return
_var
.ComputeL2Error(
_vec_coeff_real
,
_vec_coeff_imag
);
45
}
46
47
#endif
registerMooseObject
registerMooseObject("MooseApp", MFEMComplexVectorL2Error)
MFEMComplexVectorL2Error.h
MFEMProblem.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:1832
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
MFEMComplexVectorL2Error
Compute the L2 error for a complex vector variable.
Definition
MFEMComplexVectorL2Error.h:20
MFEMComplexVectorL2Error::getValue
virtual PostprocessorValue getValue() const override final
Get the L2 Error.
Definition
MFEMComplexVectorL2Error.C:42
MFEMComplexVectorL2Error::_var
mfem::ParComplexGridFunction & _var
Definition
MFEMComplexVectorL2Error.h:34
MFEMComplexVectorL2Error::validParams
static InputParameters validParams()
Definition
MFEMComplexVectorL2Error.C:18
MFEMComplexVectorL2Error::_vec_coeff_imag
mfem::VectorCoefficient & _vec_coeff_imag
Definition
MFEMComplexVectorL2Error.h:33
MFEMComplexVectorL2Error::MFEMComplexVectorL2Error
MFEMComplexVectorL2Error(const InputParameters ¶meters)
Definition
MFEMComplexVectorL2Error.C:33
MFEMComplexVectorL2Error::_vec_coeff_real
mfem::VectorCoefficient & _vec_coeff_real
Definition
MFEMComplexVectorL2Error.h:32
MFEMPostprocessor
Postprocessor for MFEM results.
Definition
MFEMPostprocessor.h:22
MFEMPostprocessor::validParams
static InputParameters validParams()
Definition
MFEMPostprocessor.C:15
Generated on Sun Sep 6 2026 20:30:06 for https://mooseframework.inl.gov by
1.9.8