[BackPort] fix: remove output fields subsumed by primitiveVars to prevent duplic…#1951
Open
NasserFlexCompute wants to merge 1 commit intorelease-candidate/25.6from
Open
Conversation
benflexcompute
approved these changes
Apr 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the simulation-to-solver JSON translation of outputFields to avoid generating duplicate VTK DataArray names when primitiveVars is requested alongside pressure and/or velocity, which can break ParaView field-subset loading.
Changes:
- Added
remove_fields_subsumed_by_primitive_vars()to droppressure/velocitywhenprimitiveVarsis present. - Applied the new deduplication during translation for both per-entity outputs and volume outputs.
- Updated/added unit tests to reflect and validate the new behavior (notably removing
velocityfrom expected translatedoutputFieldswhereprimitiveVarsis present).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
flow360/component/simulation/outputs/output_fields.py |
Introduces helper to remove pressure/velocity when subsumed by primitiveVars. |
flow360/component/simulation/translator/solver_translator.py |
Applies the helper during output-field translation to prevent duplicate VTK array names. |
tests/simulation/outputs/test_output_fields.py |
Adds unit tests covering the new helper’s behavior. |
tests/simulation/translator/test_output_translation.py |
Updates translation expectations (removes velocity where primitiveVars is present). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…… (#1948)
Note
Medium Risk
Changes solver output field translation so requested fields are silently removed in some configurations, which could affect downstream post-processing expectations. Scope is limited to output-field list generation and is covered by updated/added tests.
Overview
Prevents duplicate VTK
DataArraynames when users requestprimitiveVarsalongsidepressureand/orvelocity(a combination that can break ParaView when loading subsets of fields).Adds
remove_fields_subsumed_by_primitive_vars()and applies it during output translation (surface/slice/probe/volume) sopressure/velocityare dropped whenprimitiveVarsis present, while keeping auto-appended fields likevelocity_magnitude. Tests are added/updated to assert the new dedupedoutputFieldsbehavior.Written by Cursor Bugbot for commit c24c285. This will update automatically on new commits. Configure here.