Skip to content

Conversation

@savithru-flex
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for translating the element_type="tetrahedra" option in CustomZones to the enforceTetrahedralElements flag in the volume meshing JSON output, along with corresponding test coverage.

  • Implements translation logic to conditionally add enforceTetrahedralElements=True when element_type="tetrahedra" is set on CustomZones
  • Adds two new tests to verify the translation behavior for both element_type="tetrahedra" and element_type="mixed" settings
  • Updates code structure to build volume dictionaries conditionally before appending to the list

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
flow360/component/simulation/translator/volume_meshing_translator.py Modified _get_custom_volumes function to extract element_type from CustomZones and conditionally add enforceTetrahedralElements field to CustomVolume dictionaries
tests/simulation/translator/test_volume_meshing_translator.py Added two new test functions: test_custom_zones_element_type_tetrahedra to verify the translation of element_type="tetrahedra" and test_custom_zones_element_type_mixed to verify default behavior
Comments suppressed due to low confidence (1)

flow360/component/simulation/translator/volume_meshing_translator.py:247

  • The enforceTetrahedralElements field is not being applied to SeedpointVolume instances when element_type="tetrahedra" is set on the parent CustomZones. According to the CustomZones class definition, the element_type field applies to "the generated volume zones" which includes both CustomVolume and SeedpointVolume entities. The logic should be updated to conditionally add enforceTetrahedralElements to the SeedpointVolume dictionary as well, similar to how it's handled for CustomVolume.
                if isinstance(custom_volume, SeedpointVolume):
                    custom_volumes.append(
                        {
                            "name": custom_volume.name,
                            "pointInMesh": [
                                coord.value.item() for coord in custom_volume.point_in_mesh
                            ],
                        }
                    )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Ben <[email protected]>
@savithru-flex savithru-flex enabled auto-merge (squash) December 24, 2025 22:18
@savithru-flex savithru-flex merged commit cdf9454 into main Dec 24, 2025
20 checks passed
@savithru-flex savithru-flex deleted the savithru/enforceTetrahedralElementsTranslation branch December 24, 2025 22:23
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.

3 participants