- variableName of the variable of which to find the norm of the error.
C++ Type:VariableName
Unit:(no unit assumed)
Controllable:No
Description:Name of the variable of which to find the norm of the error.
MFEML2Error
Overview
Postprocessor for calculating the L2 error of a scalar or conforming source variable compared to a scalar function.
where and is a scalar function.
Example Input File Syntax
[Postprocessors<<<{"href": "../../../syntax/Postprocessors/index.html"}>>>]
[potential_error]
type = MFEML2Error<<<{"description": "Computes L2 error $\\left\\Vert u_{ex} - u_{h}\\right\\Vert_{\\rm L2}$ for gridfunctions using H1 or L2 elements.", "href": "MFEML2Error.html"}>>>
variable<<<{"description": "Name of the variable of which to find the norm of the error."}>>> = velocity_potential
function<<<{"description": "The analytic solution to compare against. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a number."}>>> = theta
[]
[velocity_error]
type = MFEMVectorL2Error<<<{"description": "Computes L2 error $\\left\\Vert \\vec u_{ex} - \\vec u_{h}\\right\\Vert_{\\rm L2}$ for vector gridfunctions.", "href": "MFEMVectorL2Error.html"}>>>
variable<<<{"description": "Name of the vector variable of which to find the norm of the error."}>>> = velocity
function<<<{"description": "The analytic solution to compare against. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a numeric vector value (enclosed in curly braces)."}>>> = exact_velocity
[]
[](test/tests/mfem/kernels/irrotational.i)Input Parameters
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, MULTISYSTEM_FIXED_POINT_ITERATION_END, FINAL, CUSTOM
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- functionThe analytic solution to compare against. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a number.
C++ Type:MFEMScalarCoefficientName
Controllable:No
Description:The analytic solution to compare against. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a number.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
Advanced Parameters
Input Files
- (test/tests/mfem/solvers/pmg_diffusion.i)
- (test/tests/mfem/kernels/diffusion.i)
- (test/tests/mfem/problemcomposers/custom_composer_and_operator.i)
- (test/tests/mfem/transfers/l2_mfem_parent_libmesh_sub/mfem_parent_scalar.i)
- (test/tests/mfem/transfers/h1_mfem_parent_libmesh_sub/mfem_parent_scalar.i)
- (test/tests/mfem/multiapps/problem.i)
- (test/tests/mfem/kernels/irrotational.i)
- (test/tests/mfem/functions/quadrature_function_source.i)
- (test/tests/mfem/functions/parsed_function_source.i)
- (test/tests/mfem/kernels/darcy.i)
- (test/tests/mfem/kernels/diffusion_amr.i)
(test/tests/mfem/kernels/irrotational.i)
# 2D irrotational vortex with Nedelec elements of the first kind.
centre_x = -0.75
centre_y = 0.1
[Mesh]
type = MFEMFileMesh
file = ../mesh/vortex.msh
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = SEVENTH
[]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = SEVENTH
[]
[]
[Variables]
[velocity_potential]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[AuxVariables]
[velocity]
type = MFEMVariable
fespace = HCurlFESpace
[]
[]
[Functions]
[speed]
type = ParsedFunction
expression = '1 / sqrt((x-x0)^2 + (y-y0)^2)'
symbol_names = 'x0 y0'
symbol_values = '${centre_x} ${centre_y}'
[]
[theta]
type = ParsedFunction
expression = 'atan2(y-y0, x-x0)'
symbol_names = 'x0 y0'
symbol_values = '${centre_x} ${centre_y}'
[]
[exact_velocity]
type = ParsedVectorFunction
expression_x = '-v * sin(th)'
expression_y = 'v * cos(th)'
symbol_names = 'v th'
symbol_values = 'speed theta'
[]
[]
[BCs]
[potential_velocity_boundary]
type = MFEMScalarDirichletBC
variable = velocity_potential
boundary = '1'
coefficient = theta
[]
[]
[Kernels]
[laplacian]
type = MFEMDiffusionKernel
variable = velocity_potential
[]
[]
[AuxKernels]
[grad]
type = MFEMGradAux
variable = velocity
source = velocity_potential
execute_on = TIMESTEP_END
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[main]
type = MFEMHypreGMRES
preconditioner = boomeramg
l_tol = 1e-16
l_max_its = 1000
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[potential_error]
type = MFEML2Error
variable = velocity_potential
function = theta
[]
[velocity_error]
type = MFEMVectorL2Error
variable = velocity
function = exact_velocity
[]
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/Irrotational
vtk_format = ASCII
[]
[L2CSV]
type = CSV
file_base = OutputData/Irrotational
[]
[]
(test/tests/mfem/solvers/pmg_diffusion.i)
# Diffusion solve using a p-multigrid (geometric multigrid) preconditioner.
#
# PDE: -Laplacian(u) = f on [0,1]^2
# Exact solution: u = sin(pi x)sin(pi y)
# Forcing: f = 2 pi^2 sin(pi x)sin(pi y)
# BCs: u = 0 on all four sides (exact solution is zero on boundary)
#
# Multigrid hierarchy (two levels):
# level 0 (coarse): H1 order 1
# level 1 (fine): H1 order 2 - variable lives here via fespace = h1_hierarchy
#
# Solvers:
# coarse_solver = coarse (CG + BoomerAMG on the coarse system)
# smoothers = chebyshev (Chebyshev smoother at the fine level; SPD by construction)
[Mesh]
type = MFEMFileMesh
file = ../mesh/square.e
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[]
[FESpaceHierarchies]
[h1_hierarchy]
type = MFEMFESpaceHierarchy
fespace = H1FESpace
# One refinement entry adds the fine p=2 level, giving two total levels.
refinements = 2
[]
[]
[Variables]
[concentration]
type = MFEMVariable
fespace_hierarchy = h1_hierarchy
[]
[]
[BCs]
[zero]
type = MFEMScalarDirichletBC
variable = concentration
boundary = 'bottom right top left'
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = sin(pi*x)*sin(pi*y)
[]
[forcing]
type = ParsedFunction
expression = 2*pi^2*sin(pi*x)*sin(pi*y)
[]
[]
[Kernels]
[diff]
type = MFEMDiffusionKernel
variable = concentration
[]
[rhs]
type = MFEMDomainLFKernel
variable = concentration
coefficient = forcing
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
print_level = 0
[]
[coarse]
type = MFEMCGSolver
preconditioner = boomeramg
l_max_its = 10
l_tol = 1e-2
print_level = -1
[]
[chebyshev]
type = MFEMOperatorChebyshevSmoother
order = 2
[]
[pmg]
type = MFEMGeometricMultigridSolver
variable = concentration
smoothers = chebyshev
coarse_solver = coarse
[]
[main]
type = MFEMCGSolver
preconditioner = pmg
l_tol = 1e-10
l_max_its = 200
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[l2_error]
type = MFEML2Error
variable = concentration
function = u_exact
[]
[]
[Outputs]
[csv]
type = CSV
file_base = OutputData/PMGDiffusion
[]
[]
(test/tests/mfem/kernels/diffusion.i)
[Mesh]
type = MFEMFileMesh
file = ../mesh/mug.e
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = FIRST
[]
[]
[Variables]
[concentration]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[AuxVariables]
[concentration_gradient]
type = MFEMVariable
fespace = HCurlFESpace
[]
[]
[AuxKernels]
[grad]
type = MFEMGradAux
variable = concentration_gradient
source = concentration
execute_on = TIMESTEP_END
[]
[]
[BCs]
[bottom]
type = MFEMScalarDirichletBC
variable = concentration
boundary = 'bottom'
coefficient = 1.0
[]
[top]
type = MFEMScalarDirichletBC
variable = concentration
boundary = 'top'
[]
[]
[Kernels]
[diff]
type = MFEMDiffusionKernel
variable = concentration
[]
[]
[Solvers]
inactive = 'jacobi'
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[jacobi]
type = MFEMOperatorJacobiSmoother
[]
[main]
type = MFEMHypreGMRES
preconditioner = boomeramg
l_tol = 1e-16
l_max_its = 1000
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[solution_l2_norm]
type = MFEML2Error
variable = concentration
function = 0
[]
[]
[VectorPostprocessors]
[line_sample]
type = MFEMVariableLineValueSampler
variable = 'concentration'
start_point = '2.125 0 -2.375'
end_point = '2.125 0 2.625'
num_points = 101
[]
[]
[Outputs]
active = CSV
[CSV]
type = CSV
file_base = OutputData/diffusion
[]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/ParaViewDataCollection
vtk_format = ASCII
[]
[VisItDataCollection]
type = MFEMVisItDataCollection
file_base = OutputData/VisItDataCollection
[]
[ConduitDataCollection]
type = MFEMConduitDataCollection
file_base = OutputData/ConduitDataCollection/Run
protocol = conduit_bin
[]
[]
(test/tests/mfem/problemcomposers/custom_composer_and_operator.i)
[Mesh]
type = MFEMFileMesh
file = ../mesh/star.mesh
uniform_refine = 2
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1]
type = MFEMScalarFESpace
fec_type = H1
fec_order = SECOND
[]
[]
[Variables]
[u]
type = MFEMVariable
fespace = H1
[]
[]
[Solvers]
[main]
type = MFEMMUMPS
[]
[]
[ProblemComposers]
[default_steady]
type = CustomProblemComposer
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[solution_l2_norm]
type = MFEML2Error
variable = u
function = 0
[]
[]
[Outputs]
[CSV]
type = CSV
execute_on = 'timestep_end'
file_base = OutputData/custom_composer_and_operator/l2norm
[]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/custom_composer_and_operator
vtk_format = ASCII
[]
[]
(test/tests/mfem/transfers/l2_mfem_parent_libmesh_sub/mfem_parent_scalar.i)
[Mesh]
type = MFEMFileMesh
file = ../../mesh/square_quad9.e
[]
[Problem]
type = MFEMProblem
solve = false
[]
[FESpaces]
[L2FESpace]
type = MFEMScalarFESpace
fec_type = L2
fec_order = CONSTANT
[]
[]
[Variables]
[mfem_scalar_var]
type = MFEMVariable
fespace = L2FESpace
[]
[]
[AuxVariables]
[libmesh_scalar_var]
type = MFEMVariable
fespace = L2FESpace
[]
[]
[Functions]
[parsed_function]
type = ParsedFunction
expression = 'x*x + y*y'
[]
[]
[ICs]
[libmesh_scalar_var_ic]
type = MFEMScalarIC
variable = 'mfem_scalar_var'
coefficient = parsed_function
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[MultiApps]
[libmesh_app]
type = FullSolveMultiApp
input_files = libmesh_sub_scalar.i
execute_on = 'INITIAL'
[]
[]
[Transfers]
[transfer_from_libmesh]
type = MultiApplibMeshToMFEMShapeEvaluationTransfer
source_variables = libmesh_scalar_var
variables = libmesh_scalar_var
from_multi_app = libmesh_app
[]
[]
[Postprocessors]
[Difference]
type = MFEML2Error
variable = mfem_scalar_var
function = libmesh_scalar_var
execute_on = TIMESTEP_END
[]
[]
[Outputs]
file_base = 'mfem_parent_libmesh_sub_scalar_quads'
csv = true
[]
(test/tests/mfem/transfers/h1_mfem_parent_libmesh_sub/mfem_parent_scalar.i)
[Mesh]
type = MFEMFileMesh
file = ../../mesh/square_quad9.e
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[]
[Variables]
[mfem_scalar_var]
type = MFEMVariable
fespace = H1FESpace
[]
[libmesh_scalar_var]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[BCs]
[sides]
type = MFEMScalarDirichletBC
variable = mfem_scalar_var
coefficient = 1.0
[]
[]
[Kernels]
[diff]
type = MFEMDiffusionKernel
variable = mfem_scalar_var
[]
[source]
type = MFEMDomainLFKernel
variable = mfem_scalar_var
coefficient = 2.0
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[gmres]
type = MFEMHypreGMRES
preconditioner = boomeramg
l_tol = 1e-12
l_max_its = 1000
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[MultiApps]
[libmesh_app]
type = FullSolveMultiApp
input_files = libmesh_sub_scalar.i
execute_on = 'INITIAL'
[]
[]
[Transfers]
[transfer_from_libmesh]
type = MultiApplibMeshToMFEMShapeEvaluationTransfer
source_variables = libmesh_scalar_var
variables = libmesh_scalar_var
from_multi_app = libmesh_app
[]
[]
[Postprocessors]
[Difference]
type = MFEML2Error
variable = mfem_scalar_var
function = libmesh_scalar_var
execute_on = TIMESTEP_END
[]
[]
[Outputs]
file_base = 'mfem_parent_libmesh_sub_scalar_quads'
csv = true
[]
(test/tests/mfem/multiapps/problem.i)
[Problem]
type = MFEMProblem
verbose_multiapps = true
[]
[Mesh]
type = MFEMFileMesh
file = ../mesh/square.e
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[]
[Variables]
[u]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[Kernels]
[diff]
type = MFEMDiffusionKernel
variable = u
[]
[td]
type = MFEMTimeDerivativeMassKernel
variable = u
[]
[]
[BCs]
[left]
type = MFEMScalarDirichletBC
variable = u
boundary = left
coefficient = 0
[]
[right]
type = MFEMScalarDirichletBC
variable = u
boundary = right
coefficient = 1
[]
[]
[Functions]
[exact_solution]
type = ParsedFunction
# Exact solution for u_t - u_xx = 0 on x in [0,1] with u(0,t)=0 and u(1,t)=1.
# Write u(x,t) = x + w(x,t), so w has homogeneous Dirichlet data, then expand
# w in a sine series with n-th term: (-1)^n*(2/n/pi)*sin(n*pi*x)*exp(-n^2*pi^2*t).
# This expression keeps the first five terms of that series.
expression = 'x + 2*(-sin(pi*x)*exp(-pi^2*t) + sin(2*pi*x)*exp(-4*pi^2*t)/2 - sin(3*pi*x)*exp(-9*pi^2*t)/3 + sin(4*pi*x)*exp(-16*pi^2*t)/4 - sin(5*pi*x)*exp(-25*pi^2*t)/5)/pi'
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[main]
type = MFEMHyprePCG
preconditioner = boomeramg
l_tol = 1e-12
l_max_its = 100
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
execute_on = TIMESTEP_END
[]
[error]
type = MFEML2Error
variable = u
function = exact_solution
execute_on = TIMESTEP_END
[]
[]
(test/tests/mfem/kernels/irrotational.i)
# 2D irrotational vortex with Nedelec elements of the first kind.
centre_x = -0.75
centre_y = 0.1
[Mesh]
type = MFEMFileMesh
file = ../mesh/vortex.msh
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = SEVENTH
[]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = SEVENTH
[]
[]
[Variables]
[velocity_potential]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[AuxVariables]
[velocity]
type = MFEMVariable
fespace = HCurlFESpace
[]
[]
[Functions]
[speed]
type = ParsedFunction
expression = '1 / sqrt((x-x0)^2 + (y-y0)^2)'
symbol_names = 'x0 y0'
symbol_values = '${centre_x} ${centre_y}'
[]
[theta]
type = ParsedFunction
expression = 'atan2(y-y0, x-x0)'
symbol_names = 'x0 y0'
symbol_values = '${centre_x} ${centre_y}'
[]
[exact_velocity]
type = ParsedVectorFunction
expression_x = '-v * sin(th)'
expression_y = 'v * cos(th)'
symbol_names = 'v th'
symbol_values = 'speed theta'
[]
[]
[BCs]
[potential_velocity_boundary]
type = MFEMScalarDirichletBC
variable = velocity_potential
boundary = '1'
coefficient = theta
[]
[]
[Kernels]
[laplacian]
type = MFEMDiffusionKernel
variable = velocity_potential
[]
[]
[AuxKernels]
[grad]
type = MFEMGradAux
variable = velocity
source = velocity_potential
execute_on = TIMESTEP_END
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[main]
type = MFEMHypreGMRES
preconditioner = boomeramg
l_tol = 1e-16
l_max_its = 1000
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[potential_error]
type = MFEML2Error
variable = velocity_potential
function = theta
[]
[velocity_error]
type = MFEMVectorL2Error
variable = velocity
function = exact_velocity
[]
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/Irrotational
vtk_format = ASCII
[]
[L2CSV]
type = CSV
file_base = OutputData/Irrotational
[]
[]
(test/tests/mfem/functions/quadrature_function_source.i)
[Mesh]
type = MFEMFileMesh
file = ../mesh/hinomaru.e
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[]
[Variables]
[variable]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[ICs]
[ic]
type = MFEMScalarIC
variable = variable
coefficient = material
[]
[]
[BCs]
[bc]
type = MFEMScalarDirichletBC
variable = variable
boundary = skin
[]
[]
[FunctorMaterials]
[material]
type = MFEMGenericFunctorMaterial
prop_names = material
prop_values = -100
[]
[]
[Functions]
[r]
type = ParsedFunction
expression = hypot(x,y)
[]
[p]
type = ParsedFunction
expression = atan2(y,x)
[]
[source]
type = MFEMParsedFunction
expression = v*sin(w*p)
symbol_names = 'p w v'
symbol_values = 'p 4 variable'
[]
[solution]
type = MFEMParsedFunction
expression = if(r<=1,-c*sin(w*p)*(r^w-r^2)/(w^2-4),0)
symbol_names = 'r p w c'
symbol_values = 'r p 4 material'
[]
[]
[QuadratureFunctions]
[qf_source]
type = MFEMScalarQuadratureFunction
coefficient = source
# match the default integration rule order used by DomainLFIntegrator
# for first-order elements (oa * fe_order + ob = 2 * 1 + 0)
order = 2
[]
[]
[Kernels]
[diff]
type = MFEMDiffusionKernel
variable = variable
[]
[source]
type = MFEMDomainLFKernel
variable = variable
coefficient = qf_source
block = wire
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[main]
type = MFEMHyprePCG
preconditioner = boomeramg
l_tol = 1e-16
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[error]
type = MFEML2Error
variable = variable
function = solution
[]
[]
[Outputs]
csv = true
file_base = OutputData/QuadratureFunctionSource
[]
(test/tests/mfem/functions/parsed_function_source.i)
[Mesh]
type = MFEMFileMesh
file = ../mesh/hinomaru.e
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[]
[Variables]
[variable]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[ICs]
[ic]
type = MFEMScalarIC
variable = variable
coefficient = material
[]
[]
[BCs]
[bc]
type = MFEMScalarDirichletBC
variable = variable
boundary = skin
[]
[]
[FunctorMaterials]
[material]
type = MFEMGenericFunctorMaterial
prop_names = material
prop_values = -100
[]
[]
[Functions]
[r]
type = ParsedFunction
expression = hypot(x,y)
[]
[p]
type = ParsedFunction
expression = atan2(y,x)
[]
[source]
type = MFEMParsedFunction
expression = v*sin(w*p)
symbol_names = 'p w v'
symbol_values = 'p 4 variable'
[]
[solution]
type = MFEMParsedFunction
expression = if(r<=1,-c*sin(w*p)*(r^w-r^2)/(w^2-4),0)
symbol_names = 'r p w c'
symbol_values = 'r p 4 material'
[]
[]
[Kernels]
[diff]
type = MFEMDiffusionKernel
variable = variable
[]
[source]
type = MFEMDomainLFKernel
variable = variable
coefficient = source
block = wire
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[main]
type = MFEMHyprePCG
preconditioner = boomeramg
l_tol = 1e-16
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[error]
type = MFEML2Error
variable = variable
function = solution
[]
[]
[Outputs]
csv = true
file_base = OutputData/ParsedFunctionSource
[]
(test/tests/mfem/kernels/darcy.i)
[Mesh]
type = MFEMFileMesh
file = ../mesh/star.mesh
uniform_refine = 2
[]
[Problem]
type = MFEMProblem
[]
[Functions]
[exact_velocity]
type = ParsedVectorFunction
expression_x = '-exp(x) * sin(y)'
expression_y = '-exp(x) * cos(y)'
[]
[exact_pressure]
type = ParsedFunction
expression = 'exp(x) * sin(y)'
[]
[exact_pressure_rhs]
type = ParsedFunction
expression = '-exp(x) * sin(y)'
[]
[]
[FESpaces]
[HDivFESpace]
type = MFEMVectorFESpace
fec_type = RT
fec_order = SECOND
[]
[L2FESpace]
type = MFEMScalarFESpace
fec_type = L2
fec_order = SECOND
basis = GaussLegendre
[]
[]
[Variables]
[velocity]
type = MFEMVariable
fespace = HDivFESpace
[]
[pressure]
type = MFEMVariable
fespace = L2FESpace
[]
[]
[BCs]
[flux_boundaries]
type = MFEMVectorFEBoundaryFluxIntegratedBC
variable = velocity
coefficient = exact_pressure_rhs
[]
[]
[Kernels]
[VelocityMass]
type = MFEMVectorFEMassKernel
variable = velocity
[]
[PressureGrad]
type = MFEMVectorFEDivergenceKernel
trial_variable = pressure
variable = velocity
coefficient = -1
transpose = true
[]
[VelocityDiv]
type = MFEMVectorFEDivergenceKernel
trial_variable = velocity
variable = pressure
coefficient = -1
[]
[]
[Solvers]
[main]
type = MFEMMUMPS
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[velocity_error]
type = MFEMVectorL2Error
variable = velocity
function = exact_velocity
[]
[pressure_error]
type = MFEML2Error
variable = pressure
function = exact_pressure
[]
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/Darcy
vtk_format = ASCII
[]
[DarcyErrorCSV]
type = CSV
file_base = OutputData/Darcy
[]
[]
(test/tests/mfem/kernels/diffusion_amr.i)
[Mesh]
type = MFEMFileMesh
file = ../mesh/square.msh
nonconforming = true
[]
[Adaptivity]
[Indicators]
[l2zz]
type = MFEML2ZienkiewiczZhuIndicator
variable = concentration
kernel = diff
[]
[]
[Markers]
[ref]
type = MFEMRefinementMarker
threshold = 0.7
indicator = l2zz
max_h_level = 1
[]
[]
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = FIRST
[]
[]
[Variables]
[concentration]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[AuxVariables]
[concentration_gradient]
type = MFEMVariable
fespace = HCurlFESpace
[]
[]
[AuxKernels]
[grad]
type = MFEMGradAux
variable = concentration_gradient
source = concentration
execute_on = TIMESTEP_END
[]
[]
[BCs]
[top]
type = MFEMScalarDirichletBC
variable = concentration
boundary = 4
coefficient = 1
[]
[bottom]
type = MFEMScalarDirichletBC
variable = concentration
boundary = 2
[]
[]
[Functions]
[D]
type = ParsedFunction
expression = 1+1/(1+exp(20*y-10))
[]
[solution]
type = ParsedFunction
expression = (20*y+log(exp(20*y)+2*exp(10))-log(1+2*exp(10)))/(30+log(2+exp(10))-log(1+2*exp(10)))
[]
[]
[Kernels]
[diff]
type = MFEMDiffusionKernel
variable = concentration
coefficient = D
[]
[]
[Solvers]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[main]
type = MFEMHypreGMRES
preconditioner = boomeramg
l_tol = 1e-16
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[error]
type = MFEML2Error
variable = concentration
function = solution
[]
[]
[Outputs]
csv = true
file_base = OutputData/DiffusionHRefinement
[]