Skip to content

Try to reduce roundoff error in LocalGeometry constructor #3706

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dennisYatunin
Copy link
Member

@dennisYatunin dennisYatunin commented Mar 18, 2025

Purpose

This PR overwrites the constructor for ClimaCore.Geometry.LocalGeometry in an attempt to reduce the amount of roundoff error, which may be responsible for the lack of conservation @szy21 has observed in long Float32 simulations.

To-do

If this change fixes the conservation issue, it should be moved into ClimaCore.

Content

  • Replace gᵢⱼ = ∂x∂ξ' * ∂x∂ξ with gᵢⱼ = (∂x∂ξ' * ∂x∂ξ + (∂x∂ξ' * ∂x∂ξ)') / 2
  • Replace gⁱʲ = ∂ξ∂x' * ∂ξ∂x with gⁱʲ = inv(gᵢⱼ)
  • Compute J and WJ as J = det(∂x∂ξ) and WJ = W * J

  • I have read and checked the items on the review checklist.

@dennisYatunin dennisYatunin requested a review from szy21 March 18, 2025 01:46
@dennisYatunin dennisYatunin force-pushed the dy/reduce_roundoff_error branch 3 times, most recently from e57e49d to f0f68be Compare March 18, 2025 02:48
@dennisYatunin dennisYatunin force-pushed the dy/reduce_roundoff_error branch from f0f68be to a747932 Compare March 18, 2025 02:50
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