HDF5 output of element results not necessarily from norm integration#875
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors element-wise result extraction for HDF5 output by moving component-name resolution and single-component extraction into SIMbase::extractElmRes(), so element results no longer need to be assumed to come from norm integration. It also introduces support for element-wise constant fields (material parameters) in the norms/element output path and extends utl::matrix::augmentRows() with optional prepending.
Changes:
- Refactored HDF5 element-result output to call
SIMbase::extractElmRes()for per-component extraction + naming. - Added element-wise field introspection APIs (
getNoElmFields(),getEFieldName()) and updated VTF norm output to include these fields. - Added
prependoption toutl::matrix::augmentRows()with unit test coverage.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Utility/HDF5Writer.C | Uses SIMbase::extractElmRes() for element-result extraction/naming during HDF5 writes. |
| src/SIM/SIMoutput.C | Accounts for element-wise fields when writing element norms to VTF. |
| src/SIM/SIMbase.h | Declares new extractElmRes() overloads for row-wise extraction and naming. |
| src/SIM/SIMbase.C | Implements extractElmRes() logic, including name resolution via NormBase. |
| src/ASM/IntegrandBase.h | Adds virtual APIs for element-wise fields (getNoElmFields, getEFieldName). |
| src/ASM/IntegrandBase.C | Provides default implementation of getEFieldName(). |
| src/ASM/ASMbase.h | Adds getOutputMaster() and extends element-result extraction helpers. |
| src/ASM/ASMbase.C | Implements matrix-row-to-vector element-result extraction. |
| src/ASM/LR/ASMu2D.h | Adds getOutputMaster() override; updates output-master semantics. |
| src/ASM/LR/ASMu2D.C | Initializes outputMaster and adjusts delegation for grid parameters. |
| src/ASM/LR/ASMu3D.h | Adds getOutputMaster() override; updates output-master semantics. |
| src/ASM/LR/ASMu3D.C | Initializes outputMaster and adjusts delegation for grid parameters. |
| src/LinAlg/matrix.h | Adds prepend option to augmentRows(). |
| src/LinAlg/Test/TestMatrix.C | Adds test coverage for augmentRows(..., prepend=true). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
jenkins build this with downstreams ifem-elasticity=221 please |
Added: virtual method getOutputMaster() such that the extractElmRes() methods do not need to be overridden in the sub-classes ASMu2D and ASMu3D.
extracting only a single row together with its component name. Use this to hide some logics away from the HDF5Writer method. Also a Vector-to-Vector extractElmRes() is added, such that we don't need to convert into a single-row matrix back and forth.
If set to true, the provided matrix is inserted as the first rows instead of the last.
new SIMbase::extractElmRes() method for the component name extraction
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.
The HDF5Writer class can output element-wise results, but so far it has been assumed they originate from norm integration with some complex logic to extract the name of the result components. This logic is now moved to a new
SIMbase::extractElmResult()method which extracts a single component together with its component name. The same method is also used int the VTF-export (methodSIMoutput::writeGlvn()), simplifying the logic there.This also fixes a so far undetected bug in the HDF-export: When exporting for many norm groups (i.e., more than one projection method was used), it looks like the same element norm values (those associated with the first group), where exported for all groups, producing identical results. This is fixed now but not tested.