Parameters

Parameters bundles everything a physics evaluation needs that is not the solution field itself: boundary and initial conditions, sources, the time stepper, and the per-block physics and properties.

Per-block physics and properties

physics and properties may be given either as a single object shared by the whole mesh

p = create_parameters(mesh, asm, physics, props)

or as a NamedTuple with one entry per element block, keyed by block name

p = create_parameters(
    mesh, asm,
    (steel = steel_physics, foam = foam_physics),
    (steel = steel_props,   foam = foam_props)
)

In the single-object form the object is replicated across every block. In the NamedTuple form the keys must be exactly the mesh's block names: a block with no entry, or an entry naming no block, raises a BlockMismatchError rather than running with some block silently taking another block's material.

The entries are reordered to match the block order of the function space (see Block order), so the order the NamedTuple is written in does not matter — only the names do. Downstream, p.physics and p.properties are always keyed by block name and ordered by block index, which is the pairing foreach_block and the assembly kernels rely on.

API

FiniteElementContainers.ParametersType
struct Parameters{IT<:Integer, RT<:Number, IV<:AbstractArray{IT<:Integer, 1}, RV<:AbstractArray{RT<:Number, 1}, RM1<:(AbstractMatrix), RM2<:(AbstractMatrix), RM3<:(AbstractMatrix), RM4<:(AbstractMatrix), ICFuncs<:(AbstractVector), DBCFuncs<:(AbstractVector), SRCFuncs<:(AbstractVector), NBCFuncs<:(AbstractVector), PBCFuncs<:(AbstractVector), RBCFuncs<:(AbstractVector), Phys, Props, Coords<:FiniteElementContainers.AbstractField, Field<:FiniteElementContainers.AbstractField} <: FiniteElementContainers.AbstractParameters
  • ics::InitialConditions{ICFuncs, IV, RV} where {IT<:Integer, RT<:Number, IV<:AbstractVector{IT}, RV<:AbstractVector{RT}, ICFuncs<:(AbstractVector)}

  • dirichlet_bcs::DirichletBCs{DBCFuncs, IV, RV} where {IT<:Integer, RT<:Number, IV<:AbstractVector{IT}, RV<:AbstractVector{RT}, DBCFuncs<:(AbstractVector)}

  • neumann_bcs::NeumannBCs{NBCFuncs, IT, IV, RM1} where {IT<:Integer, IV<:AbstractVector{IT}, RM1<:(AbstractMatrix), NBCFuncs<:(AbstractVector)}

  • periodic_bcs::PeriodicBCs{PBCFuncs, IV, RV} where {IT<:Integer, RT<:Number, IV<:AbstractVector{IT}, RV<:AbstractVector{RT}, PBCFuncs<:(AbstractVector)}

  • robin_bcs::RobinBCs{RBCFuncs, IT, IV, RM2, RM3} where {IT<:Integer, IV<:AbstractVector{IT}, RM2<:(AbstractMatrix), RM3<:(AbstractMatrix), RBCFuncs<:(AbstractVector)}

  • sources::Sources{SRCFuncs, RM4} where {RM4<:(AbstractMatrix), SRCFuncs<:(AbstractVector)}

  • times::TimeStepper

  • physics::Any

  • properties::Any

  • state_old::StateVariableField{RT, RV} where {RT<:Number, RV<:AbstractVector{RT}}

  • state_new::StateVariableField{RT, RV} where {RT<:Number, RV<:AbstractVector{RT}}

  • coords::FiniteElementContainers.AbstractField

  • field::FiniteElementContainers.AbstractField

  • field_old::FiniteElementContainers.AbstractField

  • hvp_scratch_field::FiniteElementContainers.AbstractField

source
FiniteElementContainers._align_blocksMethod

Align a user-supplied physics/properties argument with the element blocks of fspace, returning a NamedTuple keyed by block name and ordered by block index, so that entry b always belongs to block b.

Everything downstream – _setup_state_variables, foreach_block, the assembly kernels – pairs entry b with block b positionally. A NamedTuple supplied in a different order than the mesh's blocks would therefore hand each block another block's material without any error, so it is permuted here, and its keys are required to be exactly the block names.

source
FiniteElementContainers.update_bc_values!Method
update_bc_values!(
    p::FiniteElementContainers.AbstractParameters,
    assembler
)

This method is used to update the stored bc values. This should be called at the beginning of any load step

This method only handles updating bc values for Dirichlet and Neumann BCs

Robin BC updates are handled in robin assembly method

source