diff --git a/src/equations/laplace_diffusion_1d.jl b/src/equations/laplace_diffusion_1d.jl index 815b9908c1e..64a72ef3a13 100644 --- a/src/equations/laplace_diffusion_1d.jl +++ b/src/equations/laplace_diffusion_1d.jl @@ -24,12 +24,13 @@ function flux(u, gradients, orientation::Integer, equations_parabolic::LaplaceDi return equations_parabolic.diffusivity * dudx end -# Dirichlet-type boundary condition for use with a parabolic solver in weak form +# Dirichlet and Neumann boundary conditions for use with parabolic solvers in weak form. +# Note that these are general, so they apply to LaplaceDiffusion in any spatial dimension. @inline function (boundary_condition::BoundaryConditionDirichlet)(flux_inner, u_inner, normal::AbstractVector, x, t, operator_type::Gradient, - equations_parabolic::LaplaceDiffusion1D) + equations_parabolic::AbstractLaplaceDiffusion) return boundary_condition.boundary_value_function(x, t, equations_parabolic) end @@ -37,7 +38,7 @@ end normal::AbstractVector, x, t, operator_type::Divergence, - equations_parabolic::LaplaceDiffusion1D) + equations_parabolic::AbstractLaplaceDiffusion) return flux_inner end @@ -45,7 +46,7 @@ end normal::AbstractVector, x, t, operator_type::Divergence, - equations_parabolic::LaplaceDiffusion1D) + equations_parabolic::AbstractLaplaceDiffusion) return boundary_condition.boundary_normal_flux_function(x, t, equations_parabolic) end @@ -53,6 +54,6 @@ end normal::AbstractVector, x, t, operator_type::Gradient, - equations_parabolic::LaplaceDiffusion1D) + equations_parabolic::AbstractLaplaceDiffusion) return flux_inner end diff --git a/src/equations/laplace_diffusion_2d.jl b/src/equations/laplace_diffusion_2d.jl index b848633fbcb..5de989849b6 100644 --- a/src/equations/laplace_diffusion_2d.jl +++ b/src/equations/laplace_diffusion_2d.jl @@ -35,35 +35,4 @@ function penalty(u_outer, u_inner, inv_h, equations_parabolic::LaplaceDiffusion2 return dg.penalty_parameter * (u_outer - u_inner) * equations_parabolic.diffusivity end -# Dirichlet-type boundary condition for use with a parabolic solver in weak form -@inline function (boundary_condition::BoundaryConditionDirichlet)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Gradient, - equations_parabolic::LaplaceDiffusion2D) - return boundary_condition.boundary_value_function(x, t, equations_parabolic) -end - -@inline function (boundary_condition::BoundaryConditionDirichlet)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Divergence, - equations_parabolic::LaplaceDiffusion2D) - return flux_inner -end - -@inline function (boundary_condition::BoundaryConditionNeumann)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Divergence, - equations_parabolic::LaplaceDiffusion2D) - return boundary_condition.boundary_normal_flux_function(x, t, equations_parabolic) -end - -@inline function (boundary_condition::BoundaryConditionNeumann)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Gradient, - equations_parabolic::LaplaceDiffusion2D) - return flux_inner -end +# General Dirichlet and Neumann boundary condition functions are defined in `src/equations/laplace_diffusion_1d.jl`. diff --git a/src/equations/laplace_diffusion_3d.jl b/src/equations/laplace_diffusion_3d.jl index 3988ce7144b..fbd3d277257 100644 --- a/src/equations/laplace_diffusion_3d.jl +++ b/src/equations/laplace_diffusion_3d.jl @@ -38,35 +38,4 @@ function penalty(u_outer, u_inner, inv_h, equations_parabolic::LaplaceDiffusion3 return dg.penalty_parameter * (u_outer - u_inner) * equations_parabolic.diffusivity end -# Dirichlet-type boundary condition for use with a parabolic solver in weak form -@inline function (boundary_condition::BoundaryConditionDirichlet)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Gradient, - equations_parabolic::LaplaceDiffusion3D) - return boundary_condition.boundary_value_function(x, t, equations_parabolic) -end - -@inline function (boundary_condition::BoundaryConditionDirichlet)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Divergence, - equations_parabolic::LaplaceDiffusion3D) - return flux_inner -end - -@inline function (boundary_condition::BoundaryConditionNeumann)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Divergence, - equations_parabolic::LaplaceDiffusion3D) - return boundary_condition.boundary_normal_flux_function(x, t, equations_parabolic) -end - -@inline function (boundary_condition::BoundaryConditionNeumann)(flux_inner, u_inner, - normal::AbstractVector, - x, t, - operator_type::Gradient, - equations_parabolic::LaplaceDiffusion3D) - return flux_inner -end +# General Dirichlet and Neumann boundary condition functions are defined in `src/equations/laplace_diffusion_1d.jl`.