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 FiniteElementContainersjulia> 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::Anysset_name::Symbolvar_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::Anysset_name::Symbolvar_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::Anysset_name::Symbolvar_name::Symbol
FiniteElementContainers.DirichletBCContainer — Typestruct DirichletBCContainer{IT<:Integer, VT<:Number, IV<:AbstractArray{IT<:Integer, 1}, VV<:AbstractArray{VT<:Number, 1}} <: FiniteElementContainers.AbstractBCContainerdofs::AbstractVector{IT} where IT<:Integernodes::AbstractVector{IT} where IT<:Integervals::AbstractVector{VT} where VT<:Numbervals_dot::AbstractVector{VT} where VT<:Numbervals_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}, VV<:AbstractArray{VT<:Number, 1}} <: FiniteElementContainers.AbstractBCContainerDirichletBCContainer(
mesh,
dof::DofManager,
dbc::DirichletBC
) -> FiniteElementContainers.DirichletBCContainer{Int64, Float64, Vector{Int64}, Vector{Float64}}
dofs::AbstractVector{IT} where IT<:Integernodes::AbstractVector{IT} where IT<:Integervals::AbstractVector{VT} where VT<:Numbervals_dot::AbstractVector{VT} where VT<:Numbervals_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::Anysset_name::Symbolvar_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::Anysset_name::Symbolvar_name::Symbol
FiniteElementContainers.NeumannBC — Methodstruct NeumannBC{F} <: FiniteElementContainers.AbstractBC{F}NeumannBC(
var_name::Symbol,
sset_name::Symbol,
func::Function
) -> NeumannBC{<:Function}
func::Anysset_name::Symbolvar_name::Symbol
FiniteElementContainers.NeumannBCContainer — Typestruct 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.AbstractBCContainerelement_conns::Anyelements::AbstractVector{IT} where IT<:Integerside_nodes::AbstractMatrix{IT} where IT<:Integersides::AbstractVector{IT} where IT<:Integersurface_conns::Anyref_fe::ReferenceFiniteElements.ReferenceFEvals::AbstractMatrix{VT} where VT<:(Union{var"#s28", var"#s27"} where {var"#s28"<:Number, var"#s27"<:(StaticArraysCore.SVector)})
Internal implementation of dirichlet BCs
Boundary Condition Implementation Details
FiniteElementContainers.AbstractBC — Typeabstract type AbstractBC{F<:Function}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<:Integerdofs::AbstractVector{I} where I<:Integerelements::AbstractVector{I} where I<:Integernodes::AbstractVector{I} where I<:Integersides::AbstractVector{I} where I<:Integerside_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;
block_name,
nset_name,
sset_name
)
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