-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Field Indexer and get_element_indices for layered solids and add example of a thermal analysis #512
Conversation
…d without Add draft of an example for a thermal analysis
General question: are we planning to backport these fixes to the |
Hi @greschd , yes. That would make sense from my point of view. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #512 +/- ##
==========================================
- Coverage 92.21% 91.66% -0.55%
==========================================
Files 50 50
Lines 3352 3397 +45
==========================================
+ Hits 3091 3114 +23
- Misses 261 283 +22 ☔ View full report in Codecov by Sentry. |
…ithub.com/ansys/pydpf-composites into maint/add_thermal_example_and_fix_indexer
…example of a thermal analysis (#512) * Fix Field Indexer by distinguish between fields with data pointers and without Add draft of an example for a thermal analysis * fix `select_indices` for layered solid elements * verify `get_selected_indices` for all types of layered elements
* Fix Field Indexer and get_element_indices for layered solids and add example of a thermal analysis (#512) * Fix Field Indexer by distinguish between fields with data pointers and without Add draft of an example for a thermal analysis * Bump version 0.6.1 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Dominik Gresch <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
While adding an example for a thermal analysis (examples/013_thermal_example.py), several issues were found in the result extraction for layered solid elements where the field indexers are used. The main issue is that fields which have one entry per entity behave slightly different if compared with one that has multiple entries per entity. This became visible because a solid model with "analysis ply-wise" extrusion was used. So there is only one entry per entity for the layered fields such as angles, materials etc.
Here are some details:
FieldIndexer
has to handle cases where the data pointers of a field are set in DPF or not. This is a performance optimization in DPF. The data pointers are only available if multiple entries are set per entity. This is addressed by implementing helper functionsget_property_field_indexer
andget_field_indexer
which automatically returns the correct indexer.by_id_as_array
to clearly distinguish between a single value and an array of values because the return type was dependent on if data pointers are available or not.FieldIndexer
which returns a single value was used explicitly.get_field_indexer
returns now the correct indexer but the bug in the backend becomes visible now.number of corner nodes
was used instead ofnumber of nodes per spot
when computing the indices. This makes a difference if layered solid elements are processed. Seeget_selected_indices
in src/ansys/dpf/composites/select_indices.py.