mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-20 01:59:59 +00:00
Merge pull request #106 from JuliaFEM/feature/TimerOutputs.jl
Use TimerOutputs.jl to measure time and memory performance
This commit is contained in:
@@ -8,6 +8,13 @@ This is JuliaFEM -- Finite Element Package
|
||||
"""
|
||||
module JuliaFEM
|
||||
|
||||
using TimerOutputs
|
||||
const to = TimerOutput()
|
||||
function print_statistics()
|
||||
println(to)
|
||||
end
|
||||
export print_statistics
|
||||
|
||||
import Base: getindex, setindex!, convert, length, size, isapprox, similar,
|
||||
start, first, next, done, last, endof, vec, ==, +, -, *, /, haskey, copy,
|
||||
push!, isempty, empty!, append!, sparse, full, read
|
||||
|
||||
+4
-4
@@ -673,10 +673,10 @@ function (solver::Solver{Linear})()
|
||||
info("Starting linear solver")
|
||||
info("Increment time t=$(round(solver.time, 3))")
|
||||
info(repeat("-", 80))
|
||||
initialize!(solver)
|
||||
assemble!(solver)
|
||||
solve!(solver)
|
||||
update!(solver)
|
||||
@timeit to "initialize solver" initialize!(solver)
|
||||
@timeit to "assemble problems" assemble!(solver)
|
||||
@timeit to "solve linear system" solve!(solver)
|
||||
@timeit to "update problems" update!(solver)
|
||||
t1 = round(Base.time()-t0, 2)
|
||||
info("Linear solver ready in $t1 seconds.")
|
||||
end
|
||||
|
||||
@@ -55,3 +55,5 @@ using JuliaFEM.Testing
|
||||
u3_expected = f/E*[-nu, 1] + g/(2*E)*[-nu, 1]
|
||||
@test isapprox(u3, u3_expected)
|
||||
end
|
||||
|
||||
print_statistics()
|
||||
|
||||
Reference in New Issue
Block a user