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.DirichletBC
— Typestruct DirichletBC{F} <: FiniteElementContainers.AbstractDirichletBC{F}
func::Any
sset_name::Symbol
var_name::Symbol
User facing API to define a DirichletBC
`.
FiniteElementContainers.DirichletBC
— Methodstruct 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
FiniteElementContainers.DirichletBC
— Methodstruct 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
FiniteElementContainers.DirichletBCContainer
— Typestruct 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
FiniteElementContainers.DirichletBCContainer
— Methodstruct 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
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
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
FiniteElementContainers.NeumannBC
— Typestruct NeumannBC{F} <: FiniteElementContainers.AbstractBC{F}
func::Any
sset_name::Symbol
var_name::Symbol
User facing API to define a NeumannBC
`.
FiniteElementContainers.NeumannBC
— Methodstruct NeumannBC{F} <: FiniteElementContainers.AbstractBC{F}
NeumannBC(
var_name::String,
sset_name::Symbol,
func::Function
)
func::Any
sset_name::Symbol
var_name::Symbol
FiniteElementContainers.NeumannBC
— Methodstruct NeumannBC{F} <: FiniteElementContainers.AbstractBC{F}
NeumannBC(
var_name::Symbol,
sset_name::Symbol,
func::Function
) -> NeumannBC{<:Function}
func::Any
sset_name::Symbol
var_name::Symbol
FiniteElementContainers.NeumannBCContainer
— Typestruct 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
Boundary Condition Implementation Details
FiniteElementContainers.AbstractBC
— Typeabstract type AbstractBC{F<:Function}
FiniteElementContainers.AbstractBCContainer
— Typeabstract 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}}
FiniteElementContainers.AbstractBCFunction
— Typeabstract type AbstractBCFunction{F}
FiniteElementContainers.BCBookKeeping
— Typestruct 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
FiniteElementContainers.BCBookKeeping
— MethodBCBookKeeping(
mesh,
dof::DofManager,
var_name::Symbol,
sset_name::Symbol
) -> FiniteElementContainers.BCBookKeeping{Int64, Vector{Int64}, M} where M<:AbstractMatrix{Int64}
FiniteElementContainers.update_bc_values!
— Methodupdate_bc_values!(bcs, funcs, X, t)
Wrapper that is generic for all architectures to update bc values based on the stored function
KernelAbstractions.get_backend
— Methodget_backend(
bk::FiniteElementContainers.BCBookKeeping
) -> Any