- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Controllable:No
Description:The name of the variable that this residual object operates on
Reaction / ADReaction
Description
Reaction
(and its automatic differentiation version, ADReaction
) implements a simple first-order reaction term where the rate of reaction is directly proportional to the governing variable . Its weak form is given by where is the rate coefficient.
Reaction
can be used to help set-up variations of advection-diffusion-reaction equations.
Example Syntax
The syntax for Reaction
is simple, only taking the type
and variable
parameters. An example block is shown below for a diffusion-reaction equation:
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
rate = 2.0
[]
[diffs]
type = Diffusion
variable = s
[]
[prod]
type = CoupledForce
variable = s
v = u
[]
[]
(test/tests/fvkernels/fv_coupled_var/coupled.i)There is no FV (finite volume) version of Reaction
. If you wish to use FV, use FVCoupledForce.
Input Parameters
- 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
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Controllable:No
Description:The displacements
- 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
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.
- rate1The $(\lambda)$ multiplier, the relative amount consumed per unit time.
Default:1
C++ Type:double
Controllable:Yes
Description:The $(\lambda)$ multiplier, the relative amount consumed per unit time.
- 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.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Tagging 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.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- 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
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- 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
Input Files
- (test/tests/auxkernels/time_derivative/coupled_aux_time_derivative.i)
- (modules/combined/test/tests/optimization/optimization_density_update/top_opt_2d_pde_filter.i)
- (test/tests/misc/check_error/bc_with_aux_var.i)
- (test/tests/time_integrators/actually_explicit_euler_verification/ee-1d-quadratic-neumann.i)
- (test/tests/postprocessors/element_average_value/elem_pps_multi_block_test.i)
- (test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_conservative.i)
- (modules/phase_field/test/tests/phase_field_crystal/PFCTrad/pfct_newton_split1_asm5.i)
- (test/tests/restart/restart_transient_from_eigen/eigen.i)
- (test/tests/mortar/convergence-studies/continuity-3d/continuity.i)
- (test/tests/tag/2d_diffusion_vector_tag_test.i)
- (test/tests/interfacekernels/ad_coupled_gradient/coupled.i)
- (test/tests/executioners/solve_type_linear/linear_with_full_smp.i)
- (test/tests/outputs/debug/show_var_residual_norms.i)
- (test/tests/outputs/debug/show_execution_nodal_kernels_bcs.i)
- (modules/combined/test/tests/optimization/optimization_density_update/top_opt_3d_pde_filter.i)
- (test/tests/interfacekernels/adaptivity/adaptivity.i)
- (test/tests/dgkernels/adaptivity/adaptivity.i)
- (modules/combined/examples/optimization/helmholtz_multimat_strip.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/3d_mbb.i)
- (test/tests/outputs/debug/show_execution_nodal_aux_bcs.i)
- (test/tests/postprocessors/side_pps/side_pps_multi_bnd_test.i)
- (test/tests/misc/check_error/scalar_kernel_with_var.i)
- (test/tests/variables/fe_hier/hier-2-3d.i)
- (test/tests/problems/eigen_problem/eigensolvers/dg_krylovschur.i)
- (test/tests/transfers/multiapp_conservative_transfer/sub_power_density.i)
- (test/tests/variables/fe_hier/hier-1-3d.i)
- (modules/combined/examples/optimization/2d_mbb_pde_amr.i)
- (test/tests/misc/check_error/dg_kernel_with_aux_var.i)
- (test/tests/userobjects/nearest_point_layered_average/nearest_radius_layered_average.i)
- (modules/phase_field/test/tests/phase_field_kernels/CoupledAllenCahn.i)
- (test/tests/variables/fe_hier/hier-1-2d.i)
- (test/tests/mortar/continuity-2d-non-conforming/soln-continuity.i)
- (test/tests/mortar/continuity-3d-non-conforming/continuity_penalty_tet.i)
- (test/tests/outputs/debug/show_var_residual_norms_debug.i)
- (test/tests/tag/2d_diffusion_dg_tag.i)
- (test/tests/kernels/hfem/neumann.i)
- (test/tests/auxkernels/time_derivative_aux/test.i)
- (test/tests/time_integrators/implicit-euler/ie-monomials.i)
- (test/tests/kernels/resid_jac_together/diffusion_reaction.i)
- (test/tests/materials/boundary_material/bnd_coupling_vol.i)
- (test/tests/auxkernels/time_derivative_second_aux/test.i)
- (test/tests/dgkernels/ad_dg_diffusion/2d_diffusion_ad_dg_test.i)
- (test/tests/auxkernels/time_derivative/time_derivative.i)
- (test/tests/dgkernels/2d_diffusion_dg/2d_diffusion_dg_test.i)
- (test/tests/misc/check_error/scalar_aux_kernel_with_var.i)
- (test/tests/misc/check_error/missing_req_par_mesh_block_test.i)
- (test/tests/variables/fe_hier/hier-3-1d.i)
- (test/tests/variables/fe_hier/hier-1-1d.i)
- (test/tests/dgkernels/2d_diffusion_dg/dg_stateful.i)
- (modules/combined/examples/optimization/helmholtz_multimat_nostrip.i)
- (test/tests/dgkernels/2d_diffusion_dg/no_mallocs_with_action.i)
- (test/tests/misc/check_error/coupled_grad_without_declare.i)
- (test/tests/misc/rename-parameters/rename-postprocessor.i)
- (test/tests/dgkernels/3d_diffusion_dg/3d_diffusion_p_refinement.i)
- (test/tests/variables/fe_hier/hier-2-2d.i)
- (test/tests/userobjects/nearest_point_layered_average/radius_points_from_uo.i)
- (modules/phase_field/test/tests/mobility_derivative/coupledmatdiffusion.i)
- (test/tests/multiapps/grid-sequencing/coarse.i)
- (test/tests/bcs/penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
- (test/tests/kernels/hfem/dirichlet.i)
- (modules/solid_mechanics/examples/wave_propagation/cantilever_sweep.i)
- (test/tests/misc/check_error/interface_kernel_with_aux_var.i)
- (test/tests/time_integrators/explicit-euler/ee-1d-quadratic-neumann.i)
- (test/tests/mortar/mortar-q-points/test.i)
- (modules/solid_mechanics/examples/wave_propagation/1D_elastic_wave_propagation.i)
- (modules/phase_field/test/tests/phase_field_crystal/PFCTrad/PFCTrad_test.i)
- (test/tests/misc/check_error/aux_kernel_with_var.i)
- (test/tests/variables/fe_hermite/hermite-3-2d.i)
- (test/tests/variables/fe_hermite_convergence/hermite_converge_dirichlet.i)
- (modules/phase_field/test/tests/phase_field_crystal/PFCEnergyDensity/auxkernel.i)
- (test/tests/dgkernels/2d_diffusion_dg/no_functor_additions.i)
- (test/tests/fvkernels/fv_coupled_var/coupled.i)
- (test/tests/materials/material/material_test_dg.i)
- (test/tests/bcs/ad_penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
- (modules/combined/examples/optimization/2d_mbb_pde.i)
- (modules/phase_field/test/tests/phase_field_crystal/PFCTrad/pfct_newton_split1_asm1_10.i)
- (test/tests/outputs/debug/show_execution_kernels_bcs.i)
- (test/tests/bounds/constant_bounds_elem.i)
- (test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange.i)
- (test/tests/misc/check_error/kernel_with_empty_var.i)
- (test/tests/dgkernels/3d_diffusion_dg/3d_diffusion_dg_test.i)
- (test/tests/variables/fe_monomial_const/monomial-const-2d.i)
- (test/tests/misc/check_error/dirac_kernel_with_aux_var.i)
- (test/tests/controls/time_periods/dgkernels/dgkernels.i)
- (test/tests/outputs/debug/show_execution_userobjects.i)
- (modules/phase_field/test/tests/Nucleation/force.i)
- (modules/phase_field/test/tests/SimpleACInterface/SimpleCoupledACInterface.i)
- (test/tests/variables/fe_hermite/hermite-3-3d.i)
- (test/tests/mortar/continuity-3d-non-conforming/continuity_non_conforming_tet.i)
- (test/tests/mortar/continuity-2d-non-conforming/soln-continuity-pg.i)
- (test/tests/variables/fe_monomial_const/monomial-const-3d.i)
- (test/tests/variables/fe_hier/hier-3-2d.i)
- (test/tests/mortar/aux-gap/gap.i)
- (test/tests/nodalkernels/multiple-subdomains/test.i)
- (test/tests/kernels/ad_reaction/ad_reaction.i)
- (test/tests/kernels/hfem/lower-d-volumes.i)
- (test/tests/variables/fe_monomial_const/monomial-const-1d.i)
- (test/tests/bcs/penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
- (test/tests/mortar/gap-conductance-2d-non-conforming/gap-conductance.i)
- (test/tests/kernels/material_coupled_force/material_coupled_force.i)
- (test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_userobject.i)
- (test/tests/variables/fe_hermite_convergence/hermite_converge_periodic.i)
- (modules/phase_field/test/tests/KKS_system/nonlinear.i)
- (test/tests/userobjects/side_user_object_no_boundary_error/lower_d_side_boundary.i)
- (modules/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study_3d.i)
- (test/tests/multiapps/grid-sequencing/fine.i)
- (test/tests/userobjects/side_uo_with_lowerd_use/side-uo-with-lower-d-use.i)
- (test/tests/variables/fe_hier/hier-3-3d.i)
- (test/tests/dgkernels/dg_displacement/dg_displacement.i)
- (test/tests/variables/fe_hier/hier-2-1d.i)
- (test/tests/mortar/convergence-studies/solution-continuity/continuity.i)
- (test/tests/mortar/continuity-3d-non-conforming/continuity_penalty_sphere_hex.i)
- (test/tests/kernels/hfem/3d-lower-d-volumes.i)
- (test/tests/mortar/continuity-3d-non-conforming/continuity_tet.i)
- (test/tests/transfers/multiapp_conservative_transfer/sub_nearest_point.i)
- (test/tests/tag/tag_residual_call.i)
- (test/tests/mortar/convergence-studies/gap-conductance/gap-conductance.i)
- (test/tests/preconditioners/pbp/pbp_dg_test.i)
- (test/tests/mortar/continuity-3d-non-conforming/continuity_mixed.i)
- (test/tests/bcs/ad_penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/2d_mbb_pde.i)
- (test/tests/variables/fe_hermite/hermite-3-1d.i)
- (test/tests/mortar/continuity-2d-non-conforming/dual-soln-continuity-vcp.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/2d_mbb_pde_amr.i)
- (test/tests/mortar/continuity-2d-non-conforming/dual-soln-continuity.i)
- (test/tests/auxkernels/divergence_aux/test_fe.i)
- (modules/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study.i)
- (test/tests/mortar/continuity-3d-non-conforming/continuity_sphere_hex.i)
- (test/tests/variables/previous_newton_iteration/test.i)
- (test/tests/mortar/continuity-2d-non-conforming/sequencing-stateful-soln-continuity.i)
- (test/tests/misc/check_error/kernel_with_aux_var.i)
- (test/tests/mortar/aux-gap/mismatch.i)
- (modules/combined/examples/optimization/3d_mbb.i)
Child Objects
(test/tests/fvkernels/fv_coupled_var/coupled.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 2
[]
[Variables]
[u][]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[w]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[s][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
rate = 2.0
[]
[diffs]
type = Diffusion
variable = s
[]
[prod]
type = CoupledForce
variable = s
v = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[rxn]
type = FVReaction
variable = v
rate = 2.0
[]
[diffw]
type = FVDiffusion
variable = w
coeff = coeff
[]
[prod]
type = FVCoupledForce
variable = w
v = 'v'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[leftw]
type = FVDirichletBC
variable = w
boundary = left
value = 0
[]
[rightw]
type = FVDirichletBC
variable = w
boundary = right
value = 1
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[lefts]
type = DirichletBC
variable = s
boundary = left
value = 0
[]
[rights]
type = DirichletBC
variable = s
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/time_derivative/coupled_aux_time_derivative.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
[]
[Functions]
[./f_fn]
type = ParsedFunction
expression = t*(x+y)
[../]
[./f_dot_fn]
type = ParsedFunction
expression = (x+y)
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./l2_proj]
type = Reaction
variable = u
[../]
[./dck]
type = DotCouplingKernel
variable = u
v = f
[../]
[]
[AuxVariables]
[./f]
[../]
[./g]
[../]
[]
[AuxKernels]
[./f_k]
type = FunctionAux
variable = f
function = f_fn
[../]
# We do not allow coupling of time derivatives of aux vars into the aux vars
[./g_k]
type = DotCouplingAux
variable = g
v = f
[../]
[]
[Postprocessors]
[./l2_error]
type = ElementL2Error
variable = u
function = f_dot_fn
[../]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
nl_abs_tol = 1.e-15
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/combined/test/tests/optimization/optimization_density_update/top_opt_2d_pde_filter.i)
vol_frac = 0.4
E0 = 1e5
Emin = 1e-4
power = 2
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 20
xmin = 0
xmax = 20
ymin = 0
ymax = 10
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = pull
nodes = 0
[]
[]
[Variables]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[compliance]
family = MONOMIAL
order = CONSTANT
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.05
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top'
coefficient = 10
[]
[]
[NodalKernels]
[pull]
type = NodalGravity
variable = disp_y
boundary = pull
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type '
petsc_options_value = 'lu'
nl_abs_tol = 1e-10
line_search = none
dt = 1.0
num_steps = 30
[]
[Outputs]
[out]
type = Exodus
time_step_interval = 10
[]
[]
(test/tests/misc/check_error/bc_with_aux_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./v]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = v
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/time_integrators/actually_explicit_euler_verification/ee-1d-quadratic-neumann.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 10
elem_type = EDGE3
[]
[Functions]
[./ic]
type = ParsedFunction
expression = 0
[../]
[./forcing_fn]
type = ParsedFunction
expression = x*x-2*t+t*x*x
[../]
[./exact_fn]
type = ParsedFunction
expression = t*x*x
[../]
[./left_bc_fn]
type = ParsedFunction
expression = -t*2*x
[../]
[./right_bc_fn]
type = ParsedFunction
expression = t*2*x
[../]
[]
[Variables]
[./u]
order = SECOND
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = ic
[../]
[../]
[]
[Kernels]
[./td]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./abs]
type = Reaction
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./left]
type = FunctionNeumannBC
variable = u
boundary = '0'
function = left_bc_fn
[../]
[./right]
type = FunctionNeumannBC
variable = u
boundary = '1'
function = right_bc_fn
[../]
[]
[Postprocessors]
[./l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[../]
[]
[Executioner]
type = Transient
l_tol = 1e-12
start_time = 0.0
num_steps = 10
dt = 0.001
[./TimeIntegrator]
type = ActuallyExplicitEuler
[../]
[]
[Outputs]
exodus = true
[./console]
type = Console
max_rows = 10
[../]
[]
(test/tests/postprocessors/element_average_value/elem_pps_multi_block_test.i)
#
# Tests elemental PPS running on multiple block
#
[Mesh]
type = StripeMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 3
ny = 3
elem_type = QUAD4
stripes = 3
# StripeMesh currently only works correctly with ReplicatedMesh.
parallel_type = replicated
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = x
[../]
[]
[Variables]
[./u]
family = MONOMIAL
order = CONSTANT
[../]
[]
[Kernels]
[./uv]
type = Reaction
variable = u
[../]
[./fv]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[Postprocessors]
[./avg_1_2]
type = ElementAverageValue
variable = u
block = '0 1'
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'timestep_end'
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[]
(test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_conservative.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[power_density]
family = L2_LAGRANGE
order = FIRST
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Reaction
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[Postprocessors]
[pwr_avg]
type = ElementAverageValue
block = '0'
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
[]
[Postprocessors]
[./from_postprocessor]
type = ElementIntegralVariablePostprocessor
variable = power_density
[../]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_L2_Lagrange_conservative.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppShapeEvaluationTransfer
source_variable = power_density
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
from_postprocessors_to_be_preserved = 'from_postprocessor'
to_postprocessors_to_be_preserved = 'pwr_density'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/phase_field/test/tests/phase_field_crystal/PFCTrad/pfct_newton_split1_asm5.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 50
xmax = 8
ymax = 8
[]
[Variables]
[./n]
[./InitialCondition]
type = RandomIC
min = -1
max = 4
[../]
[../]
[./u]
scaling = 1e2
[../]
[./v]
scaling = 1e1
[../]
[]
[Kernels]
[./ndot]
type = TimeDerivative
variable = n
[../]
[./n_bulk]
type = CHBulkPFCTrad
variable = n
[../]
[./u_term]
type = MatDiffusion
variable = n
v = u
diffusivity = C2
[../]
[./v_term]
type = MatDiffusion
variable = n
v = v
diffusivity = C4
[../]
[./u_rctn]
type = Reaction
variable = u
[../]
[./u_gradn]
type = LaplacianSplit
variable = u
c = n
[../]
[./v_rctn]
type = Reaction
variable = v
[../]
[./v_gradu]
type = LaplacianSplit
variable = v
c = u
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./PFCTrad]
type = PFCTradMaterial
order = 4
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 100
l_tol = 1e-04
nl_rel_tol = 1e-09
nl_abs_tol = 1e-11
splitting = 'nuv'
petsc_options = '-snes_view'
num_steps = 2
dt = 0.1
[]
[Splits]
[./nuv]
splitting = 'v nu'
splitting_type = schur
schur_type = full
schur_pre = Sp
#petsc_options = '-dm_view'
[../]
[./nu]
vars = 'n u'
petsc_options = '-ksp_monitor'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_asm_overlap -sub_pc_type'
petsc_options_value = ' 101 asm 5 lu'
[../]
[./v]
vars = 'v'
#petsc_options = '-ksp_monitor'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 101 preonly lu 0'
#full = true
[../]
[]
[Outputs]
execute_on = 'initial timestep_end linear'
exodus = true
[]
(test/tests/restart/restart_transient_from_eigen/eigen.i)
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[Variables/u]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rhs]
type = Reaction
extra_vector_tags = 'eigen'
variable = u
rate = -1
[]
[]
[BCs]
[homogeneous]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[eigen]
type = EigenDirichletBC
variable = u
boundary = left
[]
[]
[VectorPostprocessors]
[eigenvalues]
type = Eigenvalues
[]
[]
[Executioner]
type = Eigenvalue
[]
[Outputs]
exodus = true
checkpoint = true
[]
(test/tests/mortar/convergence-studies/continuity-3d/continuity.i)
[Mesh]
second_order = true
[file]
type = FileMeshGenerator
file = hex_mesh.e
[]
[secondary]
input = file
type = LowerDBlockFromSidesetGenerator
new_block_id = 11
new_block_name = "secondary"
sidesets = '101'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
new_block_id = 12
new_block_name = "primary"
sidesets = '102'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T]
block = '1 2'
order = SECOND
[]
[lambda]
block = 'secondary'
# family = MONOMIAL
# order = CONSTANT
family = LAGRANGE
order = SECOND
use_dual = true
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = '1 2'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi) + 3*pi^2*sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_primal]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_lambda]
type = ParsedFunction
expression = 'pi*sin(pi*y)*sin(pi*z)*cos(pi*x)'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = '12'
secondary_subdomain = '11'
variable = lambda
secondary_variable = T
# delta = 0.1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type '
'-pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = '1 2'
[]
[h]
type = AverageElementSize
block = '1 2'
[]
[]
(test/tests/tag/2d_diffusion_vector_tag_test.i)
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 1.0
[../]
[]
[AuxVariables]
[./tag_variable1]
order = FIRST
family = LAGRANGE
[../]
[./tag_variable2]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./reaction1]
type = Reaction
variable = u
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[./reaction2]
type = Reaction
variable = u
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[./reaction3]
type = Reaction
variable = u
[../]
[./reaction4]
type = Reaction
variable = u
[../]
[]
[AuxKernels]
[./TagVectorAux1]
type = TagVectorAux
variable = tag_variable1
v = u
vector_tag = vec_tag1
execute_on = timestep_end
[../]
[./TagVectorAux2]
type = TagVectorAux
variable = tag_variable2
v = u
vector_tag = vec_tag2
execute_on = timestep_end
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
preset = false
boundary = 3
value = 10
extra_vector_tags = vec_tag1
[../]
[./right]
type = DirichletBC
variable = u
preset = false
boundary = 1
value = 100
extra_vector_tags = vec_tag2
[../]
[./right1]
type = DirichletBC
variable = u
preset = false
boundary = 1
value = 100
[../]
[./right2]
type = DirichletBC
variable = u
preset = false
boundary = 1
value = 100
[../]
[]
[Problem]
type = TagTestProblem
extra_tag_vectors = 'vec_tag1 vec_tag2'
test_tag_vectors = 'vec_tag1 vec_tag2'
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = vector_tag_test_out
exodus = true
[]
(test/tests/interfacekernels/ad_coupled_gradient/coupled.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[interface]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[]
[]
[Variables]
[u]
block = '0'
[]
[v]
block = '1'
[]
[w]
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
block = 0
[]
[diff_v]
type = Diffusion
variable = v
block = 1
[]
[diff_w]
type = Diffusion
variable = w
[]
[react_w]
type = Reaction
variable = w
[]
[]
[InterfaceKernels]
[interface]
type = ADCoupledInterfacialSourceGradient
variable = u
neighbor_var = v
var_source = w
boundary = primary0_interface
D = 1
D_neighbor = 1
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 0
[]
[right]
type = DirichletBC
variable = v
boundary = 'right'
value = 10
[]
[middle]
type = MatchedValueBC
variable = v
boundary = 'primary0_interface'
v = u
[]
[w_left]
type = DirichletBC
variable = w
boundary = 'left'
value = 0
[]
[w_right]
type = DirichletBC
variable = w
boundary = 'right'
value = 4
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(test/tests/executioners/solve_type_linear/linear_with_full_smp.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[u]
[]
[v]
[]
[]
[Kernels]
[u_diffusion]
type = Diffusion
variable = u
[]
[v_diffusion]
type = Diffusion
variable = v
[]
[u_reaction]
type = Reaction
variable = u
[]
[v_reaction]
type = Reaction
variable = v
[]
[u_force]
type = BodyForce
variable = u
[]
[v_force]
type = CoupledForce
variable = v
v = u
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
[]
[Outputs]
exodus = true
[]
(test/tests/outputs/debug/show_var_residual_norms.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[forcing_fnu]
type = ParsedFunction
expression = -5.8*(x+y)+x*x*x-x+y*y*y-y
[]
[forcing_fnv]
type = ParsedFunction
expression = -4
[]
[slnu]
type = ParsedGradFunction
expression = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[]
[slnv]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[]
#NeumannBC functions
[bc_fnut]
type = ParsedFunction
expression = 3*y*y-1
[]
[bc_fnub]
type = ParsedFunction
expression = -3*y*y+1
[]
[bc_fnul]
type = ParsedFunction
expression = -3*x*x+1
[]
[bc_fnur]
type = ParsedFunction
expression = 3*x*x-1
[]
[]
[Variables]
[u]
order = THIRD
family = HIERARCHIC
[]
[v]
order = SECOND
family = LAGRANGE
[]
[]
[Kernels]
active = 'diff1 diff2 test1 forceu forcev react'
[diff1]
type = Diffusion
variable = u
[]
[test1]
type = CoupledConvection
variable = u
velocity_vector = v
[]
[diff2]
type = Diffusion
variable = v
[]
[react]
type = Reaction
variable = u
[]
[forceu]
type = BodyForce
variable = u
function = forcing_fnu
[]
[forcev]
type = BodyForce
variable = v
function = forcing_fnv
[]
[]
[BCs]
active = 'bc_u_tb bc_v bc_ul bc_ur bc_ut bc_ub'
[bc_u]
type = FunctionPenaltyDirichletBC
variable = u
function = slnu
boundary = 'left right top bottom'
penalty = 1e6
[]
[bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'left right top bottom'
[]
[bc_u_lr]
type = FunctionPenaltyDirichletBC
variable = u
function = slnu
boundary = 'left right top bottom'
penalty = 1e6
[]
[bc_u_tb]
type = CoupledKernelGradBC
variable = u
var2 = v
vel = '0.1 0.1'
boundary = 'top bottom left right'
[]
[bc_ul]
type = FunctionNeumannBC
variable = u
function = bc_fnul
boundary = 'left'
[]
[bc_ur]
type = FunctionNeumannBC
variable = u
function = bc_fnur
boundary = 'right'
[]
[bc_ut]
type = FunctionNeumannBC
variable = u
function = bc_fnut
boundary = 'top'
[]
[bc_ub]
type = FunctionNeumannBC
variable = u
function = bc_fnub
boundary = 'bottom'
[]
[]
[Preconditioning]
active = ' '
[prec]
type = SMP
full = true
[]
[]
[Postprocessors]
active = 'L2u L2v'
[dofs]
type = NumDOFs
[]
[h]
type = AverageElementSize
[]
[L2u]
type = ElementL2Error
variable = u
function = slnu
[]
[L2v]
type = ElementL2Error
variable = v
function = slnv
[]
[H1error]
type = ElementH1Error
variable = u
function = solution
[]
[H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-15
nl_abs_tol = 1e-13
[]
[Outputs]
execute_on = 'timestep_end'
[debug] # This is a test, use the [Debug] block to enable this
type = VariableResidualNormsDebugOutput
[]
[]
(test/tests/outputs/debug/show_execution_nodal_kernels_bcs.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[sub]
type = SubdomainBoundingBoxGenerator
bottom_left = '0.5 0 0'
top_right = '1 1 0'
input = 'gen'
block_id = '1'
[]
[]
[Debug]
show_execution_order = ALWAYS
[]
[Variables]
[u]
block = '0 1'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
[]
[]
[NodalKernels]
[source]
type = UserForcingFunctionNodalKernel
variable = u
block = '1'
function = '1'
[]
[bc_all]
type = PenaltyDirichletNodalKernel
variable = u
value = 0
boundary = 'right bottom'
penalty = 1e10
[]
[]
[Executioner]
type = Steady
[]
(modules/combined/test/tests/optimization/optimization_density_update/top_opt_3d_pde_filter.i)
vol_frac = 0.4
E0 = 1e5
Emin = 1e-4
power = 2
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 3
nx = 24
ny = 12
nz = 12
xmin = 0
xmax = 20
ymin = 0
ymax = 10
zmin = 0
zmax = 10
[]
[middle_bottom_left_edge]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = pull
coord = '0 0 5'
[]
[]
[Variables]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[compliance]
family = MONOMIAL
order = CONSTANT
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.05
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = right
value = 0.0
[]
[no_z]
type = DirichletBC
variable = disp_z
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top front back'
coefficient = 10
[]
[]
[NodalKernels]
[pull]
type = NodalGravity
variable = disp_y
boundary = pull
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type '
petsc_options_value = 'lu'
nl_abs_tol = 1e-10
line_search = none
dt = 1.0
num_steps = 10
[]
[Outputs]
[out]
type = Exodus
time_step_interval = 10
[]
[]
(test/tests/interfacekernels/adaptivity/adaptivity.i)
# This input file is used for two tests:
# 1) Check that InterfaceKernels work with mesh adaptivity
# 2) Error out when InterfaceKernels are used with adaptivity
# and stateful material prpoerties
[Mesh]
parallel_type = 'replicated'
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[./subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '0.5 0 0'
top_right = '1 1 0'
block_id = 1
[../]
[./interface]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain1
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[../]
[./break_boundary]
input = interface
type = BreakBoundaryOnSubdomainGenerator
[../]
[]
[Variables]
[./u]
[./InitialCondition]
type = ConstantIC
value = 1
[../]
block = 0
[../]
[./u_neighbor]
[./InitialCondition]
type = ConstantIC
value = 1
[../]
block = 1
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = (x*x*x)-6.0*x
[../]
[./bc_fn]
type = ParsedFunction
expression = (x*x*x)
[../]
[]
[Kernels]
[./diff]
type = MatDiffusionTest
variable = u
prop_name = diffusivity
block = 0
[../]
[./abs]
type = Reaction
variable = u
block = 0
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
block = 0
[../]
[./diffn]
type = MatDiffusionTest
variable = u_neighbor
prop_name = diffusivity
block = 1
[../]
[./absn]
type = Reaction
variable = u_neighbor
block = 1
[../]
[./forcingn]
type = BodyForce
variable = u_neighbor
function = forcing_fn
block = 1
[../]
[]
[InterfaceKernels]
[./flux_match]
type = PenaltyInterfaceDiffusion
variable = u
neighbor_var = u_neighbor
boundary = primary0_interface
penalty = 1e6
[../]
[]
[BCs]
[./u]
type = FunctionDirichletBC
variable = u
boundary = 'left'
function = bc_fn
[../]
[./u_neighbor]
type = FunctionDirichletBC
variable = u_neighbor
boundary = 'right'
function = bc_fn
[../]
[]
[Materials]
active = 'constant'
[./stateful]
type = StatefulTest
prop_names = 'diffusivity'
prop_values = '1'
block = '0 1'
[../]
[./constant]
type = GenericConstantMaterial
prop_names = 'diffusivity'
prop_values = '1'
block = '0 1'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Adaptivity]
marker = 'marker'
steps = 1
[./Markers]
[./marker]
type = BoxMarker
bottom_left = '0 0 0'
top_right = '1 1 0'
inside = refine
outside = coarsen
[../]
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/dgkernels/adaptivity/adaptivity.i)
# This input file is used for two tests:
# 1) Check that DGKernels work with mesh adaptivity
# 2) Error out when DGKernels are used with adaptivity
# and stateful material prpoerties
[Mesh]
type = GeneratedMesh
dim = 3
nx = 2
ny = 2
nz = 2
parallel_type = 'replicated'
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[./InitialCondition]
type = ConstantIC
value = 1
[../]
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = (x*x*x)-6.0*x
[../]
[./bc_fn]
type = ParsedFunction
expression = (x*x*x)
[../]
[]
[Kernels]
[./diff]
type = MatDiffusionTest
variable = u
prop_name = diffusivity
[../]
[./abs]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
[./dgdiff]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1.0
diff = diffusivity
[../]
[]
[BCs]
active = 'all'
[./all]
type = DGMDDBC
variable = u
boundary = '1 2 3 4'
function = bc_fn
prop_name = diffusivity
sigma = 6
epsilon = -1.0
[../]
[]
[Materials]
active = 'constant'
[./stateful]
type = StatefulTest
prop_names = 'diffusivity'
prop_values = '1'
[../]
[./constant]
type = GenericConstantMaterial
prop_names = 'diffusivity'
prop_values = '1'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Adaptivity]
marker = 'marker'
steps = 1
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
coarsen = 0.5
indicator = error
refine = 0.5
[../]
[../]
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/optimization/helmholtz_multimat_strip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[RenameBottom]
type = RenameBoundaryGenerator
input = Bottom
old_boundary = 'top bottom right left'
new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
[]
[Middle]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 6
xmin = 0
xmax = 150
ymin = 0
ymax = 3
[]
[MoveMiddle]
type = TransformGenerator
input = Middle
transform = TRANSLATE
vector_value = '0 15 0'
[]
[RenameMiddle]
type = RenameBoundaryGenerator
input = MoveMiddle
old_boundary = 'top bottom right left'
new_boundary = 'top_middle bottom_middle right_middle left_middle'
[]
[Top]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[MoveTop]
type = TransformGenerator
input = Top
transform = TRANSLATE
vector_value = '0 18 0'
[]
[RenameTop]
type = RenameBoundaryGenerator
input = MoveTop
old_boundary = 'top bottom right left'
new_boundary = 'top_top bottom_top right_top left_top'
[]
[bottom_gen]
type = ParsedSubdomainMeshGenerator
input = RenameBottom
combinatorial_geometry = 'y <= 15'
block_id = 1
[]
[middle_gen]
type = ParsedSubdomainMeshGenerator
input = RenameMiddle
combinatorial_geometry = 'y <= 18 & y > 15'
block_id = 2
[]
[top_gen]
type = ParsedSubdomainMeshGenerator
input = RenameTop
combinatorial_geometry = 'y > 18'
block_id = 3
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'bottom_gen middle_gen top_gen'
stitch_boundaries_pairs = 'top_bottom bottom_middle; top_middle bottom_top'
[]
[left_load]
type = ExtraNodesetGenerator
input = stitch
new_boundary = left_load
coord = '37.5 33 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 33 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
block = '1 2 3'
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 4.0
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top left_middle '
'right_middle'
coefficient = 10
[]
[]
[NodalKernels]
[left_down]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[right_down]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[sensitivity]
type = ParsedMaterial
property_name = 'sensitivity'
block = '2'
expression = '0'
[]
[elasticity_tensor_one]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_one
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '1'
[]
[elasticity_tensor_three]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_three
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '3'
[]
[elasticity_tensor_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1.0
poissons_ratio = 0.3
block = '2'
[]
# One: Tungsten
[E_phys_one]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_one
block = '1'
outputs = 'exodus'
[]
# Three: SS316
[E_phys_three]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_three
block = '3'
outputs = 'exodus'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc_one]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_one
block = '1'
[]
[dc_three]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_three
block = '3'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update_one]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '1'
[]
[update_three]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '3'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 90
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
block = '1 3'
[]
[objective_one]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '1'
[]
[objective_three]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '3'
[]
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/3d_mbb.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-8
power = 3
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 3
nx = 30
ny = 10
nz = 10
xmin = 0
xmax = 30
ymin = 0
ymax = 10
zmin = 0
zmax = 10
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold_y
coord = '0 0 0; 0 0 10'
[]
[push]
type = ExtraNodesetGenerator
input = node
new_boundary = push
coord = '30 10 5'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.15 # radius coeff
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_y
boundary = hold_y
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top front back'
coefficient = 10
[]
[boundary_penalty_right]
type = ADRobinBC
variable = Dc
boundary = 'right'
coefficient = 10
[]
[]
[NodalKernels]
[push]
type = NodalGravity
variable = disp_y
boundary = push
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
line_search = none
nl_abs_tol = 1e-4
l_max_its = 200
start_time = 0.0
dt = 1.0
num_steps = 2
[]
[Outputs]
[out]
type = CSV
execute_on = 'INITIAL TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[]
[Controls]
[first_period]
type = TimePeriod
start_time = 0.0
end_time = 10
enable_objects = 'BCs::boundary_penalty_right'
execute_on = 'initial timestep_begin'
[]
[]
(test/tests/outputs/debug/show_execution_nodal_aux_bcs.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[sub]
type = SubdomainBoundingBoxGenerator
bottom_left = '0.5 0 0'
top_right = '1 1 0'
input = 'gen'
block_id = '1'
[]
[]
[Debug]
show_execution_order = ALWAYS
[]
[Variables]
[u]
block = '0 1'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
[]
[]
[AuxVariables]
[v]
[]
[]
[BCs]
[setting]
type = NeumannBC
variable = u
boundary = 'top'
value = '4'
[]
[]
[Executioner]
type = Steady
[]
[Dampers]
inactive = 'limit_u'
[limit_u]
type = BoundingValueNodalDamper
variable = u
max_value = 1.5
min_value = -20
[]
[]
(test/tests/postprocessors/side_pps/side_pps_multi_bnd_test.i)
#
# Tests elemental PPS running on multiple blocks
#
[Mesh]
type = StripeMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 3
ny = 3
elem_type = QUAD4
stripes = 3
# StripeMesh currently only works correctly with ReplicatedMesh.
parallel_type = replicated
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = x*(y+1)
[../]
[]
[Variables]
[./u]
family = MONOMIAL
order = CONSTANT
[../]
[]
[Kernels]
[./uv]
type = Reaction
variable = u
[../]
[./fv]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[Postprocessors]
[./int_0_1]
type = SideIntegralVariablePostprocessor
variable = u
boundary = '0 1'
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'timestep_end'
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[]
(test/tests/misc/check_error/scalar_kernel_with_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./v]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = u
[../]
[]
[ScalarKernels]
[./nope]
type = ODETimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/variables/fe_hier/hier-2-3d.i)
[Mesh]
type = GeneratedMesh
dim = 3
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
nx = 1
ny = 1
nz = 1
elem_type = HEX27
# This problem only has 1 element, so using DistributedMesh in parallel
# isn't really an option, and we don't care that much about DistributedMesh
# in serial.
parallel_type = replicated
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 2*y
[../]
[./bc_fnb]
type = ParsedFunction
expression = -2*y
[../]
[./bc_fnl]
type = ParsedFunction
expression = -2*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 2*x
[../]
[./bc_fnf]
type = ParsedFunction
expression = 2*z
[../]
[./bc_fnk]
type = ParsedFunction
expression = -2*z
[../]
[./forcing_fn]
type = ParsedFunction
expression = -6+x*x+y*y+z*z
[../]
[./solution]
type = ParsedGradFunction
expression = x*x+y*y+z*z
grad_x = 2*x
grad_y = 2*y
grad_z = 2*z
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[./bc_front]
type = FunctionNeumannBC
variable = u
boundary = 'front'
function = bc_fnf
[../]
[./bc_back]
type = FunctionNeumannBC
variable = u
boundary = 'back'
function = bc_fnk
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-11
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/problems/eigen_problem/eigensolvers/dg_krylovschur.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[../]
[]
[DGKernels]
[./dg_diff]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1
[]
[]
[Kernels]
[./rhs]
type = Reaction
variable = u
extra_vector_tags = 'eigen'
[../]
[]
[Executioner]
type = Eigenvalue
solve_type = KRYLOVSCHUR
eigen_problem_type = HERMITIAN
which_eigen_pairs = LARGEST_MAGNITUDE
[]
[VectorPostprocessors]
[./eigenvalues]
type = Eigenvalues
execute_on = 'timestep_end'
[../]
[]
[Outputs]
csv = true
execute_on = 'timestep_end'
[]
(test/tests/transfers/multiapp_conservative_transfer/sub_power_density.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.01 # to make sure the meshes don't align
xmax = 0.49 # to make sure the meshes don't align
ymax = 1
nx = 10
ny = 10
[]
[block1]
input = gen
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0.2 0.2 0'
top_right = '0.3 0.8 0'
[]
[]
[Variables]
[sink]
family = MONOMIAL
order = CONSTANT
[]
[]
[Functions]
[sink_func]
type = ParsedFunction
expression = '5e2*x*(0.5-x)+5e1'
[]
[]
[Kernels]
[reaction]
type = Reaction
variable = sink
[]
[coupledforce]
type = BodyForce
variable = sink
function = sink_func
[]
[]
[AuxVariables]
[from_parent]
block = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[sink]
type = ElementIntegralVariablePostprocessor
block = 1
variable = sink
[]
[from_parent_pp]
type = ElementIntegralVariablePostprocessor
block = 1
variable = from_parent
execute_on = 'transfer'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/variables/fe_hier/hier-1-3d.i)
[Mesh]
type = GeneratedMesh
dim = 3
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
nx = 5
ny = 5
elem_type = HEX8
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 1
[../]
[./bc_fnb]
type = ParsedFunction
expression = -1
[../]
[./bc_fnl]
type = ParsedFunction
expression = -1
[../]
[./bc_fnr]
type = ParsedFunction
expression = 1
[../]
[./bc_fnf]
type = ParsedFunction
expression = 1
[../]
[./bc_fnk]
type = ParsedFunction
expression = -1
[../]
[./forcing_fn]
type = ParsedFunction
expression = x+y+z
[../]
[./solution]
type = ParsedGradFunction
expression = x+y+z
grad_x = 1
grad_y = 1
grad_z = 1
[../]
[]
[Variables]
[./u]
order = FIRST
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[./bc_front]
type = FunctionNeumannBC
variable = u
boundary = 'front'
function = bc_fnf
[../]
[./bc_back]
type = FunctionNeumannBC
variable = u
boundary = 'back'
function = bc_fnk
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/combined/examples/optimization/2d_mbb_pde_amr.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-8
power = 2
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 30
ny = 10
xmin = 0
xmax = 30
ymin = 0
ymax = 10
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = pull
nodes = 0
[]
[push]
type = ExtraNodesetGenerator
input = node
new_boundary = push
coord = '30 10 0'
[]
[]
[Variables]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Emin]
family = MONOMIAL
order = CONSTANT
initial_condition = ${Emin}
[]
[power]
family = MONOMIAL
order = CONSTANT
initial_condition = ${power}
[]
[E0]
family = MONOMIAL
order = CONSTANT
initial_condition = ${E0}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.15 # radius coeff
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_y
boundary = pull
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top'
coefficient = 10
[]
[boundary_penalty_right]
type = ADRobinBC
variable = Dc
boundary = 'right'
coefficient = 10
[]
[]
[NodalKernels]
[pull]
type = NodalGravity
variable = disp_y
boundary = push
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'Emin mat_den power E0'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
line_search = none
nl_abs_tol = 1e-4
l_max_its = 200
start_time = 0.0
dt = 1.0
num_steps = 70
[]
[Outputs]
[out]
type = Exodus
execute_on = 'INITIAL TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Controls]
[first_period]
type = TimePeriod
start_time = 0.0
end_time = 40
enable_objects = 'BCs::boundary_penalty_right'
execute_on = 'initial timestep_begin'
[]
[]
[Adaptivity]
max_h_level = 2
recompute_markers_during_cycles = true
interval = 1
cycles_per_step = 1
marker = density_marker
[Indicators]
[density_jump]
type = ValueJumpIndicator
variable = mat_den_nodal
[]
[]
[Markers]
[density_marker]
type = ErrorToleranceMarker
indicator = density_jump
coarsen = 0.1
refine = 0.1
[]
[]
[]
(test/tests/misc/check_error/dg_kernel_with_aux_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./v]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = u
[../]
[]
[DGKernels]
[./nope]
type = DGDiffusion
variable = v
epsilon = -1
sigma = 6
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/userobjects/nearest_point_layered_average/nearest_radius_layered_average.i)
# This input tests the NearestRadiusLayeredAverage object by taking the average
# of layered rings and using the variable u(x,y,x) = r + z, where r sqrt(x^2 + y^2)
# Given a ring of inner and outer radii r1 and r2, respectively, and of height z1 and z2,
# the analytical solution is given by:
# avg(r1,r2,z1,z2) = 2/3 * (r1^2 + r1*r2 + r2^2) / (r1 + r2) + (z1 + z2) / 2
# Convergence to these values as num_sectors is increased is verified.
[Mesh]
[./ccmg]
type = ConcentricCircleMeshGenerator
num_sectors = 8
radii = '0.1 0.2 0.3 0.4 0.5'
rings = '2 2 2 2 2'
has_outer_square = false
preserve_volumes = true
smoothing_max_it = 3
[]
[./extruder]
type = MeshExtruderGenerator
input = ccmg
extrusion_vector = '0 0 1'
num_layers = 4
[]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ring_average]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./reac]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = func
[../]
[]
[Functions]
[func]
type = ParsedFunction
expression = 'sqrt(x * x + y * y) + z'
[]
[]
[AuxKernels]
[./np_layered_average]
type = SpatialUserObjectAux
variable = ring_average
execute_on = timestep_end
user_object = nrla
[../]
[]
[UserObjects]
[./nrla]
type = NearestRadiusLayeredAverage
direction = z
num_layers = 2
points = '0.05 0 0
0.15 0 0
0.25 0 0
0.35 0 0
0.45 0 0'
variable = u
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/phase_field_kernels/CoupledAllenCahn.i)
#
# Test the coupled Allen-Cahn Bulk kernel
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 12
ymax = 12
elem_type = QUAD4
[]
[Variables]
[./w]
[../]
[./eta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 0.0
y1 = 0.0
radius = 6.0
invalue = 0.9
outvalue = 0.1
int_width = 3.0
[../]
[../]
[]
[Kernels]
[./detadt]
type = TimeDerivative
variable = eta
[../]
[./ACBulk]
type = CoupledAllenCahn
variable = w
v = eta
f_name = F
[../]
[./W]
type = Reaction
variable = w
[../]
[./CoupledBulk]
type = MatReaction
variable = eta
v = w
[../]
[./ACInterface]
type = ACInterface
variable = eta
kappa_name = 1
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'L'
prop_values = '1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'eta'
expression = '2 * eta^2 * (1-eta)^2 - 0.2*eta'
derivative_order = 2
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
l_max_its = 15
l_tol = 1.0e-4
nl_max_its = 10
nl_rel_tol = 1.0e-11
start_time = 0.0
num_steps = 2
dt = 0.5
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
hide = w
file_base = AllenCahn_out
exodus = true
[]
(test/tests/variables/fe_hier/hier-1-2d.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 5
ny = 5
elem_type = QUAD9
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 1
[../]
[./bc_fnb]
type = ParsedFunction
expression = -1
[../]
[./bc_fnl]
type = ParsedFunction
expression = -1
[../]
[./bc_fnr]
type = ParsedFunction
expression = 1
[../]
[./forcing_fn]
type = ParsedFunction
expression = x+y
[../]
[./solution]
type = ParsedGradFunction
expression = x+y
grad_x = 1
grad_y = 1
[../]
[]
[Variables]
[./u]
order = FIRST
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/mortar/continuity-2d-non-conforming/soln-continuity.i)
[Mesh]
second_order = true
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[./primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[../]
[./secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[../]
[]
[Variables]
[./T]
block = '1 2'
order = SECOND
[../]
[./lambda]
block = '10'
[../]
[]
[BCs]
[./neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[../]
[]
[Kernels]
[./conduction]
type = Diffusion
variable = T
block = '1 2'
[../]
[./sink]
type = Reaction
variable = T
block = '1 2'
[../]
[./forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[../]
[]
[Functions]
[./forcing_function]
type = ParsedFunction
expression= '-4 + x^2 + y^2'
[../]
[./exact_soln]
type = ParsedFunction
expression= 'x^2 + y^2'
[../]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[./mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[dofmap]
type = DOFMap
execute_on = 'initial'
[]
[]
(test/tests/mortar/continuity-3d-non-conforming/continuity_penalty_tet.i)
[Mesh]
second_order = false
[left_block]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 2
nz = 2
xmin = 0
xmax = 0.3
ymin = 0
ymax = .5
zmin = 0
zmax = .5
elem_type = TET4
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3 4 5'
new_boundary = 'lb_bottom lb_back lb_right lb_front lb_left lb_top'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[]
[right_block]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 2
nz = 2
xmin = 0.3
xmax = 0.6
ymin = 0
ymax = .5
zmin = 0
zmax = .5
elem_type = TET4
[]
[right_block_id]
type = SubdomainIDGenerator
input = right_block
subdomain_id = 2
[]
[right_block_change_boundary_id]
type = RenameBoundaryGenerator
input = right_block_id
old_boundary = '0 1 2 3 4 5'
new_boundary = '100 101 102 103 104 105'
[]
[combined]
type = MeshCollectionGenerator
inputs = 'left_block_id right_block_change_boundary_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'left_block right_block'
[]
[right_right_sideset]
type = SideSetsAroundSubdomainGenerator
input = block_rename
new_boundary = rb_right
block = right_block
normal = '1 0 0'
[]
[right_left_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_right_sideset
new_boundary = rb_left
block = right_block
normal = '-1 0 0'
[]
[right_top_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_left_sideset
new_boundary = rb_top
block = right_block
normal = '0 0 1'
[]
[right_bottom_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_top_sideset
new_boundary = rb_bottom
block = right_block
normal = '0 0 -1'
[]
[right_front_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_bottom_sideset
new_boundary = rb_front
block = right_block
normal = '0 1 0'
[]
[right_back_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_front_sideset
new_boundary = rb_back
block = right_block
normal = '0 -1 0'
[]
[secondary]
input = right_back_sideset
type = LowerDBlockFromSidesetGenerator
sidesets = 'lb_right'
new_block_id = '12'
new_block_name = 'secondary'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'rb_left'
new_block_id = '11'
new_block_name = 'primary'
[]
[]
[Variables]
[T]
block = '1 2'
order = FIRST
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = 'lb_back lb_front lb_left lb_top lb_bottom rb_right rb_top rb_bottom rb_front rb_back'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi) + 3*pi^2*sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_primal]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_lambda]
type = ParsedFunction
expression = 'pi*sin(pi*y)*sin(pi*z)*cos(pi*x)'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = PenaltyEqualValueConstraint
primary_boundary = 'rb_left'
secondary_boundary = 'lb_right'
primary_subdomain = '11'
secondary_subdomain = '12'
secondary_variable = T
penalty_value = 1.0e5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Postprocessors]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = 'left_block right_block'
[]
[h]
type = AverageElementSize
block = 'left_block right_block'
[]
[]
(test/tests/outputs/debug/show_var_residual_norms_debug.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[forcing_fnu]
type = ParsedFunction
expression = -5.8*(x+y)+x*x*x-x+y*y*y-y
[]
[forcing_fnv]
type = ParsedFunction
expression = -4
[]
[slnu]
type = ParsedGradFunction
expression = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[]
[slnv]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[]
#NeumannBC functions
[bc_fnut]
type = ParsedFunction
expression = 3*y*y-1
[]
[bc_fnub]
type = ParsedFunction
expression = -3*y*y+1
[]
[bc_fnul]
type = ParsedFunction
expression = -3*x*x+1
[]
[bc_fnur]
type = ParsedFunction
expression = 3*x*x-1
[]
[]
[Variables]
[u]
order = THIRD
family = HIERARCHIC
[]
[v]
order = SECOND
family = LAGRANGE
[]
[]
[Kernels]
active = 'diff1 diff2 test1 forceu forcev react'
[diff1]
type = Diffusion
variable = u
[]
[test1]
type = CoupledConvection
variable = u
velocity_vector = v
[]
[diff2]
type = Diffusion
variable = v
[]
[react]
type = Reaction
variable = u
[]
[forceu]
type = BodyForce
variable = u
function = forcing_fnu
[]
[forcev]
type = BodyForce
variable = v
function = forcing_fnv
[]
[]
[BCs]
active = 'bc_u_tb bc_v bc_ul bc_ur bc_ut bc_ub'
[bc_u]
type = FunctionPenaltyDirichletBC
variable = u
function = slnu
boundary = 'left right top bottom'
penalty = 1e6
[]
[bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'left right top bottom'
[]
[bc_u_lr]
type = FunctionPenaltyDirichletBC
variable = u
function = slnu
boundary = 'left right top bottom'
penalty = 1e6
[]
[bc_u_tb]
type = CoupledKernelGradBC
variable = u
var2 = v
vel = '0.1 0.1'
boundary = 'top bottom left right'
[]
[bc_ul]
type = FunctionNeumannBC
variable = u
function = bc_fnul
boundary = 'left'
[]
[bc_ur]
type = FunctionNeumannBC
variable = u
function = bc_fnur
boundary = 'right'
[]
[bc_ut]
type = FunctionNeumannBC
variable = u
function = bc_fnut
boundary = 'top'
[]
[bc_ub]
type = FunctionNeumannBC
variable = u
function = bc_fnub
boundary = 'bottom'
[]
[]
[Preconditioning]
active = ' '
[prec]
type = SMP
full = true
[]
[]
[Postprocessors]
active = 'L2u L2v'
[dofs]
type = NumDOFs
[]
[h]
type = AverageElementSize
[]
[L2u]
type = ElementL2Error
variable = u
function = slnu
[]
[L2v]
type = ElementL2Error
variable = v
function = slnv
[]
[H1error]
type = ElementH1Error
variable = u
function = solution
[]
[H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-15
nl_abs_tol = 1e-13
[]
[Outputs]
execute_on = 'timestep_end'
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/tag/2d_diffusion_dg_tag.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[./InitialCondition]
type = ConstantIC
value = 1
[../]
[../]
[]
[AuxVariables]
[./tag_variable1]
order = FIRST
family = MONOMIAL
[../]
[./tag_variable2]
order = FIRST
family = MONOMIAL
[../]
[]
[AuxKernels]
[./TagVectorAux1]
type = TagVectorAux
variable = tag_variable1
v = u
vector_tag = vec_tag2
execute_on = timestep_end
[../]
[./TagVectorAux2]
type = TagMatrixAux
variable = tag_variable2
v = u
matrix_tag = mat_tag2
execute_on = timestep_end
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
value = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[./abs]
type = Reaction
variable = u
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1'
[../]
[]
[DGKernels]
[./dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[]
[BCs]
[./all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[]
[Problem]
type = TagTestProblem
test_tag_vectors = 'nontime residual vec_tag1 vec_tag2'
test_tag_matrices = 'mat_tag1 mat_tag2'
extra_tag_matrices = 'mat_tag1 mat_tag2'
extra_tag_vectors = 'vec_tag1 vec_tag2'
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-10
[]
[Postprocessors]
[./h]
type = AverageElementSize
[../]
[./dofs]
type = NumDOFs
[../]
[./l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/hfem/neumann.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 3
ny = 3
dim = 2
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = 0
[]
[reaction]
type = Reaction
variable = u
rate = '1'
block = 0
[]
[source]
type = BodyForce
variable = u
value = '1'
block = 0
[]
[]
[DGKernels]
[surface]
type = HFEMDiffusion
variable = u
lowerd_variable = lambda
[]
[]
[BCs]
[all]
type = NeumannBC
boundary = 'left right top bottom'
variable = u
[]
[]
[Postprocessors]
[intu]
type = ElementIntegralVariablePostprocessor
variable = u
block = 0
[]
[lambdanorm]
type = ElementL2Norm
variable = lambda
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Outputs]
[out]
# we hide lambda because it may flip sign due to element
# renumbering with distributed mesh
type = Exodus
hide = lambda
[]
[]
(test/tests/auxkernels/time_derivative_aux/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 3
ny = 2
[]
[Functions]
# These functions have implemented time derivatives
[some_function]
type = ParsedFunction
expression = t*(x+y)
[]
[some_other_function]
type = PiecewiseLinear
x = '0 0.05 0.15 0.25'
y = '1 2 3 4'
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = NeumannBC
variable = u
value = 5
boundary = 'left'
[]
[]
[Materials]
[material]
type = GenericFunctorMaterial
prop_names = 'some_matprop'
prop_values = 'some_function'
[]
[]
[AuxVariables]
[variable_derivative]
family = MONOMIAL
order = CONSTANT
[]
inactive = 'variable_derivative_fv'
[variable_derivative_fv]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[function_derivative_qp]
family = MONOMIAL
order = FIRST
[]
[function_derivative_elem]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
# Time derivative of a nonlinear variable
[var_derivative]
type = TimeDerivativeAux
variable = variable_derivative
functor = u
factor = 10
execute_on = 'TIMESTEP_END'
[]
# this places the derivative of a FE variable in a FV one
# let's output a warning
inactive = 'var_derivative_to_fv'
[var_derivative_to_fv]
type = TimeDerivativeAux
variable = variable_derivative_fv
functor = u
[]
# Time derivative of a function: using the functor system
# Time derivative of a functor material property is not currently supported
[function_derivative_quadrature_point]
type = TimeDerivativeAux
variable = function_derivative_qp
functor = 'some_function'
factor = 2
execute_on = 'INITIAL TIMESTEP_END'
[]
[function_derivative_element]
type = TimeDerivativeAux
variable = function_derivative_elem
functor = 'some_other_function'
factor = 2
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/time_integrators/implicit-euler/ie-monomials.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
variable = u
value = 1
[../]
[]
[Functions]
active = 'forcing_fn exact_fn'
[./forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
value = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./abs] # u * v
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
[./dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[../]
[]
[BCs]
[./all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Transient
nl_rel_tol = 1e-10
num_steps = 1
[]
[Outputs]
execute_on = 'timestep_end'
console = true
[]
(test/tests/kernels/resid_jac_together/diffusion_reaction.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
[Variables]
[u]
[InitialCondition]
type = FunctionIC
function = '5*x+y'
[]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[react]
type = Reaction
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_abs_tol = 1e-15
nl_rel_tol = 1e-12
residual_and_jacobian_together = true
[]
[Outputs]
exodus = true
[]
(test/tests/materials/boundary_material/bnd_coupling_vol.i)
#
# Coupling volumetric material property inside boundary restricted material
# Also bringing boundary restricted material inside another boundary restricted
# material
#
# Solving: k \Laplace u + u - f = 0
#
# u = x^2 + y^2
# k = 3, but is decomposed as k3vol = k1vol + k2vol, where k1vol = 1 and k2vol = 2
#
# Boundary material property is computed as k3bnd = k1vol + k2bnd
#
# The material properties with suffix `vol` are volumetric, the ones with suffix `bnd`
# are boundary restricted
#
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 4
ny = 4
elem_type = QUAD9
[]
[Functions]
[./exact_fn]
type = ParsedFunction
expression = x*x+y*y
[../]
[./f_fn]
type = ParsedFunction
expression = -4*3+x*x+y*y
[../]
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[Kernels]
[./diff]
type = DiffMKernel
variable = u
offset = 0
mat_prop = k3vol
[../]
[./r]
type = Reaction
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = f_fn
[../]
[]
[BCs]
[./all]
type = MatDivergenceBC
variable = u
prop_name = k3bnd
boundary = 'left right top bottom'
[../]
[]
[Materials]
[./k1vol]
type = GenericConstantMaterial
prop_names = 'k1vol'
prop_values = 1
block = 0
[../]
[./k2vol]
type = GenericConstantMaterial
prop_names = 'k2vol'
prop_values = 2
block = 0
[../]
[./k2bnd]
type = GenericConstantMaterial
prop_names = 'k2bnd'
prop_values = 2
boundary = 'left right top bottom'
[../]
[./k3vol]
type = SumMaterial
sum_prop_name = k3vol
mp1 = k1vol
mp2 = k2vol
block = 0
val1 = 1
val2 = 2
[../]
[./k3bnd]
type = SumMaterial
sum_prop_name = 'k3bnd'
mp1 = k1vol
mp2 = k2bnd
boundary = 'left right top bottom'
val1 = 1
val2 = 2
[../]
[]
[Postprocessors]
[./l2err]
type = ElementL2Error
variable = u
function = exact_fn
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/time_derivative_second_aux/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 3
ny = 2
[]
[Variables]
[u]
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = NeumannBC
variable = u
value = 5
boundary = 'left'
[]
[]
[AuxVariables]
[variable_derivative]
family = MONOMIAL
order = CONSTANT
[]
inactive = 'variable_derivative_fv'
[variable_derivative_fv]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[]
[AuxKernels]
# Time derivative of a nonlinear variable
[var_derivative]
type = SecondTimeDerivativeAux
variable = variable_derivative
v = u
factor = 10
execute_on = 'TIMESTEP_END'
[]
# this places the derivative of a FE variable in a FV one
# let's output a warning
inactive = 'var_derivative_to_fv'
[var_derivative_to_fv]
type = SecondTimeDerivativeAux
variable = variable_derivative_fv
v = u
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
l_tol = 1e-10
[TimeIntegrator]
type = CentralDifference
[]
[]
[Outputs]
exodus = true
[]
(test/tests/dgkernels/ad_dg_diffusion/2d_diffusion_ad_dg_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
[u]
order = FIRST
family = MONOMIAL
[InitialCondition]
type = ConstantIC
value = 1
[]
[]
[]
[Functions]
[forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[]
[exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[abs] # u * v
type = Reaction
variable = u
[]
[forcing]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[DGKernels]
[dg_diff]
type = ADDGDiffusion
variable = u
epsilon = -1
sigma = 6
diff = diff
[]
[]
[Materials]
[ad_coupled_mat]
type = ADCoupledMaterial
coupled_var = u
ad_mat_prop = diff
regular_mat_prop = diff_regular
[]
[]
[BCs]
[all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[Adaptivity]
steps = 2
refine_fraction = 1.0
coarsen_fraction = 0
max_h_level = 8
[]
nl_rel_tol = 1e-10
[]
[Postprocessors]
[h]
type = AverageElementSize
[]
[dofs]
type = NumDOFs
[]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[]
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/time_derivative/time_derivative.i)
# This test is setting the values of an auxiliary varaible f according to the
# function f_fn. This function is time dependent.
#
# Then the f_dot is brought as a forcing function into the L2 projection, thus
# the resulting values of u should give the f_dot which is known.
#
# NOTE: There is no need to do more than 2 time steps, because f_dot is constant
# in time. That means that the projection is exactly the same for the second time
# step as is for the first time step. The solver has nothing to do and you can
# see that on the "zero" initial non-linear residual.
#
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
[]
[Functions]
[./f_fn]
type = ParsedFunction
expression = t*(x+y)
[../]
[./f_dot_fn]
type = ParsedFunction
expression = (x+y)
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./l2_proj]
type = Reaction
variable = u
[../]
[./dck]
type = DotCouplingKernel
variable = u
v = f
[../]
[]
[AuxVariables]
[./f]
[../]
[]
[AuxKernels]
[./f_k]
type = FunctionAux
variable = f
function = f_fn
[../]
[]
[Postprocessors]
[./l2_error]
type = ElementL2Error
variable = u
function = f_dot_fn
[../]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
nl_abs_tol = 1.e-15
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/dgkernels/2d_diffusion_dg/2d_diffusion_dg_test.i)
###########################################################
# This is a test of the Discontinuous Galerkin System.
# Discontinous basis functions are used (Monomials) and
# a Laplacian DGKernel contributes to the
# internal edges around each element. Jumps are allowed
# but penalized by this method.
#
# @Requirement F3.60
###########################################################
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
# xmin = -1
# xmax = 1
# ymin = -1
# ymax = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
active = 'u'
[u]
order = FIRST
family = MONOMIAL
[InitialCondition]
type = ConstantIC
value = 1
[]
[]
[]
[Functions]
active = 'forcing_fn exact_fn'
[forcing_fn]
type = ParsedFunction
# function = -4.0+(x*x)+(y*y)
# function = x
# function = (x*x)-2.0
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
# function = (x*x*x)-6.0*x
[]
[exact_fn]
type = ParsedGradFunction
# function = x
# grad_x = 1
# grad_y = 0
# function = (x*x)+(y*y)
# grad_x = 2*x
# grad_y = 2*y
# function = (x*x)
# grad_x = 2*x
# grad_y = 0
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
# function = (x*x*x)
# grad_x = 3*x*x
# grad_y = 0
[]
[]
[Kernels]
active = 'diff abs forcing'
[diff]
type = Diffusion
variable = u
[]
[abs] # u * v
type = Reaction
variable = u
[]
[forcing]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[DGKernels]
active = 'dg_diff'
[dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[]
[]
[BCs]
active = 'all'
[all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
# petsc_options = '-snes_mf'
# petsc_options_iname = '-pc_type -pc_hypre_type'
# petsc_options_value = 'hypre boomeramg'
# petsc_options = '-snes_mf'
# max_r_steps = 2
[Adaptivity]
steps = 2
refine_fraction = 1.0
coarsen_fraction = 0
max_h_level = 8
[]
nl_rel_tol = 1e-10
# nl_rel_tol = 1e-12
[]
[Postprocessors]
active = 'h dofs l2_err'
[h]
type = AverageElementSize
[]
[dofs]
type = NumDOFs
[]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[]
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/misc/check_error/scalar_aux_kernel_with_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./v]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = u
[../]
[]
[AuxScalarKernels]
[./nope]
type = ConstantScalarAux
variable = u
value = 11
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/misc/check_error/missing_req_par_mesh_block_test.i)
#
# Tests elemental PPS running on multiple block
#
[Mesh]
type = StripeMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 3
ny = 3
elem_type = QUAD4
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = x
[../]
[]
[Variables]
[./u]
family = MONOMIAL
order = CONSTANT
[../]
[]
[Kernels]
[./uv]
type = Reaction
variable = u
[../]
[./fv]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[Postprocessors]
[./avg_1_2]
type = ElementAverageValue
variable = u
block = '0 1'
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'timestep_end'
[]
(test/tests/variables/fe_hier/hier-3-1d.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 5
elem_type = EDGE3
[]
[Functions]
[./bc_fnl]
type = ParsedFunction
expression = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
expression = -6*x+(x*x*x)
[../]
[./solution]
type = ParsedGradFunction
expression = x*x*x
grad_x = 3*x*x
[../]
[]
[Variables]
[./u]
order = THIRD
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/variables/fe_hier/hier-1-1d.i)
###########################################################
# This is a simple test demonstrating the use of the
# Hierarchic variable type.
#
# @Requirement F3.10
###########################################################
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 5
elem_type = EDGE3
[]
[Functions]
[./bc_fnl]
type = ParsedFunction
expression = -1
[../]
[./bc_fnr]
type = ParsedFunction
expression = 1
[../]
[./forcing_fn]
type = ParsedFunction
expression = x
[../]
[./solution]
type = ParsedGradFunction
expression = x
grad_x = 1
[../]
[]
# Hierarchic Variable type
[Variables]
[./u]
order = FIRST
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-11
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/dgkernels/2d_diffusion_dg/dg_stateful.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[./InitialCondition]
type = ConstantIC
value = 1
[../]
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./abs]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
[./dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[../]
[]
[BCs]
[./all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[]
[Materials]
[./stateful]
type = StatefulMaterial
initial_diffusivity = 1
boundary = 'left'
[../]
[./general]
type = GenericConstantMaterial
block = '0'
prop_names = 'dummy'
prop_values = '1'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
[]
(modules/combined/examples/optimization/helmholtz_multimat_nostrip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[RenameBottom]
type = RenameBoundaryGenerator
input = Bottom
old_boundary = 'top bottom right left'
new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
[]
[Top]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[MoveTop]
type = TransformGenerator
input = Top
transform = TRANSLATE
vector_value = '0 15 0'
[]
[RenameTop]
type = RenameBoundaryGenerator
input = MoveTop
old_boundary = 'top bottom right left'
new_boundary = 'top_top bottom_top right_top left_top'
[]
[bottom_gen]
type = ParsedSubdomainMeshGenerator
input = RenameBottom
combinatorial_geometry = 'y <= 15'
block_id = 1
[]
[top_gen]
type = ParsedSubdomainMeshGenerator
input = RenameTop
combinatorial_geometry = 'y > 15'
block_id = 3
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'bottom_gen top_gen'
stitch_boundaries_pairs = 'top_bottom bottom_top'
[]
[left_load]
type = ExtraNodesetGenerator
input = stitch
new_boundary = left_load
coord = '37.5 30 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 30 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 4.0
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top'
coefficient = 10
[]
[]
[NodalKernels]
[left_down]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[right_down]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor_one]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_one
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '1'
[]
[elasticity_tensor_three]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_three
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '3'
[]
# One: Tungsten
[E_phys_one]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_one
block = '1'
outputs = 'exodus'
[]
# Three: SS316
[E_phys_three]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_three
block = '3'
outputs = 'exodus'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc_one]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_one
block = '1'
[]
[dc_three]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_three
block = '3'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update_one]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '1'
[]
[update_three]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '3'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 90
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
block = '1 3'
[]
[objective_one]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '1'
[]
[objective_three]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '3'
[]
[]
(test/tests/dgkernels/2d_diffusion_dg/no_mallocs_with_action.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[./InitialCondition]
type = ConstantIC
value = 1
[../]
[../]
[]
[AuxVariables]
[v]
order = FIRST
family = MONOMIAL
[]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./abs] # u * v
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGDiffusionAction]
variable = u
epsilon = -1
sigma = 6
# We couple in an auxiliary variable in order to ensure that we've properly
# ghosted both non-linear and auxiliary solution vectors
coupled_var = v
[]
[BCs]
[./all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[console]
type = Console
system_info = 'framework mesh aux nonlinear relationship execution'
[]
[]
[Problem]
error_on_jacobian_nonzero_reallocation = true
[]
[Postprocessors]
active = 'num_rm'
[num_rm]
type = NumRelationshipManagers
[]
[num_internal_sides]
type = NumInternalSides
[]
[]
(test/tests/misc/check_error/coupled_grad_without_declare.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[forcing_fnu]
type = ParsedFunction
expression = -5.8*(x+y)+x*x*x-x+y*y*y-y
[]
[forcing_fnv]
type = ParsedFunction
expression = -4
[]
[slnu]
type = ParsedGradFunction
expression = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[]
[slnv]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[]
#NeumannBC functions
[bc_fnut]
type = ParsedFunction
expression = 3*y*y-1
[]
[bc_fnub]
type = ParsedFunction
expression = -3*y*y+1
[]
[bc_fnul]
type = ParsedFunction
expression = -3*x*x+1
[]
[bc_fnur]
type = ParsedFunction
expression = 3*x*x-1
[]
[]
[Variables]
[u]
order = THIRD
family = HIERARCHIC
[]
[v]
order = SECOND
family = LAGRANGE
[]
[]
[Kernels]
active = 'diff1 diff2 test1 forceu forcev react'
[diff1]
type = Diffusion
variable = u
[]
[test1]
type = CoupledConvection
variable = u
velocity_vector = v
# Trigger the error in this class
test_coupling_declaration_error = true
[]
[diff2]
type = Diffusion
variable = v
[]
[react]
type = Reaction
variable = u
[]
[forceu]
type = BodyForce
variable = u
function = forcing_fnu
[]
[forcev]
type = BodyForce
variable = v
function = forcing_fnv
[]
[]
[BCs]
active = 'bc_u_tb bc_v bc_ul bc_ur bc_ut bc_ub'
[bc_u]
type = FunctionPenaltyDirichletBC
variable = u
function = slnu
boundary = 'left right top bottom'
penalty = 1e6
[]
[bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'left right top bottom'
[]
[bc_u_lr]
type = FunctionPenaltyDirichletBC
variable = u
function = slnu
boundary = 'left right top bottom'
penalty = 1e6
[]
[bc_u_tb]
type = CoupledKernelGradBC
variable = u
var2 = v
vel = '0.1 0.1'
boundary = 'top bottom left right'
[]
[bc_ul]
type = FunctionNeumannBC
variable = u
function = bc_fnul
boundary = 'left'
[]
[bc_ur]
type = FunctionNeumannBC
variable = u
function = bc_fnur
boundary = 'right'
[]
[bc_ut]
type = FunctionNeumannBC
variable = u
function = bc_fnut
boundary = 'top'
[]
[bc_ub]
type = FunctionNeumannBC
variable = u
function = bc_fnub
boundary = 'bottom'
[]
[]
[Preconditioning]
active = ' '
[prec]
type = SMP
full = true
[]
[]
[Postprocessors]
active = 'L2u L2v'
[dofs]
type = NumDOFs
[]
[h]
type = AverageElementSize
[]
[L2u]
type = ElementL2Error
variable = u
function = slnu
[]
[L2v]
type = ElementL2Error
variable = v
function = slnv
[]
[H1error]
type = ElementH1Error
variable = u
function = solution
[]
[H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-15
nl_abs_tol = 1e-13
[]
[Outputs]
execute_on = 'timestep_end'
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/misc/rename-parameters/rename-postprocessor.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
nx = 20
dim = 1
[]
[]
[Variables]
[u][]
[]
[Kernels]
[diff]
type = RenamedPostprocessorDiffusion
variable = u
diffusion_postprocessor = 'parsed'
[]
[rxn]
type = Reaction
rate = 2
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 1
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 0
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[parsed]
type = ParsedPostprocessor
pp_names = ''
function = '2'
execute_on = 'initial'
[]
[avg_u]
type = ElementAverageValue
variable = u
[]
[]
[Outputs]
[out]
type = CSV
hide = 'parsed'
[]
[]
(test/tests/dgkernels/3d_diffusion_dg/3d_diffusion_p_refinement.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 1
zmin = 0
zmax = 1
elem_type = HEX8
[]
[Variables]
[u]
order = FIRST
family = MONOMIAL
[InitialCondition]
type = ConstantIC
value = 0.5
[]
[]
[]
[Functions]
[forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[]
[exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[abs]
type = Reaction
variable = u
[]
[forcing]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[DGKernels]
[dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[]
[]
[BCs]
[all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3 4 5'
function = exact_fn
epsilon = -1
sigma = 6
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[Adaptivity]
switch_h_to_p_refinement = true
steps = 2
refine_fraction = 1.0
coarsen_fraction = 0
max_h_level = 8
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = 'initial timestep_end'
[]
[dofs]
type = NumDOFs
execute_on = 'initial timestep_end'
[]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/variables/fe_hier/hier-2-2d.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 5
ny = 5
elem_type = QUAD9
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 2*y
[../]
[./bc_fnb]
type = ParsedFunction
expression = -2*y
[../]
[./bc_fnl]
type = ParsedFunction
expression = -2*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 2*x
[../]
[./forcing_fn]
type = ParsedFunction
expression = -4+x*x+y*y
[../]
[./solution]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/userobjects/nearest_point_layered_average/radius_points_from_uo.i)
[Mesh]
[ccmg]
type = ConcentricCircleMeshGenerator
num_sectors = 8
radii = '0.1 0.2 0.3 0.4 0.5'
rings = '2 2 2 2 2'
has_outer_square = false
preserve_volumes = true
smoothing_max_it = 3
[]
[extruder]
type = MeshExtruderGenerator
input = ccmg
extrusion_vector = '0 0 1'
num_layers = 4
[]
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[ring_average]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[reac]
type = Reaction
variable = u
[]
[forcing]
type = BodyForce
variable = u
function = func
[]
[]
[Functions]
[func]
type = ParsedFunction
expression = 'sqrt(x * x + y * y) + z'
[]
[]
[AuxKernels]
[np_layered_average]
type = SpatialUserObjectAux
variable = ring_average
execute_on = timestep_end
user_object = nrla
[]
[]
[UserObjects]
[nrla]
type = NearestRadiusLayeredAverage
direction = z
num_layers = 2
points = '0.05 0 0
0.15 0 0
0.25 0 0
0.35 0 0
0.45 0 0'
variable = u
[]
[]
[VectorPostprocessors]
# getting the points from the user object itself is here exactly equivalent to the points
# provided in the 'spatial_manually_provided' vector postprocessor
[spatial_from_uo]
type = SpatialUserObjectVectorPostprocessor
userobject = nrla
[]
[spatial_manually_provided]
type = SpatialUserObjectVectorPostprocessor
userobject = nrla
points = '0.05 0 0.25
0.05 0 0.75
0.15 0 0.25
0.15 0 0.75
0.25 0 0.25
0.25 0 0.75
0.35 0 0.25
0.35 0 0.75
0.45 0 0.25
0.45 0 0.75'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
exodus = true
execute_on = final
[]
(modules/phase_field/test/tests/mobility_derivative/coupledmatdiffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
xmax = 15.0
ymax = 15.0
elem_type = QUAD4
[]
[Variables]
[./c]
[./InitialCondition]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
[../]
[../]
[./d]
[./InitialCondition]
type = SmoothCircleIC
x1 = 15
y1 = 15
radius = 8
int_width = 3
invalue = 2
outvalue = 0
[../]
[../]
[./u]
[../]
[./w]
[../]
[]
[Kernels]
[./ctime]
type = TimeDerivative
variable = c
[../]
[./umat]
type = MatReaction
variable = c
v = u
mob_name = 1
[../]
[./urxn]
type = Reaction
variable = u
[../]
[./cres]
type = MatDiffusion
variable = u
diffusivity = Dc
args = d
v = c
[../]
[./dtime]
type = TimeDerivative
variable = d
[../]
[./wmat]
type = MatReaction
variable = d
v = w
mob_name = 1
[../]
[./wrxn]
type = Reaction
variable = w
[../]
[./dres]
type = MatDiffusion
variable = w
diffusivity = Dd
args = c
v = d
[../]
[]
[Materials]
[./Dc]
type = DerivativeParsedMaterial
property_name = Dc
expression = '0.01+c^2+d'
coupled_variables = 'c d'
derivative_order = 1
[../]
[./Dd]
type = DerivativeParsedMaterial
property_name = Dd
expression = 'd^2+c+1.5'
coupled_variables = 'c d'
derivative_order = 1
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 lu 1'
dt = 1
num_steps = 2
[]
[Outputs]
exodus = true
[]
(test/tests/multiapps/grid-sequencing/coarse.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[./diff]
type = Diffusion
variable = u
[../]
[rxn]
type = Reaction
variable = u
[]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 1
solve_type = 'PJFNK'
petsc_options = '-snes_monitor_solution'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/bcs/penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = -2*(x*x+y*y-2)+(1-x*x)*(1-y*y)
[../]
[./solution]
type = ParsedGradFunction
value = (1-x*x)*(1-y*y)
grad_x = 2*(x*y*y-x)
grad_y = 2*(x*x*y-y)
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
active = 'bc_all'
[./bc_all]
type = PenaltyDirichletBC
variable = u
value = 0
boundary = 'top left right bottom'
penalty = 1e5
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-14
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/kernels/hfem/dirichlet.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 3
ny = 3
dim = 2
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
[]
[uhat]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[lambdab]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[]
[AuxVariables]
[v]
order = CONSTANT
family = MONOMIAL
block = 0
initial_condition = '1'
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = 0
[]
[source]
type = CoupledForce
variable = u
v = v
coef = '1'
block = 0
[]
[reaction]
type = Reaction
variable = uhat
rate = '1'
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[uhat_coupled]
type = CoupledForce
variable = uhat
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
v = lambdab
coef = '1'
[]
[]
[DGKernels]
[surface]
type = HFEMDiffusion
variable = u
lowerd_variable = lambda
[]
[]
[BCs]
[all]
type = HFEMDirichletBC
boundary = 'left right top bottom'
variable = u
lowerd_variable = lambdab
uhat = uhat
[]
[]
[Postprocessors]
[intu]
type = ElementIntegralVariablePostprocessor
variable = u
block = 0
[]
[lambdanorm]
type = ElementL2Norm
variable = lambda
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Outputs]
[out]
# we hide lambda because it may flip sign due to element
# renumbering with distributed mesh
type = Exodus
hide = lambda
[]
[]
(modules/solid_mechanics/examples/wave_propagation/cantilever_sweep.i)
# Frequency Response function for cantilever beam:
# Analytic results: 509Hz and 763Hz
# Simulation results with coarse mesh: 600Hz and 800Hz
[Mesh]
type = GeneratedMesh
elem_type = HEX8
dim = 3
xmin=0
xmax=1
nx=10
ymin=0
ymax=0.1
ny = 1
zmin=0
zmax=0.15
nz = 2
[]
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y disp_z'
[]
[Problem]
type = ReferenceResidualProblem
reference_vector = 'ref'
extra_tag_vectors = 'ref'
group_variables = 'disp_x disp_y disp_z'
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
[all]
strain = SMALL
add_variables = true
new_system = true
formulation = TOTAL
[]
[]
[]
[]
[Kernels]
#reaction terms
[reaction_realx]
type = Reaction
variable = disp_x
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[reaction_realy]
type = Reaction
variable = disp_y
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[reaction_realz]
type = Reaction
variable = disp_z
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[]
[AuxVariables]
[disp_mag]
[]
[]
[AuxKernels]
[disp_mag]
type = ParsedAux
variable = disp_mag
coupled_variables = 'disp_x disp_y disp_z'
expression = 'sqrt(disp_x^2+disp_y^2+disp_z^2)'
[]
[]
[BCs]
#Left
[disp_x_left]
type = DirichletBC
variable = disp_x
boundary = 'left'
value = 0.0
[]
[disp_y_left]
type = DirichletBC
variable = disp_y
boundary = 'left'
value = 0.0
[]
[disp_z_left]
type = DirichletBC
variable = disp_z
boundary = 'left'
value = 0.0
[]
#Right
[BC_right_yreal]
type = NeumannBC
variable = disp_y
boundary = 'right'
value = 1000
[]
[BC_right_zreal]
type = NeumannBC
variable = disp_z
boundary = 'right'
value = 1000
[]
[]
[Materials]
[elastic_tensor_Al]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 68e9
poissons_ratio = 0.36
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
[]
[]
[Postprocessors]
[dispMag]
type = NodalExtremeValue
value_type = max
variable = disp_mag
[]
[]
[Functions]
[./freq2]
type = ParsedFunction
symbol_names = density
symbol_values = 2.7e3 #Al kg/m3
expression = '-t*t*density'
[../]
[]
[Controls]
[./func_control]
type = RealFunctionControl
parameter = 'Kernels/*/rate'
function = 'freq2'
execute_on = 'initial timestep_begin'
[../]
[]
[Executioner]
type = Transient
solve_type=LINEAR
petsc_options_iname = ' -pc_type'
petsc_options_value = 'lu'
start_time = 300 #starting frequency
end_time = 1200 #ending frequency
nl_abs_tol = 1e-6
[TimeStepper]
type = ConstantDT
dt = 50 #frequency stepsize
[]
[]
[Outputs]
csv=true
exodus=false
console = false
[]
(test/tests/misc/check_error/interface_kernel_with_aux_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./v]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = u
[../]
[]
[InterfaceKernels]
[./nope]
type = InterfaceDiffusion
variable = v
neighbor_var = u
boundary = 'left'
D = 4
D_neighbor = 2
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/time_integrators/explicit-euler/ee-1d-quadratic-neumann.i)
[GlobalParams]
implicit = false
[]
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 10
elem_type = EDGE3
[]
[Functions]
[./ic]
type = ParsedFunction
expression = 0
[../]
[./forcing_fn]
type = ParsedFunction
expression = x*x-2*t+t*x*x
[../]
[./exact_fn]
type = ParsedFunction
expression = t*x*x
[../]
[./left_bc_fn]
type = ParsedFunction
expression = -t*2*x
[../]
[./right_bc_fn]
type = ParsedFunction
expression = t*2*x
[../]
[]
[Variables]
[./u]
order = SECOND
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = ic
[../]
[../]
[]
[Kernels]
[./td]
type = TimeDerivative
variable = u
implicit = true
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./abs]
type = Reaction
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./left]
type = FunctionNeumannBC
variable = u
boundary = '0'
function = left_bc_fn
[../]
[./right]
type = FunctionNeumannBC
variable = u
boundary = '1'
function = right_bc_fn
[../]
[]
[Postprocessors]
[./l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[../]
[]
[Executioner]
type = Transient
scheme = 'explicit-euler'
solve_type = 'LINEAR'
l_tol = 1e-12
start_time = 0.0
num_steps = 10
dt = 0.001
[]
[Outputs]
exodus = true
[./console]
type = Console
max_rows = 10
[../]
[]
(test/tests/mortar/mortar-q-points/test.i)
[Mesh]
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[./primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[../]
[./secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[../]
uniform_refine = 2
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[./T]
block = '1 2'
[../]
[]
[Kernels]
[./conduction]
type = Diffusion
variable = T
block = '1 2'
[../]
[./reaction]
type = Reaction
variable = T
block = '1 2'
[../]
[]
[Constraints]
[./mortar]
type = SpatiallyVaryingSource
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
secondary_variable = T
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
solve_type = NEWTON
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/examples/wave_propagation/1D_elastic_wave_propagation.i)
w=10 #frequency
[Mesh]
type = GeneratedMesh
dim = 1
xmin=0
xmax=1
nx = 1000
[]
[Variables]
[uxr]
order = FIRST
family = LAGRANGE
[]
[uxi]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
#stressdivergence terms
[urealx]
type = StressDivergenceTensors
variable = uxr
displacements='uxr'
component = 0
base_name = real
[]
[uimagx]
type = StressDivergenceTensors
variable = uxi
displacements='uxi'
component = 0
base_name = imag
[]
#reaction terms
[reaction_realx]
type = Reaction
variable = uxr
rate = ${fparse -w*w}
[]
[reaction_imagx]
type = Reaction
variable = uxi
rate = ${fparse -w*w}
[]
[]
[BCs]
#Left
[uxr_left]
type = CoupledVarNeumannBC
variable = uxr
boundary = 'left'
v = uxi
coef=${fparse -w}
[]
[uxi_left]
type = CoupledVarNeumannBC
variable = uxi
boundary = 'left'
v = uxr
coef=${fparse w}
[]
#Right
[BC_right_xreal]
type = DirichletBC
variable = uxr
boundary = 'right'
value = 0.5
[]
[BC_right_ximag]
type = DirichletBC
variable = uxi
boundary = 'right'
value = 0
[]
[]
[Materials]
[elasticity_tensor_real]
type = ComputeIsotropicElasticityTensor
base_name = real
youngs_modulus = 1
poissons_ratio = 0.0
[]
[strain_real]
type = ComputeSmallStrain
base_name = real
displacements='uxr'
[]
[stress_real]
type = ComputeLinearElasticStress
base_name = real
[]
[elasticity_tensor_imag]
type = ComputeIsotropicElasticityTensor
base_name = imag
youngs_modulus = 1
poissons_ratio = 0.0
[]
[strain_imag]
type = ComputeSmallStrain
base_name = imag
displacements='uxi'
[]
[stress_imag]
type = ComputeLinearElasticStress
base_name = imag
[]
[]
[VectorPostprocessors]
[midpt_real]
type = PointValueSampler
variable = uxr
points = '0.5 0.0 0'
sort_by = id
[]
[midpt_imag]
type = PointValueSampler
variable = uxi
points = '0.5 0.0 0'
sort_by = id
[]
[]
[Outputs]
csv=true
exodus=true
[]
[Executioner]
type = Steady
solve_type=LINEAR
petsc_options_iname = ' -pc_type'
petsc_options_value = 'lu'
[]
(modules/phase_field/test/tests/phase_field_crystal/PFCTrad/PFCTrad_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 50
xmax = 8
ymax = 8
[]
[Variables]
[./n]
[./InitialCondition]
type = RandomIC
min = -1
max = 4
[../]
[../]
[./u]
scaling = 1e2
[../]
[./v]
scaling = 1e1
[../]
[]
[Kernels]
[./ndot]
type = TimeDerivative
variable = n
[../]
[./n_bulk]
type = CHBulkPFCTrad
variable = n
[../]
[./u_term]
type = MatDiffusion
variable = n
v = u
diffusivity = C2
[../]
[./v_term]
type = MatDiffusion
variable = n
v = v
diffusivity = C4
[../]
[./u_rctn]
type = Reaction
variable = u
[../]
[./u_gradn]
type = LaplacianSplit
variable = u
c = n
[../]
[./v_rctn]
type = Reaction
variable = v
[../]
[./v_gradu]
type = LaplacianSplit
variable = v
c = u
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./PFCTrad]
type = PFCTradMaterial
order = FOURTH
[../]
[]
[Preconditioning]
active = 'SMP'
[./SMP]
type = SMP
full = false
off_diag_row = 'u n n v'
off_diag_column = 'n u v u'
[../]
[./FDP]
type = FDP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
# petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
# petsc_options_value = 'hypre boomeramg 101'
# petsc_options_iname = -pc_type
# petsc_options_value = lu
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 101 preonly lu 5'
l_max_its = 100
l_tol = 1e-04
nl_rel_tol = 1e-09
nl_abs_tol = 1e-11
num_steps = 2
dt = 0.1
[]
[Outputs]
exodus = true
[]
(test/tests/misc/check_error/aux_kernel_with_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rea]
type = Reaction
variable = u
[]
[]
[AuxKernels]
[nope]
type = ParsedAux
variable = u
expression = '1'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/variables/fe_hermite/hermite-3-2d.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 5
ny = 5
elem_type = QUAD9
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
expression = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
expression = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
expression = -6*x-6*y+(x*x*x)+(y*y*y)
[../]
[./solution]
type = ParsedGradFunction
value = (x*x*x)+(y*y*y)
grad_x = 3*x*x
grad_y = 3*y*y
[../]
[]
[Variables]
[./u]
order = THIRD
family = HERMITE
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/variables/fe_hermite_convergence/hermite_converge_dirichlet.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 4
ny = 4
elem_type = QUAD4
# This test will not work in parallel with DistributedMesh enabled
# due to a bug in PeriodicBCs.
parallel_type = replicated
[]
[Functions]
[./bc_fn]
type = ParsedGradFunction
value = -sin(pi*x)*sin(pi*y)
grad_x = -pi*cos(pi*x)*sin(pi*y)
grad_y = -pi*sin(pi*x)*cos(pi*y)
[../]
[./forcing_fn]
type = ParsedFunction
expression = -2*pi*pi*sin(pi*x)*sin(pi*y)-sin(pi*x)*sin(pi*y)
[../]
[]
[Variables]
[./u]
order = THIRD
family = HERMITE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./all]
type = FunctionPenaltyDirichletBC
variable = u
boundary = 'bottom right top left'
function = bc_fn
penalty = 1e10
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = bc_fn
[../]
[./H1error]
type = ElementH1Error
variable = u
function = bc_fn
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = bc_fn
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
# We use higher-order quadrature to ensure that the forcing function
# is integrated accurately.
[./Quadrature]
order=ELEVENTH
[../]
[]
[Adaptivity]
steps = 2
marker = uniform
[./Markers]
[./uniform]
type = UniformMarker
mark = refine
[../]
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
print_mesh_changed_info = true
[]
(modules/phase_field/test/tests/phase_field_crystal/PFCEnergyDensity/auxkernel.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
nz = 0
xmax = 6
ymax = 6
zmax = 0
[]
[Variables]
[./n]
[./InitialCondition]
type = RandomIC
min = 0.0
max = 0.1
[../]
[../]
[./u]
scaling = 1e2
[../]
[./v]
scaling = 1e1
[../]
[]
[AuxVariables]
[./ed]
order = CONSTANT
family = MONOMIAL
[../]
[./edrff0]
order = CONSTANT
family = MONOMIAL
[../]
[./edrff1]
order = CONSTANT
family = MONOMIAL
[../]
[./edrff2]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./ndot]
type = TimeDerivative
variable = n
[../]
[./n_bulk]
type = CHBulkPFCTrad
variable = n
[../]
[./u_term]
type = MatDiffusion
variable = n
v = u
diffusivity = C2
[../]
[./v_term]
type = MatDiffusion
variable = n
v = v
diffusivity = C4
[../]
[./u_rctn]
type = Reaction
variable = u
[../]
[./u_gradn]
type = LaplacianSplit
variable = u
c = n
[../]
[./v_rctn]
type = Reaction
variable = v
[../]
[./v_gradu]
type = LaplacianSplit
variable = v
c = u
[../]
[]
[AuxKernels]
[./Energy_n]
type = PFCEnergyDensity
execute_on = 'initial timestep_end'
variable = ed
v = 'n u v'
[../]
[./Energy_rff0]
type = PFCRFFEnergyDensity
execute_on = 'initial timestep_end'
variable = edrff0
log_approach = tolerance
v = 'n u v'
[../]
[./Energy_rff1]
type = PFCRFFEnergyDensity
execute_on = 'initial timestep_end'
variable = edrff1
log_approach = cancelation
v = 'n u v'
[../]
[./Energy_rff2]
type = PFCRFFEnergyDensity
execute_on = 'initial timestep_end'
variable = edrff2
log_approach = expansion
v = 'n u v'
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./PFCTrad]
type = PFCTradMaterial
order = FOURTH
[../]
[]
[Postprocessors]
[./Total_free_energy]
type = PFCElementEnergyIntegral
variable = ed
execute_on = 'initial timestep_end'
[../]
[]
[Preconditioning]
active = 'SMP'
[./SMP]
type = SMP
full = false
off_diag_row = 'u n n v'
off_diag_column = 'n u v u'
[../]
[./FDP]
type = FDP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
# petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
# petsc_options_value = 'hypre boomeramg 101'
# petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
# petsc_options_value = 'asm 101 preonly lu 1'
petsc_options_iname = '-pc_type '
petsc_options_value = 'lu '
l_max_its = 100
l_tol = 1e-04
nl_rel_tol = 1e-09
nl_abs_tol = 1e-11
num_steps = 1
dt = 0.1
[]
[Outputs]
exodus = true
[]
(test/tests/dgkernels/2d_diffusion_dg/no_functor_additions.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[./InitialCondition]
type = ConstantIC
value = 1
[../]
[../]
[]
[AuxVariables]
[v]
order = FIRST
family = MONOMIAL
[]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./abs] # u * v
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
[regular_dg_diffusion]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[]
[]
[DGDiffusionAction]
variable = u
kernels_to_add = 'COUPLED'
coupled_var = v
[]
[BCs]
[./all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[console]
type = Console
system_info = 'framework mesh aux nonlinear relationship execution'
[]
[]
[Problem]
error_on_jacobian_nonzero_reallocation = true
[]
[Postprocessors]
[num_rm]
type = NumRelationshipManagers
[]
[]
(test/tests/fvkernels/fv_coupled_var/coupled.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 2
[]
[Variables]
[u][]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[w]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[s][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
rate = 2.0
[]
[diffs]
type = Diffusion
variable = s
[]
[prod]
type = CoupledForce
variable = s
v = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[rxn]
type = FVReaction
variable = v
rate = 2.0
[]
[diffw]
type = FVDiffusion
variable = w
coeff = coeff
[]
[prod]
type = FVCoupledForce
variable = w
v = 'v'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[leftw]
type = FVDirichletBC
variable = w
boundary = left
value = 0
[]
[rightw]
type = FVDirichletBC
variable = w
boundary = right
value = 1
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[lefts]
type = DirichletBC
variable = s
boundary = left
value = 0
[]
[rights]
type = DirichletBC
variable = s
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(test/tests/materials/material/material_test_dg.i)
[Mesh]
file = sq-2blk.e
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = MONOMIAL
[./InitialCondition]
type = ConstantIC
value = 1
[../]
[../]
[]
[Functions]
active = 'forcing_fn exact_fn'
[./forcing_fn]
type = ParsedFunction
expression = (x*x*x)-6.0*x
[../]
[./exact_fn]
type = ParsedGradFunction
value = (x*x*x)
grad_x = 3*x*x
grad_y = 0
[../]
[]
[Kernels]
active = 'diff abs forcing'
[./diff]
type = MatDiffusionTest
variable = u
prop_name = matp
[../]
[./abs]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
active = 'dgdiff'
[./dgdiff]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1.0
diff = matp
[../]
[]
[BCs]
active = 'all'
[./all]
type = DGMDDBC
variable = u
boundary = '1 2 3 4'
function = exact_fn
prop_name = matp
sigma = 6
epsilon = -1.0
[../]
[]
[Materials]
active = 'mat_1 mat_2'
[./mat_1]
type = MTMaterial
block = 1
value = 1
[../]
[./mat_2]
type = MTMaterial
block = 2
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = out_dg
exodus = true
[]
(test/tests/bcs/ad_penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = -2*(x*x+y*y-2)+(1-x*x)*(1-y*y)
[../]
[./solution]
type = ParsedGradFunction
value = (1-x*x)*(1-y*y)
grad_x = 2*(x*y*y-x)
grad_y = 2*(x*x*y-y)
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = ADDiffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = ADBodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
active = 'bc_all'
[./bc_all]
type = ADPenaltyDirichletBC
variable = u
value = 0
boundary = 'top left right bottom'
penalty = 1e5
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-14
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/combined/examples/optimization/2d_mbb_pde.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-8
power = 2
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 150
ny = 50
xmin = 0
xmax = 30
ymin = 0
ymax = 10
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold_y
nodes = 0
[]
[push]
type = ExtraNodesetGenerator
input = node
new_boundary = push
coord = '30 10 0'
[]
[]
[Variables]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Emin]
family = MONOMIAL
order = CONSTANT
initial_condition = ${Emin}
[]
[power]
family = MONOMIAL
order = CONSTANT
initial_condition = ${power}
[]
[E0]
family = MONOMIAL
order = CONSTANT
initial_condition = ${E0}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.15 # radius coeff
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_y
boundary = hold_y
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top'
coefficient = 10
[]
[boundary_penalty_right]
type = ADRobinBC
variable = Dc
boundary = 'right'
coefficient = 10
[]
[]
[NodalKernels]
[push]
type = NodalGravity
variable = disp_y
boundary = push
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'Emin mat_den power E0'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
line_search = none
nl_abs_tol = 1e-4
l_max_its = 200
start_time = 0.0
dt = 1.0
num_steps = 70
[]
[Outputs]
[out]
type = Exodus
execute_on = 'INITIAL TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Controls]
[first_period]
type = TimePeriod
start_time = 0.0
end_time = 10
enable_objects = 'BCs::boundary_penalty_right'
execute_on = 'initial timestep_begin'
[]
[]
(modules/phase_field/test/tests/phase_field_crystal/PFCTrad/pfct_newton_split1_asm1_10.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 50
xmax = 8
ymax = 8
[]
[Variables]
[./n]
[./InitialCondition]
type = RandomIC
min = -1
max = 4
[../]
[../]
[./u]
scaling = 1e2
[../]
[./v]
scaling = 1e1
[../]
[]
[Kernels]
[./ndot]
type = TimeDerivative
variable = n
[../]
[./n_bulk]
type = CHBulkPFCTrad
variable = n
[../]
[./u_term]
type = MatDiffusion
variable = n
v = u
diffusivity = C2
[../]
[./v_term]
type = MatDiffusion
variable = n
v = v
diffusivity = C4
[../]
[./u_rctn]
type = Reaction
variable = u
[../]
[./u_gradn]
type = LaplacianSplit
variable = u
c = n
[../]
[./v_rctn]
type = Reaction
variable = v
[../]
[./v_gradu]
type = LaplacianSplit
variable = v
c = u
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./PFCTrad]
type = PFCTradMaterial
order = 4
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 100
l_tol = 1e-04
nl_rel_tol = 1e-09
nl_abs_tol = 1e-11
splitting = 'nuv'
petsc_options = '-snes_view'
num_steps = 2
dt = 0.1
[]
[Splits]
[./nuv]
splitting = 'v nu'
splitting_type = schur
schur_type = full
schur_pre = Sp
#petsc_options = '-dm_view'
[../]
[./nu]
vars = 'n u'
petsc_options = '-ksp_monitor'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_asm_nblocks -pc_asm_overlap -sub_pc_type'
petsc_options_value = ' 101 asm 10 1 lu'
[../]
[./v]
vars = 'v'
#petsc_options = '-ksp_monitor'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 101 preonly lu 0'
#full = true
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/outputs/debug/show_execution_kernels_bcs.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[left]
type = ParsedSubdomainMeshGenerator
input = 'gmg'
combinatorial_geometry = 'x < 0.5'
block_id = '2'
[]
[middle_boundary]
type = SideSetsBetweenSubdomainsGenerator
input = 'left'
primary_block = '0'
paired_block = '2'
new_boundary = 'middle'
[]
[]
[Functions]
[forcing_fnu]
type = ParsedFunction
expression = -5.8*(x+y)+x*x*x-x+y*y*y-y
[]
[forcing_fnv]
type = ParsedFunction
expression = -4
[]
[slnu]
type = ParsedGradFunction
expression = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[]
[slnv]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[]
# NeumannBC functions
[bc_fnut]
type = ParsedFunction
expression = 3*y*y-1
[]
[bc_fnub]
type = ParsedFunction
expression = -3*y*y+1
[]
[bc_fnul]
type = ParsedFunction
expression = -3*x*x+1
[]
[bc_fnur]
type = ParsedFunction
expression = 3*x*x-1
[]
[]
[Variables]
[u]
order = THIRD
family = HIERARCHIC
[]
[v]
order = SECOND
family = LAGRANGE
[]
[]
[Kernels]
[diff1]
type = Diffusion
variable = u
[]
[test1]
type = CoupledConvection
variable = u
velocity_vector = v
[]
[diff2]
type = Diffusion
variable = v
[]
[react]
type = Reaction
variable = u
[]
[forceu]
type = BodyForce
variable = u
function = forcing_fnu
[]
[forcev]
type = BodyForce
variable = v
function = forcing_fnv
[]
[]
[BCs]
[bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'left right top bottom'
[]
[bc_u_tb]
type = CoupledKernelGradBC
variable = u
var2 = v
vel = '0.1 0.1'
boundary = 'top bottom left right'
[]
[bc_ul]
type = FunctionNeumannBC
variable = u
function = bc_fnul
boundary = 'left'
[]
[bc_ur]
type = FunctionNeumannBC
variable = u
function = bc_fnur
boundary = 'right'
[]
[bc_ut]
type = FunctionNeumannBC
variable = u
function = bc_fnut
boundary = 'top'
[]
[bc_ub]
type = FunctionNeumannBC
variable = u
function = bc_fnub
boundary = 'bottom'
[]
[]
[Dampers]
active = ''
[limit_v]
type = BoundingValueElementDamper
variable = v
max_value = 1.5
min_value = -20
[]
[limit_u]
type = BoundingValueElementDamper
variable = u
max_value = 1.5
min_value = -20
[]
[]
[InterfaceKernels]
[diff_ik_2]
type = InterfaceDiffusion
variable = 'u'
neighbor_var = 'v'
boundary = 'middle'
[]
[diff_ik_1]
type = InterfaceDiffusion
variable = 'v'
neighbor_var = 'u'
boundary = 'middle'
[]
[]
[DGKernels]
[diff_dg_2]
type = DGDiffusion
variable = 'u'
epsilon = -1
sigma = 6
[]
[diff_dg_1]
type = DGDiffusion
variable = 'u'
epsilon = -1
sigma = 6
[]
[]
[DiracKernels]
[source_2]
type = FunctionDiracSource
variable = 'u'
point = '0.1 0.1 0'
function = 'x + y'
[]
[source_1]
type = FunctionDiracSource
variable = 'u'
point = '0.1 0.1 0'
function = 'x + y'
block = '2'
[]
[source_0]
type = FunctionDiracSource
variable = 'u'
# in block 0, but since it's not block restricted it shows up as active in
# block 2 as well
point = '0.6 0.5 0'
function = 'x + y'
[]
[]
[Materials]
[diff]
type = GenericConstantMaterial
prop_names = 'D D_neighbor'
prop_values = '0 0'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-15
nl_abs_tol = 1e-13
[]
[Debug]
show_execution_order = 'NONE ALWAYS INITIAL NONLINEAR LINEAR TIMESTEP_BEGIN TIMESTEP_END FINAL'
[]
(test/tests/bounds/constant_bounds_elem.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 10
[]
[Variables]
[u]
order = CONSTANT
family = MONOMIAL
[]
[v]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxVariables]
[bounds_dummy]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[reaction_u]
type = Reaction
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[reaction_v]
type = Reaction
variable = v
[]
[]
[DGKernels]
[dg_diff_u]
type = ADDGDiffusion
variable = u
epsilon = -1
sigma = 6
diff = 3
[]
[dg_diff_v]
type = ADDGDiffusion
variable = v
epsilon = -1
sigma = 6
diff = 4
[]
[]
[BCs]
[left_u]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0'
function = -0.5
epsilon = -1
sigma = 6
[]
[right_u]
type = NeumannBC
variable = u
boundary = 1
value = 30
[]
[left_v]
type = DGFunctionDiffusionDirichletBC
variable = v
boundary = '0'
function = 4
epsilon = -1
sigma = 6
[]
[right_v]
type = NeumannBC
variable = v
boundary = 1
value = -40
[]
[]
[Bounds]
[u_upper_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = u
bound_type = upper
bound_value = 1
[]
[u_lower_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = u
bound_type = lower
bound_value = 0
[]
[v_upper_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = v
bound_type = upper
bound_value = 3
[]
[v_lower_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = v
bound_type = lower
bound_value = -1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-snes_type'
petsc_options_value = 'vinewtonrsls'
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[power_density]
family = L2_LAGRANGE
order = FIRST
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Reaction
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[Postprocessors]
[pwr_avg]
type = ElementAverageValue
block = '0'
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_L2_Lagrange.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppShapeEvaluationTransfer
source_variable = power_density
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/misc/check_error/kernel_with_empty_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = ''
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/dgkernels/3d_diffusion_dg/3d_diffusion_dg_test.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 5
xmin = 0
xmax = 1
ymin = 0
ymax = 1
zmin = 0
zmax = 1
elem_type = HEX8
[]
[Variables]
active = 'u'
[u]
order = FIRST
family = MONOMIAL
[InitialCondition]
type = ConstantIC
value = 0.5
[]
[]
[]
[Functions]
active = 'forcing_fn exact_fn'
[forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[]
[exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[]
[]
[Kernels]
active = 'diff abs forcing'
[diff]
type = Diffusion
variable = u
[]
[abs] # u * v
type = Reaction
variable = u
[]
[forcing]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[DGKernels]
active = 'dg_diff'
[dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[]
[]
[BCs]
active = 'all'
[all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3 4 5'
function = exact_fn
epsilon = -1
sigma = 6
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
active = 'h dofs l2_err'
[h]
type = AverageElementSize
execute_on = 'initial timestep_end'
[]
[dofs]
type = NumDOFs
execute_on = 'initial timestep_end'
[]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/variables/fe_monomial_const/monomial-const-2d.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 100
ny = 100
elem_type = QUAD4
[]
[Functions]
[./bc_fn]
type=ParsedFunction
expression=0
[../]
[./bc_fnt]
type = ParsedFunction
expression = 0
[../]
[./bc_fnb]
type = ParsedFunction
expression = 0
[../]
[./bc_fnl]
type = ParsedFunction
expression = 0
[../]
[./bc_fnr]
type = ParsedFunction
expression = 0
[../]
[./forcing_fn]
# type = ParsedFunction
# expression = 0
type = MTPiecewiseConst2D
[../]
[./solution]
type = MTPiecewiseConst2D
[../]
[]
[Variables]
[./u]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
# Note: MOOSE's DirichletBCs do not work properly with shape functions that do not
# have DOFs at the element edges. This test works because the solution
# has been designed to be zero at the boundary which is satisfied by the IC
# Ticket #1352
active = ''
[./bc_all]
type=FunctionDirichletBC
variable = u
boundary = 'top bottom left right'
function = bc_fn
[../]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1.e-10
[./Adaptivity]
[../]
[]
[Outputs]
execute_on = 'timestep_end'
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[]
(test/tests/misc/check_error/dirac_kernel_with_aux_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./v]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = u
[../]
[]
[DiracKernels]
[./nope]
type = CachingPointSource
variable = v
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/controls/time_periods/dgkernels/dgkernels.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Adaptivity]
marker = uniform_marker
[Markers]
[uniform_marker]
type = UniformMarker
mark = REFINE
[]
[]
[]
[Variables]
[u]
order = FIRST
family = MONOMIAL
initial_condition = 1
[]
[]
[Functions]
[forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[]
[exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[abs] # u * v
type = Reaction
variable = u
[]
[forcing]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[DGKernels]
[dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[]
[dg_diff2]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 4
[]
[]
[BCs]
[all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
num_steps = 4
dt = 1
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[]
[Controls]
[dg_problem]
type = TimePeriod
enable_objects = 'DGKernels/dg_diff2'
disable_objects = 'DGKernel::dg_diff'
start_time = '2'
execute_on = 'initial timestep_begin'
[]
[]
(test/tests/outputs/debug/show_execution_userobjects.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1.5 2.4'
dy = '1.3 0.9'
ix = '3 2'
iy = '2 3'
subdomain_id = '0 1
1 0'
[]
[add_interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
second_order = true
[]
[Functions]
[forcing_fnu]
type = ParsedFunction
expression = -5.8*(x+y)+x*x*x-x+y*y*y-y
[]
[forcing_fnv]
type = ParsedFunction
expression = -4
[]
[slnu]
type = ParsedGradFunction
expression = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[]
[slnv]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[]
# NeumannBC functions
[bc_fnut]
type = ParsedFunction
expression = 3*y*y-1
[]
[bc_fnub]
type = ParsedFunction
expression = -3*y*y+1
[]
[bc_fnul]
type = ParsedFunction
expression = -3*x*x+1
[]
[bc_fnur]
type = ParsedFunction
expression = 3*x*x-1
[]
[]
[Variables]
[u]
order = SECOND
family = HIERARCHIC
[]
[v]
order = SECOND
family = LAGRANGE
initial_condition = 1
[]
[]
[AuxVariables]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
active = 'diff1 diff2 test1 forceu forcev react'
[diff1]
type = Diffusion
variable = u
[]
[test1]
type = CoupledConvection
variable = u
velocity_vector = v
[]
[diff2]
type = Diffusion
variable = v
[]
[react]
type = Reaction
variable = u
[]
[forceu]
type = BodyForce
variable = u
function = forcing_fnu
[]
[forcev]
type = BodyForce
variable = v
function = forcing_fnv
[]
[]
[AuxKernels]
[set_v_elem]
type = FunctionAux
variable = v_elem
# selected not to be the solution for no particular reason
function = forcing_fnv
[]
[]
[BCs]
[bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'left right top bottom'
[]
[bc_u_tb]
type = CoupledKernelGradBC
variable = u
var2 = v
vel = '0.1 0.1'
boundary = 'top bottom left right'
[]
[bc_ul]
type = FunctionNeumannBC
variable = u
function = bc_fnul
boundary = 'left'
[]
[bc_ur]
type = FunctionNeumannBC
variable = u
function = bc_fnur
boundary = 'right'
[]
[bc_ut]
type = FunctionNeumannBC
variable = u
function = bc_fnut
boundary = 'top'
[]
[bc_ub]
type = FunctionNeumannBC
variable = u
function = bc_fnub
boundary = 'bottom'
[]
[]
[Postprocessors]
# Global user objects
[dofs]
type = NumDOFs
[]
[h]
type = AverageElementSize
[]
# Elemental user objects
[L2u]
type = ElementL2Error
variable = u
function = slnu
# Testing an option
force_preic = true
[]
[L2v]
type = ElementL2Error
variable = v
function = slnv
# Testing an option
force_preaux = true
[]
[H1error]
type = ElementH1Error
variable = u
function = slnu
[]
[H1Semierror]
type = ElementH1SemiError
variable = u
function = slnu
[]
[L2v_elem]
type = ElementL2Error
variable = v_elem
function = slnv
[]
[f_integral]
type = FunctionElementIntegral
function = slnv
[]
[int_v]
type = ElementIntegralVariablePostprocessor
variable = v
block = 1
execute_on = 'TIMESTEP_END transfer'
[]
[int_v_elem]
type = ElementIntegralVariablePostprocessor
variable = v_elem
block = 1
execute_on = 'TIMESTEP_END transfer'
[]
# Side user objects
[integral_v]
type = SideIntegralVariablePostprocessor
variable = v
boundary = 0
[]
[]
[VectorPostprocessors]
# General UOs
[memory]
type = VectorMemoryUsage
[]
[line]
type = LineValueSampler
variable = v
num_points = 10
start_point = '0 0 0'
end_point = '0.5 0.5 0'
sort_by = 'x'
[]
# Nodal UOs
[nodal_sampler_y]
type = NodalValueSampler
variable = v
sort_by = 'y'
[]
[nodal_sampler_x]
type = NodalValueSampler
variable = v
sort_by = 'x'
[]
# Element UO
[elem_sample]
type = ElementValueSampler
variable = v_elem
sort_by = 'x'
[]
[]
[UserObjects]
# Nodal user objects
[find_node]
type = NearestNodeNumberUO
point = '0.5 0.5 0'
[]
# Side user objects
[side_int]
type = LayeredSideIntegral
variable = v
boundary = 0
direction = y
num_layers = 4
[]
[side_int_2]
type = NearestPointLayeredSideIntegral
variable = v
boundary = 0
direction = x
num_layers = 3
points = '1 1 0'
[]
# Interface user objects
[values]
type = InterfaceQpValueUserObject
var = v
boundary = interface
[]
inactive = 'prime_1 prime_2'
# Threaded general user objects
[prime_2]
type = PrimeProductUserObject
[]
[prime_1]
type = PrimeProductUserObject
[]
# Domain user objects
[domain_2]
type = InterfaceDomainUserObject
u = u
v = v
block = '0'
robin_boundaries = 'left'
interface_boundaries = 'interface'
interface_penalty = 1e-10
nl_abs_tol = 1e1
[]
[domain_1]
type = InterfaceDomainUserObject
u = u
v = v
block = '0 1'
robin_boundaries = 'left'
interface_boundaries = 'interface'
interface_penalty = 1e-10
nl_abs_tol = 1e1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
l_tol = 1e-5
[]
[Problem]
kernel_coverage_check = false
[]
[MultiApps]
active = ''
[full_solve]
type = FullSolveMultiApp
execute_on = 'initial timestep_end final'
input_files = show_execution_userobjects.i
cli_args = 'Problem/solve=false'
[]
[]
[Transfers]
active = ''
[conservative]
type = MultiAppNearestNodeTransfer
from_multi_app = full_solve
source_variable = v
variable = v_elem
from_postprocessors_to_be_preserved = int_v
to_postprocessors_to_be_preserved = int_v_elem
[]
[]
[Debug]
show_execution_order = 'ALWAYS INITIAL NONLINEAR LINEAR TIMESTEP_BEGIN TIMESTEP_END FINAL'
[]
(modules/phase_field/test/tests/Nucleation/force.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
nz = 0
xmin = 0
xmax = 20
ymin = 0
ymax = 20
elem_type = QUAD4
[]
[Variables]
[./c]
[../]
[]
[Kernels]
[./c_force]
type = DiscreteNucleationForce
variable = c
map = map
no_nucleus_value = -1
nucleus_value = 2
[../]
[./c_react]
type = Reaction
variable = c
[../]
[]
[UserObjects]
[./inserter]
type = DiscreteNucleationInserter
hold_time = 0.4
probability = 0.01
seed = 12346
radius = 3.27
[../]
[./map]
type = DiscreteNucleationMap
int_width = 2
periodic = c
inserter = inserter
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
nl_abs_tol = 1e-10
num_steps = 10
dt = 0.2
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/phase_field/test/tests/SimpleACInterface/SimpleCoupledACInterface.i)
#
# Test the coupled Allen-Cahn Bulk kernel
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
nz = 0
xmin = 0
xmax = 50
ymin = 0
ymax = 50
zmin = 0
zmax = 50
elem_type = QUAD4
uniform_refine = 1
[]
[Variables]
[./w]
[../]
[./eta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 25.0
y1 = 25.0
radius = 6.0
invalue = 1.0
outvalue = 0.0
int_width = 5.0
[../]
[../]
[]
[Kernels]
[./detadt]
type = TimeDerivative
variable = eta
[../]
[./ACBulk]
type = AllenCahn
variable = eta
f_name = F
[../]
[./CoupledBulk]
type = MatReaction
variable = eta
v = w
[../]
[./W]
type = Reaction
variable = w
[../]
[./CoupledACInterface]
type = SimpleCoupledACInterface
variable = w
v = eta
kappa_name = 1
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'L'
prop_values = '1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'eta'
expression = 'eta^2 * (1-eta)^2'
derivative_order = 2
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
l_max_its = 15
l_tol = 1.0e-4
nl_max_its = 10
nl_rel_tol = 1.0e-11
start_time = 0.0
num_steps = 2
dt = 2
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
hide = w
exodus = true
[]
(test/tests/variables/fe_hermite/hermite-3-3d.i)
[Mesh]
type = GeneratedMesh
dim = 3
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
nx = 1
ny = 1
nz = 1
elem_type = HEX27
# This problem only has 1 element, so using DistributedMesh in parallel
# isn't really an option, and we don't care that much about DistributedMesh
# in serial.
parallel_type = replicated
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
expression = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
expression = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 3*x*x
[../]
[./bc_fnk]
type = ParsedFunction
expression = -3*z*z
[../]
[./bc_fnf]
type = ParsedFunction
expression = 3*z*z
[../]
[./forcing_fn]
type = ParsedFunction
expression = -6*x-6*y-6*z+(x*x*x)+(y*y*y)+(z*z*z)
[../]
[./solution]
type = ParsedGradFunction
value = (x*x*x)+(y*y*y)+(z*z*z)
grad_x = 3*x*x
grad_y = 3*y*y
grad_z = 3*z*z
[../]
[]
[Variables]
[./u]
order = THIRD
family = HERMITE
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[./bc_front]
type = FunctionNeumannBC
variable = u
boundary = 'front'
function = bc_fnf
[../]
[./bc_back]
type = FunctionNeumannBC
variable = u
boundary = 'back'
function = bc_fnk
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/mortar/continuity-3d-non-conforming/continuity_non_conforming_tet.i)
[Mesh]
second_order = false
[file]
type = FileMeshGenerator
file = tet_non_mesh.e
[]
[secondary]
input = file
type = LowerDBlockFromSidesetGenerator
new_block_id = 11
new_block_name = "secondary"
sidesets = '101'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
new_block_id = 12
new_block_name = "primary"
sidesets = '102'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T]
block = '1 2'
[]
[lambda]
block = 'secondary'
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = '1 2'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi) + 3*pi^2*sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_primal]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_lambda]
type = ParsedFunction
expression = 'pi*sin(pi*y)*sin(pi*z)*cos(pi*x)'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = '12'
secondary_subdomain = '11'
variable = lambda
secondary_variable = T
delta = 0.1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type '
'-pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = '1 2'
[]
[h]
type = AverageElementSize
block = '1 2'
[]
[]
(test/tests/mortar/continuity-2d-non-conforming/soln-continuity-pg.i)
[Mesh]
second_order = false
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[]
[secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[]
[]
[Variables]
[T]
block = '1 2'
order = FIRST
[]
[lambda]
block = '10'
order = FIRST
use_dual = true
[]
[]
[AuxVariables]
[aux_lm]
block = '10'
order = FIRST
use_dual = false
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = '-4 + x^2 + y^2'
[]
[exact_soln]
type = ParsedFunction
expression = 'x^2 + y^2'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
use_petrov_galerkin = true
aux_lm = aux_lm
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type '
'-pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[]
(test/tests/variables/fe_monomial_const/monomial-const-3d.i)
[Mesh]
type = GeneratedMesh
dim = 3
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
nx = 21
ny = 21
nz = 21
elem_type = HEX8
[]
[Functions]
[./bc_fn]
type=ParsedFunction
expression=0
[../]
[./bc_fnt]
type = ParsedFunction
expression = 0
[../]
[./bc_fnb]
type = ParsedFunction
expression = 0
[../]
[./bc_fnl]
type = ParsedFunction
expression = 0
[../]
[./bc_fnr]
type = ParsedFunction
expression = 0
[../]
[./forcing_fn]
# type = ParsedFunction
# expression = 0
type = MTPiecewiseConst3D
[../]
[./solution]
type = MTPiecewiseConst3D
[../]
[]
[Variables]
[./u]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
# Note: MOOSE's DirichletBCs do not work properly with shape functions that do not
# have DOFs at the element edges. This test works because the solution
# has been designed to be zero at the boundary which is satisfied by the IC
# Ticket #1352
active = ''
[./bc_all]
type=FunctionDirichletBC
variable = u
boundary = 'top bottom left right'
function = bc_fn
[../]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1.e-9
[./Adaptivity]
[../]
[]
[Outputs]
execute_on = 'timestep_end'
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[]
(test/tests/variables/fe_hier/hier-3-2d.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 5
ny = 5
elem_type = QUAD9
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
expression = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
expression = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
expression = -6*x-6*y+(x*x*x)+(y*y*y)
[../]
[./solution]
type = ParsedGradFunction
expression = (x*x*x)+(y*y*y)
grad_x = 3*x*x
grad_y = 3*y*y
[../]
[]
[Variables]
[./u]
order = THIRD
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/mortar/aux-gap/gap.i)
[Mesh]
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[]
[secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[]
[]
[Variables]
[T]
block = '1 2'
[]
[lambda]
block = '10'
use_dual = true
[]
[]
[AuxVariables]
[gap]
block = '10'
[]
[]
[AuxKernels]
[gap]
type = WeightedGapAux
variable = gap
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = '-4 + x^2 + y^2'
[]
[exact_soln]
type = ParsedFunction
expression = 'x^2 + y^2'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[dofmap]
type = DOFMap
execute_on = 'initial'
[]
[]
(test/tests/nodalkernels/multiple-subdomains/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[sub]
type = SubdomainBoundingBoxGenerator
bottom_left = '0.5 0 0'
top_right = '1 1 0'
input = 'gen'
block_id = '1'
[]
[]
[Variables]
[u]
block = '0 1'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
[]
[]
[NodalKernels]
[source]
type = UserForcingFunctionNodalKernel
variable = u
block = '0 1'
function = '1'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/ad_reaction/ad_reaction.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[u]
[]
[]
[Kernels]
[diffusion]
type = ADDiffusion
variable = u
[]
[reaction]
type = ADReaction
variable = u
[]
[force]
type = ADBodyForce
variable = u
[]
[]
[BCs]
[left]
type = ADDirichletBC
boundary = left
variable = u
value = 0
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/hfem/lower-d-volumes.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 3
ny = 3
dim = 2
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
[]
[uhat]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[lambdab]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[]
[AuxVariables]
[v]
order = CONSTANT
family = MONOMIAL
block = 0
initial_condition = '1'
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = 0
[]
[source]
type = CoupledForce
variable = u
v = v
coef = '1'
block = 0
[]
[reaction]
type = Reaction
variable = uhat
rate = '1'
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[uhat_coupled]
type = CoupledForce
variable = uhat
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
v = lambdab
coef = '1'
[]
[]
[DGKernels]
[surface]
type = TestLowerDVolumes
variable = u
lowerd_variable = lambda
l = 1
n = 3
[]
[]
[BCs]
[all]
type = HFEMDirichletBC
boundary = 'left right top bottom'
variable = u
lowerd_variable = lambdab
uhat = uhat
[]
[]
[Postprocessors]
[intu]
type = ElementIntegralVariablePostprocessor
variable = u
block = 0
[]
[lambdanorm]
type = ElementL2Norm
variable = lambda
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Outputs]
[out]
# we hide lambda because it may flip sign due to element
# renumbering with distributed mesh
type = Exodus
hide = lambda
[]
[]
(test/tests/variables/fe_monomial_const/monomial-const-1d.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 100
elem_type = EDGE3
[]
[Functions]
[./bc_fn]
type=ParsedFunction
expression=0
[../]
[./forcing_fn]
type = MTPiecewiseConst1D
[../]
[./solution]
type = MTPiecewiseConst1D
[../]
[]
[Variables]
[./u]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
# Note: MOOSE's DirichletBCs do not work properly with shape functions that do not
# have DOFs at the element edges. This test works because the solution
# has been designed to be zero at the boundary which is satisfied by the IC
# Ticket #1352
active = ''
[./bc_all]
type=FunctionDirichletBC
variable = u
boundary = 'left right'
function = bc_fn
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1.e-9
[./Adaptivity]
[../]
[]
[Outputs]
execute_on = 'timestep_end'
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[]
(test/tests/bcs/penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = -4+x*x+y*y
[../]
[./solution]
type = ParsedGradFunction
value = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
active = 'bc_all'
[./bc_all]
type = FunctionPenaltyDirichletBC
variable = u
function = solution
boundary = 'top left right bottom'
penalty = 1e6
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-14
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/mortar/gap-conductance-2d-non-conforming/gap-conductance.i)
[Mesh]
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[./primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[../]
[./secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[../]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[./T]
block = '1 2'
[../]
[./lambda]
block = '10'
[../]
[]
[BCs]
[./neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[../]
[]
[Kernels]
[./conduction]
type = Diffusion
variable = T
block = '1 2'
[../]
[./sink]
type = Reaction
variable = T
block = '1 2'
[../]
[./forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[../]
[]
[Functions]
[./forcing_function]
type = ParsedFunction
expression = '-4 + x^2 + y^2'
[../]
[./exact_soln]
type = ParsedFunction
expression = 'x^2 + y^2'
[../]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[./mortar]
type = GapHeatConductanceTest
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
[../]
[]
[Materials]
[constant]
type = ADGenericConstantMaterial
prop_names = 'gap_conductance'
prop_values = '.03'
block = '1 2'
[]
[./ssm]
type = SpatialStatefulMaterial
block = '1 2'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type'
petsc_options_value = 'lu basic'
[]
[Outputs]
exodus = true
[dofmap]
type = DOFMap
execute_on = 'initial'
[]
[]
(test/tests/kernels/material_coupled_force/material_coupled_force.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
nx = 10
ymin = 0
ymax = 2
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./v1]
initial_condition = 3
[../]
[./v2]
[../]
[]
[ICs]
[./v2_ic]
type = FunctionIC
variable = v2
function = v2_func
[../]
[]
[Functions]
[./v2_func]
type = ParsedFunction
expression = 'x + 2 * y'
[../]
[./reference]
type = ParsedFunction
expression = '3 * (-1) * 3.5 + (x + 2 * y) * 15 * 1.2'
[../]
[]
[Materials]
[./mat]
type = GenericConstantMaterial
prop_names = 'm1 m2'
prop_values = '-1 15'
[../]
[]
[Kernels]
[./reaction]
type = Reaction
variable = u
[../]
[./coupled]
type = MatCoupledForce
variable = u
v = 'v1 v2'
coef = '3.5 1.2'
material_properties = 'm1 m2'
[../]
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = reference
variable = u
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_userobject.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
parallel_type = replicated
[]
[Variables]
[power_density]
family = L2_LAGRANGE
order = FIRST
[]
[]
[AuxVariables]
[./multi_layered_average]
family = LAGRANGE
order = FIRST
[../]
[]
[UserObjects]
[./multi_layered_average]
type = LayeredAverage
variable = power_density
direction = y
num_layers = 4
[../]
[]
[AuxKernels]
[./layered_aux]
type = SpatialUserObjectAux
variable = multi_layered_average
execute_on = 'nonlinear TIMESTEP_END'
user_object = multi_layered_average
[../]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Reaction
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[Postprocessors]
[layered_avg]
type = ElementAverageValue
block = '0'
variable = multi_layered_average
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_L2_Lagrange.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppUserObjectTransfer
user_object = multi_layered_average
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/variables/fe_hermite_convergence/hermite_converge_periodic.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 4
ny = 4
elem_type = QUAD4
# This test will not work in parallel with DistributedMesh enabled
# due to a bug in PeriodicBCs.
parallel_type = replicated
[]
[Functions]
[./bc_fn]
type = ParsedGradFunction
value = -sin(pi*x)*sin(pi*y)
grad_x = -pi*cos(pi*x)*sin(pi*y)
grad_y = -pi*sin(pi*x)*cos(pi*y)
[../]
[./bc_fnt]
type = ParsedFunction
expression = -pi*sin(pi*x)*cos(pi*y)
[../]
[./bc_fnb]
type = ParsedFunction
expression = pi*sin(pi*x)*cos(pi*y)
[../]
[./forcing_fn]
type = ParsedFunction
expression = -2*pi*pi*sin(pi*x)*sin(pi*y)-sin(pi*x)*sin(pi*y)
[../]
[]
[Variables]
[./u]
order = THIRD
family = HERMITE
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = u
auto_direction= 'x y'
[../]
[../]
[./bc_top]
type=FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type=FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = bc_fn
[../]
[./H1error]
type = ElementH1Error
variable = u
function = bc_fn
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = bc_fn
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
# We use higher-order quadrature to ensure that the forcing function
# is integrated accurately.
[./Quadrature]
order=ELEVENTH
[../]
[]
[Adaptivity]
steps = 2
marker = uniform
[./Markers]
[./uniform]
type = UniformMarker
mark = refine
[../]
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
print_mesh_changed_info = true
[]
(modules/phase_field/test/tests/KKS_system/nonlinear.i)
#
# This test checks if the thwo phase and lagrange multiplier solutions can be replicated
# with a two order parameter approach, where the second order parameter eta2 is a
# nonlinear variable that is set as eta2 := 1 - eta1 (using Reaction, CoupledForce, and BodyForce)
# The solution is reproduced.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmax = 5
[]
[AuxVariables]
[Fglobal]
order = CONSTANT
family = MONOMIAL
[]
[]
[Variables]
# concentration
[c]
order = FIRST
family = LAGRANGE
[InitialCondition]
type = FunctionIC
function = x/5
[]
[]
# order parameter 1
[eta1]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[]
# order parameter 2
[eta2]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[]
# phase concentration 1
[c1]
order = FIRST
family = LAGRANGE
initial_condition = 0.9
[]
# phase concentration 2
[c2]
order = FIRST
family = LAGRANGE
initial_condition = 0.1
[]
[]
[Materials]
# simple toy free energies
[f1] # = fd
type = DerivativeParsedMaterial
property_name = F1
coupled_variables = 'c1'
expression = '(0.9-c1)^2'
[]
[f2] # = fm
type = DerivativeParsedMaterial
property_name = F2
coupled_variables = 'c2'
expression = '(0.1-c2)^2'
[]
# Switching functions for each phase
[h1_eta]
type = SwitchingFunctionMaterial
h_order = HIGH
eta = eta1
function_name = h1
[]
[h2_eta]
type = SwitchingFunctionMaterial
h_order = HIGH
eta = eta2
function_name = h2
[]
# Coefficients for diffusion equation
[Dh1]
type = DerivativeParsedMaterial
material_property_names = 'D h1(eta1)'
expression = D*h1
property_name = Dh1
coupled_variables = eta1
[]
[Dh2]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta2)'
expression = D*h2
property_name = Dh2
coupled_variables = eta2
[]
# Barrier functions for each phase
[g1]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta1
function_name = g1
[]
[g2]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta2
function_name = g2
[]
# constant properties
[constants]
type = GenericConstantMaterial
prop_names = 'D L kappa'
prop_values = '0.7 0.7 0.2'
[]
[]
[Kernels]
#Kernels for diffusion equation
[diff_time]
type = TimeDerivative
variable = c
[]
[diff_c1]
type = MatDiffusion
variable = c
diffusivity = Dh1
v = c1
args = 'eta1'
[]
[diff_c2]
type = MatDiffusion
variable = c
diffusivity = Dh2
v = c2
args = 'eta2'
[]
# Kernels for Allen-Cahn equation for eta1
[deta1dt]
type = TimeDerivative
variable = eta1
[]
[ACBulkF1]
type = KKSMultiACBulkF
variable = eta1
Fj_names = 'F1 F2 '
hj_names = 'h1 h2 '
gi_name = g1
eta_i = eta1
wi = 0.2
coupled_variables = 'c1 c2 eta2'
[]
[ACBulkC1]
type = KKSMultiACBulkC
variable = eta1
Fj_names = 'F1 F2'
hj_names = 'h1 h2'
cj_names = 'c1 c2'
eta_i = eta1
coupled_variables = 'eta2'
[]
[ACInterface1]
type = ACInterface
variable = eta1
kappa_name = kappa
[]
# Phase concentration constraints
[chempot12]
type = KKSPhaseChemicalPotential
variable = c1
cb = c2
fa_name = F1
fb_name = F2
[]
[phaseconcentration]
type = KKSMultiPhaseConcentration
variable = c2
cj = 'c1 c2'
hj_names = 'h1 h2'
etas = 'eta1 eta2'
c = c
[]
# equation for eta2 = 1 - eta1
# 0 = eta2 + eta1 -1
[constraint_eta1] # eta2
type = Reaction
variable = eta2
[]
[constraint_eta2] # + eta1
type = CoupledForce
variable = eta2
coef = -1
v = eta1
[]
[constraint_one] # - 1
type = BodyForce
variable = eta2
[]
[]
[AuxKernels]
[Fglobal_total]
type = KKSMultiFreeEnergy
Fj_names = 'F1 F2 '
hj_names = 'h1 h2 '
gj_names = 'g1 g2 '
variable = Fglobal
w = 0.2
interfacial_vars = 'eta1 eta2 '
kappa_names = 'kappa kappa'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'lu nonzero'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-11
end_time = 350
dt = 10
[]
[VectorPostprocessors]
[c]
type = LineValueSampler
variable = c
start_point = '0 0 0'
end_point = '5 0 0'
num_points = 21
sort_by = x
[]
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(test/tests/userobjects/side_user_object_no_boundary_error/lower_d_side_boundary.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 3
ny = 3
dim = 2
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
[]
[uhat]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[lambdab]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[]
[AuxVariables]
[v]
order = CONSTANT
family = MONOMIAL
block = 0
initial_condition = '1'
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = 0
[]
[source]
type = CoupledForce
variable = u
v = v
coef = '1'
block = 0
[]
[reaction]
type = Reaction
variable = uhat
rate = '1'
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[uhat_coupled]
type = CoupledForce
variable = uhat
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
v = lambdab
coef = '1'
[]
[]
[DGKernels]
[surface]
type = HFEMDiffusion
variable = u
lowerd_variable = lambda
[]
[]
[BCs]
[all]
type = HFEMDirichletBC
boundary = 'left right top bottom'
variable = u
lowerd_variable = lambdab
uhat = uhat
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Postprocessors]
[avg]
type = SideAverageValue
boundary = 'left right top bottom'
[]
[]
(modules/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study_3d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 5
ny = 5
nz = 2
xmax = 5
ymax = 5
zmax = 2
[]
[]
[Variables/u]
[]
[Kernels]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[UserObjects/study]
type = ConeRayStudy
start_points = '2.5 2.5 0'
directions = '0 0 1'
half_cone_angles = 10
# Must be set with RayKernels that
# contribute to the residual
execute_on = PRE_KERNELS
# For outputting Rays
always_cache_traces = true
ray_data_name = weight
[]
[RayKernels/null]
type = NullRayKernel
[]
# Rays only hit the front surface
[RayBCs/kill]
type = KillRayBC
boundary = 'front'
[]
[RayKernels/line_source]
type = LineSourceRayKernel
variable = u
# Scale by the weights in the ConeRayStudy
ray_data_factor_names = weight
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[rays]
type = RayTracingExodus
study = study
execute_on = FINAL
[]
[]
[Adaptivity]
steps = 0 # 6 for pretty pictures
marker = marker
initial_marker = marker
max_h_level = 6
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.25
refine = 0.5
[]
[]
(test/tests/multiapps/grid-sequencing/fine.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 40
[]
[Variables]
[u]
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 1
solve_type = 'PJFNK'
petsc_options = '-snes_monitor_solution'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[coarse]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
positions = '0 0 0'
input_files = coarse.i
[]
[]
[Transfers]
[mesh_function_begin]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = coarse
source_variable = u
variable = u
execute_on = timestep_begin
[]
[]
(test/tests/userobjects/side_uo_with_lowerd_use/side-uo-with-lower-d-use.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = 0
ymax = 2
nx = 2
ny = 2
subdomain_ids = '1 2 3 4'
[]
[1to2]
type = SideSetsBetweenSubdomainsGenerator
input = gmg
primary_block = '1'
paired_block = '2'
new_boundary = 'onetwo'
[]
[2to1]
type = SideSetsBetweenSubdomainsGenerator
input = 1to2
primary_block = '2'
paired_block = '1'
new_boundary = 'twoone'
[]
[1to3]
type = SideSetsBetweenSubdomainsGenerator
input = 2to1
primary_block = '1'
paired_block = '3'
new_boundary = 'onethree'
[]
[3to1]
type = SideSetsBetweenSubdomainsGenerator
input = 1to3
primary_block = '3'
paired_block = '1'
new_boundary = 'threeone'
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = '1 2 3 4'
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = '1 2 3 4'
[]
[reaction]
type = Reaction
variable = u
rate = '1'
block = '1 2 3 4'
[]
[source]
type = BodyForce
variable = u
value = '1'
block = '1 2 3 4'
[]
[]
[DGKernels]
[surface]
type = HFEMDiffusion
variable = u
lowerd_variable = lambda
[]
[]
[BCs]
[all]
type = NeumannBC
boundary = 'left right top bottom'
variable = u
[]
[]
[UserObjects]
[onetwo_uo]
type = LowerDIntegralSideUserObject
boundary = onetwo
lowerd_variable = lambda
[]
[twoone_uo]
type = LowerDIntegralSideUserObject
boundary = twoone
lowerd_variable = lambda
[]
[onethree_uo]
type = LowerDIntegralSideUserObject
boundary = onethree
lowerd_variable = lambda
[]
[threeone_uo]
type = LowerDIntegralSideUserObject
boundary = threeone
lowerd_variable = lambda
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
(test/tests/variables/fe_hier/hier-3-3d.i)
[Mesh]
type = GeneratedMesh
dim = 3
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
nx = 1
ny = 1
nz = 1
elem_type = HEX27
# This problem only has 1 element, so using DistributedMesh in parallel
# isn't really an option, and we don't care that much about DistributedMesh
# in serial.
parallel_type = replicated
[]
[Functions]
[./bc_fnt]
type = ParsedFunction
expression = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
expression = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
expression = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 3*x*x
[../]
[./bc_fnk]
type = ParsedFunction
expression = -3*z*z
[../]
[./bc_fnf]
type = ParsedFunction
expression = 3*z*z
[../]
[./forcing_fn]
type = ParsedFunction
expression = -6*x-6*y-6*z+(x*x*x)+(y*y*y)+(z*z*z)
[../]
[./solution]
type = ParsedGradFunction
expression = (x*x*x)+(y*y*y)+(z*z*z)
grad_x = 3*x*x
grad_y = 3*y*y
grad_z = 3*z*z
[../]
[]
[Variables]
[./u]
order = THIRD
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = bc_fnt
[../]
[./bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bc_fnb
[../]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[./bc_front]
type = FunctionNeumannBC
variable = u
boundary = 'front'
function = bc_fnf
[../]
[./bc_back]
type = FunctionNeumannBC
variable = u
boundary = 'back'
function = bc_fnk
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/dgkernels/dg_displacement/dg_displacement.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
displacements = 'disp_x disp_y'
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[../]
[]
[AuxVariables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
expression = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[./disp_func]
type = ParsedFunction
expression = x
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./abs]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
[./dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
use_displaced_mesh = true
[../]
[]
[BCs]
[./all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_rel_tol = 1e-10
[]
[Outputs]
execute_on = 'timestep_end'
file_base = out
exodus = true
[]
[ICs]
[./disp_x_ic]
function = disp_func
variable = disp_x
type = FunctionIC
[../]
[]
(test/tests/variables/fe_hier/hier-2-1d.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 5
elem_type = EDGE3
[]
[Functions]
[./bc_fnl]
type = ParsedFunction
expression = -2*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 2*x
[../]
[./forcing_fn]
type = ParsedFunction
expression = -2+x*x
[../]
[./solution]
type = ParsedGradFunction
expression = x*x
grad_x = 2*x
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/mortar/convergence-studies/solution-continuity/continuity.i)
[Mesh]
second_order = true
[./left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = QUAD4
[../]
[./left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary_id = '0 1 2 3'
new_boundary_name = 'lb_bottom lb_right lb_top lb_left'
[../]
[./left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[../]
[./right_block]
type = GeneratedMeshGenerator
dim = 2
xmin = 1
xmax = 2
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = QUAD4
[../]
[./right_block_id]
type = SubdomainIDGenerator
input = right_block
subdomain_id = 2
[../]
[right_block_change_boundary_id]
type = RenameBoundaryGenerator
input = right_block_id
old_boundary_id = '0 1 2 3'
new_boundary_id = '100 101 102 103'
[]
[./combined]
type = MeshCollectionGenerator
inputs = 'left_block_id right_block_change_boundary_id'
[../]
[./block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'left_block right_block'
[../]
[right_right_sideset]
type = SideSetsAroundSubdomainGenerator
input = block_rename
new_boundary = rb_right
block = right_block
normal = '1 0 0'
[]
[right_left_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_right_sideset
new_boundary = rb_left
block = right_block
normal = '-1 0 0'
[]
[right_top_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_left_sideset
new_boundary = rb_top
block = right_block
normal = '0 1 0'
[]
[right_bottom_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_top_sideset
new_boundary = rb_bottom
block = right_block
normal = '0 -1 0'
[]
[secondary]
input = right_bottom_sideset
type = LowerDBlockFromSidesetGenerator
sidesets = 'lb_right'
new_block_id = '10001'
new_block_name = 'secondary_lower'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'rb_left'
new_block_id = '10000'
new_block_name = 'primary_lower'
[]
[]
[Variables]
[./T]
block = 'left_block right_block'
order = SECOND
[../]
[./lambda]
block = 'secondary_lower'
[../]
[]
[BCs]
[./neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = 'lb_bottom lb_top lb_left rb_bottom rb_right rb_top'
[../]
[]
[Kernels]
[./conduction]
type = Diffusion
variable = T
block = 'left_block right_block'
[../]
[./sink]
type = Reaction
variable = T
block = 'left_block right_block'
[../]
[./forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = 'left_block right_block'
[../]
[]
[Functions]
[./forcing_function]
type = ParsedFunction
expression = ''
[../]
[./exact_soln_primal]
type = ParsedFunction
expression = ''
[../]
[exact_soln_lambda]
type = ParsedFunction
expression = ''
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[./mortar]
type = EqualValueConstraint
primary_boundary = rb_left
secondary_boundary = lb_right
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
secondary_variable = T
variable = lambda
delta = 0.4
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Outputs]
csv = true
[dofmap]
type = DOFMap
execute_on = 'initial'
[]
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary_lower'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = 'left_block right_block'
[]
[h]
type = AverageElementSize
block = 'left_block right_block'
[]
[]
(test/tests/mortar/continuity-3d-non-conforming/continuity_penalty_sphere_hex.i)
[Mesh]
second_order = false
[file]
type = FileMeshGenerator
file = spheres_hex8.e
[]
[secondary]
input = file
type = LowerDBlockFromSidesetGenerator
new_block_id = 11
new_block_name = "secondary"
sidesets = '101'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
new_block_id = 12
new_block_name = "primary"
sidesets = '102'
[]
uniform_refine = 0
[]
[Problem]
error_on_jacobian_nonzero_reallocation = true
[]
[Variables]
[T]
block = '1 2'
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = '1 2'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = 'x^2 + y^2 + z^2 - 6'
[]
[exact_soln_primal]
type = ParsedFunction
expression = 'x^2 + y^2 + z^2'
[]
[exact_soln_lambda]
type = ParsedFunction
expression = '4'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = PenaltyEqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = '12'
secondary_subdomain = '11'
secondary_variable = T
correct_edge_dropping = true
penalty_value = 1.e5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 6'
[]
[Outputs]
exodus = true
[]
[Postprocessors]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = '1 2'
[]
[h]
type = AverageElementSize
block = '1 2'
[]
[]
(test/tests/kernels/hfem/3d-lower-d-volumes.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 3
ny = 3
nz = 3
dim = 3
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
[]
[uhat]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[lambdab]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[]
[AuxVariables]
[v]
order = CONSTANT
family = MONOMIAL
block = 0
initial_condition = '1'
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = 0
[]
[source]
type = CoupledForce
variable = u
v = v
coef = '1'
block = 0
[]
[reaction]
type = Reaction
variable = uhat
rate = '1'
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[uhat_coupled]
type = CoupledForce
variable = uhat
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
v = lambdab
coef = '1'
[]
[]
[DGKernels]
[surface]
type = TestLowerDVolumes
variable = u
lowerd_variable = lambda
l = 1
n = 3
[]
[]
[BCs]
[all]
type = HFEMDirichletBC
boundary = 'left right top bottom back front'
variable = u
lowerd_variable = lambdab
uhat = uhat
[]
[]
[Postprocessors]
[intu]
type = ElementIntegralVariablePostprocessor
variable = u
block = 0
[]
[lambdanorm]
type = ElementL2Norm
variable = lambda
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Outputs]
[out]
# we hide lambda because it may flip sign due to element
# renumbering with distributed mesh
type = Exodus
hide = lambda
[]
[]
(test/tests/mortar/continuity-3d-non-conforming/continuity_tet.i)
[Mesh]
second_order = false
[left_block]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 2
nz = 2
xmin = 0
xmax = 0.3
ymin = 0
ymax = .5
zmin = 0
zmax = .5
elem_type = TET4
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3 4 5'
new_boundary = 'lb_bottom lb_back lb_right lb_front lb_left lb_top'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[]
[right_block]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 2
nz = 2
xmin = 0.3
xmax = 0.6
ymin = 0
ymax = .5
zmin = 0
zmax = .5
elem_type = TET4
[]
[right_block_id]
type = SubdomainIDGenerator
input = right_block
subdomain_id = 2
[]
[right_block_change_boundary_id]
type = RenameBoundaryGenerator
input = right_block_id
old_boundary = '0 1 2 3 4 5'
new_boundary = '100 101 102 103 104 105'
[]
[combined]
type = MeshCollectionGenerator
inputs = 'left_block_id right_block_change_boundary_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'left_block right_block'
[]
[right_right_sideset]
type = SideSetsAroundSubdomainGenerator
input = block_rename
new_boundary = rb_right
block = right_block
normal = '1 0 0'
[]
[right_left_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_right_sideset
new_boundary = rb_left
block = right_block
normal = '-1 0 0'
[]
[right_top_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_left_sideset
new_boundary = rb_top
block = right_block
normal = '0 0 1'
[]
[right_bottom_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_top_sideset
new_boundary = rb_bottom
block = right_block
normal = '0 0 -1'
[]
[right_front_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_bottom_sideset
new_boundary = rb_front
block = right_block
normal = '0 1 0'
[]
[right_back_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_front_sideset
new_boundary = rb_back
block = right_block
normal = '0 -1 0'
[]
[secondary]
input = right_back_sideset
type = LowerDBlockFromSidesetGenerator
sidesets = 'lb_right'
new_block_id = '12'
new_block_name = 'secondary'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'rb_left'
new_block_id = '11'
new_block_name = 'primary'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T]
block = '1 2'
order = FIRST
[]
[lambda]
block = 'secondary'
family = MONOMIAL
order = CONSTANT
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = 'lb_back lb_front lb_left lb_top lb_bottom rb_right rb_top rb_bottom rb_front rb_back'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi) + 3*pi^2*sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_primal]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_lambda]
type = ParsedFunction
expression = 'pi*sin(pi*y)*sin(pi*z)*cos(pi*x)'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 'rb_left'
secondary_boundary = 'lb_right'
primary_subdomain = '11'
secondary_subdomain = '12'
variable = lambda
secondary_variable = T
delta = .1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type '
'-pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = 'left_block right_block'
[]
[h]
type = AverageElementSize
block = 'left_block right_block'
[]
[]
(test/tests/transfers/multiapp_conservative_transfer/sub_nearest_point.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.01 # to make sure the meshes don't align
xmax = 0.49 # to make sure the meshes don't align
ymax = 1
nx = 10
ny = 10
[]
[block1]
input = gen
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0.2 0.2 0'
top_right = '0.3 0.8 0'
[]
[]
[Variables]
[sink]
family = MONOMIAL
order = CONSTANT
[]
[]
[Functions]
[sink_func]
type = ParsedFunction
expression = '5e2*x*(0.5-x)+5e1'
[]
[]
[Kernels]
[reaction]
type = Reaction
variable = sink
[]
[coupledforce]
type = BodyForce
variable = sink
function = sink_func
[]
[]
[AuxVariables]
[from_parent]
block = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[sink]
type = ElementIntegralVariablePostprocessor
block = 1
variable = sink
[]
[from_parent_pp]
type = ElementIntegralVariablePostprocessor
block = 1
variable = from_parent
execute_on = 'transfer'
[]
[]
[Outputs]
exodus = true
[console]
type = Console
execute_on = 'timestep_end timestep_begin'
[]
[]
(test/tests/tag/tag_residual_call.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
solve = false
extra_tag_vectors = 'vec_tag1 vec_tag2'
[]
[Variables]
[u]
initial_condition = 1
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
extra_vector_tags = 'vec_tag1'
[]
[react]
type = Reaction
variable = u
extra_vector_tags = 'vec_tag1 vec_tag2'
[]
[]
[UserObjects]
[call_residual]
type = CallTaggedResidualsTest
residual_tags = 'vec_tag1 vec_tag2'
[]
[]
[Executioner]
type = Steady
[]
(test/tests/mortar/convergence-studies/gap-conductance/gap-conductance.i)
[Problem]
error_on_jacobian_nonzero_reallocation = true
[]
[Mesh]
second_order = true
[./left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = QUAD4
[../]
[./left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary_id = '0 1 2 3'
new_boundary = 'lb_bottom lb_right lb_top lb_left'
[../]
[./left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[../]
[./right_block]
type = GeneratedMeshGenerator
dim = 2
xmin = 2
xmax = 3
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = QUAD4
[../]
[./right_block_id]
type = SubdomainIDGenerator
input = right_block
subdomain_id = 2
[../]
[right_block_change_boundary_id]
type = RenameBoundaryGenerator
input = right_block_id
old_boundary_id = '0 1 2 3'
new_boundary_id = '100 101 102 103'
[]
[./combined]
type = MeshCollectionGenerator
inputs = 'left_block_id right_block_change_boundary_id'
[../]
[./block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'left_block right_block'
[../]
[right_right_sideset]
type = SideSetsAroundSubdomainGenerator
input = block_rename
new_boundary = rb_right
block = right_block
normal = '1 0 0'
[]
[right_left_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_right_sideset
new_boundary = rb_left
block = right_block
normal = '-1 0 0'
[]
[right_top_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_left_sideset
new_boundary = rb_top
block = right_block
normal = '0 1 0'
[]
[right_bottom_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_top_sideset
new_boundary = rb_bottom
block = right_block
normal = '0 -1 0'
[]
[secondary]
input = right_bottom_sideset
type = LowerDBlockFromSidesetGenerator
sidesets = 'lb_right'
new_block_id = '10001'
new_block_name = 'secondary_lower'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'rb_left'
new_block_id = '10000'
new_block_name = 'primary_lower'
[]
[]
[Variables]
[./T]
block = 'left_block right_block'
order = SECOND
[../]
[./lambda]
block = 'secondary_lower'
family = MONOMIAL
order = CONSTANT
[../]
[]
[BCs]
[./neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = 'lb_bottom lb_top lb_left rb_bottom rb_right rb_top'
[../]
[]
[Kernels]
[./conduction]
type = Diffusion
variable = T
block = 'left_block right_block'
[../]
[./sink]
type = Reaction
variable = T
block = 'left_block right_block'
[../]
[./forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = 'left_block right_block'
[../]
[]
[Functions]
[./forcing_function]
type = ParsedFunction
expression = ''
[../]
[./exact_soln_primal]
type = ParsedFunction
expression = ''
[../]
[exact_soln_lambda]
type = ParsedFunction
expression = ''
[]
[mms_secondary]
type = ParsedFunction
expression = ''
[]
[mms_primary]
type = ParsedFunction
expression = ''
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[./mortar]
type = GapHeatConductanceTest
primary_boundary = rb_left
secondary_boundary = lb_right
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
secondary_variable = T
variable = lambda
secondary_gap_conductance = 1
primary_gap_conductance = 1
secondary_mms_function = mms_secondary
primary_mms_function = mms_primary
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[dofmap]
type = DOFMap
execute_on = 'initial'
[]
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary_lower'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = 'left_block right_block'
[]
[h]
type = AverageElementSize
block = 'left_block right_block'
[]
[]
(test/tests/preconditioners/pbp/pbp_dg_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[../]
[./v]
order = FIRST
family = MONOMIAL
[../]
[]
[Preconditioning]
[./PBP]
type = PBP
solve_order = 'u v'
preconditioner = 'AMG AMG'
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[./abs_u]
type = Reaction
variable = u
[../]
[./forcing_u]
type = BodyForce
variable = u
function = forcing_fn
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[./abs_v]
type = Reaction
variable = v
[../]
[./forcing_v]
type = BodyForce
variable = v
function = forcing_fn
[../]
[./conv_v]
type = CoupledForce
variable = v
v = u
[../]
[]
[DGKernels]
[./dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[../]
[./dg_diff_2]
type = DGDiffusion
variable = v
epsilon = -1
sigma = 6
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
value = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[]
[BCs]
[./all_u]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[./all_v]
type = DGFunctionDiffusionDirichletBC
variable = v
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[]
[Problem]
type = FEProblem
error_on_jacobian_nonzero_reallocation = true
[]
[Executioner]
type = Steady
l_max_its = 10
nl_max_its = 10
solve_type = JFNK
[]
[Outputs]
exodus = true
[]
(test/tests/mortar/continuity-3d-non-conforming/continuity_mixed.i)
[Mesh]
second_order = false
[file]
type = FileMeshGenerator
file = mixed_mesh.e
[]
[secondary]
input = file
type = LowerDBlockFromSidesetGenerator
new_block_id = 11
new_block_name = "secondary"
sidesets = '101'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
new_block_id = 12
new_block_name = "primary"
sidesets = '102'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T]
block = '1 2'
[]
[lambda]
block = 'secondary'
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = '1 2'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi) + 3*pi^2*sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_primal]
type = ParsedFunction
expression = 'sin(x*pi)*sin(y*pi)*sin(z*pi)'
[]
[exact_soln_lambda]
type = ParsedFunction
expression = 'pi*sin(pi*y)*sin(pi*z)*cos(pi*x)'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = '12'
secondary_subdomain = '11'
variable = lambda
secondary_variable = T
delta = 0.1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type '
'-pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = '1 2'
[]
[h]
type = AverageElementSize
block = '1 2'
[]
[]
(test/tests/bcs/ad_penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = -4+x*x+y*y
[../]
[./solution]
type = ParsedGradFunction
value = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = ADDiffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = ADBodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
active = 'bc_all'
[./bc_all]
type = ADFunctionPenaltyDirichletBC
variable = u
function = solution
boundary = 'top left right bottom'
penalty = 1e6
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-14
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/2d_mbb_pde.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-8
power = 3
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 150
ny = 50
xmin = 0
xmax = 30
ymin = 0
ymax = 10
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold_y
nodes = 0
[]
[push]
type = ExtraNodesetGenerator
input = node
new_boundary = push
coord = '30 10 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.15 # radius coeff
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_y
boundary = hold_y
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top'
coefficient = 10
[]
[boundary_penalty_right]
type = ADRobinBC
variable = Dc
boundary = 'right'
coefficient = 10
[]
[]
[NodalKernels]
[push]
type = NodalGravity
variable = disp_y
boundary = push
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
line_search = none
nl_abs_tol = 1e-4
l_max_its = 200
start_time = 0.0
dt = 1.0
num_steps = 70
[]
[Outputs]
[out]
type = CSV
execute_on = 'INITIAL TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[]
[Controls]
[first_period]
type = TimePeriod
start_time = 0.0
end_time = 10
enable_objects = 'BCs::boundary_penalty_right'
execute_on = 'initial timestep_begin'
[]
[]
(test/tests/variables/fe_hermite/hermite-3-1d.i)
###########################################################
# This is a simple test demonstrating the use of the
# Hermite variable type.
#
# @Requirement F3.10
###########################################################
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 5
elem_type = EDGE3
[]
[Functions]
[./bc_fnl]
type = ParsedFunction
expression = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
expression = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
expression = -6*x+(x*x*x)
[../]
[./solution]
type = ParsedGradFunction
value = x*x*x
grad_x = 3*x*x
[../]
[]
# Hermite Variable type
[Variables]
[./u]
order = THIRD
family = HERMITE
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = Diffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = bc_fnl
[../]
[./bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = bc_fnr
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/mortar/continuity-2d-non-conforming/dual-soln-continuity-vcp.i)
[Mesh]
second_order = false
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[]
[secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[]
[]
[Variables]
[T]
block = '1 2'
order = FIRST
[]
[lambda]
block = '10'
order = FIRST
use_dual = true
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression= '-4 + x^2 + y^2'
[]
[exact_soln]
type = ParsedFunction
expression= 'x^2 + y^2'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
[]
[]
[Preconditioning]
[vcp]
type = VCP
full = true
lm_variable = 'lambda'
primary_variable = 'T'
preconditioner = 'AMG'
is_lm_coupling_diagonal = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = ' -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = ' NONZERO 1e-15'
[]
[Outputs]
file_base = 'dual-soln-continuity_out'
exodus = true
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/2d_mbb_pde_amr.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-8
power = 3
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 30
ny = 10
xmin = 0
xmax = 30
ymin = 0
ymax = 10
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push]
type = ExtraNodesetGenerator
input = node
new_boundary = push
coord = '30 10 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.15 # radius coeff
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top'
coefficient = 10
[]
[boundary_penalty_right]
type = ADRobinBC
variable = Dc
boundary = 'right'
coefficient = 10
[]
[]
[NodalKernels]
[push]
type = NodalGravity
variable = disp_y
boundary = push
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
line_search = none
nl_abs_tol = 1e-4
l_max_its = 200
start_time = 0.0
dt = 1.0
num_steps = 70
[]
[Outputs]
[out]
type = CSV
execute_on = 'INITIAL TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[]
[Controls]
[first_period]
type = TimePeriod
start_time = 0.0
end_time = 40
enable_objects = 'BCs::boundary_penalty_right'
execute_on = 'initial timestep_begin'
[]
[]
[Adaptivity]
max_h_level = 2
recompute_markers_during_cycles = true
interval = 1
cycles_per_step = 1
marker = density_marker
[Indicators]
[density_jump]
type = ValueJumpIndicator
variable = mat_den_nodal
[]
[]
[Markers]
[density_marker]
type = ErrorToleranceMarker
indicator = density_jump
coarsen = 0.1
refine = 0.1
[]
[]
[]
(test/tests/mortar/continuity-2d-non-conforming/dual-soln-continuity.i)
[Mesh]
second_order = false
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[./primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[../]
[./secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[../]
[]
[Variables]
[./T]
block = '1 2'
order = FIRST
[../]
[./lambda]
block = '10'
order = FIRST
use_dual = true
[../]
[]
[BCs]
[./neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[../]
[]
[Kernels]
[./conduction]
type = Diffusion
variable = T
block = '1 2'
[../]
[./sink]
type = Reaction
variable = T
block = '1 2'
[../]
[./forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[../]
[]
[Functions]
[./forcing_function]
type = ParsedFunction
expression= '-4 + x^2 + y^2'
[../]
[./exact_soln]
type = ParsedFunction
expression= 'x^2 + y^2'
[../]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[./mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/divergence_aux/test_fe.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1.5 1 0.1'
dy = '1.3 1 0.9'
ix = '2 4 1'
iy = '2 3 3'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[add_inner_boundaries_top]
type = SideSetsAroundSubdomainGenerator
input = cmg
new_boundary = 'block_2_top'
block = 2
normal = '0 1 0'
[]
[add_inner_boundaries_bot]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_top
new_boundary = 'block_2_bot'
block = 2
normal = '0 -1 0'
[]
[add_inner_boundaries_right]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_bot
new_boundary = 'block_2_right'
block = 2
normal = '1 0 0'
[]
[add_inner_boundaries_left]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_right
new_boundary = 'block_2_left'
block = 2
normal = '-1 0 0'
[]
[]
[Variables]
[u]
[]
[v]
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[reaction_u]
type = Reaction
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[reaction_v]
type = Reaction
variable = v
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[divergence]
type = ADDivergenceAux
variable = div
u = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 1
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[top]
type = DirichletBC
variable = v
boundary = top
value = 1
[]
[bottom]
type = DirichletBC
variable = v
boundary = bottom
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[int_divergence]
type = ElementL1Error
block = 2
variable = div
function = 0
[]
[sum_surface_current]
type = ParsedPostprocessor
function = 's1 - s2 + s3 - s4'
pp_names = 's1 s2 s3 s4'
[]
[s1]
type = SideIntegralVariablePostprocessor
boundary = 'block_2_right'
variable = 'u'
[]
[s2]
type = SideIntegralVariablePostprocessor
boundary = 'block_2_left'
variable = 'u'
[]
[s3]
type = SideIntegralVariablePostprocessor
boundary = 'block_2_top'
variable = 'v'
[]
[s4]
type = SideIntegralVariablePostprocessor
boundary = 'block_2_bot'
variable = 'v'
[]
[]
[Outputs]
csv = true
hide = 's1 s2 s3 s4'
[]
(modules/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 5
ymax = 5
[]
[]
[Variables/u]
[]
[Kernels]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[UserObjects/study]
type = ConeRayStudy
start_points = '1 1.5 0'
directions = '2 1 0'
half_cone_angles = 2.5
ray_data_name = weight
# Must be set with RayKernels that
# contribute to the residual
execute_on = PRE_KERNELS
# For outputting Rays
always_cache_traces = true
[]
[RayBCs]
[reflect]
type = ReflectRayBC
boundary = 'right'
[]
[kill_rest]
type = KillRayBC
boundary = 'top'
[]
[]
[RayKernels/line_source]
type = LineSourceRayKernel
variable = u
# Scale by the weights in the ConeRayStudy
ray_data_factor_names = weight
[]
[Outputs]
exodus = true
[rays]
type = RayTracingExodus
study = study
execute_on = FINAL
[]
[]
[Adaptivity]
steps = 0 # 6 for pretty pictures
marker = marker
initial_marker = marker
max_h_level = 6
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.25
refine = 0.5
[]
[]
(test/tests/mortar/continuity-3d-non-conforming/continuity_sphere_hex.i)
[Mesh]
second_order = false
[file]
type = FileMeshGenerator
file = spheres_hex8.e
[]
[secondary]
input = file
type = LowerDBlockFromSidesetGenerator
new_block_id = 11
new_block_name = "secondary"
sidesets = '101'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
new_block_id = 12
new_block_name = "primary"
sidesets = '102'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T]
block = '1 2'
[]
[lambda]
block = 'secondary'
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln_primal
variable = T
boundary = '1 2'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = 'x^2 + y^2 + z^2 - 6'
[]
[exact_soln_primal]
type = ParsedFunction
expression = 'x^2 + y^2 + z^2'
[]
[exact_soln_lambda]
type = ParsedFunction
expression = '4'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = '12'
secondary_subdomain = '11'
variable = lambda
secondary_variable = T
correct_edge_dropping = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type '
'-pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = '1 2'
[]
[h]
type = AverageElementSize
block = '1 2'
[]
[]
(test/tests/variables/previous_newton_iteration/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Problem]
previous_nl_solution_required = true
[]
[Functions]
[./v_fn]
type = ParsedFunction
expression = -4+(x*x+y*y)+1
[../]
[./left_u_bc_fn]
type = ParsedFunction
expression = -2*x
[../]
[./top_u_bc_fn]
type = ParsedFunction
expression = 2*y
[../]
[./right_u_bc_fn]
type = ParsedFunction
expression = 2*x
[../]
[./bottom_u_bc_fn]
type = ParsedFunction
expression = -2*y
[../]
[]
[AuxVariables]
[./a]
order = SECOND
[../]
[./v]
order = SECOND
[../]
[]
[AuxKernels]
[./ak_a]
type = QuotientAux
variable = a
numerator = v
denominator = u
[../]
[./ak_v]
type = FunctionAux
variable = v
function = v_fn
[../]
[]
[Variables]
[./u]
order = SECOND
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
variable = u
value = 1
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[./react]
type = Reaction
variable = u
[../]
[./cv_u]
type = CoupledForceLagged
variable = u
v = v
[../]
[]
[BCs]
[./u_bc_left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = left_u_bc_fn
[../]
[./u_bc_top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = top_u_bc_fn
[../]
[./u_bc_right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = right_u_bc_fn
[../]
[./u_bc_bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bottom_u_bc_fn
[../]
[]
[Preconditioning]
[./pc]
type = SMP
full = true
solve_type = PJFNK
[../]
[]
[Executioner]
type = Steady
# to get multiple NL iterations
l_tol = 1e-3
nl_rel_tol = 1e-10
[]
[Outputs]
[./out]
type = Exodus
execute_on = 'nonlinear'
[../]
[]
(test/tests/mortar/continuity-2d-non-conforming/sequencing-stateful-soln-continuity.i)
[Mesh]
second_order = true
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[./primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[../]
[./secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[../]
[]
[Variables]
[./T]
block = '1 2'
order = SECOND
[../]
[./lambda]
block = '10'
[../]
[]
[AuxVariables]
[ssm]
order = CONSTANT
family = MONOMIAL
block = '1 2'
[]
[]
[BCs]
[./neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[../]
[]
[Kernels]
[./conduction]
type = Diffusion
variable = T
block = '1 2'
[../]
[./sink]
type = Reaction
variable = T
block = '1 2'
[../]
[./forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[../]
[]
[AuxKernels]
[ssm]
type = MaterialRealAux
variable = ssm
property = diffusivity
block = '1 2'
[]
[]
[Materials]
[./ssm]
type = SpatialStatefulMaterial
block = '1 2'
[../]
[]
[Functions]
[./forcing_function]
type = ParsedFunction
expression= '-4 + x^2 + y^2'
[../]
[./exact_soln]
type = ParsedFunction
expression= 'x^2 + y^2'
[../]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[./mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
solve_type = NEWTON
type = Steady
nl_abs_tol = 1e-12
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
num_grids = 2
[]
[Outputs]
exodus = true
[]
[Adaptivity]
steps = 1
marker = uniform
[Markers]
[uniform]
type = UniformMarker
mark = refine
[]
[]
[]
(test/tests/misc/check_error/kernel_with_aux_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./v]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rea]
type = Reaction
variable = v
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(test/tests/mortar/aux-gap/mismatch.i)
[Mesh]
second_order = true
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
[]
[primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[]
[secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[]
[]
[Variables]
[T]
block = '1 2'
order = SECOND
[]
[lambda]
block = '10'
use_dual = true
order = SECOND
[]
[]
[AuxVariables]
[gap]
block = '10'
[]
[]
[AuxKernels]
[gap]
type = WeightedGapAux
variable = gap
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
[]
[]
[BCs]
[neumann]
type = FunctionGradientNeumannBC
exact_solution = exact_soln
variable = T
boundary = '3 4 5 6 7 8'
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = T
block = '1 2'
[]
[sink]
type = Reaction
variable = T
block = '1 2'
[]
[forcing_function]
type = BodyForce
variable = T
function = forcing_function
block = '1 2'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = '-4 + x^2 + y^2'
[]
[exact_soln]
type = ParsedFunction
expression = 'x^2 + y^2'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = EqualValueConstraint
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu basic NONZERO 1e-15'
[]
[Outputs]
exodus = true
[dofmap]
type = DOFMap
execute_on = 'initial'
[]
[]
(modules/combined/examples/optimization/3d_mbb.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-8
power = 2
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 3
nx = 60
ny = 20
nz = 20
xmin = 0
xmax = 30
ymin = 0
ymax = 10
zmin = 0
zmax = 10
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold_y
coord = '0 0 0; 0 0 10'
[]
[push]
type = ExtraNodesetGenerator
input = node
new_boundary = push
coord = '30 10 5'
[]
[]
[Variables]
[disp_z]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Emin]
family = MONOMIAL
order = CONSTANT
initial_condition = ${Emin}
[]
[power]
family = MONOMIAL
order = CONSTANT
initial_condition = ${power}
[]
[E0]
family = MONOMIAL
order = CONSTANT
initial_condition = ${E0}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 0.15 # radius coeff
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_y
boundary = hold_y
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'left top front back'
coefficient = 10
[]
[boundary_penalty_right]
type = ADRobinBC
variable = Dc
boundary = 'right'
coefficient = 10
[]
[]
[NodalKernels]
[push]
type = NodalGravity
variable = disp_y
boundary = push
gravity_value = -1
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'Emin mat_den power E0'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
incremental = false
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
line_search = none
nl_abs_tol = 1e-4
l_max_its = 200
start_time = 0.0
dt = 1.0
num_steps = 70
[]
[Outputs]
[out]
type = Exodus
execute_on = 'INITIAL TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Controls]
[first_period]
type = TimePeriod
start_time = 0.0
end_time = 10
enable_objects = 'BCs::boundary_penalty_right'
execute_on = 'initial timestep_begin'
[]
[]
(modules/stochastic_tools/test/include/kernels/MaterialReaction.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// 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 "Reaction.h"
class MaterialReaction : public Reaction
{
public:
static InputParameters validParams();
MaterialReaction(const InputParameters & parameters);
protected:
virtual Real computeQpResidual();
virtual Real computeQpJacobian();
const MaterialProperty<Real> & _coeff;
};
(test/include/kernels/RenamedKernel.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// 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 "Reaction.h"
class RenamedKernel : public Reaction
{
public:
static InputParameters validParams();
RenamedKernel(const InputParameters & parameters);
protected:
virtual Real computeQpResidual() override;
virtual Real computeQpJacobian() override;
Real _coef;
};
(framework/include/kernels/MassMatrix.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// 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 "Reaction.h"
/**
* Computes a finite element mass matrix meant for use in preconditioning schemes which require one
*/
class MassMatrix : public Reaction
{
public:
static InputParameters validParams();
MassMatrix(const InputParameters & parameters);
virtual void computeResidual() override {}
};
(test/include/kernels/DeprecatedParamKernel.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// 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 "Reaction.h"
class DeprecatedParamKernel : public Reaction
{
public:
static InputParameters validParams();
DeprecatedParamKernel(const InputParameters & parameters);
protected:
virtual Real computeQpResidual() override;
virtual Real computeQpJacobian() override;
Real _coef;
};
(test/include/kernels/ExpiredKernel.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// 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 "Reaction.h"
class ExpiredKernel : public Reaction
{
public:
static InputParameters validParams();
ExpiredKernel(const InputParameters & parameters);
protected:
virtual Real computeQpResidual() override;
virtual Real computeQpJacobian() override;
Real _coef;
};
(test/include/kernels/DeprecatedKernel.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// 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 "Reaction.h"
class DeprecatedKernel : public Reaction
{
public:
static InputParameters validParams();
DeprecatedKernel(const InputParameters & parameters);
protected:
virtual Real computeQpResidual();
virtual Real computeQpJacobian();
Real _coef;
};