Skip to content

Geo/quad extrapolation test#14600

Open
mcgicjn2 wants to merge 2 commits into
masterfrom
geo/quad_extrapolation_test
Open

Geo/quad extrapolation test#14600
mcgicjn2 wants to merge 2 commits into
masterfrom
geo/quad_extrapolation_test

Conversation

@mcgicjn2

Copy link
Copy Markdown
Contributor

Caches the extrapolation matrix for element types with different numbers of nodes

  • tests

Fixes #14599

Copilot AI left a comment

Copy link
Copy Markdown

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 addresses crashes/incorrect results when extrapolating integration-point values to nodes in GeoMechanics models containing mixed element/geometry configurations by improving extrapolation-matrix caching, and adds regression test cases for mixed-element setups.

Changes:

  • Updates GeoExtrapolateIntegrationPointValuesToNodesProcess to cache extrapolation matrices by a computed key instead of typeid only.
  • Adds new mixed-element test meshes and parameter sets (quads-only, triangles-only, and mixed).
  • Extends the Python test suite with a regression test comparing mixed vs non-mixed results.

Reviewed changes

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

Show a summary per file
File Description
applications/GeoMechanicsApplication/custom_processes/geo_extrapolate_integration_point_values_to_nodes_process.hpp Adds a cache-key helper declaration to support improved extrapolation-matrix caching.
applications/GeoMechanicsApplication/custom_processes/geo_extrapolate_integration_point_values_to_nodes_process.cpp Switches cache lookups/inserts to use the new computed cache key.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation.py Adds a new regression test for mixed-element extrapolation output consistency.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation/mixed_elements/quads/simple_mesh.mdpa Introduces a quads-only mesh for the mixed-elements regression scenario.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation/mixed_elements/quads/ProjectParameters.json Adds solver/process settings to run the quads-only regression case.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation/mixed_elements/triangles/simple_mesh.mdpa Introduces a triangles-only mesh for the mixed-elements regression scenario.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation/mixed_elements/triangles/ProjectParameters.json Adds solver/process settings to run the triangles-only regression case.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation/mixed_elements/mixed/simple_mesh.mdpa Introduces a mixed mesh combining quads and triangles for the regression scenario.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation/mixed_elements/mixed/ProjectParameters.json Adds solver/process settings to run the mixed-element regression case.
applications/GeoMechanicsApplication/tests/test_integration_node_extrapolation/mixed_elements/mixed/MaterialParameters.json Provides local material parameters for the mixed regression case.

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

Comment on lines +204 to +210
// Combine geometry type and number of integration points for unique key
const auto& r_geometry = rElement.GetGeometry();
std::size_t key = static_cast<std::size_t>(r_geometry.GetGeometryType());
key ^= GeoElementUtilities::GetNumberOfIntegrationPointsOf(rElement) << 16;
key ^= r_geometry.size() << 16;

return key;
13 1.5000000000 0.0000000000 0.0000000000
14 1.5000000000 -1.0000000000 0.0000000000
15 0.5000000000 -1.0000000000 0.0000000000
End Nodes
Comment on lines +104 to +120
# two quadrilaterals
file_path_quads = os.path.join(file_path, "quads")
test_helper.run_kratos(file_path_quads)
simulation_output = reader.read_output_from(os.path.join(file_path_quads, test_name+'.post.res'))
heads_quads = GiDOutputFileReader.nodal_values_at_time(
"HYDRAULIC_HEAD", 1, simulation_output, node_ids=range(1,14))

# mixed elements
file_path_mixed = os.path.join(file_path, "mixed")
test_helper.run_kratos(file_path_mixed)
simulation_output = reader.read_output_from(os.path.join(file_path_mixed, test_name+'.post.res'))
heads_mixed = GiDOutputFileReader.nodal_values_at_time(
"HYDRAULIC_HEAD", 1, simulation_output, node_ids=range(1,14))


for head_quad, head_mixed in zip(heads_quads, heads_mixed):
self.assertAlmostEqual(head_mixed, head_quad, places=4)
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.

[GeoMechanicsApplication] Extrapolation of integration values to nodes crashes \ incorrect for mixed elements of diff order types

2 participants