Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b39d904
Remove the MeshedRegion.grid cache to allow for plotting of modified …
PProfizi Sep 27, 2022
55bbd9f
Revert "Remove the MeshedRegion.grid cache to allow for plotting of m…
PProfizi Sep 27, 2022
5e05ecd
Rather than removing the cache, reset the grid after a call to set_co…
PProfizi Sep 27, 2022
52afa44
Upload the doc even if failed, to be able to check on it.
PProfizi Sep 28, 2022
f6c89cc
Add grid.clear_data() to DpfPlotter.add_mesh as well as to Plotter.pl…
PProfizi Sep 30, 2022
d057409
Update the grid.points when setting coordinates field instead of inva…
PProfizi Oct 3, 2022
10358ca
Update the grid.points when setting coordinates field instead of inva…
PProfizi Oct 3, 2022
792ab30
Improve coverage.
PProfizi Oct 3, 2022
03d3ba7
Improve coverage and fix data copy.
PProfizi Oct 3, 2022
e27416c
Decorate setters to invalidate the grid entirely.
PProfizi Oct 5, 2022
f8a3514
Add an actual clean command.
PProfizi Oct 7, 2022
5651022
Add an actual clean command.
PProfizi Oct 7, 2022
59a7ec7
Set default language as "en" in conf.py to remove warning.
PProfizi Oct 7, 2022
a399da9
Fix 08.averaging\README.txt
PProfizi Oct 7, 2022
a748683
Fix indent
PProfizi Oct 7, 2022
f122405
Fix indent
PProfizi Oct 7, 2022
f4ba135
Fix warnings
PProfizi Oct 7, 2022
75032b0
Exclude examples/python_plugins from APIDOC as well as examples/examp…
PProfizi Oct 7, 2022
0f81110
Indicate to autodoc that ansys.dpf.core.examples.python_plugins shoul…
PProfizi Oct 7, 2022
7352a5a
Resolve sphinx warning
PProfizi Oct 7, 2022
ec1b333
Try installing pandoc
PProfizi Oct 7, 2022
6f5e080
Comment-out other jobs
PProfizi Oct 7, 2022
ce9d569
Comment-out other jobs
PProfizi Oct 7, 2022
f8afb5f
Add -P as argument to sphinx build, which runs the Python debugger pd…
PProfizi Oct 7, 2022
54e788a
Add a reset function after each example equivalent to the kill-dpf-se…
PProfizi Oct 7, 2022
483a25c
try shutting down servers manually.
PProfizi Oct 10, 2022
c24c430
Reset as it did not work.
PProfizi Oct 10, 2022
946f91c
Count servers both before and after each example
PProfizi Oct 10, 2022
ee1d2f5
Count servers both before and after each example
PProfizi Oct 10, 2022
da92d26
Update ansys/dpf/core/meshed_region.py
PProfizi Oct 10, 2022
23c5ece
Comment 03-exchange_data_between_servers.py
PProfizi Oct 10, 2022
89d4f75
Comment 11-server_types.py
PProfizi Oct 10, 2022
7a8935b
Add a waiting time for servers to close.
PProfizi Oct 10, 2022
a889e3b
Adjust MeshedRegion's setter tests for set_coordinate_field and set_p…
PProfizi Oct 11, 2022
d380be3
Proposal for a wrapper which deals with updating the vtk grid object …
PProfizi Oct 11, 2022
2c3414b
Fix flake8
PProfizi Oct 11, 2022
ed41364
Rescope to the issue at end: update the coordinates.
PProfizi Oct 11, 2022
141693d
Fix flake8
PProfizi Oct 11, 2022
0f2ab19
Merge branch 'master' into fix/remove_grid_cache
PProfizi Oct 12, 2022
3358caf
Merge branch 'master' into fix/doc_generation_2
PProfizi Oct 12, 2022
62999b4
Add garbage collection and call shutdown_all_session_servers after ea…
PProfizi Oct 12, 2022
0c5a2e1
Revert "Comment 11-server_types.py"
PProfizi Oct 12, 2022
4d7e2ba
Revert "Comment 03-exchange_data_between_servers.py"
PProfizi Oct 12, 2022
78b20ba
Shut servers down and collect garbage before the examples too.
PProfizi Oct 12, 2022
f686012
Merge branch 'master' into fix/doc_generation_2
PProfizi Oct 12, 2022
c037168
Revert "Comment-out other jobs"
PProfizi Oct 12, 2022
6087460
Revert "Comment-out other jobs"
PProfizi Oct 12, 2022
7d647c8
Merge branch 'master' into fix/remove_grid_cache
PProfizi Oct 12, 2022
9199890
Merge branch 'fix/doc_generation_2' into fix/remove_grid_cache
PProfizi Oct 12, 2022
fed2f19
Merge branch 'master' into fix/remove_grid_cache
PProfizi Oct 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,14 @@ jobs:
with:
files: docs/build/html
dest: HTML-doc-${{env.PACKAGE_NAME}}.zip
if: always()

- name: "Upload HTML Documentation"
uses: actions/upload-artifact@v3
with:
name: HTML-doc-${{env.PACKAGE_NAME}}
path: HTML-doc-${{env.PACKAGE_NAME}}.zip
if: always()

run_examples:
name: "Run Examples with/without bin"
Expand Down
4 changes: 4 additions & 0 deletions ansys/dpf/core/meshed_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ def set_coordinates_field(self, coordinates_field):
coordinates_field : PropertyField or Field
"""
self._api.meshed_region_set_coordinates_field(self, coordinates_field)
if self._full_grid is not None:
Copy link
Contributor

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

if hasattr(self._full_grid, "points"):
from copy import copy
self._full_grid.points = copy(coordinates_field.data)

@property
def available_named_selections(self):
Expand Down
3 changes: 3 additions & 0 deletions ansys/dpf/core/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ def add_mesh(self, meshed_region, deform_by=None, scale_factor=1.0, **kwargs):
>>> pl.add_mesh(mesh)

"""
if meshed_region.grid is not None:
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works.

meshed_region.grid.clear_data()
self._internal_plotter.add_mesh(meshed_region=meshed_region,
deform_by=deform_by,
scale_factor=scale_factor,
Expand Down Expand Up @@ -767,6 +769,7 @@ def plot_contour(
self._internal_plotter.add_scale_factor_legend(scale_factor, **kwargs)
else:
grid = mesh.grid
grid.clear_data()
self._internal_plotter._plotter.add_mesh(grid, scalars=overall_data, **kwargs_in)

background = kwargs.pop("background", None)
Expand Down
8 changes: 8 additions & 0 deletions tests/test_meshregion.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ def test_set_coordinates_field_meshedregion(simple_bar_model):
field_coordinates.data = new_data
mesh.set_coordinates_field(field_coordinates)
field_coordinates = mesh.nodes.coordinates_field
point_0 = list(mesh.grid.points[0])
assert np.allclose(field_coordinates.data[0], [1.0, 1.0, 1.0])
assert np.allclose(point_0, [1.0, 1.0, 1.0])
field_coordinates.data = field_coordinates.data * 2.0
mesh.set_coordinates_field(field_coordinates)
field_coordinates = mesh.nodes.coordinates_field
point_1 = list(mesh.grid.points[0])
assert np.allclose(field_coordinates.data[0], [2.0, 2.0, 2.0])
assert np.allclose(point_1, [2.0, 2.0, 2.0])


def test_get_element_types_field_meshedregion(simple_bar_model):
Expand Down