Boundary Conditions

This section describes the user facing API for boundary conditions along with the implementation details.

DirichletBC

We can set up dirichlet boundary conditions on a variable u and sideset sset_1 with a zero function as follows.

julia> using FiniteElementContainers
julia> bc_func(x, t) = 0.bc_func (generic function with 1 method)
julia> bc = DirichletBC(:u, :sset_1, bc_func)DirichletBC{typeof(Main.bc_func)}(Main.bc_func, :sset_1, :u)

Internally this is eventually converted in a DirichletBCContainer

API

FiniteElementContainers.DirichletBCMethod
struct DirichletBC{F} <: FiniteElementContainers.AbstractBC{F}
DirichletBC(
    var_name::String,
    sset_name::String,
    func::Function
) -> DirichletBC{<:Function}
  • func::Any

  • sset_name::Symbol

  • var_name::Symbol

source
FiniteElementContainers.DirichletBCMethod
struct DirichletBC{F} <: FiniteElementContainers.AbstractBC{F}
DirichletBC(
    var_name::Symbol,
    sset_name::Symbol,
    func::Function
) -> DirichletBC{<:Function}
  • func::Any

  • sset_name::Symbol

  • var_name::Symbol

source
FiniteElementContainers.DirichletBCContainerMethod
struct DirichletBCContainer{B, T, V} <: FiniteElementContainers.AbstractBCContainer{B, T, 1, V}
DirichletBCContainer(
    dof::DofManager,
    dbc::DirichletBC
) -> FiniteElementContainers.DirichletBCContainer{FiniteElementContainers.BCBookKeeping{_A, Vector{Int64}}, Float64, Vector{Float64}} where _A<:(AbstractMatrix{<:Integer})
  • bookkeeping::Any

  • vals::Any

source
FiniteElementContainers._update_bc_values!Method
_update_bc_values!(
    bc::FiniteElementContainers.DirichletBCContainer,
    func,
    X,
    t,
    backend::KernelAbstractions.Backend
)

GPU kernel wrapper for updating bc values based on the stored function

source
FiniteElementContainers._update_bc_values!Method
_update_bc_values!(
    bc::FiniteElementContainers.DirichletBCContainer,
    func,
    X,
    t,
    _::KernelAbstractions.CPU
)

CPU implementation for updating stored bc values based on the stored function

source
FiniteElementContainers.NeumannBCMethod
struct NeumannBC{F} <: FiniteElementContainers.AbstractBC{F}
NeumannBC(
    var_name::String,
    sset_name::Symbol,
    func::Function
)
  • func::Any

  • sset_name::Symbol

  • var_name::Symbol

source
FiniteElementContainers.NeumannBCMethod
struct NeumannBC{F} <: FiniteElementContainers.AbstractBC{F}
NeumannBC(
    var_name::Symbol,
    sset_name::Symbol,
    func::Function
) -> NeumannBC{<:Function}
  • func::Any

  • sset_name::Symbol

  • var_name::Symbol

source
FiniteElementContainers.NeumannBCContainerType
struct NeumannBCContainer{B, C1, C2, R, T, V} <: FiniteElementContainers.AbstractBCContainer{B, T, 2, V}
  • bookkeeping::Any

  • element_conns::Any

  • surface_conns::Any

  • ref_fe::Any

  • vals::Any

Internal implementation of dirichlet BCs

source

Boundary Condition Implementation Details

FiniteElementContainers.AbstractBCContainerType
abstract type AbstractBCContainer{B<:FiniteElementContainers.BCBookKeeping, T<:(Union{var"#s38", var"#s37"} where {var"#s38"<:Number, var"#s37"<:(StaticArraysCore.SVector)}), N, V<:AbstractArray{T<:(Union{var"#s38", var"#s37"} where {var"#s38"<:Number, var"#s37"<:(StaticArraysCore.SVector)}), N}}
source
FiniteElementContainers.BCBookKeepingType
struct BCBookKeeping{M<:(AbstractMatrix{<:Integer}), V<:(AbstractVector{<:Integer})}
  • blocks::AbstractVector{<:Integer}

  • dofs::AbstractVector{<:Integer}

  • elements::AbstractVector{<:Integer}

  • nodes::AbstractVector{<:Integer}

  • sides::AbstractVector{<:Integer}

  • side_nodes::AbstractMatrix{<:Integer}

This struct is used to help with book keeping nodes, sides, etc. for all types of boundary conditions.

TODO need to add a domain ID for extending to Schwarz

source
FiniteElementContainers.BCBookKeepingMethod
BCBookKeeping(
    dof::DofManager,
    var_name::Symbol,
    sset_name::Symbol
) -> FiniteElementContainers.BCBookKeeping{_A, Vector{Int64}} where _A<:(AbstractMatrix{<:Integer})
source