FEVector

A FEVector represents a block-structured vector used in finite element computations. It consists of one or more FEVectorBlocks, each associated with a specific FESpace. All blocks share a common one-dimensional array that stores the global degrees of freedom (DoFs). Each block can only write to a region of the array specified by offsets, ensuring that each FESpace manages its own DoFs within the global vector.

Core.ArrayMethod
Array(FEB::FEVectorBlock) -> Vector

Convert an FEVectorBlock to a standard Julia array containing the coefficients for that block.

source
Core.ArrayMethod
Array(FEV::FEVector) -> Vector

Convert an FEVector to a standard Julia array containing all coefficients.

source
ExtendableFEMBase.FEVectorType
struct FEVector{T, Tv, Ti}

A block-structured vector for storing coefficients associated with one or more finite element spaces (FESpace).

An FEVector consists of a global coefficient array subdivided into multiple FEVectorBlocks, each corresponding to a specific FESpace. This structure enables efficient block-wise access, assembly, and manipulation of solution vectors in finite element computations, especially for multi-field or mixed problems.

Type Parameters

  • T: Value type of the vector entries (e.g., Float64).
  • Tv: Value type for the associated FESpace.
  • Ti: Integer type for the associated FESpace.

Fields

  • FEVectorBlocks::Array{FEVectorBlock{T, Tv, Ti}, 1}: Array of blocks, each representing a segment of the global vector for a specific FESpace.
  • entries::Array{T, 1}: The global coefficient array, shared by all blocks.
  • tags::Vector{Any}: Optional tags for identifying or accessing blocks (e.g., by name or symbol).
source
ExtendableFEMBase.FEVectorMethod
FEVector{T}(FES; name = nothing, tags = nothing, kwargs...) where T <: Real

Constructs an FEVector for storing coefficients associated with one or more finite element spaces (FESpace).

  • If FES is a single FESpace, the resulting FEVector contains one block.
  • If FES is a vector of FESpace objects, the resulting FEVector is block-structured, with one block per space.

Optionally, you can assign a name (as a String for all blocks, or a vector of String for each block) and/or tags (as an array of any type) to the blocks for identification and access.

Arguments

  • FES::FESpace or FES::Vector{<:FESpace}: The finite element space(s) for which to create the vector.

Keyword Arguments

  • entries: Optional array of coefficients. If not provided, a zero vector of appropriate length is created.
  • name: Name for the vector or for each block (default: nothing causes auto naming by index or tag).
  • tags: Array of tags for the blocks (default: [], i.e. block access only by index).

Returns

  • An FEVector object with one or more FEVectorBlocks, each corresponding to a given FESpace.
source
ExtendableFEMBase.FEVectorBlockType
struct FEVectorBlock{T, Tv, Ti, FEType, APT} <: AbstractArray{T, 1}

A block within an FEVector representing a contiguous segment of coefficients associated with a specific finite element space (FESpace).

Each FEVectorBlock provides array-like access to the degrees of freedom (DOFs) for its associated FESpace, mapping local indices to a shared global coefficient array. This enables efficient block-wise operations, assembly, and extraction of sub-vectors corresponding to different FE spaces.

Type Parameters

  • T: Value type of the vector entries (e.g., Float64).
  • Tv: Value type for the associated FESpace.
  • Ti: Integer type for the associated FESpace.
  • FEType: Type of the finite element.
  • APT: Assembly type for the finite element.

Fields

  • name::String: Name or label for this block (for identification or debugging).
  • FES::FESpace{Tv, Ti, FEType, APT}: The finite element space associated with this block.
  • offset::Int: Global offset (start index in the global vector).
  • last_index::Int: Global end index (inclusive).
  • entries::Array{T, 1}: Reference to the global coefficient array (shared with the parent FEVector).

Usage

FEVectorBlock is typically created internally by FEVector constructors and provides efficient access to the coefficients for a particular FE space. Supports standard array operations (getindex, setindex!, size, length, etc.) and can be used for block-wise assembly, extraction, and manipulation.

source
Base.append!Method
append!(
    FEF::FEVector{T},
    FES::FESpace{Tv, Ti, FEType, APT};
    name,
    tag
) -> Int64

Overloaded append function for FEVector that adds a FEVectorBlock at the end.

source
Base.fill!Method
fill!(b::FEVectorBlock, value)

Overloaded fill function for FEVectorBlock (only fills the block, not the complete FEVector).

source
Base.lengthMethod
length(FEB::FEVectorBlock) -> Int64

Custom length function for FEVectorBlock that gives the coressponding number of degrees of freedoms of the associated FESpace

source
Base.lengthMethod
length(FEF::FEVector) -> Int64

Custom length function for FEVector that gives the number of defined FEMatrixBlocks in it

source
Base.showMethod
show(io::IO, FEF::FEVector)

Custom show function for FEVector that prints some information on its blocks.

source
Base.showMethod
show(
    io::IO,
    _::MIME{Symbol("text/plain")},
    FEB::FEVectorBlock
)

Custom show function for FEVectorBlock that prints some information and the view of that block.

source
Base.viewMethod
view(
    FEB::FEVectorBlock,
    inds::Union{Integer, AbstractArray{<:Integer}}
) -> Any

Returns a view of a slice of the FEVectorBlock, specified by local indices inds (which can be an integer, a range, or an array of indices). The indices are relative to the block (i.e., 1 corresponds to the first entry of the block).

Arguments

  • FEB::FEVectorBlock: The FEVectorBlock to view.
  • inds: Indices relative to the block (e.g., 1:30, [2,4,6]).

Returns

  • A view into the underlying entries array for the specified slice.
source
Base.viewMethod
view(
    FEB::FEVectorBlock
) -> SubArray{_A, 1, P, Tuple{UnitRange{Int64}}, true} where {_A, P<:(Vector)}

Returns a view of the part of the full FEVector that coressponds to the block.

source
ExtendableFEMBase.FESpacesMethod
FESpaces(
    FEV::FEVector{T, Tv, Ti}
) -> Vector{T} where T<:FESpace

Returns the vector of FEspaces for the blocks of the given FEVector.

source
ExtendableFEMBase.normsMethod
norms(FEV::FEVector{T}) -> Any
norms(FEV::FEVector{T}, p::Real) -> Any

Returns a vector with the individual norms of all blocks.

source
LinearAlgebra.dotMethod
dot(a::FEVectorBlock{T}, b::FEVectorBlock{T}) -> Any

Scalar product between two FEVEctorBlocks.

source