- abs_tol1e-50Absolute nonlinear tolerance.
Default:1e-50
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Absolute nonlinear tolerance.
- max_its1Maximum nonlinear iterations.
Default:1
C++ Type:unsigned int
Controllable:No
Description:Maximum nonlinear iterations.
- print_level1Solver verbosity.
Default:1
C++ Type:unsigned int
Controllable:No
Description:Solver verbosity.
- rel_tol1e-08Relative nonlinear tolerance.
Default:1e-08
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Relative nonlinear tolerance.
- use_initial_guessTrueWhether to preserve the current MFEM solution vector as the initial guess for an iterative solver.
Default:True
C++ Type:bool
Controllable:No
Description:Whether to preserve the current MFEM solution vector as the initial guess for an iterative solver.
MFEMNewtonNonlinearSolver
Overview
Defines and builds an mfem::NewtonSolver to solve nonlinear MFEM equation systems.
This solver requires Jacobian information from the MFEM operator and uses the externally configured MFEM linear solver for the inner linear solves.
Define this object in the Solvers block.
Input 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.
Advanced Parameters
Input Files
(test/tests/mfem/submeshes/nl_hphi_magnetodynamic.i)
# Solve for the magnetic field around a closed superconductor subject to
# global current constraint.
conductor_domains = 'TorusCore TorusSheath'
vacuum_permeability = 1.0
n_value = 20.0
j_c = 1.0
e_c = 1.0
[Problem]
type = MFEMProblem
[]
[Mesh]
type = MFEMMesh
file = ../mesh/split_embedded_concentric_torus.e
[]
[SubMeshes]
[conductor]
type = MFEMDomainSubMesh
block = ${conductor_domains}
submesh_boundary = conductor_surface
[]
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = FIRST
[]
[HDivFESpace]
type = MFEMVectorFESpace
fec_type = RT
fec_order = CONSTANT
submesh = conductor
[]
[CoilHCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = FIRST
submesh = conductor
[]
[]
[Variables]
[coil_induced_h_field]
type = MFEMVariable
fespace = CoilHCurlFESpace
[]
[]
[AuxVariables]
[coil_external_h_field]
type = MFEMVariable
fespace = CoilHCurlFESpace
[]
[j_field]
type = MFEMVariable
fespace = HDivFESpace
[]
[]
[AuxKernels]
[update_j_field]
type = MFEMCurlAux
variable = j_field
source = coil_induced_h_field
scale_factor = 1.0
execute_on = TIMESTEP_END
[]
[]
[Functions]
[resistivity]
type = MFEMParsedFunction
expression = '(e_c/j_c) * (j/j_c)^(n_val-1)'
symbol_names = 'j e_c j_c n_val'
symbol_values = 'coil_induced_h_field_curl_mag ${e_c} ${j_c} ${n_value}'
[]
[j_dresistivity_dj]
type = MFEMParsedFunction
expression = '(n_val-1) * resistivity'
symbol_names = 'n_val resistivity'
symbol_values = '${n_value} resistivity'
[]
[]
[FunctorMaterials]
[Vacuum]
type = MFEMGenericFunctorMaterial
prop_names = 'permeability'
prop_values = '${vacuum_permeability}'
[]
[]
[BCs]
[conductor_bdr]
type = MFEMVectorTangentialDirichletBC
variable = coil_induced_h_field
vector_coefficient = coil_external_h_field
boundary = conductor_surface
[]
[]
[Kernels]
[dBdt]
type = MFEMTimeDerivativeVectorFEMassKernel
variable = coil_induced_h_field
coefficient = permeability
[]
[curlE]
type = MFEMNLCurlCurlKernel
variable = coil_induced_h_field
k_coefficient = resistivity
curlu_dk_dcurlu_coefficient = j_dresistivity_dj
block = ${conductor_domains}
[]
[]
[Preconditioner]
[ams]
type = MFEMHypreAMS
fespace = CoilHCurlFESpace
[]
[]
[Solvers]
[pcg]
type = MFEMHyprePCG
preconditioner = ams
l_tol = 1e-12
l_max_its = 100
print_level = 0
[]
[newton]
type = MFEMNewtonNonlinearSolver
max_its = 150
abs_tol = 1e-5
print_level = 1
[]
[]
[Executioner]
type = MFEMTransient
dt = 0.5
start_time = 0.0
end_time = 2.0
[]
[MultiApps]
[hphi_magnetostatic]
type = FullSolveMultiApp
input_files = hphi_magnetostatic.i
execute_on = INITIAL
[]
[]
[Transfers]
[from_external_field]
type = MultiAppMFEMShapeEvaluationTransfer
source_variables = h_field
variables = coil_external_h_field
from_multi_app = hphi_magnetostatic
[]
[]
[Postprocessors]
[CoilPower]
type = MFEMVectorFEInnerProductIntegralPostprocessor
coefficient = resistivity
dual_variable = j_field
primal_variable = j_field
block = 'TorusCore TorusSheath'
[]
[]
[Outputs]
inactive = ConductorParaViewDataCollection
[ReportedPostprocessors]
type = CSV
file_base = OutputData/HPhiMagnetodynamicNLClosedCoilCSV
[]
[ConductorParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/HPhiMagnetodynamicNLClosedCoil
vtk_format = ASCII
submesh = conductor
[]
[]
(test/tests/mfem/nonlinear/nlheatconduction_qf.i)
# Nonlinear heat conduction (MFEM Example 16), with the temperature-dependent diffusivity routed
# through a scalar quadrature function coefficient. The stored values are re-projected on each
# nonlinear iteration, reproducing the reference solve in nlheatconduction.i.
kappa = 0.5
alpha = 1e-2
[Mesh]
type = MFEMMesh
file = ../mesh/star.mesh
uniform_refine = 1
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = SECOND
[]
[]
[Variables]
[temperature]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[Functions]
[initial]
type = ParsedFunction
expression = 'if((x*x + y*y > 0.251), 1.0, 2.0)'
[]
[diffusivity_temperature_dependence]
type = MFEMParsedFunction
expression = 'alpha * temperature'
symbol_names = 'alpha temperature'
symbol_values = '${alpha} temperature'
[]
[]
[ICs]
[diffused_ic]
type = MFEMScalarIC
coefficient = initial
variable = temperature
[]
[]
[QuadratureFunctions]
[qf_k]
type = MFEMScalarQuadratureFunction
coefficient = diffusivity_temperature_dependence
# the quadrature rule order matches the one used by DiffusionIntegrator for
# second-order H1 elements on quadrilaterals (2 * fe_order + dim - 1 = 5)
order = 5
[]
[]
[Solvers]
[nl]
type = MFEMNewtonNonlinearSolver
max_its = 30
abs_tol = 1.0e-5
rel_tol = 1.0e-5
print_level = 1
[]
[main]
type = MFEMMUMPS
print_level = 0
[]
[]
[Kernels]
[nl_diffusion]
type = MFEMNLDiffusionKernel
variable = temperature
k_coefficient = qf_k
dk_du_coefficient = ${alpha}
[]
[linear_diffusion]
type = MFEMDiffusionKernel
variable = temperature
coefficient = ${kappa}
[]
[dT_dt]
type = MFEMTimeDerivativeMassKernel
variable = temperature
[]
[]
[Executioner]
type = MFEMTransient
device = cpu
assembly_level = legacy
dt = 1e-2
start_time = 0.0
end_time = 0.5
[]
[VectorPostprocessors]
[centre_temperature]
type = MFEMPointValueSampler
variable = 'temperature'
points = '0.0 0.0 0.0'
execute_on = TIMESTEP_END
[]
[]
[Outputs]
file_base = NLHeatConductionQF
csv = true
time_step_interval = 10
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/NLHeatConductionQF
vtk_format = ASCII
[]
[]
(test/tests/mfem/nonlinear/nldiffusion_newton.i)
!include nldiffusion_common.i
[Preconditioner]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[]
[Solvers]
[lin]
type = MFEMHyprePCG
preconditioner = boomeramg
print_level = 1
l_tol = 1e-12
l_max_its = 1000
[]
[native_mfem_nl]
type = MFEMNewtonNonlinearSolver
max_its = 100
abs_tol = 1.0e-10
rel_tol = 1.0e-9
print_level = 1
[]
[]
(test/tests/mfem/nonlinear/nlheatconduction.i)
# Implementation of MFEM Example 16, for a time dependent nonlinear heat equation problem of the
# form
# dT/dt = \nabla \cdot (\kappa + \alpha T) \nabla T
kappa = 0.5
alpha = 1e-2
[Mesh]
type = MFEMMesh
file = ../mesh/star.mesh
uniform_refine = 1
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = SECOND
[]
[]
[Variables]
[temperature]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[AuxVariables]
inactive = average_temperature
[average_temperature]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[AuxKernels]
inactive = average_field
[average_field]
type = MFEMScalarTimeAverageAux
variable = average_temperature
source = temperature
[]
[]
[Functions]
[initial]
type = ParsedFunction
expression = 'if((x*x + y*y > 0.251), 1.0, 2.0)'
[]
[diffusivity_temperature_dependence]
type = MFEMParsedFunction
expression = 'alpha * temperature'
symbol_names = 'alpha temperature'
symbol_values = '${alpha} temperature'
[]
[]
[ICs]
[diffused_ic]
type = MFEMScalarIC
coefficient = initial
variable = temperature
[]
[]
[Solvers]
[nl]
type = MFEMNewtonNonlinearSolver
max_its = 30
abs_tol = 1.0e-5
rel_tol = 1.0e-5
print_level = 1
[]
[main]
type = MFEMMUMPS
print_level = 0
[]
[]
[Kernels]
[nl_diffusion]
type = MFEMNLDiffusionKernel
variable = temperature
k_coefficient = diffusivity_temperature_dependence
dk_du_coefficient = ${alpha}
[]
[linear_diffusion]
type = MFEMDiffusionKernel
variable = temperature
coefficient = ${kappa}
[]
[dT_dt]
type = MFEMTimeDerivativeMassKernel
variable = temperature
[]
[]
[Executioner]
type = MFEMTransient
device = cpu
assembly_level = legacy
dt = 1e-2
start_time = 0.0
end_time = 0.5
[]
[VectorPostprocessors]
[centre_temperature]
type = MFEMPointValueSampler
variable = 'temperature'
points = '0.0 0.0 0.0'
execute_on = TIMESTEP_END
[]
[]
[Outputs]
file_base = NLHeatConduction
csv = true
time_step_interval = 10
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/NLHeatConduction
vtk_format = ASCII
[]
[]
(test/tests/mfem/nonlinear/nlheattransfer.i)
[Problem]
type = MFEMProblem
[]
[Mesh]
type = MFEMMesh
file = ../mesh/stacked_hexes.e
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = FIRST
[]
[]
[Variables]
[temperature]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[ICs]
[temperature_ic]
type = MFEMScalarIC
coefficient = 200.0
variable = temperature
[]
[]
[Functions]
[T_inf]
type = MFEMParsedFunction
expression = 'temperature + 1'
symbol_names = 'temperature'
symbol_values = 'temperature'
[]
[htc]
type = MFEMParsedFunction
expression = 'temperature/100 + 1'
symbol_names = 'temperature'
symbol_values = 'temperature'
[]
[dhtc_dT]
type = MFEMParsedFunction
expression = '1 / 100'
symbol_names = 'temperature'
symbol_values = 'temperature'
[]
[dT_inf_dT]
type = MFEMParsedFunction
expression = '1'
symbol_names = 'temperature'
symbol_values = 'temperature'
[]
[]
[Solvers]
[nl]
type = MFEMNewtonNonlinearSolver
max_its = 150
abs_tol = 1e-12
rel_tol = 1.0e-8
print_level = 1
[]
[linear]
type = MFEMMUMPS
print_level = 0
[]
[]
[Kernels]
[dT_dt]
type = MFEMTimeDerivativeMassKernel
variable = temperature
[]
[diffusion]
type = MFEMDiffusionKernel
variable = temperature
[]
[]
[BCs]
active = nonlinear
[nonlinear]
type = MFEMNLConvectiveHeatFluxBC
variable = temperature
boundary = 'right'
T_infinity = T_inf
d_T_infinity_dT_coefficient = dT_inf_dT
heat_transfer_coefficient = htc
d_heat_transfer_dT_coefficient = dhtc_dT
[]
[linearized]
type = MFEMNLConvectiveHeatFluxBC
variable = temperature
boundary = 'right'
T_infinity = 201.0
heat_transfer_coefficient = 3.0
d_heat_transfer_dT_coefficient = 0.0
[]
[]
[VectorPostprocessors]
[line_sample]
type = MFEMLineValueSampler
variable = 'temperature'
start_point = '0.0 0.5 0.5'
end_point = '1.0 0.5 0.5'
num_points = 3
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = MFEMTransient
device = cpu
assembly_level = legacy
dt = 1
num_steps = 3
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/NLHeatTransfer
vtk_format = ASCII
[]
[CSV]
type = CSV
file_base = NLHeatTransfer
time_step_interval = 3
[]
[]