-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: specialize on interpolations in the different Values structs #339
Conversation
Codecov Report
@@ Coverage Diff @@
## master #339 +/- ##
==========================================
- Coverage 87.92% 87.87% -0.06%
==========================================
Files 20 20
Lines 2195 2194 -1
==========================================
- Hits 1930 1928 -2
- Misses 265 266 +1
Continue to review full report at Codecov.
|
@JimBrouzoulis wanted to know for isoparametric mapping: using Ferrite, BenchmarkTools
for dim in (2, 3)
for shape in (RefTetrahedron, RefCube)
for order in (1, 2)
if dim == 3 && shape == RefCube
continue
end
qr = QuadratureRule{dim,shape}(1)
quadratic = Lagrange{dim,shape,order}()
cv_vector = CellVectorValues(qr, quadratic)
cv_scalar = CellScalarValues(qr, quadratic)
xe = Ferrite.reference_coordinates(quadratic)
@btime reinit!($cv_scalar, $xe)
@btime reinit!($cv_vector, $xe)
end
end
end
|
Perhaps just store the interpolations as fields too? I believe there are some code that currely tries to reverse-engineer that. |
Could do that, I actually think that doesn't take any space.
|
Added the field. Last commit is just some renameing, |
Would it also be faster to allow the compiler to know how many quadrature points there are? So change QuadratureRule to
|
I don't think that will have a big effect. The work inside the quadrature loop should be big enough to offset it. This also applies to I will try add a more representative benchmark. |
The |
I've been trying this out for dispatching the Is there any drawback to also storing the |
pinging this I really like this PR, it can work very nicely for subtyped stuff and eases a lot of other things we faced when trying LOD and adapative prototyping with Ferrite. :) |
forgot to mention this in my previous post: I'd also vote to incorporate the qr in |
The extra parameters on the abstract types could be skipped, then this wouldn't be a problem I think? |
The interpolations are stored as abstract fields in the struct since they are never accessed in performance critical parts of the code, but it is convenient to have access too them after creating the FEValues. Closes #339.
The interpolations are stored as abstract fields in the struct since they are never accessed in performance critical parts of the code, but it is convenient to have access too them after creating the FEValues. Closes #339.
Allows the compiler to know how many base functions there are when doing e.g.
reinit!
.Example benchmark:
Results (PR in left, master in right):