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}, IM<:AbstractArray{IT<:Integer, 2}, VV<:AbstractArray{VT<:Number, 1}} <: FiniteElementContainers.AbstractDirichletBCContainer{IT<:Integer, VT<:Number, IV<:AbstractArray{IT<:Integer, 1}, IM<:AbstractArray{IT<:Integer, 2}, VV<:AbstractArray{VT<:Number, 1}}
  • bookkeeping::FiniteElementContainers.BCBookKeeping{IT, IV, IM} where {IT<:Integer, IV<:AbstractVector{IT}, IM<:AbstractMatrix{IT}}

  • 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}, IM<:AbstractArray{IT<:Integer, 2}, VV<:AbstractArray{VT<:Number, 1}} <: FiniteElementContainers.AbstractDirichletBCContainer{IT<:Integer, VT<:Number, IV<:AbstractArray{IT<:Integer, 1}, IM<:AbstractArray{IT<:Integer, 2}, VV<:AbstractArray{VT<:Number, 1}}
DirichletBCContainer(
    mesh,
    dof::DofManager,
    dbc::DirichletBC
) -> FiniteElementContainers.DirichletBCContainer{Int64, Float64, Vector{Int64}, M, Vector{Float64}} where M<:AbstractMatrix{Int64}
  • bookkeeping::FiniteElementContainers.BCBookKeeping{IT, IV, IM} where {IT<:Integer, IV<:AbstractVector{IT}, IM<:AbstractMatrix{IT}}

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

  • element_conns::Any

  • surface_conns::Any

  • ref_fe::ReferenceFiniteElements.ReferenceFE

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

Internal implementation of dirichlet BCs

source

Boundary Condition Implementation Details

FiniteElementContainers.AbstractBCContainerType
abstract type AbstractBCContainer{IT<:Integer, VT<:(Union{var"#s34", var"#s33"} where {var"#s34"<:Number, var"#s33"<:(StaticArraysCore.SVector)}), N, IV<:AbstractArray{IT<:Integer, 1}, IM<:AbstractArray{IT<:Integer, 2}, VV<:AbstractArray{VT<:(Union{var"#s34", var"#s33"} where {var"#s34"<:Number, var"#s33"<:(StaticArraysCore.SVector)}), N}}
source
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
FiniteElementContainers.BCBookKeepingMethod
BCBookKeeping(
    mesh,
    dof::DofManager,
    var_name::Symbol,
    sset_name::Symbol
) -> FiniteElementContainers.BCBookKeeping{Int64, Vector{Int64}, M} where M<:AbstractMatrix{Int64}
source