Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions benchmark/ConstitutiveModelsBenchmark/ViscousModelsBenchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Gridap.TensorValues
using HyperFEM.PhysicalModels
using BenchmarkTools


function benchmark_viscous_model()
elasto = NeoHookean3D(λ=1e6, μ=1e3)
visco = ViscousIncompressible(IncompressibleNeoHookean3D(λ=0., μ=1e3), 10.)
model = GeneralizedMaxwell(elasto, visco)
Ψ, ∂Ψu, ∂Ψuu = model(Δt = 1e-2)
F = TensorValue(1.:9...) * 1e-3 + I3
Fn = TensorValue(1.:9...) * 5e-4 + I3
Uvn = TensorValue(1.,2.,3.,2.,4.,5.,3.,5.,6.) * 2e-4 + I3
J = det(F)
Uvn *= J^(-1/3)
λvn = 1e-3
Avn = VectorValue(Uvn.data..., λvn)
SUITE["Constitutive models"]["Visco-elastic Ψ"] = @benchmarkable $Ψ($F, $Fn, $Avn)
SUITE["Constitutive models"]["Visco-elastic ∂Ψu"] = @benchmarkable $∂Ψu($F, $Fn, $Avn)
SUITE["Constitutive models"]["Visco-elastic ∂Ψuu"] = @benchmarkable $∂Ψuu($F, $Fn, $Avn)
end

benchmark_viscous_model()
4 changes: 4 additions & 0 deletions benchmark/ConstitutiveModelsBenchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

SUITE["Constitutive models"] = BenchmarkGroup()

include("ViscousModelsBenchmarks.jl")
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,5 @@ function _δδ_λ_2D(λ::Float64)
λ)
end

@benchmark _δδ_μ_2D(1.0)
@benchmark 1.0 * ((δᵢₖδⱼₗ2D + δᵢₗδⱼₖ2D))

@benchmark _δδ_λ_2D(1.0)
@benchmark 1.0 * δᵢⱼδₖₗ2D
SUITE["Tensor algebra"]["δδ_μ_2d"] = @benchmarkable δᵢₖδⱼₗ2D + δᵢₗδⱼₖ2D
SUITE["Tensor algebra"]["δδ_λ_2d"] = @benchmarkable 1.0 * δᵢⱼδₖₗ2D
2 changes: 2 additions & 0 deletions benchmark/TensorAlgebraBenchmarks/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

include("TensorAlgebraBenchmarks.jl")
8 changes: 8 additions & 0 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using BenchmarkTools
using HyperFEM

const SUITE = BenchmarkGroup()

include("TensorAlgebraBenchmarks/benchmarks.jl")

include("ConstitutiveModelsBenchmark/benchmarks.jl")
28 changes: 0 additions & 28 deletions test/TestConstitutiveModels/ViscousModelsBenchmarks.jl

This file was deleted.