Assembly
Ferrite.start_assemble — Functionstart_assemble(K::AbstractSparseMatrixCSC; fillzero::Bool=true) -> CSCAssembler
start_assemble(K::AbstractSparseMatrixCSC, f::Vector; fillzero::Bool=true) -> CSCAssemblerCreate a CSCAssembler from the matrix K and optional vector f.
start_assemble(K::Symmetric{AbstractSparseMatrixCSC}; fillzero::Bool=true) -> SymmetricCSCAssembler
start_assemble(K::Symmetric{AbstractSparseMatrixCSC}, f::Vector=Td[]; fillzero::Bool=true) -> SymmetricCSCAssemblerCreate a SymmetricCSCAssembler from the matrix K and optional vector f.
CSCAssembler and SymmetricCSCAssembler allocate workspace necessary for efficient matrix assembly. To assemble the contribution from an element, use assemble!.
The keyword argument fillzero can be set to false if K and f should not be zeroed out, but instead keep their current values.
Depending on the loaded extensions more assembly formats become available through this interface.
Ferrite.assemble! — Functionassemble!(a::COOAssembler, dofs, Ke)
assemble!(a::COOAssembler, dofs, Ke, fe)Assembles the element matrix Ke and element vector fe into a.
assemble!(a::COOAssembler, rowdofs, coldofs, Ke)Assembles the matrix Ke into a according to the dofs specified by rowdofs and coldofs.
assemble!(g, dofs, ge)Assembles the element residual ge into the global residual vector g.
assemble!(A::AbstractAssembler, dofs::AbstractVector{Int}, Ke::AbstractMatrix)
assemble!(A::AbstractAssembler, dofs::AbstractVector{Int}, Ke::AbstractMatrix, fe::AbstractVector)Assemble the element stiffness matrix Ke (and optional force vector fe) into the global stiffness (and force) in A, given the element degrees of freedom dofs.
This is equivalent to K[dofs, dofs] += Ke and f[dofs] += fe, where K is the global stiffness matrix and f the global force/residual vector, but more efficient.
Ferrite.finish_assemble — Functionfinish_assemble(a::COOAssembler) -> K, fFinalize the assembly and return the sparse matrix K::SparseMatrixCSC and vector f::Vector. If the assembler has not been used for vector assembly, f is an empty vector.