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.AbstractDirichletBC{F}
DirichletBC(
    var_name::String,
    sset_name::String,
    func::Function
) -> DirichletBC{F} where F<:Function
  • func::Any

  • sset_name::Symbol

  • var_name::Symbol

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

  • sset_name::Symbol

  • var_name::Symbol

source
FiniteElementContainers.DirichletBCContainerType
struct DirichletBCContainer{IT<:Integer, VT<:Number, IV<:AbstractArray{IT<:Integer, 1}, VV<:AbstractArray{VT<:Number, 1}} <: FiniteElementContainers.AbstractBCContainer
  • dofs::AbstractVector{IT} where IT<:Integer

  • nodes::AbstractVector{IT} where IT<:Integer

  • vals::AbstractVector{VT} where VT<:Number

  • vals_dot::AbstractVector{VT} where VT<:Number

  • vals_dot_dot::AbstractVector{VT} where VT<:Number

Internal implementation of dirichlet BCs

source
FiniteElementContainers.DirichletBCContainerMethod
struct DirichletBCContainer{IT<:Integer, VT<:Number, IV<:AbstractArray{IT<:Integer, 1}, VV<:AbstractArray{VT<:Number, 1}} <: FiniteElementContainers.AbstractBCContainer
DirichletBCContainer(
    mesh,
    dof::DofManager,
    dbc::DirichletBC
) -> FiniteElementContainers.DirichletBCContainer{Int64, Float64, Vector{Int64}, Vector{Float64}}
  • dofs::AbstractVector{IT} where IT<:Integer

  • nodes::AbstractVector{IT} where IT<:Integer

  • vals::AbstractVector{VT} where VT<:Number

  • vals_dot::AbstractVector{VT} where VT<:Number

  • vals_dot_dot::AbstractVector{VT} where VT<:Number

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{IT<:Integer, VT<:(Union{var"#s28", var"#s27"} where {var"#s28"<:Number, var"#s27"<:(StaticArraysCore.SVector)}), IV<:AbstractArray{IT<:Integer, 1}, IM<:AbstractArray{IT<:Integer, 2}, VV<:AbstractArray{VT<:(Union{var"#s28", var"#s27"} where {var"#s28"<:Number, var"#s27"<:(StaticArraysCore.SVector)}), 2}, C1, C2, RE<:ReferenceFiniteElements.ReferenceFE} <: FiniteElementContainers.AbstractBCContainer
  • element_conns::Any

  • elements::AbstractVector{IT} where IT<:Integer

  • side_nodes::AbstractMatrix{IT} where IT<:Integer

  • sides::AbstractVector{IT} where IT<:Integer

  • surface_conns::Any

  • ref_fe::ReferenceFiniteElements.ReferenceFE

  • vals::AbstractMatrix{VT} where VT<:(Union{var"#s28", var"#s27"} where {var"#s28"<:Number, var"#s27"<:(StaticArraysCore.SVector)})

Internal implementation of dirichlet BCs

source

Boundary Condition Implementation Details

FiniteElementContainers.BCBookKeepingType
struct BCBookKeeping{I<:Integer, V<:AbstractArray{I<:Integer, 1}, M<:AbstractArray{I<:Integer, 2}}
  • blocks::AbstractVector{I} where I<:Integer

  • dofs::AbstractVector{I} where I<:Integer

  • elements::AbstractVector{I} where I<:Integer

  • nodes::AbstractVector{I} where I<:Integer

  • sides::AbstractVector{I} where I<:Integer

  • side_nodes::AbstractMatrix{I} where I<: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