- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- function0The vector analytical solution to compare against
Default:0
C++ Type:FunctionName
Unit:(no unit assumed)
Controllable:No
Description:The vector analytical solution to compare against
- function_x0The analytical solution to compare against in the x direction
Default:0
C++ Type:FunctionName
Unit:(no unit assumed)
Controllable:No
Description:The analytical solution to compare against in the x direction
- function_y0The analytical solution to compare against in the y direction
Default:0
C++ Type:FunctionName
Unit:(no unit assumed)
Controllable:No
Description:The analytical solution to compare against in the y direction
- function_z0The analytical solution to compare against in the z direction
Default:0
C++ Type:FunctionName
Unit:(no unit assumed)
Controllable:No
Description:The analytical solution to compare against in the z direction
- var_xThe FE solution in the x direction
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The FE solution in the x direction
- var_yThe FE solution in the y direction
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The FE solution in the y direction
- var_zThe FE solution in the z direction
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The FE solution in the z direction
- variableThe vector FE solution
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The vector FE solution
ElementVectorL2Error
Returns the L2-norm of the difference between a pair of computed and analytical vector-valued solutions.
Overview
The L2-error between a vector-valued solution u and a known vector-valued function f is written
(∫Ω∣∣u−f∣∣2dx)1/2
where ∣∣⋅∣∣ denotes the l2-norm in Rd.
The user can specify u with either a single nonlinear vector variable, or with up to three nonlinear scalar variables simultaneously, which would each typically represent the x, y, z components of the vector variable.
Likewise, the user can also specify f with either a single Function object defining the vectorValue
method, e.g. ParsedVectorFunction, or up to three such objects defining the value
method, e.g. ParsedFunction.
Example Input File Syntax
With a single nonlinear vector variable and a single vector-valued function:
[Postprocessors]
[L2Error]
type = ElementVectorL2Error
variable = u
function = f
[]
[]
With component-wise specifications for both the nonlinear variable and the function:
[./integral]
type = ElementVectorL2Error
var_x = u
var_y = v
function_x = bc_u
function_y = bc_v
execute_on = 'initial timestep_end'
[../]
Input Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- 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, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, TRANSFER
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.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
Execution Scheduling 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:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- 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
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (test/tests/kernels/vector_fe/ad_coupled_curl_product.i)
- (test/tests/kernels/vector_fe/coupled_electrostatics.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
- (test/tests/kernels/vector_fe/vector_kernel.i)
- (test/tests/kernels/vector_fe/ad_vector_kernel.i)
- (test/tests/postprocessors/element_vec_l2_error_pps/element_vec_l2_error.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
- (modules/xfem/test/tests/moment_fitting/solid_mechanics_moment_fitting.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
Child Objects
(test/tests/kernels/vector_fe/coupled_electrostatics.i)
# Test for DivField and GradField kernels and VectorDivPenaltyDirichletBC bcs.
# This test uses Raviart-Thomas elements to solve a model div-grad problem
# in H(div). The problem is simply a div-grad formulation, u = -grad(p), and
# div(u) = f, of the standard Poisson problem div(grad(p)) = -f.
# Manufactured solution: p = cos(k*x)*sin(k*y)*cos(k*z).
k = asin(1)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 6
ny = 6
nz = 6
xmax = 1
ymax = 1
zmax = 1
xmin = -1
ymin = -1
zmin = -1
elem_type = HEX27
[]
[]
[Variables]
[u]
family = RAVIART_THOMAS
order = FIRST
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Functions]
[f]
type = ParsedVectorFunction
expression_x = ${k}*sin(${k}*x)*sin(${k}*y)*cos(${k}*z)
expression_y = -${k}*cos(${k}*x)*cos(${k}*y)*cos(${k}*z)
expression_z = ${k}*cos(${k}*x)*sin(${k}*y)*sin(${k}*z)
div = ${Mesh/gmg/dim}*${k}^2*cos(${k}*x)*sin(${k}*y)*cos(${k}*z)
[]
[]
[Kernels]
[coefficient]
type = VectorFunctionReaction
variable = u
sign = negative
[]
[gradient]
type = GradField
variable = u
coupled_scalar_variable = p
[]
[divergence]
type = DivField
variable = p
coupled_vector_variable = u
[]
[forcing]
type = BodyForce
variable = p
function = ${Functions/f/div}
[]
[mean_zero_p]
type = ScalarLagrangeMultiplier
variable = p
lambda = lambda
[]
[]
[ScalarKernels]
[constraint]
type = AverageValueConstraint
variable = lambda
pp_name = PP
value = 0.0
[]
[]
[BCs]
[sides]
type = VectorDivPenaltyDirichletBC
variable = u
function = f
penalty = 1e8
boundary = 'top bottom left right front back'
[]
[]
[Postprocessors]
active = PP
[PP]
type = ElementIntegralVariablePostprocessor
variable = p
execute_on = linear
[]
[L2Error]
type = ElementVectorL2Error
variable = u
function = f
[]
[HDivSemiError]
type = ElementHDivSemiError
variable = u
function = f
[]
[HDivError]
type = ElementHDivError
variable = u
function = f
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = '-pc_type -ksp_rtol -ksp_norm_type'
petsc_options_value = ' jacobi 1e-12 preconditioned'
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/element_vec_l2_error_pps/element_vec_l2_error.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
[]
[Variables]
active = 'u v'
[./u]
order = FIRST
family = LAGRANGE
[../]
[./v]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
active = 'bc_u bc_v f_u f_v'
# A ParsedFunction allows us to supply analytic expressions
# directly in the input file
[./bc_u]
type = ParsedFunction
expression = sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[./bc_v]
type = ParsedFunction
expression = sin(alpha*pi*y)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[./f_u]
type = ParsedFunction
expression = alpha*alpha*pi*pi*sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[./f_v]
type = ParsedFunction
expression = alpha*alpha*pi*pi*sin(alpha*pi*y)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[]
[Kernels]
active = 'diff_u diff_v forcing_u forcing_v'
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
# This Kernel can take a function name to use
[./forcing_u]
type = BodyForce
variable = u
function = f_u
[../]
[./forcing_v]
type = BodyForce
variable = v
function = f_v
[../]
[]
[BCs]
active = 'all_u all_v'
# The BC can take a function name to use
[./all_u]
type = FunctionDirichletBC
variable = u
boundary = 'bottom right top left'
function = bc_u
[../]
[./all_v]
type = FunctionDirichletBC
variable = v
boundary = 'bottom right top left'
function = bc_v
[../]
[]
[Executioner]
type = Steady
[./Adaptivity]
refine_fraction = 1.0
coarsen_fraction = 0.0
max_h_level = 10
steps = 3
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
execute_on = 'initial timestep_end'
[../]
[./integral]
type = ElementVectorL2Error
var_x = u
var_y = v
function_x = bc_u
function_y = bc_v
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
file_base = out
exodus = false
csv = true
[]
(test/tests/kernels/vector_fe/ad_coupled_curl_product.i)
# This example couples the product of the curl of a variable vector
# and a supplied field into a diffusion problem of a Lagrange variable
# using automatic differentiation
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 5
xmin = -1
ymin = -1
zmin = -1
elem_type = HEX20
[]
[Variables]
[u]
[]
[v]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[coupled_curl_supplied_field_product]
type = ADCoupledCurlSuppliedFieldProduct
variable = u
vector = v
supplied_field_x = '0'
supplied_field_y = '0'
supplied_field_z = '1'
[]
[u_diff]
type = Diffusion
variable = u
[]
[u_body_force]
type = BodyForce
variable = u
function = u_body_force_ffn
[]
[diff]
type = ADVectorFEWave
variable = v
x_forcing_func = x_ffn
y_forcing_func = y_ffn
[]
[]
[BCs]
[v_bnd]
type = VectorCurlPenaltyDirichletBC
boundary = 'left right top bottom front back'
penalty = 1e10
function = v_sln
variable = v
[]
[u_bnd]
type = ADFunctionPenaltyDirichletBC
boundary = 'left right top bottom front back'
penalty = 1e10
function = u_sln
variable = u
[]
[]
[Functions]
[x_ffn]
type = ParsedFunction
expression = '(2*pi*pi + 1)*cos(pi*x)*sin(pi*y)'
[]
[y_ffn]
type = ParsedFunction
expression = '-(2*pi*pi + 1)*sin(pi*x)*cos(pi*y)'
[]
[u_body_force_ffn]
type = ParsedFunction
expression = '-2*pi*cos(pi*x)*cos(pi*y) + pi^2*cos(z*pi)'
[]
[u_sln]
type = ParsedFunction
expression = 'cos(z*pi)'
[]
[v_sln]
type = ParsedVectorFunction
expression_x = 'cos(pi*x)*sin(pi*y)'
expression_y = '-sin(pi*x)*cos(pi*y)'
curl_z = '-2*pi*cos(pi*x)*cos(pi*y)'
[]
[]
[Postprocessors]
[v_L2Error]
type = ElementVectorL2Error
variable = v
function = v_sln
[]
[HCurlSemiError]
type = ElementHCurlSemiError
variable = v
function = v_sln
[]
[HCurlError]
type = ElementHCurlError
variable = v
function = v_sln
[]
[u_L2Error]
type = ElementL2Error
variable = u
function = u_sln
[]
[]
[Preconditioning]
[pre]
type = SMP
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = true
csv = true
[]
(test/tests/kernels/vector_fe/coupled_electrostatics.i)
# Test for DivField and GradField kernels and VectorDivPenaltyDirichletBC bcs.
# This test uses Raviart-Thomas elements to solve a model div-grad problem
# in H(div). The problem is simply a div-grad formulation, u = -grad(p), and
# div(u) = f, of the standard Poisson problem div(grad(p)) = -f.
# Manufactured solution: p = cos(k*x)*sin(k*y)*cos(k*z).
k = asin(1)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 6
ny = 6
nz = 6
xmax = 1
ymax = 1
zmax = 1
xmin = -1
ymin = -1
zmin = -1
elem_type = HEX27
[]
[]
[Variables]
[u]
family = RAVIART_THOMAS
order = FIRST
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Functions]
[f]
type = ParsedVectorFunction
expression_x = ${k}*sin(${k}*x)*sin(${k}*y)*cos(${k}*z)
expression_y = -${k}*cos(${k}*x)*cos(${k}*y)*cos(${k}*z)
expression_z = ${k}*cos(${k}*x)*sin(${k}*y)*sin(${k}*z)
div = ${Mesh/gmg/dim}*${k}^2*cos(${k}*x)*sin(${k}*y)*cos(${k}*z)
[]
[]
[Kernels]
[coefficient]
type = VectorFunctionReaction
variable = u
sign = negative
[]
[gradient]
type = GradField
variable = u
coupled_scalar_variable = p
[]
[divergence]
type = DivField
variable = p
coupled_vector_variable = u
[]
[forcing]
type = BodyForce
variable = p
function = ${Functions/f/div}
[]
[mean_zero_p]
type = ScalarLagrangeMultiplier
variable = p
lambda = lambda
[]
[]
[ScalarKernels]
[constraint]
type = AverageValueConstraint
variable = lambda
pp_name = PP
value = 0.0
[]
[]
[BCs]
[sides]
type = VectorDivPenaltyDirichletBC
variable = u
function = f
penalty = 1e8
boundary = 'top bottom left right front back'
[]
[]
[Postprocessors]
active = PP
[PP]
type = ElementIntegralVariablePostprocessor
variable = p
execute_on = linear
[]
[L2Error]
type = ElementVectorL2Error
variable = u
function = f
[]
[HDivSemiError]
type = ElementHDivSemiError
variable = u
function = f
[]
[HDivError]
type = ElementHDivError
variable = u
function = f
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = '-pc_type -ksp_rtol -ksp_norm_type'
petsc_options_value = ' jacobi 1e-12 preconditioned'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with scalar inputs
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
# dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 1
xmin = 0
ymax = 1
ymin = -1
elem_type = QUAD9
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-y^2 - cos(pi*y) - 2'
expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = '-y^2 + sin(pi*y) - 2'
expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[azim_dB_dt_func]
type = ParsedFunction
expression = '-(2*y + 2*x)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[aux_E_real_x]
family = MONOMIAL
order = FIRST
[]
[aux_E_real_y]
family = MONOMIAL
order = FIRST
[]
[azim_dB_dt_term_scalar]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_E_real_x]
type = VectorVariableComponentAux
variable = aux_E_real_x
vector_variable = E_real
component = X
[]
[aux_E_real_y]
type = VectorVariableComponentAux
variable = aux_E_real_y
vector_variable = E_real
component = Y
[]
[aux_azim_dB_dt_scalar]
type = AzimuthMagneticTimeDerivRZ
Efield_X = aux_E_real_x
Efield_Y = aux_E_real_y
variable = azim_dB_dt_term_scalar
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_azim_dB_dt_scalar]
type = ElementL2Error
variable = azim_dB_dt_term_scalar
function = azim_dB_dt_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-16
[]
[Outputs]
exodus = true
csv = true
[]
(test/tests/kernels/vector_fe/vector_kernel.i)
# This example reproduces the libmesh vector_fe example 3 results
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[diff]
type = VectorFEWave
variable = u
x_forcing_func = x_ffn
y_forcing_func = y_ffn
[]
[]
[BCs]
[bnd]
type = VectorCurlPenaltyDirichletBC
boundary = 'left right top bottom'
penalty = 1e10
function = sln
variable = u
[]
[]
[Functions]
[x_ffn]
type = ParsedFunction
expression = '(2*pi*pi + 1)*cos(pi*x)*sin(pi*y)'
[]
[y_ffn]
type = ParsedFunction
expression = '-(2*pi*pi + 1)*sin(pi*x)*cos(pi*y)'
[]
[sln]
type = ParsedVectorFunction
expression_x = cos(pi*x)*sin(pi*y)
expression_y = -sin(pi*x)*cos(pi*y)
curl_z = -2*pi*cos(pi*x)*cos(pi*y)
[]
[]
[Postprocessors]
active = ''
[L2Error]
type = ElementVectorL2Error
variable = u
function = sln
[]
[HCurlSemiError]
type = ElementHCurlSemiError
variable = u
function = sln
[]
[HCurlError]
type = ElementHCurlError
variable = u
function = sln
[]
[]
[Preconditioning]
[pre]
type = SMP
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/vector_fe/ad_vector_kernel.i)
# This example reproduces the libmesh vector_fe example 3 results
# using automatic differentiation
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[diff]
type = ADVectorFEWave
variable = u
x_forcing_func = x_ffn
y_forcing_func = y_ffn
[]
[]
[BCs]
[bnd]
type = VectorCurlPenaltyDirichletBC
boundary = 'left right top bottom'
penalty = 1e10
function = sln
variable = u
[]
[]
[Functions]
[x_ffn]
type = ParsedFunction
expression = '(2*pi*pi + 1)*cos(pi*x)*sin(pi*y)'
[]
[y_ffn]
type = ParsedFunction
expression = '-(2*pi*pi + 1)*sin(pi*x)*cos(pi*y)'
[]
[sln]
type = ParsedVectorFunction
expression_x = 'cos(pi*x)*sin(pi*y)'
expression_y = '-sin(pi*x)*cos(pi*y)'
curl_z = '-2*pi*cos(pi*x)*cos(pi*y)'
[]
[]
[Postprocessors]
active = ''
[L2Error]
type = ElementVectorL2Error
variable = u
function = sln
[]
[HCurlSemiError]
type = ElementHCurlSemiError
variable = u
function = sln
[]
[HCurlError]
type = ElementHCurlError
variable = u
function = sln
[]
[]
[Preconditioning]
[pre]
type = SMP
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/element_vec_l2_error_pps/element_vec_l2_error.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
[]
[Variables]
active = 'u v'
[./u]
order = FIRST
family = LAGRANGE
[../]
[./v]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
active = 'bc_u bc_v f_u f_v'
# A ParsedFunction allows us to supply analytic expressions
# directly in the input file
[./bc_u]
type = ParsedFunction
expression = sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[./bc_v]
type = ParsedFunction
expression = sin(alpha*pi*y)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[./f_u]
type = ParsedFunction
expression = alpha*alpha*pi*pi*sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[./f_v]
type = ParsedFunction
expression = alpha*alpha*pi*pi*sin(alpha*pi*y)
symbol_names = 'alpha'
symbol_values = '2'
[../]
[]
[Kernels]
active = 'diff_u diff_v forcing_u forcing_v'
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
# This Kernel can take a function name to use
[./forcing_u]
type = BodyForce
variable = u
function = f_u
[../]
[./forcing_v]
type = BodyForce
variable = v
function = f_v
[../]
[]
[BCs]
active = 'all_u all_v'
# The BC can take a function name to use
[./all_u]
type = FunctionDirichletBC
variable = u
boundary = 'bottom right top left'
function = bc_u
[../]
[./all_v]
type = FunctionDirichletBC
variable = v
boundary = 'bottom right top left'
function = bc_v
[../]
[]
[Executioner]
type = Steady
[./Adaptivity]
refine_fraction = 1.0
coarsen_fraction = 0.0
max_h_level = 10
steps = 3
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
execute_on = 'initial timestep_end'
[../]
[./integral]
type = ElementVectorL2Error
var_x = u
var_y = v
function_x = bc_u
function_y = bc_v
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
file_base = out
exodus = false
csv = true
[]
(modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
# Test for SourceCurrentHeating
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# heating = 'sin(x*pi)*cos(x*pi) + sin(y*pi)*cos(y*pi)'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-2*cos(pi*y) + pi^2*cos(pi*y)'
expression_y = '-pi^2*cos(pi*x) + 2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = 'pi^2*sin(pi*y)'
expression_y = '-pi^2*sin(pi*x)'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[heating_func]
type = ParsedFunction
expression = '1.0*sin(x*pi)*cos(x*pi) + 1.0*sin(y*pi)*cos(y*pi)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[current_heating_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_current_heating]
type = SourceCurrentHeating
variable = current_heating_term
E_real = E_real
E_imag = E_imag
source_real = current_real
source_imag = current_imag
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_aux_heating]
type = ElementL2Error
variable = current_heating_term
function = heating_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
# Test for EMJouleHeatingSource
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
E_imag = E_imag
E_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
E_imag = E_imag
E_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = EMJouleHeatingSource
variable = n
E_imag = E_imag
E_real = E_real
conductivity = cond_real
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/xfem/test/tests/moment_fitting/solid_mechanics_moment_fitting.i)
# Test for a mechanics problem which uses four points moment_fitting approach.
# See this paper (https://doi.org/10.1007/s00466-018-1544-2) for more details about moment_fitting approach.
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
volumetric_locking_correction = true
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[UserObjects]
[./line_seg_cut_uo0]
type = LineSegmentCutUserObject
cut_data = '0.0000e+00 6.3330e-01 3.9000e-01 6.3330e-01'
time_start_cut = 0.0
time_end_cut = 0.0
[../]
[./line_seg_cut_uo1]
type = LineSegmentCutUserObject
cut_data = '3.9000e-01 6.3330e-01 6.8000e-01 6.3330e-01'
time_start_cut = 0.0
time_end_cut = 0.0
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = SMALL
[../]
[]
[Functions]
[./right_trac_x]
type = ParsedFunction
expression = '-(t*M*y)/I'
symbol_names = 'M E I'
symbol_values = '2e4 1e6 0.666666667'
[../]
[./bottom_disp_y]
type = ParsedFunction
expression = '((t*M)/(2*E*I))*(1-nu*nu)*(x*x-0.25*l*l)'
symbol_names = 'M E I l nu'
symbol_values = '2e4 1e6 0.666666667 2.0 0.3'
[../]
[./soln_x]
type = ParsedFunction
expression = '-(M/(E*I))*(1-nu*nu)*x*y'
symbol_names = 'M E I nu'
symbol_values = '2e4 1e6 0.666666667 0.3'
[../]
[./soln_y]
type = ParsedFunction
expression = '(M/(2*E*I))*(1-nu*nu)*(x*x-0.25*l*l+(nu/(1-nu))*y*y)'
symbol_names = 'M E I l nu'
symbol_values = '2e4 1e6 0.666666667 2.0 0.3'
[../]
[]
[BCs]
[./right_x]
type = FunctionNeumannBC
boundary = 1
variable = disp_x
function = right_trac_x
[../]
[./bottom_y]
type = FunctionDirichletBC
boundary = 0
variable = disp_y
function = bottom_disp_y
[../]
[./left_x]
type = DirichletBC
boundary = 3
variable = disp_x
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'none'
# [./Quadrature]
# order = FOURTH
# type = MONOMIAL
# [../]
[./Predictor]
type = SimplePredictor
scale = 1.0
[../]
# controls for linear iterations
l_max_its = 100
l_tol = 1e-2
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-16
nl_abs_tol = 1e-10
# time control
start_time = 0.0
dt = 0.5
end_time = 1.0
num_steps = 5000
[]
[Postprocessors]
[./numel]
type = NumElements
execute_on = timestep_end
[../]
[./integral]
type = ElementVectorL2Error
var_x = disp_x
var_y = disp_y
function_x = soln_x
function_y = soln_y
execute_on = timestep_end
[../]
[]
[Outputs]
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
# Test for ADConductionCurrent
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for both the real and imag. component
[exact]
type = ParsedVectorFunction
expression_x = 'y*y'
expression_y = '-x*x'
[]
#The forcing terms for the real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 - 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 - epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 + epsilon_i*mu_r*omega_r^2*y^2 - epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 + epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 + 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 + mu_i*omega_i*sigma_r*y^2 + mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 + mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 - mu_r*omega_r*sigma_r*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 + 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 + epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 - epsilon_i*mu_r*omega_r^2*x^2 + epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 - epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 - 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 - mu_i*omega_i*sigma_r*x^2 - mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 - mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 + mu_r*omega_r*sigma_r*x^2 + 2'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 + 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 + epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 - epsilon_i*mu_r*omega_r^2*y^2 + epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 - epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 - 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 - mu_i*omega_i*sigma_r*y^2 - mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 - mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 + mu_r*omega_r*sigma_r*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 - 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 - epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 + epsilon_i*mu_r*omega_r^2*x^2 - epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 + epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 + 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 + mu_i*omega_i*sigma_r*x^2 + mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 + mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 - mu_r*omega_r*sigma_r*x^2 + 2'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
E_imag = E_imag
E_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
E_imag = E_imag
E_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
# Test for ADMatWaveReaction
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for both the real and imag. component
[exact]
type = ParsedVectorFunction
expression_x = 'y*y'
expression_y = '-x*x'
[]
#The forcing terms for the real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r omega_i mu_i epsilon_i'
symbol_values = 'omega mu epsilon omega mu epsilon'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 - 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 - epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 + epsilon_i*mu_r*omega_r^2*y^2 - epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 + epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 + 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 + 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 + epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 - epsilon_i*mu_r*omega_r^2*x^2 + epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 - epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 - 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 + 2'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r omega_i mu_i epsilon_i'
symbol_values = 'omega mu epsilon omega mu epsilon'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 + 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 + epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 - epsilon_i*mu_r*omega_r^2*y^2 + epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 - epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 - 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 - 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 - epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 + epsilon_i*mu_r*omega_r^2*x^2 - epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 + epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 + 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 + 2'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
# Test for EMJouleHeatingHeatGeneratedAux
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
# heating = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
[heating_func]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
E_imag = E_imag
E_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
E_imag = E_imag
E_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = EMJouleHeatingSource
variable = n
E_imag = E_imag
E_real = E_real
conductivity = cond_real
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[AuxVariables]
[heating_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_microwave_heating]
type = EMJouleHeatingHeatGeneratedAux
variable = heating_term
E_imag = E_imag
E_real = E_real
conductivity = cond_real
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[error_aux_heating]
type = ElementL2Error
variable = heating_term
function = heating_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with a vector input
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
# dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 1
xmin = 0
ymax = 1
ymin = -1
elem_type = QUAD9
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-y^2 - cos(pi*y) - 2'
expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = '-y^2 + sin(pi*y) - 2'
expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[azim_dB_dt_func]
type = ParsedFunction
expression = '-(2*y + 2*x)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
E_real = E_real
E_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[azim_dB_dt_term_vector]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_azim_dB_dt_vector]
type = AzimuthMagneticTimeDerivRZ
Efield = E_real
variable = azim_dB_dt_term_vector
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_azim_dB_dt_vector]
type = ElementL2Error
variable = azim_dB_dt_term_vector
function = azim_dB_dt_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-16
[]
[Outputs]
exodus = true
csv = true
[]
(framework/include/postprocessors/ElementHCurlSemiError.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ElementVectorL2Error.h"
/**
* This postprocessor will print out the H(curl)-seminorm of the difference
* between the computed solution and the passed function.
* ||u-f||_{H(curl)} = sqrt( \int |curl u - curl f|^2 dx )
*/
class ElementHCurlSemiError : public ElementVectorL2Error
{
public:
static InputParameters validParams();
ElementHCurlSemiError(const InputParameters & parameters);
protected:
virtual Real computeQpIntegral() override;
/// vector variable
const VectorMooseVariable & _u_var;
/// curl of the vector variable
const VectorVariableCurl & _curl_u;
};
(framework/include/postprocessors/ElementHDivSemiError.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ElementVectorL2Error.h"
/**
* This postprocessor will print out the H(div)-seminorm of the difference
* between the computed solution and the passed function.
* ||u-f||_{H(div)} = sqrt( \int |div u - div f|^2 dx )
*/
class ElementHDivSemiError : public ElementVectorL2Error
{
public:
static InputParameters validParams();
ElementHDivSemiError(const InputParameters & parameters);
protected:
virtual Real computeQpIntegral() override;
/// vector variable
const VectorMooseVariable & _u_var;
/// div of the vector variable
const VectorVariableDivergence & _div_u;
};