Assembly
Ferrite.start_assemble — Function
start_assemble(K::AbstractSparseMatrixCSC{Tv}; fillzero::Bool=true) -> CSCAssembler{Tv}
start_assemble(K::AbstractSparseMatrixCSC{Tv}, f::Vector{Tv}; fillzero::Bool=true) -> CSCAssembler{Tv}Create a CSCAssembler{Tv} from the matrix K and optional vector f with value type Tv.
start_assemble(K::Symmetric{AbstractSparseMatrixCSC{Tv}}; fillzero::Bool=true) -> SymmetricCSCAssembler{Tv}
start_assemble(K::Symmetric{AbstractSparseMatrixCSC{Tv}}, f::Vector=Tv[]; fillzero::Bool=true) -> SymmetricCSCAssembler{Tv}Create a SymmetricCSCAssembler{Tv} from the matrix K and optional vector f with value type Tv.
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! — Function
assemble!(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::Ferrite.AbstractAssembler, dofs::AbstractVector{Int}, Ke::AbstractMatrix)
assemble!(A::Ferrite.AbstractAssembler, dofs::AbstractVector{Int}, Ke::AbstractMatrix, fe::AbstractVector)Assemble the square 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.
assemble!(A::Ferrite.AbstractAssembler, rowdofs::AbstractVector{Int}, coldofs::AbstractVector{Int}, Ke::AbstractMatrix)
assemble!(A::Ferrite.AbstractAssembler, rowdofs::AbstractVector{Int}, coldofs::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 row degrees of freedom, rowdofs, and element column degrees of freedom, coldofs. This is equivalent to K[rowdofs, coldofs] += Ke and f[rowdofs] += fe, but more efficient.
Ferrite.finish_assemble — Function
finish_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.