docs: add tutorial for elemental nodal results on mixed-element meshes - #3296
Open
PProfizi wants to merge 2 commits into
Open
docs: add tutorial for elemental nodal results on mixed-element meshes#3296PProfizi wants to merge 2 commits into
PProfizi wants to merge 2 commits into
Conversation
…ement meshes Adds a new sphinx-gallery tutorial under post_processing_basics that shows how to: - Discover element types in bulk via Elements.element_types_field (PropertyField) and dpf.element_types.descriptor() (n_nodes, is_solid, is_shell, is_beam, is_quadratic). - Read an ElementalNodal stress field on a mixed-element mesh and use Field.get_entity_data_by_id() to expose the variable per-element row count. - Use the split_shells argument on result operators to obtain a per-shape FieldsContainer with an elshape label and run vectorised numpy operations on one uniform sub-field. - Use extend_to_mid_nodes to fill mid-side node values on a corner-only ElementalNodal field for quadratic elements. Dataset: examples.download_all_kinds_of_complexity().
PProfizi
marked this pull request as ready for review
June 30, 2026 14:47
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3296 +/- ##
=======================================
Coverage 82.84% 82.84%
=======================================
Files 94 94
Lines 11737 11737
=======================================
Hits 9724 9724
Misses 2013 2013 |
split_shells groups by stress category (Solid/Shell-with-N-layers), not geometric type, and mixes Tet10+Hex20 inside elshape=2 so per-shape sub-fields are not uniform. The correct mechanism for uniform per-shape ElementalNodal fields is to build a Scoping from element_types_field via a numpy mask and pass it as mesh_scoping. Also fixes the false 'rows = n_nodes' claim (rows = n_corner_nodes for solids, nodes*layers for shells) and replaces the no-op nodal_to_elemental_nodal->extend_to_mid_nodes demo by feeding the per-shape Tet10 field straight into extend_to_mid_nodes_fc, which now visibly grows (4,6) -> (10,6).
Contributor
|
The documentation for this pull request will be available at https://dpf.docs.pyansys.com/pull/3296. Please allow some time for the documentation to be deployed. |
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.
Summary
New PyDPF-Core sphinx-gallery tutorial under
post_processing_basics/titledProcess elemental nodal results on mixed-element meshes.
The tutorial demonstrates the recommended workflow for handling
ElementalNodalresults on a mesh that mixes several element types (different node counts per
element):
Elements.element_types_field(aPropertyField) and map each type to itsElementDescriptor(n_nodes,is_solid,is_shell,is_beam,is_quadratic).ElementalNodalstress field; show thatField.get_entity_data_by_id()returns a variable-shape array whose row countequals the element's
n_nodes.split_shellsargument on result operators to obtain a per-shapeFieldsContainer(carrying theelshapelabel). Within each per-shapesub-field the node count is uniform, so the flat
dataarray can be reshapedto
(n_elements, n_nodes, n_components)and processed with numpy.extend_to_mid_nodesto fill the mid-side node values of a corner-onlyElementalNodalfield on quadratic elements.Dataset:
examples.download_all_kinds_of_complexity().Files
doc/sphinx_gallery_tutorials/post_processing_basics/mixed_element_results.py-- new tutorial (
_order: 2, labelref_tutorials_mixed_element_results).doc/sphinx_gallery_tutorials/post_processing_basics/GALLERY_HEADER.rst-- new grid card.
Validation
python -m py_compileon the tutorial file passes.src/ansys/dpf/core/.(
deploy-pr-doclabel).