Skip to content

[ENH] Refactor mesh extraction and add scalar field at interface to structural elements | | GEN-12031 #1019

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

Merged
merged 4 commits into from
May 2, 2025

Conversation

Leguark
Copy link
Member

@Leguark Leguark commented May 1, 2025

Description

Refactored the mesh extraction process using marching cubes algorithm to improve accuracy and efficiency. The main changes include:

  1. Renamed scalar_field to scalar_field_at_interface in the StructuralElement class for better clarity
  2. Added proper assignment of scalar field values to structural elements
  3. Simplified the mesh extraction logic by using the output group's scalar field matrix and mask directly
  4. Improved the marching cubes implementation with proper parameters (allow_degenerate=False, method="lewiner")
  5. Added comprehensive tests to verify the mesh extraction results

Relates to #mesh-extraction-improvements

Checklist

  • My code uses type hinting for function and method arguments and return values.
  • I have created tests which cover my code.
  • The test code either 1. demonstrates at least one valuable use case (e.g. integration tests)
    or 2. verifies that outputs are as expected for given inputs (e.g. unit tests).
  • New tests pass locally with my changes.

@Leguark Leguark marked this pull request as ready for review May 1, 2025 13:30
@graphite-app graphite-app bot added the gempy 3 Will come with the next major update label May 1, 2025
@Leguark Leguark changed the title [TEST] Adding asserts to marching cubes test [ENH] Refactor mesh extraction and add scalar field at interface to structural elements May 1, 2025
Copy link

graphite-app bot commented May 1, 2025

Graphite Automations

"Add gempy label" took an action on this PR • (05/01/25)

1 label was added to this PR based on Miguel de la Varga's automation.

@Leguark Leguark changed the title [ENH] Refactor mesh extraction and add scalar field at interface to structural elements [ENH] Refactor mesh extraction and add scalar field at interface to structural elements | | GEN-12031 May 2, 2025
Copy link
Member Author

Leguark commented May 2, 2025

Merge activity

  • May 2, 5:28 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • May 2, 5:29 AM EDT: Graphite rebased this pull request as part of a merge.
  • May 2, 6:27 AM EDT: Graphite rebased this pull request as part of a merge.
  • May 2, 6:36 AM EDT: @Leguark merged this pull request with Graphite.

@Leguark Leguark changed the base branch from masking_mc to graphite-base/1019 May 2, 2025 09:28
@Leguark Leguark changed the base branch from graphite-base/1019 to main May 2, 2025 09:28
@Leguark Leguark force-pushed the marching_cubes_better_intergration branch from 2388ffb to a0f9fc7 Compare May 2, 2025 09:29
Leguark added 4 commits May 2, 2025 10:26
Simplified and clarified the mesh extraction code by removing outdated comments, unused methods, and redundant handling of masks. Added proper mask reshaping and updated marching_cubes function parameters for improved reliability and efficiency. Adjusted test cases accordingly.
Switches the `image` parameter to `True` in the marching cubes test to ensure image generation is tested. This improves test coverage and better validates the functionality of the 3D plotting method.
@Leguark Leguark force-pushed the marching_cubes_better_intergration branch from 6742563 to 95a82f3 Compare May 2, 2025 10:26
@Leguark Leguark merged commit 765d22c into main May 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gempy 3 Will come with the next major update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant