- boundaryThe list of boundary IDs from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundary IDs from the mesh where this object applies
- functorThe boundary-value functor.
C++ Type:FunctionName
Unit:(no unit assumed)
Controllable:No
Description:The boundary-value functor.
- variableThe name of the variable this boundary condition supplies data for
C++ Type:LinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable this boundary condition supplies data for
KokkosLinearFVFunctorDirichletBC
This object provides Dirichlet boundary value data for Kokkos linear finite volume kernels. The boundary value is supplied through a Kokkos-compatible functor.
For kernels that need boundary normal gradient data, this object supplies the affine relation
where is the cell value, is the prescribed boundary value, and is the cell-center-to-face-center distance. Kernels apply their own physics coefficients when consuming this relation.
Currently, the only accepted functor type is KokkosParsedFunction, as we are waiting on relocatable device code (RDC) support.
Example Syntax
[dir]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution_kokkos
[](test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d.i)Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable: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
Advanced Parameters
Input Files
- (test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d-internal-neumann.i)
- (test/tests/kokkos/linearfvkernels/advection-diffusion/kokkos_advection_diffusion-1d.i)
- (test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-1d-radial.i)
- (test/tests/kokkos/fe-fv-interplay/multisystem.i)
- (test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d.i)
- (test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d-neumann.i)
- (test/tests/kokkos/linearfvkernels/diffusion/match-non-kokkos.i)
- (test/tests/kokkos/fe-fv-interplay/aux-read-from-fv.i)
(test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[diffusion]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = coeff_func_kokkos
[]
[source]
type = KokkosLinearFVSource
variable = u
source_density = source_func_kokkos
scaling_factor = unit_fn
[]
[]
[LinearFVBCs]
[dir]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution_kokkos
[]
[]
[Functions]
[unit_fn]
type = KokkosParsedFunction
expression = 1.0
[]
[coeff_func_kokkos]
type = KokkosParsedFunction
expression = '1.0 + 0.5*x*y'
[]
[source_func_kokkos]
type = KokkosParsedFunction
expression = '2*(1.5-y*y) + 2*x*y*(1.5-y*y) + 2*(1.5-x*x) + 2*x*y*(1.5-x*x)'
[]
[analytic_solution_kokkos]
type = KokkosParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = 'FINAL'
[]
[]
(test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d-internal-neumann.i)
# 2D diffusion MMS test with Neumann normal-gradient BCs on internal block boundaries.
# Exact solution: u = v = 1.5 - x^2
# Diffusion coeff: D = 1 + 0.5*x*y
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 0.5'
ix = '2 2'
dy = '0.5'
iy = '2'
subdomain_id = '1 2'
[]
[left_internal]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
new_boundary = left_internal
primary_block = 1
paired_block = 2
[]
[right_internal]
type = SideSetsBetweenSubdomainsGenerator
input = left_internal
new_boundary = right_internal
primary_block = 2
paired_block = 1
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
block = 1
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
block = 2
[]
[]
[LinearFVKernels]
[diffusion_left]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = coeff_func_kokkos
block = 1
[]
[source_left]
type = KokkosLinearFVSource
variable = u
source_density = source_func_kokkos
scaling_factor = unit_fn
block = 1
[]
[diffusion_right]
type = KokkosLinearFVDiffusion
variable = v
diffusion_coeff = coeff_func_kokkos
block = 2
[]
[source_right]
type = KokkosLinearFVSource
variable = v
source_density = source_func_kokkos
scaling_factor = unit_fn
block = 2
[]
[]
[LinearFVBCs]
[dirichlet_left]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = left
functor = analytic_solution_kokkos
[]
[neumann_left_internal]
type = KokkosLinearFVFunctorNeumannBC
variable = u
boundary = left_internal
functor = left_internal_gradient
[]
[dirichlet_right]
type = KokkosLinearFVFunctorDirichletBC
variable = v
boundary = right
functor = analytic_solution_kokkos
[]
[neumann_right_internal]
type = KokkosLinearFVFunctorNeumannBC
variable = v
boundary = right_internal
functor = right_internal_gradient
[]
[]
[Functions]
[unit_fn]
type = KokkosParsedFunction
expression = 1.0
[]
[coeff_func_kokkos]
type = KokkosParsedFunction
expression = '1.0 + 0.5*x*y'
[]
[source_func_kokkos]
type = KokkosParsedFunction
expression = '2.0 + 2.0*x*y'
[]
[analytic_solution_kokkos]
type = KokkosParsedFunction
expression = '1.5 - x*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1.5 - x*x'
[]
[left_internal_gradient]
type = KokkosParsedFunction
expression = '-1.0'
[]
[right_internal_gradient]
type = KokkosParsedFunction
expression = '1.0'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[left_error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
block = 1
[]
[right_error]
type = ElementL2FunctorError
approximate = v
exact = analytic_solution
execute_on = FINAL
block = 2
[]
[error]
type = ParsedPostprocessor
expression = 'sqrt(left*left + right*right)'
pp_names = 'left_error right_error'
pp_symbols = 'left right'
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = 'FINAL'
[]
[]
(test/tests/kokkos/linearfvkernels/advection-diffusion/kokkos_advection_diffusion-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[advection]
type = KokkosLinearFVAdvection
variable = u
velocity = '0.5 0 0'
[]
[diffusion]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = unit_fn
[]
[source]
type = KokkosLinearFVSource
variable = u
source_density = source_func_kokkos
scaling_factor = unit_fn
[]
[]
[LinearFVBCs]
[inflow]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = left
functor = analytic_solution_kokkos
[]
[outflow]
type = KokkosLinearFVFunctorNeumannBC
variable = u
boundary = right
functor = zero_fn
[]
[]
[Functions]
[unit_fn]
type = KokkosParsedFunction
expression = 1.0
[]
[zero_fn]
type = KokkosParsedFunction
expression = 0.0
[]
[source_func_kokkos]
type = KokkosParsedFunction
expression = 'x - 3.0'
[]
[analytic_solution_kokkos]
type = KokkosParsedFunction
expression = '1.0 + (1.0 - x) * (1.0 - x)'
[]
[analytic_solution]
type = ParsedFunction
expression = '1.0 + (1.0 - x) * (1.0 - x)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = 'FINAL'
[]
[]
(test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-1d-radial.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 1
xmax = 2
[]
coord_type = RZ
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[diffusion]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = unit_fn
[]
[source]
type = KokkosLinearFVSource
variable = u
source_density = source_func_kokkos
scaling_factor = unit_fn
[]
[]
[LinearFVBCs]
[dirichlet]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = 'left right'
functor = analytic_solution_kokkos
[]
[]
[Functions]
[unit_fn]
type = KokkosParsedFunction
expression = 1
[]
[source_func_kokkos]
type = KokkosParsedFunction
expression = 4
[]
[analytic_solution_kokkos]
type = KokkosParsedFunction
expression = '5-x*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '5-x*x'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-12'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = FINAL
[]
[]
(test/tests/kokkos/fe-fv-interplay/multisystem.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 5
[]
[]
[Problem]
nl_sys_names = 'u_sys'
linear_sys_names = 'v_sys'
[]
[Variables]
[u]
solver_sys = 'u_sys'
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'v_sys'
[]
[]
[Kernels]
[diff]
type = KokkosDiffusion
variable = u
[]
[coupled]
type = CoupledForce
variable = u
v = v
[]
[]
[LinearFVKernels]
[diff]
type = KokkosLinearFVDiffusion
diffusion_coeff = 'unity'
variable = v
[]
[coupled]
type = LinearFVSource
source_density = u
variable = v
[]
[]
[BCs]
[left]
type = KokkosDirichletBC
boundary = 'left'
variable = u
value = 0
[]
[right]
type = KokkosDirichletBC
boundary = 'right'
variable = u
value = 1
[]
[]
[LinearFVBCs]
[left]
type = KokkosLinearFVFunctorDirichletBC
boundary = 'left'
variable = v
functor = 'zero'
[]
[right]
type = KokkosLinearFVFunctorDirichletBC
boundary = 'right'
variable = v
functor = 'unity'
[]
[]
[Functions]
[zero]
type = KokkosParsedFunction
expression = '0'
[]
[unity]
type = KokkosParsedFunction
expression = '1'
[]
[]
[Postprocessors]
[fe_avg]
type = ElementAverageValue
variable = u
execute_on = FINAL
[]
[fv_avg]
type = ElementAverageFunctorPostprocessor
functor = v
execute_on = FINAL
evaluation_type = CELL_AVERAGE
[]
[]
[Convergence]
[fixed_point]
type = IterationCountConvergence
converge_at_max_iterations = true
min_iterations = 10
max_iterations = 10
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
system_names = 'u_sys v_sys'
multi_system_fixed_point = true
multi_system_fixed_point_convergence = fixed_point
nl_abs_tol = 1e-12
l_tol = 1e-12
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = FINAL
[]
[]
(test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[diffusion]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = coeff_func_kokkos
[]
[source]
type = KokkosLinearFVSource
variable = u
source_density = source_func_kokkos
scaling_factor = unit_fn
[]
[]
[LinearFVBCs]
[dir]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution_kokkos
[]
[]
[Functions]
[unit_fn]
type = KokkosParsedFunction
expression = 1.0
[]
[coeff_func_kokkos]
type = KokkosParsedFunction
expression = '1.0 + 0.5*x*y'
[]
[source_func_kokkos]
type = KokkosParsedFunction
expression = '2*(1.5-y*y) + 2*x*y*(1.5-y*y) + 2*(1.5-x*x) + 2*x*y*(1.5-x*x)'
[]
[analytic_solution_kokkos]
type = KokkosParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = 'FINAL'
[]
[]
(test/tests/kokkos/linearfvkernels/diffusion/kokkos_diffusion-2d-neumann.i)
# 2D diffusion MMS test with mixed Dirichlet (left/right) and Neumann (top/bottom) BCs.
# Exact solution: u = (1.5 - x^2)(1.5 - y^2)
# Diffusion coeff: D = 1 + 0.5*x*y
# Neumann normal gradient on bottom (n = -y): -du/dy|_{y=0} = 0 (du/dy = 0 at y=0)
# Neumann normal gradient on top (n = +y): du/dy|_{y=ymax}
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[diffusion]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = coeff_func_kokkos
[]
[source]
type = KokkosLinearFVSource
variable = u
source_density = source_func_kokkos
scaling_factor = unit_fn
[]
[]
[LinearFVBCs]
[dirichlet_lr]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = 'left right'
functor = analytic_solution_kokkos
[]
[neumann_bottom]
type = KokkosLinearFVFunctorNeumannBC
variable = u
boundary = 'bottom'
functor = neumann_bottom_gradient
[]
[neumann_top]
type = KokkosLinearFVFunctorNeumannBC
variable = u
boundary = 'top'
functor = neumann_top_gradient
[]
[]
[Functions]
[unit_fn]
type = KokkosParsedFunction
expression = 1.0
[]
[coeff_func_kokkos]
type = KokkosParsedFunction
expression = '1.0 + 0.5*x*y'
[]
[source_func_kokkos]
type = KokkosParsedFunction
expression = '2*(1.5-y*y) + 2*x*y*(1.5-y*y) + 2*(1.5-x*x) + 2*x*y*(1.5-x*x)'
[]
[analytic_solution_kokkos]
type = KokkosParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
# Outward normal gradient on bottom (n = -y): -du/dy|_{y=0} = 0
[neumann_bottom_gradient]
type = KokkosParsedFunction
expression = 0.0
[]
# Outward normal gradient on top (n = +y): du/dy|_{y=ymax}
# du/dy = (1.5-x^2)*(-2*ymax)
[neumann_top_gradient]
type = KokkosParsedFunction
expression = '(1.5-x*x)*(-2.0*0.5)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = 'FINAL'
[]
[]
(test/tests/kokkos/linearfvkernels/diffusion/match-non-kokkos.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[AuxVariables]
[v_volume]
type = MooseLinearVariableFVReal
initial_condition = 50
[]
[v_functor]
type = MooseLinearVariableFVReal
initial_condition = 25
[]
[v_parsed]
type = MooseLinearVariableFVReal
initial_condition = 12.5
[]
[]
[AuxKernels]
[volume]
type = VolumeAux
variable = v_volume
[]
[functor]
type = FunctorAux
variable = v_functor
functor = u
[]
[parsed]
type = ParsedAux
variable = v_parsed
coupled_variables = 'v_volume v_functor'
expression = '0.5*v_volume+0.5*v_functor'
[]
[]
[LinearFVKernels]
[diffusion]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = KokkosLinearFVSource
variable = u
source_density = source_func
scaling_factor = unit_fn
[]
[]
[LinearFVBCs]
[dir]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[unit_fn]
type = KokkosParsedFunction
expression = '1'
[]
[coeff_func]
type = KokkosParsedFunction
expression = '0.5*x'
[]
[source_func]
type = KokkosParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = KokkosParsedFunction
expression = '1-x*x'
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
file_base = diffusion-1d-aux_out
exodus = true
execute_on = TIMESTEP_END
[]
(test/tests/kokkos/fe-fv-interplay/aux-read-from-fv.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 4
ny = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[AuxVariables]
[v]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[v]
type = KokkosCopyValueAux
source = u
variable = v
[]
[]
[LinearFVKernels]
[diffusion]
type = KokkosLinearFVDiffusion
variable = u
diffusion_coeff = 'unity'
[]
[]
[LinearFVBCs]
[left]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = "left"
functor = 'zero'
[]
[right]
type = KokkosLinearFVFunctorDirichletBC
variable = u
boundary = "right"
functor = 'unity'
[]
[]
[Functions]
[zero]
type = KokkosParsedFunction
expression = '0'
[]
[unity]
type = KokkosParsedFunction
expression = '1'
[]
[]
[Postprocessors]
[kokkos_avg]
type = KokkosElementAverageValue
variable = v
execute_on = FINAL
[]
[linear_fv_avg]
type = ElementAverageFunctorPostprocessor
functor = 'u'
execute_on = FINAL
evaluation_type = CELL_AVERAGE
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_on = FINAL
[]
[]