- functionThe analytic solution to compare against
C++ Type:FunctionName
Controllable:No
Description:The analytic solution to compare against
- variableThe name of the variable that this object operates on
C++ Type:std::vector<VariableName>
Controllable:No
Description:The name of the variable that this object operates on
ElementH1Error
Computes the H1 error between a variable and a function
The H1 error is a popular metric of error as it is associated with the natural norm for commonly used finite element spaces.
where u
is the variable parameter, f
the function parameter, the norm exponent and the domain of integration, which may be limited to certain blocks using the block
parameter.
Example input syntax
In this example, we compute a variety of error between a variable and a function with the H1, L2 and H1-semi norms to verify that the H1 error is the sum of the L2 error and the H1-semi error.
[Postprocessors]
[./dofs]
type = NumDOFs
execute_on = 'initial timestep_end'
[../]
[./h1_error]
type = ElementH1Error
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[./h1_semi]
type = ElementH1SemiError
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[./l2_error]
type = ElementL2Error
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[]
(test/tests/postprocessors/element_h1_error_pps/element_h1_error_pp_test.i)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
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Options:NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, TRANSFER, ALWAYS
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
- p2The exponent used in the norm.
Default:2
C++ Type:double
Controllable:No
Description:The exponent used in the norm.
- 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.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- outputsVector of output names were you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names were you would like to restrict the output of variables(s) associated with this object
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (test/tests/variables/fe_hier/hier-1-3d.i)
- (test/tests/indicators/laplacian_jump_indicator/biharmonic.i)
- (test/tests/variables/fe_hier/hier-3-3d.i)
- (test/tests/variables/fe_hier/hier-1-2d.i)
- (test/tests/variables/fe_hier/hier-1-1d.i)
- (test/tests/variables/fe_hermite/hermite-3-3d.i)
- (test/tests/variables/fe_hier/hier-3-2d.i)
- (test/tests/variables/fe_hier/hier-2-2d.i)
- (test/tests/variables/fe_monomial_const/monomial-const-3d.i)
- (test/tests/variables/fe_monomial_const/monomial-const-2d.i)
- (test/tests/bcs/penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
- (test/tests/nodalkernels/penalty_dirichlet/nodal_penalty_dirichlet.i)
- (test/tests/outputs/debug/show_var_residual_norms_debug.i)
- (test/tests/postprocessors/element_h1_error_pps/element_h1_error_pp_test.i)
- (test/tests/bcs/penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
- (test/tests/indicators/laplacian_jump_indicator/biharmonic_transient.i)
- (test/tests/bcs/ad_penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
- (test/tests/variables/fe_hermite/hermite-3-1d.i)
- (test/tests/variables/fe_hier/hier-2-3d.i)
- (test/tests/outputs/debug/show_var_residual_norms.i)
- (test/tests/variables/fe_hier/hier-3-1d.i)
- (test/tests/variables/fe_monomial_const/monomial-const-1d.i)
- (test/tests/misc/check_error/coupled_grad_without_declare.i)
- (test/tests/postprocessors/num_vars/num_vars.i)
- (test/tests/variables/fe_hier/hier-2-1d.i)
- (test/tests/variables/fe_hermite/hermite-3-2d.i)
- (test/tests/bcs/ad_penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
- (test/tests/postprocessors/mms_slope/mms_slope_test.i)
- (test/tests/variables/fe_hermite_convergence/hermite_converge_periodic.i)
- (test/tests/variables/fe_hermite_convergence/hermite_converge_dirichlet.i)
(test/tests/postprocessors/element_h1_error_pps/element_h1_error_pp_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
xmin = 0
xmax = 2
ymin = 0
ymax = 2
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
active = 'forcing_func u_func'
[./forcing_func]
type = ParsedFunction
#value = alpha*alpha*pi*pi*(y*y*sin(alpha*pi*x*y)+y*y*sin(alpha*pi*x*y))
value = alpha*alpha*pi*pi*sin(alpha*pi*x)
vars = 'alpha'
vals = '4'
[../]
[./u_func]
type = ParsedGradFunction
#value = sin(alpha*pi*x*y)
#grad_x = alpha*pi*y*cos(alpha*pi*x*y)
#grad_y = alpha*pi*x*cos(alpha*pi*x*y)
value = sin(alpha*pi*x)
grad_x = alpha*pi*cos(alpha*pi*x)
vars = 'alpha'
vals = '4'
[../]
[]
[Kernels]
active = 'diff forcing'
[./diff]
type = Diffusion
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_func
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
boundary = '1'
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = '3'
value = 0
[../]
[]
[Executioner]
type = Steady
[./Adaptivity]
refine_fraction = 1.0
coarsen_fraction = 0.0
max_h_level = 10
steps = 4
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
execute_on = 'initial timestep_end'
[../]
[./h1_error]
type = ElementH1Error
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[./h1_semi]
type = ElementH1SemiError
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[./l2_error]
type = ElementL2Error
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
file_base = out
exodus = false
csv = 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
value = 1
[../]
[./bc_fnb]
type = ParsedFunction
value = -1
[../]
[./bc_fnl]
type = ParsedFunction
value = -1
[../]
[./bc_fnr]
type = ParsedFunction
value = 1
[../]
[./bc_fnf]
type = ParsedFunction
value = 1
[../]
[./bc_fnk]
type = ParsedFunction
value = -1
[../]
[./forcing_fn]
type = ParsedFunction
value = x+y+z
[../]
[./solution]
type = ParsedGradFunction
value = 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
csv = true
[]
(test/tests/indicators/laplacian_jump_indicator/biharmonic.i)
[GlobalParams]
# Parameters used by Functions.
vars = 'c'
vals = '50'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -.5
xmax = .5
ymin = -.5
ymax = .5
nx = 10
ny = 10
[]
[Variables]
[./u]
order = THIRD
family = HERMITE
[../]
[]
[Kernels]
[./biharmonic]
type = Biharmonic
variable = u
[../]
[./body_force]
type = BodyForce
variable = u
function = forcing_func
[../]
[]
[BCs]
active = 'all_value all_flux'
[./all_value]
type = FunctionPenaltyDirichletBC
variable = u
boundary = 'left right top bottom'
function = u_func
penalty = 1e10
[../]
[./all_flux]
type = FunctionPenaltyFluxBC
variable = u
boundary = 'left right top bottom'
function = u_func
penalty = 1e10
[../]
[./all_laplacian]
type = BiharmonicLapBC
variable = u
boundary = 'left right top bottom'
laplacian_function = lapu_func
[../]
[]
[Adaptivity]
[Indicators]
[error]
type = LaplacianJumpIndicator
variable = u
scale_by_flux_faces = true
[]
[]
[]
[Executioner]
type = Steady
# Note: the unusually tight tolerances here are due to the penalty
# BCs (currently the only way of accurately Dirichlet boundary
# conditions on Hermite elements in MOOSE).
nl_rel_tol = 1.e-15
l_tol = 1.e-15
# We have exact Jacobians
solve_type = 'NEWTON'
# Use 6x6 quadrature to ensure the forcing function is integrated
# accurately.
[./Quadrature]
type = GAUSS
order = ELEVENTH
[../]
[]
[Functions]
[./u_func]
type = ParsedGradFunction
value = 'exp(-c*(x^2+y^2))'
grad_x = '-2*c*exp(-c*(x^2+y^2))*x'
grad_y = '-2*c*exp(-c*(x^2+y^2))*y'
[../]
[./lapu_func]
type = ParsedFunction
value = '4*c*(c*(x^2+y^2) - 1)*exp(-c*(x^2+y^2))'
[../]
[./forcing_func]
type = ParsedFunction
value = '16*c^2*(c^2*(x^2+y^2)^2 - 4*c*(x^2+y^2) + 2)*exp(-c*(x^2+y^2))'
[../]
[]
[Postprocessors]
[./l2_error]
type = ElementL2Error
variable = u
function = u_func
[../]
[./h1_error]
type = ElementH1Error
variable = u
function = u_func
[../]
[]
[Outputs]
exodus = true
[]
(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
value = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
value = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
value = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 3*x*x
[../]
[./bc_fnk]
type = ParsedFunction
value = -3*z*z
[../]
[./bc_fnf]
type = ParsedFunction
value = 3*z*z
[../]
[./forcing_fn]
type = ParsedFunction
value = -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 = 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
csv = 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
value = 1
[../]
[./bc_fnb]
type = ParsedFunction
value = -1
[../]
[./bc_fnl]
type = ParsedFunction
value = -1
[../]
[./bc_fnr]
type = ParsedFunction
value = 1
[../]
[./forcing_fn]
type = ParsedFunction
value = x+y
[../]
[./solution]
type = ParsedGradFunction
value = 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
csv = 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
value = -1
[../]
[./bc_fnr]
type = ParsedFunction
value = 1
[../]
[./forcing_fn]
type = ParsedFunction
value = x
[../]
[./solution]
type = ParsedGradFunction
value = 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
csv = 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
value = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
value = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
value = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 3*x*x
[../]
[./bc_fnk]
type = ParsedFunction
value = -3*z*z
[../]
[./bc_fnf]
type = ParsedFunction
value = 3*z*z
[../]
[./forcing_fn]
type = ParsedFunction
value = -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
csv = 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
value = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
value = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
value = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
value = -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 = 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
csv = 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
value = 2*y
[../]
[./bc_fnb]
type = ParsedFunction
value = -2*y
[../]
[./bc_fnl]
type = ParsedFunction
value = -2*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 2*x
[../]
[./forcing_fn]
type = ParsedFunction
value = -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]
[./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
csv = 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
value=0
[../]
[./bc_fnt]
type = ParsedFunction
value = 0
[../]
[./bc_fnb]
type = ParsedFunction
value = 0
[../]
[./bc_fnl]
type = ParsedFunction
value = 0
[../]
[./bc_fnr]
type = ParsedFunction
value = 0
[../]
[./forcing_fn]
# type = ParsedFunction
# value = 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'
csv = true
[./out]
type = Exodus
elemental_as_nodal = 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
value=0
[../]
[./bc_fnt]
type = ParsedFunction
value = 0
[../]
[./bc_fnb]
type = ParsedFunction
value = 0
[../]
[./bc_fnl]
type = ParsedFunction
value = 0
[../]
[./bc_fnr]
type = ParsedFunction
value = 0
[../]
[./forcing_fn]
# type = ParsedFunction
# value = 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'
csv = true
[./out]
type = Exodus
elemental_as_nodal = 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
value = -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
csv = true
[]
(test/tests/nodalkernels/penalty_dirichlet/nodal_penalty_dirichlet.i)
#In order to compare the solution generated using preset BC, the penalty was set to 1e10.
#Large penalty number should be used with caution.
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD4
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
value = -2*(x*x+y*y-2)
[../]
[./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]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[NodalKernels]
[./bc_all]
type = PenaltyDirichletNodalKernel
variable = u
value = 0
boundary = 'top left right bottom'
penalty = 1e10
[../]
[]
# [BCs]
# [./fix]
# type = DirichletBC
# preset = true
# variable = u
# value = 0
# boundary = 'top left right bottom'
# [../]
# []
[Postprocessors]
[./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]
file_base = nodal_preset_bc_out
exodus = true
[]
(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
value = -5.8*(x+y)+x*x*x-x+y*y*y-y
[../]
[./forcing_fnv]
type = ParsedFunction
value = -4
[../]
[./slnu]
type = ParsedGradFunction
value = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[../]
[./slnv]
type = ParsedGradFunction
value = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
#NeumannBC functions
[./bc_fnut]
type = ParsedFunction
value = 3*y*y-1
[../]
[./bc_fnub]
type = ParsedFunction
value = -3*y*y+1
[../]
[./bc_fnul]
type = ParsedFunction
value = -3*x*x+1
[../]
[./bc_fnur]
type = ParsedFunction
value = 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'
# petsc_options = '-snes'
nl_rel_tol = 1e-15
nl_abs_tol = 1e-13
[]
[Outputs]
execute_on = 'timestep_end'
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/postprocessors/element_h1_error_pps/element_h1_error_pp_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
xmin = 0
xmax = 2
ymin = 0
ymax = 2
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
active = 'forcing_func u_func'
[./forcing_func]
type = ParsedFunction
#value = alpha*alpha*pi*pi*(y*y*sin(alpha*pi*x*y)+y*y*sin(alpha*pi*x*y))
value = alpha*alpha*pi*pi*sin(alpha*pi*x)
vars = 'alpha'
vals = '4'
[../]
[./u_func]
type = ParsedGradFunction
#value = sin(alpha*pi*x*y)
#grad_x = alpha*pi*y*cos(alpha*pi*x*y)
#grad_y = alpha*pi*x*cos(alpha*pi*x*y)
value = sin(alpha*pi*x)
grad_x = alpha*pi*cos(alpha*pi*x)
vars = 'alpha'
vals = '4'
[../]
[]
[Kernels]
active = 'diff forcing'
[./diff]
type = Diffusion
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_func
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
boundary = '1'
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = '3'
value = 0
[../]
[]
[Executioner]
type = Steady
[./Adaptivity]
refine_fraction = 1.0
coarsen_fraction = 0.0
max_h_level = 10
steps = 4
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
execute_on = 'initial timestep_end'
[../]
[./h1_error]
type = ElementH1Error
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[./h1_semi]
type = ElementH1SemiError
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[./l2_error]
type = ElementL2Error
variable = u
function = u_func
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
file_base = out
exodus = false
csv = 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
value = -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
csv = true
[]
(test/tests/indicators/laplacian_jump_indicator/biharmonic_transient.i)
[GlobalParams]
# Parameters used by Functions.
vars = 'c'
vals = '50'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -.5
xmax = .5
ymin = -.5
ymax = .5
nx = 10
ny = 10
[]
[Variables]
[./u]
order = THIRD
family = HERMITE
[../]
[]
[Kernels]
[./biharmonic]
type = Biharmonic
variable = u
[../]
[./body_force]
type = BodyForce
variable = u
function = forcing_func
[../]
[]
[BCs]
[./all_value]
type = FunctionPenaltyDirichletBC
variable = u
boundary = 'left right top bottom'
function = u_func
penalty = 1e10
[../]
[./all_flux]
type = FunctionPenaltyFluxBC
variable = u
boundary = 'left right top bottom'
function = u_func
penalty = 1e10
[../]
[]
[Adaptivity]
[./Indicators]
[./error]
type = LaplacianJumpIndicator
variable = u
scale_by_flux_faces = true
[../]
[../]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.1
# Note: the unusually tight tolerances here are due to the penalty
# BCs (currently the only way of accurately Dirichlet boundary
# conditions on Hermite elements in MOOSE).
nl_rel_tol = 1.e-15
l_tol = 1.e-15
# We have exact Jacobians
solve_type = 'NEWTON'
# Use 6x6 quadrature to ensure the forcing function is integrated
# accurately.
[./Quadrature]
type = GAUSS
order = ELEVENTH
[../]
[]
[Functions]
[./u_func]
type = ParsedGradFunction
value = 'exp(-c*(x^2+y^2))*exp(-t)'
grad_x = '-2*c*exp(-c*(x^2+y^2))*x*exp(-t)'
grad_y = '-2*c*exp(-c*(x^2+y^2))*y*exp(-t)'
[../]
[./forcing_func]
type = ParsedFunction
value = '16*c^2*(c^2*(x^2+y^2)^2 - 4*c*(x^2+y^2) + 2)*exp(-c*(x^2+y^2))*exp(-t)'
[../]
[]
[ICs]
[./u_ic]
type = FunctionIC
function = u_func
variable = u
[../]
[]
[Postprocessors]
[./l2_error]
type = ElementL2Error
variable = u
function = u_func
[../]
[./h1_error]
type = ElementH1Error
variable = u
function = u_func
[../]
[]
[Outputs]
exodus = true
[]
(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
value = -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
csv = true
[]
(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
value = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
value = -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
csv = true
[]
(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
value = 2*y
[../]
[./bc_fnb]
type = ParsedFunction
value = -2*y
[../]
[./bc_fnl]
type = ParsedFunction
value = -2*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 2*x
[../]
[./bc_fnf]
type = ParsedFunction
value = 2*z
[../]
[./bc_fnk]
type = ParsedFunction
value = -2*z
[../]
[./forcing_fn]
type = ParsedFunction
value = -6+x*x+y*y+z*z
[../]
[./solution]
type = ParsedGradFunction
value = 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
csv = 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
value = -5.8*(x+y)+x*x*x-x+y*y*y-y
[../]
[./forcing_fnv]
type = ParsedFunction
value = -4
[../]
[./slnu]
type = ParsedGradFunction
value = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[../]
[./slnv]
type = ParsedGradFunction
value = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
#NeumannBC functions
[./bc_fnut]
type = ParsedFunction
value = 3*y*y-1
[../]
[./bc_fnub]
type = ParsedFunction
value = -3*y*y+1
[../]
[./bc_fnul]
type = ParsedFunction
value = -3*x*x+1
[../]
[./bc_fnur]
type = ParsedFunction
value = 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'
# petsc_options = '-snes'
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/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
value = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
value = -6*x+(x*x*x)
[../]
[./solution]
type = ParsedGradFunction
value = 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
csv = true
[]
(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
value=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'
csv = true
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[]
(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
value = -5.8*(x+y)+x*x*x-x+y*y*y-y
[../]
[./forcing_fnv]
type = ParsedFunction
value = -4
[../]
[./slnu]
type = ParsedGradFunction
value = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[../]
[./slnv]
type = ParsedGradFunction
value = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
#NeumannBC functions
[./bc_fnut]
type = ParsedFunction
value = 3*y*y-1
[../]
[./bc_fnub]
type = ParsedFunction
value = -3*y*y+1
[../]
[./bc_fnul]
type = ParsedFunction
value = -3*x*x+1
[../]
[./bc_fnur]
type = ParsedFunction
value = 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'
# petsc_options = '-snes'
nl_rel_tol = 1e-15
nl_abs_tol = 1e-13
[]
[Outputs]
execute_on = 'timestep_end'
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/postprocessors/num_vars/num_vars.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
value = -6*(x+y)+x*x+y*y
[../]
[./forcing_fnv]
type = ParsedFunction
value = -4+x*x*x-x+y*y*y-y
[../]
[./bc_fnut]
type = ParsedFunction
value = 3*y*y-1
[../]
[./bc_fnub]
type = ParsedFunction
value = -3*y*y+1
[../]
[./bc_fnul]
type = ParsedFunction
value = -3*x*x+1
[../]
[./bc_fnur]
type = ParsedFunction
value = 3*x*x-1
[../]
[./slnu]
type = ParsedGradFunction
value = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[../]
[./slnv]
type = ParsedGradFunction
value = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
[]
[Variables]
[./u]
order = THIRD
family = HIERARCHIC
[../]
[./v]
order = SECOND
family = LAGRANGE
[../]
[]
[Kernels]
[./diff1]
type = Diffusion
variable = u
[../]
[./diff2]
type = Diffusion
variable = v
[../]
[./forceu]
type = BodyForce
variable = u
function = forcing_fnu
[../]
[./forcev]
type = BodyForce
variable = v
function = forcing_fnv
[../]
[]
[BCs]
# active = 'bc_u bc_v'
# [./bc_u]
# type = FunctionDirichletBC
# variable = u
# function = slnu
# boundary = 'top left right bottom'
# [../]
[./bc_ut]
type = FunctionDirichletBC
variable = u
boundary = top
function = bc_fnut
[../]
[./bc_ub]
type = FunctionDirichletBC
variable = u
boundary = bottom
function = bc_fnub
[../]
[./bc_ul]
type = FunctionDirichletBC
variable = u
boundary = left
function = bc_fnul
[../]
[./bc_ur]
type = FunctionDirichletBC
variable = u
boundary = right
function = bc_fnur
[../]
[./bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'top left right bottom'
[../]
[]
[Preconditioning]
[./prec]
type = SMP
full = true
[../]
[]
[Postprocessors]
active = 'num_vars'
[./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
[../]
[./num_vars]
type = NumVars
system = 'NL'
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_rel_tol = 1e-15
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
execute_on = 'timestep_end'
csv = true
[]
(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
value = -2*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 2*x
[../]
[./forcing_fn]
type = ParsedFunction
value = -2+x*x
[../]
[./solution]
type = ParsedGradFunction
value = 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
csv = true
[]
(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
value = 3*y*y
[../]
[./bc_fnb]
type = ParsedFunction
value = -3*y*y
[../]
[./bc_fnl]
type = ParsedFunction
value = -3*x*x
[../]
[./bc_fnr]
type = ParsedFunction
value = 3*x*x
[../]
[./forcing_fn]
type = ParsedFunction
value = -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
csv = 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
value = -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
csv = true
[]
(test/tests/postprocessors/mms_slope/mms_slope_test.i)
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
# do not use uniform refine, we are using adaptive refining
# uniform_refine = 6
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
active = 'forcing_func u_func'
[./forcing_func]
type = ParsedFunction
value = alpha*alpha*pi*pi*sin(alpha*pi*x)
vars = 'alpha'
vals = '4'
[../]
[./u_func]
type = ParsedGradFunction
value = sin(alpha*pi*x)
grad_x = alpha*pi*sin(alpha*pi*x)
vars = 'alpha'
vals = '4'
[../]
[]
[Kernels]
active = 'diff forcing'
[./diff]
type = Diffusion
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_func
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
boundary = '3'
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = '1'
value = 0
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-14
[./Adaptivity]
# if the refine fraction is 1 it will refine every element
# remember < 1 means only refine that percentage of elements
refine_fraction = 1
steps = 6
# do not coarsen at all
coarsen_fraction = 0
# maximum level of refinement steps, make sure this is > max_r_steps
max_h_level = 10
# leave this as is
error_estimator = KellyErrorEstimator
[../]
[]
# print l2 and h1 errors from the Postprocessors too so I can compare
[Postprocessors]
active = 'l2_error h1_error dofs'
# active = ' '
[./l2_error]
type = ElementL2Error
variable = u
function = u_func
[../]
[./h1_error]
type = ElementH1Error
variable = u
function = u_func
[../]
[./dofs]
type = NumDOFs
[../]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = out
exodus = 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
value = -pi*sin(pi*x)*cos(pi*y)
[../]
[./bc_fnb]
type = ParsedFunction
value = pi*sin(pi*x)*cos(pi*y)
[../]
[./forcing_fn]
type = ParsedFunction
value = -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
csv = true
print_mesh_changed_info = 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
value = -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
csv = true
print_mesh_changed_info = true
[]