Skip to content

Commit 2671859

Browse files
authored
Merge pull request #16 from MultiSimOLab/benchmarking
Added benchmarking
2 parents 3a22095 + 1dfdc32 commit 2671859

6 files changed

Lines changed: 39 additions & 33 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Gridap.TensorValues
2+
using HyperFEM.PhysicalModels
3+
using BenchmarkTools
4+
5+
6+
function benchmark_viscous_model()
7+
elasto = NeoHookean3D=1e6, μ=1e3)
8+
visco = ViscousIncompressible(IncompressibleNeoHookean3D=0., μ=1e3), 10.)
9+
model = GeneralizedMaxwell(elasto, visco)
10+
Ψ, ∂Ψu, ∂Ψuu = model(Δt = 1e-2)
11+
F = TensorValue(1.:9...) * 1e-3 + I3
12+
Fn = TensorValue(1.:9...) * 5e-4 + I3
13+
Uvn = TensorValue(1.,2.,3.,2.,4.,5.,3.,5.,6.) * 2e-4 + I3
14+
J = det(F)
15+
Uvn *= J^(-1/3)
16+
λvn = 1e-3
17+
Avn = VectorValue(Uvn.data..., λvn)
18+
SUITE["Constitutive models"]["Visco-elastic Ψ"] = @benchmarkable $Ψ($F, $Fn, $Avn)
19+
SUITE["Constitutive models"]["Visco-elastic ∂Ψu"] = @benchmarkable $∂Ψu($F, $Fn, $Avn)
20+
SUITE["Constitutive models"]["Visco-elastic ∂Ψuu"] = @benchmarkable $∂Ψuu($F, $Fn, $Avn)
21+
end
22+
23+
benchmark_viscous_model()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
SUITE["Constitutive models"] = BenchmarkGroup()
3+
4+
include("ViscousModelsBenchmarks.jl")

test/TestTensorAlgebra/TensorAlgebraBenchmarks.jl renamed to benchmark/TensorAlgebraBenchmarks/TensorAlgebraBenchmarks.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,5 @@ function _δδ_λ_2D(λ::Float64)
4242
λ)
4343
end
4444

45-
@benchmark _δδ_μ_2D(1.0)
46-
@benchmark 1.0 * ((δᵢₖδⱼₗ2D + δᵢₗδⱼₖ2D))
47-
48-
@benchmark _δδ_λ_2D(1.0)
49-
@benchmark 1.0 * δᵢⱼδₖₗ2D
45+
SUITE["Tensor algebra"]["δδ_μ_2d"] = @benchmarkable δᵢₖδⱼₗ2D + δᵢₗδⱼₖ2D
46+
SUITE["Tensor algebra"]["δδ_λ_2d"] = @benchmarkable 1.0 * δᵢⱼδₖₗ2D
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
include("TensorAlgebraBenchmarks.jl")

benchmark/benchmarks.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using BenchmarkTools
2+
using HyperFEM
3+
4+
const SUITE = BenchmarkGroup()
5+
6+
include("TensorAlgebraBenchmarks/benchmarks.jl")
7+
8+
include("ConstitutiveModelsBenchmark/benchmarks.jl")

test/TestConstitutiveModels/ViscousModelsBenchmarks.jl

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)