Skip to content

Added interpolate_L2_field - #223

Merged
miguelmaso merged 2 commits into
mainfrom
l2-interp
Aug 25, 2026
Merged

miguelmaso merged 2 commits into
mainfrom
l2-interp

Conversation

@miguelmaso

@miguelmaso miguelmaso commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

The function interpolate_L2_field allows to easily export the first Piola-Kirchhoff stress (or any L2 field) to VTK.
The function is compatible with:

  • scalars
  • vectors
  • tensors

By defaut, the type will be inferred from the cell field/lazy operation

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Benchmark Results (Julia v1)

Time benchmarks
main 2747719... main / 2747719...
Constitutive models/Visco-elastic Ψ 29.2 ± 12 μs 28.5 ± 12 μs 1.03 ± 0.61
Constitutive models/Visco-elastic ∂Ψ∂F 24.3 ± 12 μs 24.6 ± 13 μs 0.988 ± 0.71
Constitutive models/Visco-elastic ∂∂Ψ∂FF 0.0641 ± 0.021 ms 0.0651 ± 0.021 ms 0.984 ± 0.45
Constitutive models/Visco-polyconvex Ψ 0.111 ± 0.002 μs 0.11 ± 0.002 μs 1.01 ± 0.026
Constitutive models/Visco-polyconvex ∂Ψ∂F 0.124 ± 0.003 μs 0.124 ± 0.002 μs 1 ± 0.029
Constitutive models/Visco-polyconvex ∂∂Ψ∂FF 7.45 ± 3.2 μs 6.57 ± 3.4 μs 1.13 ± 0.76
Simulations/StaticMechanicalDirichlet 0.114 ± 0.0081 s 0.113 ± 0.0054 s 1.01 ± 0.086
Simulations/StaticMechanicalNeumann 0.0968 ± 0.02 s 0.0999 ± 0.019 s 0.969 ± 0.27
Simulations/ViscoElastic 9.79 s 10.1 s 0.97
Tensor algebra/Cofactor 0.059 ± 0.002 μs 0.062 ± 0.003 μs 0.952 ± 0.056
Tensor algebra/Det(A)Inv(A') 0.083 ± 0.002 μs 0.084 ± 0.002 μs 0.988 ± 0.033
Tensor algebra/IIsym 0.057 ± 0.003 μs 0.058 ± 0.002 μs 0.983 ± 0.062
Tensor algebra/push_forward_C_to_F 0.178 ± 0.013 μs 0.177 ± 0.016 μs 1.01 ± 0.12
Tensor algebra/×ᵢ⁴ 0.055 ± 0.002 μs 0.055 ± 0.002 μs 1 ± 0.051
Tensor algebra/δδ_λ_2d 19 ± 1 ns 19 ± 1 ns 1 ± 0.074
Tensor algebra/δδ_μ_2d 19 ± 1 ns 19 ± 1 ns 1 ± 0.074
time_to_load 2.01 ± 0.046 s 1.98 ± 0.047 s 1.01 ± 0.034
Memory benchmarks
main 2747719... main / 2747719...
Constitutive models/Visco-elastic Ψ 0.542 k allocs: 0.0443 MB 0.542 k allocs: 0.0443 MB 1
Constitutive models/Visco-elastic ∂Ψ∂F 0.593 k allocs: 0.0492 MB 0.593 k allocs: 0.0492 MB 1
Constitutive models/Visco-elastic ∂∂Ψ∂FF 1.05 k allocs: 0.0853 MB 1.05 k allocs: 0.0853 MB 1
Constitutive models/Visco-polyconvex Ψ 0 allocs: 0 B 0 allocs: 0 B
Constitutive models/Visco-polyconvex ∂Ψ∂F 0 allocs: 0 B 0 allocs: 0 B
Constitutive models/Visco-polyconvex ∂∂Ψ∂FF 0.187 k allocs: 15.2 kB 0.187 k allocs: 15.2 kB 1
Simulations/StaticMechanicalDirichlet 1.51 M allocs: 0.108 GB 1.51 M allocs: 0.108 GB 1
Simulations/StaticMechanicalNeumann 1.48 M allocs: 0.0927 GB 1.48 M allocs: 0.0927 GB 1
Simulations/ViscoElastic 0.162 G allocs: 12.8 GB 0.162 G allocs: 12.8 GB 1
Tensor algebra/Cofactor 2 allocs: 0.156 kB 2 allocs: 0.156 kB 1
Tensor algebra/Det(A)Inv(A') 4 allocs: 0.25 kB 4 allocs: 0.25 kB 1
Tensor algebra/IIsym 1 allocs: 0.656 kB 1 allocs: 0.656 kB 1
Tensor algebra/push_forward_C_to_F 1 allocs: 0.656 kB 1 allocs: 0.656 kB 1
Tensor algebra/×ᵢ⁴ 1 allocs: 0.656 kB 1 allocs: 0.656 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.149 k allocs: 11.1 kB 0.149 k allocs: 11.1 kB 1

@miguelmaso
miguelmaso merged commit e2f0bbb into main Aug 25, 2026
4 checks passed
@miguelmaso
miguelmaso deleted the l2-interp branch August 25, 2026 14:56
@miguelmaso miguelmaso mentioned this pull request Aug 25, 2026
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.

1 participant