Skip to content

Commit 4f227b2

Browse files
committed
Merge branch 'kam/assembler_value_type' of github.com:Ferrite-FEM/Ferrite.jl into kam/assembler_value_type
2 parents 7f61ffe + f83b71d commit 4f227b2

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/src/devdocs/assembly.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# [Assembly](@id devdocs-assembly)
22

3-
The assembler handles the insertion of the element matrices and element vectors into the system matrix and right hand side.
3+
An assembler handles the insertion of the element matrices and element vectors into the system matrix and vector.
4+
and should *normally* (the exact interface is yet to be fully established) subtype `AbstractAssembler{T}`. Here `T` is the
5+
`eltype` of the contained system matrix and vector. This allows the user to infer the eltype when preallocating the element
6+
matrix and vector, e.g.
7+
```julia
8+
function doassemble!(assembler::Ferrite.AbstractAssembler{T}, ...) where {T}
9+
Ke = zeros(T, n, n) # n = dofs per cell
10+
fe = zeros(T, n)
11+
for cell in CellIterator(...)
12+
element_routine!(Ke, fe, cell, ...)
13+
assemble!(assembler, celldofs(cell), Ke, fe)
14+
end
15+
end
16+
```
417

518
## Custom matrix formats
619
While the CSC and CSR formats are the most common sparse matrix formats in practice, users might want to have optimized custom matrix formats for their specific use-case. The default assemblers [`Ferrite.CSCAssembler`](@ref) and [`Ferrite.CSRAssembler`](@ref) should be able to handle most cases in practice. To support a custom format users have to dispatch the following functions on their matrix type. There is the public interface

0 commit comments

Comments
 (0)