Skip to content

feat: Add Young Modulus & Poisson import from VTK mesh#4021

Merged
dkachuma merged 10 commits intodevelopfrom
feat/npillardou/vtkmesh-youngs-poisson-import
Apr 14, 2026
Merged

feat: Add Young Modulus & Poisson import from VTK mesh#4021
dkachuma merged 10 commits intodevelopfrom
feat/npillardou/vtkmesh-youngs-poisson-import

Conversation

@npillardou
Copy link
Copy Markdown
Contributor

@npillardou npillardou commented Apr 8, 2026

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>

@npillardou npillardou changed the title Add Young Modulus & Poisson import from VTK mesh feat: Add Young Modulus & Poisson import from VTK mesh Apr 8, 2026
@npillardou npillardou added type: feature New feature or request ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI ci: run code coverage enables running of the code coverage CI jobs labels Apr 10, 2026
continue;

// E was imported and is positive: nu must also be valid
GEOS_ERROR_IF( nu[k] <= -0.5 || nu[k] >= 0.5,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For most common materials, Poisson’s ratio falls within the range of 0 to 0.5.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@dkachuma dkachuma left a comment

Choose a reason for hiding this comment

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

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?

Comment thread src/coreComponents/constitutive/solid/ElasticIsotropic.cpp Outdated
Comment thread src/coreComponents/constitutive/solid/ElasticIsotropic.cpp Outdated
Comment thread src/coreComponents/constitutive/solid/ElasticIsotropic.cpp
@dkachuma dkachuma requested a review from Copilot April 14, 2026 22:33
@dkachuma dkachuma merged commit 3bda7f6 into develop Apr 14, 2026
25 checks passed
@dkachuma dkachuma deleted the feat/npillardou/vtkmesh-youngs-poisson-import branch April 14, 2026 22:34
Copy link
Copy Markdown
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 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 youngModulus and poissonRatio fields on multiple solid constitutive model types.
  • Add new solid field traits (youngModulus, poissonRatio) and register/initialize them in ElasticIsotropic with 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.

Comment on lines +184 to +189
// E was imported and is positive: nu must also be valid
if( nu[k] <= -0.5 || nu[k] >= 0.5 )
{
++numInvalidNu;
continue;
}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +155 to +160
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.
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants