Merge pull request #225 from JuliaFEM/KristofferC-patch-2

Improve performance in elasticity by moving out the computation of X from the integration point loop.

Before:
```
 12.576967 seconds (37.65 M allocations: 1.852 GiB, 11.65% gc time)
```

After:
```
 11.251927 seconds (35.27 M allocations: 1.692 GiB, 11.27% gc time)
```

2 million allocations less.
This commit is contained in:
Jukka Aho
2019-04-08 18:44:59 +03:00
committed by GitHub
+2 -1
View File
@@ -130,13 +130,14 @@ function assemble!(assembly::Assembly,
for element in elements
u = element("displacement", time)
X = element("geometry", time)
fill!(Km, 0.0)
fill!(Kg, 0.0)
fill!(f_int, 0.0)
fill!(f_ext, 0.0)
for ip in get_integration_points(element)
X = element("geometry", time)
eval_basis!(bi, X, ip)
w = ip.weight*bi.detJ
N = bi.N