From 8c955d2b5f383a9c6814be9793b511dcc021febc Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Sun, 13 Aug 2017 21:43:25 +0300 Subject: [PATCH] Add another loop to assembly procedure Yet another loop, but this way we can preallocate matrices when constructiong local matrices of elements with same dimensions (which is the case in practice) --- src/assembly.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/assembly.jl b/src/assembly.jl index 8029aaa..dad60dc 100644 --- a/src/assembly.jl +++ b/src/assembly.jl @@ -73,3 +73,11 @@ function assemble!(problem::Problem, time::Real, ::Type{Val{:mass_matrix}}; dens end end +function assemble!(assembly::Assembly, problem::Problem, elements::Vector{Element}, time::Real) + warn("assemble!() this is default assemble operation, decreased performance can be expected without preallocation of memory!") + for element in elements + assemble!(assembly, problem, element, time) + end + return nothing +end +