feat: Add Young Modulus & Poisson import from VTK mesh#4021
feat: Add Young Modulus & Poisson import from VTK mesh#4021
Conversation
| continue; | ||
|
|
||
| // E was imported and is positive: nu must also be valid | ||
| GEOS_ERROR_IF( nu[k] <= -0.5 || nu[k] >= 0.5, |
There was a problem hiding this comment.
For most common materials, Poisson’s ratio falls within the range of 0 to 0.5.
There was a problem hiding this comment.
I agree with you, but there was some checks already done around line 80-84 that were with this range :
if( nu > -0.5 && nu < 0.5 )
{
++numConstantsSpecified;
errorCheck += "nu, ";
}
So I kept them as it is.
dkachuma
left a comment
There was a problem hiding this comment.
My understanding of (nu, E, K and G) is that we need only 2 of these. What combinations are currently supported. Currently you can provide K and G. You're proposing nu and E I suppose, but can we do any other combinations. Maybe just add a note in the documentation. For example what happens if the user tries to load K and E?
There was a problem hiding this comment.
Pull request overview
This PR adds support for importing per-cell Young’s modulus and Poisson’s ratio from an external VTK mesh into the solid constitutive data, converting those imported values into bulk/shear moduli during initialization, and enabling optional output of the imported/derived fields.
Changes:
- Extend the schema to allow
youngModulusandpoissonRatiofields on multiple solid constitutive model types. - Add new solid field traits (
youngModulus,poissonRatio) and register/initialize them inElasticIsotropicwith per-cell E/ν → K/G conversion. - Update integrated test baseline references to reflect the new capability.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreComponents/schema/schema.xsd.other | Allows youngModulus/poissonRatio attributes for relevant constitutive types in the schema. |
| src/coreComponents/constitutive/solid/SolidFields.hpp | Defines new solid field traits for youngModulus and poissonRatio. |
| src/coreComponents/constitutive/solid/ElasticIsotropic.hpp | Declares new per-cell storage and initialization hook for conversion. |
| src/coreComponents/constitutive/solid/ElasticIsotropic.cpp | Registers new fields and implements MPI-aggregated per-cell conversion logic + back-computation for output. |
| BASELINE_NOTES.md | Records baseline update rationale for the PR. |
| .integrated_tests.yaml | Updates the integrated test baseline ID to the PR’s baseline artifact. |
| // E was imported and is positive: nu must also be valid | ||
| if( nu[k] <= -0.5 || nu[k] >= 0.5 ) | ||
| { | ||
| ++numInvalidNu; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
The per-cell conversion treats any in-range poissonRatio value as “imported”. Since the field default is currently 0.0 (a valid Poisson’s ratio), importing only youngModulus (or failing to import poissonRatio for some cells) will silently convert using ν=0.0, producing incorrect bulk/shear moduli. Use an unambiguously invalid sentinel default for poissonRatio (e.g., 0.5 or 1.0), and/or add an explicit check to ensure ν was actually imported before converting.
| void ElasticIsotropic::initializePostInitialConditionsPreSubGroups() | ||
| { | ||
| SolidBase::initializePostInitialConditionsPreSubGroups(); | ||
|
|
||
| // If per-cell Young's modulus and Poisson's ratio were imported from an external mesh | ||
| // convert them to bulk and shear modulus on a cell-by-cell basis. |
There was a problem hiding this comment.
New per-cell E/ν import/conversion logic isn’t covered by existing ElasticIsotropic unit tests (they currently validate allocation and constant-K/G stress updates). Adding a unit test that sets per-cell youngModulus/poissonRatio (including invalid/missing values) and verifies the resulting bulk/shear (and back-computed E/ν) would help prevent regressions.
This feature adds register data fields for Poisson's ratio and Young Modulus directly from VTK mesh, avoiding any external conversion operations.
It also offers the possibility to obtain them as output by adding (according to user needs) :
<Outputs> <VTK name="vtkOutput" fieldNames="{ rock_youngModulus, rock_poissonRatio }" /> </Outputs>