Skip to content

Conversation

@miguelmaso
Copy link
Collaborator

The double contraction operator A:A is optimized and faster than tr(A'·A). After this PR, a lot of replacements should be made in the constitutive models.

@miguelmaso miguelmaso requested a review from jmartfrut November 25, 2025 16:01
@miguelmaso miguelmaso changed the title Added couble contraction operator : Added double contraction operator : Nov 25, 2025
@github-actions
Copy link

github-actions bot commented Nov 25, 2025

Benchmark Results (Julia v1)

Time benchmarks
main 552883b... main / 552883b...
Constitutive models/Visco-elastic Ψ 0.0496 ± 0.029 ms 0.0498 ± 0.028 ms 0.996 ± 0.81
Constitutive models/Visco-elastic ∂Ψu 0.0639 ± 0.0047 ms 0.0644 ± 0.0075 ms 0.993 ± 0.14
Constitutive models/Visco-elastic ∂Ψuu 0.111 ± 0.015 ms 0.112 ± 0.015 ms 0.99 ± 0.19
Simulations/StaticMechanicalDirichlet 0.14 ± 0.0065 s 0.148 ± 0.0091 s 0.948 ± 0.073
Simulations/StaticMechanicalNeumann 0.125 ± 0.0096 s 0.126 ± 0.012 s 0.993 ± 0.12
Simulations/ViscoElastic 8.07 s 8.43 s 0.958
Tensor algebra/Cofactor 0.07 ± 0.01 μs 0.061 ± 0.01 μs 1.15 ± 0.25
Tensor algebra/Det(A)Inv(A') 0.13 ± 0.01 μs 0.14 ± 0.011 μs 0.929 ± 0.1
Tensor algebra/δδ_λ_2d 30 ± 0 ns 30 ± 0 ns 1 ± 0
Tensor algebra/δδ_μ_2d 30 ± 0 ns 30 ± 0 ns 1 ± 0
time_to_load 2.41 ± 0.001 s 2.46 ± 0.02 s 0.977 ± 0.008
Memory benchmarks
main 552883b... main / 552883b...
Constitutive models/Visco-elastic Ψ 1.25 k allocs: 0.0794 MB 1.25 k allocs: 0.0794 MB 1
Constitutive models/Visco-elastic ∂Ψu 1.37 k allocs: 0.0917 MB 1.37 k allocs: 0.0917 MB 1
Constitutive models/Visco-elastic ∂Ψuu 2.31 k allocs: 0.158 MB 2.31 k allocs: 0.158 MB 1
Simulations/StaticMechanicalDirichlet 1.59 M allocs: 0.114 GB 1.59 M allocs: 0.114 GB 1
Simulations/StaticMechanicalNeumann 1.41 M allocs: 0.0901 GB 1.41 M allocs: 0.0901 GB 1
Simulations/ViscoElastic 0.128 G allocs: 8.3 GB 0.128 G allocs: 8.3 GB 1
Tensor algebra/Cofactor 1 allocs: 0.0781 kB 1 allocs: 0.0781 kB 1
Tensor algebra/Det(A)Inv(A') 4 allocs: 0.25 kB 4 allocs: 0.25 kB 1
Tensor algebra/δδ_λ_2d 0 allocs: 0 B 0 allocs: 0 B
Tensor algebra/δδ_μ_2d 0 allocs: 0 B 0 allocs: 0 B
time_to_load 0.159 k allocs: 11.6 kB 0.149 k allocs: 11.1 kB 1.04

@miguelmaso
Copy link
Collaborator Author

Duplicated. inner must be used

@miguelmaso miguelmaso closed this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants