-
Couldn't load subscription status.
- Fork 23
Update MeshedRegion.grid coordinates when necessary and clear data before plotting. #513
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
Conversation
…meshes with mesh setters.
Codecov Report
@@ Coverage Diff @@
## master #513 +/- ##
==========================================
+ Coverage 86.79% 86.96% +0.16%
==========================================
Files 67 67
Lines 7196 7212 +16
==========================================
+ Hits 6246 6272 +26
+ Misses 950 940 -10 |
…odified meshes with mesh setters." This reverts commit b39d904.
ansys/dpf/core/meshed_region.py
Outdated
| coordinates_field : PropertyField or Field | ||
| """ | ||
| self._api.meshed_region_set_coordinates_field(self, coordinates_field) | ||
| self._full_grid = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we just invalidate the coords of the grid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rlagha FYI I modified the proposed code as requested.
…lidating the whole UnstructuredGrid.
…lidating the whole UnstructuredGrid.
ansys/dpf/core/meshed_region.py
Outdated
| coordinates_field : PropertyField or Field | ||
| """ | ||
| self._api.meshed_region_set_coordinates_field(self, coordinates_field) | ||
| if self._full_grid is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PProfizi In my opinion, we need to think larger. Here the "real" issue is not "when set coordinates is called the grid needs to be updated" but "when the mesh is updated (equivalent to setters are called) the grid is out dated".
With your we will have the same bug if set connectivity, or set element types is called
| >>> pl.add_mesh(mesh) | ||
| """ | ||
| if meshed_region.grid is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked what happens with meshes containers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works.
…roperty_field of connectivity to check update of the mesh.grid.
…linked to the mesh.
* Move Documentation to a reusable workflow, can be manually triggered or called by the CI. * Move tests to tests.yml, can be triggered manually, can be called by the CI. * Add gate.yml workflow for gatebin testing. * Install ansys-grpc-dpf==0.4.0 when ANSYS_VERSION=221 * Add wheel and wheelhouse arguments to the tests.yml * Set wheel and wheelhouse arguments as optional. * Create a reusable workflow for running examples, which can be triggered manually or called from the CI. * Set optional arguments as optional * Update docs workflow to the latest master changes * Call docs from CI * Update tests.yml to reflect changes in master * Add "extra" env * Update examples.yml to latest in master * call examples.yml in CI * Update retro jobs in CI * Add debug job in CI * Add gate job in CI * Update gate.yml * Update name of docs workflow in ci.yml * Update needs of draft_release * Update tests.yml add DOCSTRING argument * Use lower-case names * Fix docs.yml * Rename testing step in tests.yml * Update tests.yml to current master state. * Update gate.yml to current master state. * Update docs.yml to current master state. * Skip running python-operators examples when on linux. * Apply changes from #537 to doc job * Apply changes from #513 to doc job * Do not automatically run CI on push to release* branch. This can be managed via a PR if necessary. In theory one can push a bump commit and a tag, which requires only the CI on the tag push. * Add docs_on_release step, add 3.8 to release steps. * Separate the workflow triggered on v* tag push. * Schedule CI release every sunday at 1pm UTC. Condition draft_release step to push of tag. * Fix pydpf-post_testing workflow branch name issue * Allow for workflow call of PyDPF-Post testing * Run PyDPF-Post compatibility testing on both windows and linux * Run PyDPF-Post compatibility testing on latest tagged revision by default * PyDPF-Post compatibility testing accepts ANSYS_VERSION as input * Run PyDPF-Post compatibility testing on non-draft CI * Run PyDPF-Post compatibility testing on release and weekly CI for 231, 222 and 221 * PyDPF-Post branch name is not required * Fix PyDPF-Post cloning step * Make pydpf-post testing necessary for draft_release in ci_release.yml * Remove concurrency temporarily * Add back concurrency * Comment other jobs temporarily * Add pydpf-post-TOKEN as required input when run from a workflow * Split repo name construction * Actually no need for the dpf-post secret * Fix pydpf-post cloning step. * Fix pydpf-post cloning step. * Fix pydpf-post install step. * Fix pydpf-post install step. * Fix pydpf-post install step. * Fix pydpf-post install step. * Use new "working-directory" input for prepare_tests and test_docstrings actions. * Fix test API * Use prepare_v2.2 pydpf-actions * Uncomment all jobs * Fix pydpf-post.yml * Fix pydpf-post.yml - test docstrings in src/ * Quick fix: only use the three first parts of version strings. * Update deprecated set-output command. * Fix test-results-post log path * Use packaging.version.parse instead of our custom version_tuple function. * Fix setup step * Fix setup step * Remove test_version_tuple * Bump all pydpf-actions to v2.2 * Merge with master, apply changes for test_docker * Test test_docker on a regular PR
to allow for plotting of modified meshes with mesh setters.
Use case:
Update the vtk grid associated to the mesh when the coordinates are modified via
set_coordinates_fieldorset_property_field(coordinates)(and by extension vianodes.coordinates). -> this uses thepyvista.UnstructuredGrid.pointssetter.Update the vtk grid associated to the mesh when the connectivity is modified via
set_property_field( nodal_properties.nodal_connectivity or element_properties.connectivity). -> there is no setter forpyvista.UnstructuredGrid.cellsorpyvista.UnstructuredGrid.cell_connectivity, so the only solution seems to invalidate the grid. This requires more work, yet to solve the current reported bugs this is not necessary as they only concern updating the coordinates.Also reset the grid's data using
grid.clear_data()when usingPlotter.plot_contourorDpfPlotter.add_mesh.