From 3c67c9c2c9689a13d273d5242558efacfac1cbc1 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Thu, 15 Nov 2018 12:26:17 -0500 Subject: [PATCH] single threaded --- src/problems_elasticity.jl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/problems_elasticity.jl b/src/problems_elasticity.jl index 1b32356..65cdc5c 100644 --- a/src/problems_elasticity.jl +++ b/src/problems_elasticity.jl @@ -75,10 +75,9 @@ end function assemble!(assembly::Assembly, problem::Problem{Elasticity}, elements::Vector{<:Element}, time, formulation) local_buffer = allocate_buffer(problem, elements) - assemblers = [FEMSparse.start_assemble(assembly.K, assembly.f) for i in 1:Threads.nthreads()] - @time @Threads.threads for i in 1:length(elements) - tid = Threads.threadid() - assemble_element!(assembly, assemblers[tid], problem, elements[i], local_buffer, time, formulation) + assembler = FEMSparse.start_assemble(assembly.K, assembly.f) + for i in 1:length(elements) + assemble_element!(assembly, assembler, problem, elements[i], local_buffer, time, formulation) end end @@ -246,10 +245,8 @@ function assemble_element!(assembly::Assembly, # calculate stress - #E = element("youngs modulus", ip, time)::Float64 - #nu = element("poissons ratio", ip, time)::Float64 - E = 200e3 - nu = 0.3 + E = element("youngs modulus", ip, time)::Float64 + nu = element("poissons ratio", ip, time)::Float64 la = E*nu/((1.0+nu)*(1.0-2.0*nu)) mu = E/(2.0*(1.0+nu)) D[1,1] = D[2,2] = D[3,3] = 2*mu + la