Skip to content

Commit 4d8327e

Browse files
authored
Merge pull request #208 from MultiSimOLab/visco-bench
Updated Visco-Benchmark: equal cost, better syntax
2 parents 43e3a47 + e632255 commit 4d8327e

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

benchmark/ConstitutiveModelsBenchmark/ViscousModelsBenchmarks.jl

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ using BenchmarkTools
55

66
function benchmark_viscous_model()
77
elasto = NeoHookean3D=1e6, μ=1e3)
8-
visco = ViscousIncompressible(IsochoricNeoHookean3D=1e3), τ=10.)
8+
visco = ViscousIncompressible(IsochoricNeoHookean3D=1e2), τ=10.)
9+
visco = ViscousIncompressible(IsochoricNeoHookean3D=1e3), τ=1.)
10+
visco = ViscousIncompressible(IsochoricNeoHookean3D=1e4), τ=.1)
11+
visco = ViscousIncompressible(IsochoricNeoHookean3D=1e5), τ=.01)
912
model = GeneralizedMaxwell(elasto, visco)
1013
update_time_step!(model, 1e-2)
11-
Ψ, ∂Ψu, ∂Ψuu = model()
14+
Ψ, ∂Ψ∂F, ∂∂Ψ∂FF = model()
1215
F = TensorValue(1.:9...) * 1e-3 + I3
1316
Fn = TensorValue(1.:9...) * 5e-4 + I3
1417
Uvn = TensorValue(1.,2.,3.,2.,4.,5.,3.,5.,6.) * 2e-4 + I3
@@ -17,8 +20,8 @@ function benchmark_viscous_model()
1720
λvn = 1e-3
1821
Avn = VectorValue(Uvn..., λvn)
1922
SUITE["Constitutive models"]["Visco-elastic Ψ"] = @benchmarkable $Ψ($F, $Fn, $Avn)
20-
SUITE["Constitutive models"]["Visco-elastic ∂Ψu"] = @benchmarkable $Ψu($F, $Fn, $Avn)
21-
SUITE["Constitutive models"]["Visco-elastic ∂Ψuu"] = @benchmarkable $Ψuu($F, $Fn, $Avn)
23+
SUITE["Constitutive models"]["Visco-elastic ∂Ψ∂F"] = @benchmarkable $Ψ∂F($F, $Fn, $Avn)
24+
SUITE["Constitutive models"]["Visco-elastic ∂∂Ψ∂FF"] = @benchmarkable $∂Ψ∂FF($F, $Fn, $Avn)
2225
end
2326

2427
function benchmark_viscous_polyconvex_model()
@@ -29,16 +32,16 @@ function benchmark_viscous_polyconvex_model()
2932
visco = ViscousPolyconvex=1e5, τ=.01)
3033
model = GeneralizedMaxwell(elasto, visco)
3134
update_time_step!(model, 1e-1)
32-
Ψ, ∂Ψu, ∂Ψuu = model()
35+
Ψ, ∂Ψ∂F, ∂∂Ψ∂FF = model()
3336
F = TensorValue(1.:9...) * 1e-2 + I3
3437
Fn = TensorValue(1.:9...) * 5e-3 + I3
3538
Cvn = 0.25 * (F+Fn) · (F+Fn)'
3639
F /= det(F)
3740
Fn /= det(Fn)
3841
Cvn /= det(Cvn)
3942
SUITE["Constitutive models"]["Visco-polyconvex Ψ"] = @benchmarkable $Ψ($F, $Fn, $Cvn)
40-
SUITE["Constitutive models"]["Visco-polyconvex ∂Ψu"] = @benchmarkable $Ψu($F, $Fn, $Cvn)
41-
SUITE["Constitutive models"]["Visco-polyconvex ∂Ψuu"] = @benchmarkable $Ψuu($F, $Fn, $Cvn)
43+
SUITE["Constitutive models"]["Visco-polyconvex ∂Ψ∂F"] = @benchmarkable $Ψ∂F($F, $Fn, $Cvn)
44+
SUITE["Constitutive models"]["Visco-polyconvex ∂∂Ψ∂FF"] = @benchmarkable $∂Ψ∂FF($F, $Fn, $Cvn)
4245
end
4346

4447
benchmark_viscous_model()

0 commit comments

Comments
 (0)