-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use a new _ParametricGeometry for specializations #131
Conversation
…jl into tetrahedron
I'm trying out a slightly (moderately (strongly)) hacky solution. I don't love it, but it gets the analytical jacobian for BezierCurve working, so let's see how performance compares. |
Update: The hacky solution was able to get the |
cc: @JoshuaLampert, @kylebeggs Just need to update the docs and I think this one is otherwise just about done. |
So this means |
Sorry, I have not been able to keep up with this PR. However, if this is true:
I would urge to fix this before merging. Just my opinion but performance should be near the top in priority in a package like this. |
I think this is definitely worth considering. I had visions of defining analytical methods for geometries like
I'm a little disappointed that performance decreased for
This is a good question. I haven't done any real numerical sensitivity analysis but I suspect that most practical geometries have parametric functions that evolve fairly slowly, so the sensitivity of the result to changes in step size is likely reduced, i.e. |
@kylebeggs, I didn't see your comment until after posting mine. I'm going
to need some time to dial in the implementation with this one, so (if
you've got the time) go ahead and press forward with #129 (`AutoEnzyme`)
and we can plan to merge that one first.
…On Thu, Nov 14, 2024 at 8:25 AM Kyle Beggs ***@***.***> wrote:
Sorry, I have not been able to keep up with this PR. However, if this is
true:
The new method for integrating Triangles is ~5 times slower now. What do
you think about that?
I would urge to fix this before merging. Just my opinion but performance
should be near the top in priority in a package like this.
—
Reply to this email directly, view it on GitHub
<#131 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA657OUMNXB3Z6AIAPY3SEL2ASQGDAVCNFSM6AAAAABRQ5Y7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZWGM2TGOJXHA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Performance with this change is oddly kind of a mixed bag. There's actually a couple of ideas contained in this PR, so I think I'm going to partition it into multiple smaller changes to make them easier to review and reason about. |
Changes
_ParametricGeometry <: Meshes.Geometry
type to serve as a simple wrapper for custom parametric functions._ParametricGeometry
with domain-transformed parametric function, and then use the standard_integral
code paths. This new process was applied to specialization methods for:BezierCurve
Line
Plane
Ray
Tetrahedron
Triangle
jacobian(::BezierCurve, ts, ::Analytical)
method - performance was inferior to the genericFiniteDifference
method._guarantee_analytical
_parametric(::Geometry, ts...)
used for specializations_zeros([T,] N)
and_ones([T,] N)
return anNTuple{N,T}
of zeros/ones (faster than allocating a vector withBase.zeros/ones
)BezierCurve
from normal section, reducing redundancy.Triangle
.Results
Tetrahedron
not fully supported #40 by adding full support for integratingTetrahedron
types._ParametricGeometry
in the future.BezierCurve
.HAdaptiveCubature
rule.Triangle
due to new requirement to calldifferential
inside integrand (vs baked-in analytical), but simultaneously discovered and fixed a bug where Unitful functions couldn't be integrated with the old version.TODO