|
9 | 9 | """
|
10 | 10 | $(TYPEDEF)
|
11 | 11 |
|
12 |
| -block of an FEMatrix that carries coefficients for an associated pair of FESpaces and can be assigned as an two-dimensional AbstractArray (getindex, setindex, size) |
| 12 | +A block of an `FEMatrix` representing the coupling between two finite element spaces. |
| 13 | +
|
| 14 | +`FEMatrixBlock` acts as a two-dimensional array (subclassing `AbstractArray{TvM, 2}`) and stores the coefficients for a specific pair of row and column finite element spaces (`FESpace`). |
| 15 | +Each block is mapped to a submatrix of the global sparse matrix, with offsets and sizes corresponding to the degrees of freedom of the associated spaces. |
| 16 | +
|
| 17 | +# Fields |
| 18 | +- `name::String`: Name of the block (for identification and display). |
| 19 | +- `FES::FESpace{TvG, TiG, FETypeX, APTX}`: Row finite element space. |
| 20 | +- `FESY::FESpace{TvG, TiG, FETypeY, APTY}`: Column finite element space. |
| 21 | +- `offset::Int64`: Row offset in the global matrix. |
| 22 | +- `offsetY::Int64`: Column offset in the global matrix. |
| 23 | +- `last_index::Int64`: Last row index for this block. |
| 24 | +- `last_indexY::Int64`: Last column index for this block. |
| 25 | +- `entries::AbstractSparseMatrix{TvM, TiM}`: Reference to the underlying global sparse matrix (shared with the parent `FEMatrix`). |
| 26 | +
|
| 27 | +See also: [`FEMatrix`], [`FESpace`] |
13 | 28 | """
|
14 | 29 | struct FEMatrixBlock{TvM, TiM, TvG, TiG, FETypeX, FETypeY, APTX, APTY} <: AbstractArray{TvM, 2}
|
15 | 30 | name::String
|
|
40 | 55 | """
|
41 | 56 | $(TYPEDEF)
|
42 | 57 |
|
43 |
| -an AbstractMatrix (e.g. an ExtendableSparseMatrix) with an additional layer of several FEMatrixBlock subdivisions each carrying coefficients for their associated pair of FESpaces |
| 58 | +A block-structured sparse matrix type for finite element assembly. |
| 59 | +
|
| 60 | +`FEMatrix` represents a (typically sparse) matrix with an additional layer of structure: it is subdivided into multiple `FEMatrixBlock`s, each associated with a specific pair of finite element spaces (`FESpace`). |
| 61 | +
|
| 62 | +# Fields |
| 63 | +- `FEMatrixBlocks::Array{FEMatrixBlock{TvM, TiM, TvG, TiG}, 1}`: The array of matrix blocks, each corresponding to a pair of row and column finite element spaces. |
| 64 | +- `entries::AbstractSparseMatrix{TvM, TiM}`: The underlying sparse matrix storing all coefficients. |
| 65 | +- `tags::Matrix{Any}`: Optional tags for identifying or accessing blocks. |
| 66 | +
|
| 67 | +# Type Parameters |
| 68 | +- `TvM`: Value type for matrix entries (e.g., `Float64`). |
| 69 | +- `TiM`: Integer type for matrix indices (e.g., `Int64`). |
| 70 | +- `TvG`, `TiG`: Value and index types for the associated finite element spaces. |
| 71 | +- `nbrow`: Number of block rows. |
| 72 | +- `nbcol`: Number of block columns. |
| 73 | +- `nbtotal`: Total number of blocks. |
44 | 74 | """
|
45 | 75 | struct FEMatrix{TvM, TiM, TvG, TiG, nbrow, nbcol, nbtotal} <: AbstractSparseMatrix{TvM, TiM}
|
46 | 76 | FEMatrixBlocks::Array{FEMatrixBlock{TvM, TiM, TvG, TiG}, 1}
|
@@ -204,7 +234,7 @@ function FEMatrix(
|
204 | 234 | return FEMatrix{TvM, TiM}(FESXv, FESYv; kwargs...)
|
205 | 235 | end
|
206 | 236 |
|
207 |
| -function FEMatrix{TvM, TiM}(FESX::Array{<:FESpace{TvG, TiG}, 1}, FESY::Array{<:FESpace{TvG, TiG}, 1}; entries = nothing, name = :automatic, tags = nothing, tagsX = tags, tagsY = tagsX, npartitions = 1, kwargs...) where {TvM, TiM, TvG, TiG} |
| 237 | +function FEMatrix{TvM, TiM}(FESX::Array{<:FESpace{TvG, TiG}, 1}, FESY::Array{<:FESpace{TvG, TiG}, 1} = FESX; entries = nothing, name = :automatic, tags = nothing, tagsX = tags, tagsY = tagsX, npartitions = 1, kwargs...) where {TvM, TiM, TvG, TiG} |
208 | 238 | ndofsX, ndofsY = 0, 0
|
209 | 239 | for j in 1:length(FESX)
|
210 | 240 | ndofsX += FESX[j].ndofs
|
|
0 commit comments