Skip to content

fix reset cache without pyvista #1153

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

Merged
merged 2 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions src/ansys/mapdl/core/mapdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def __init__(
self._ignore_errors = False
self._print_com = print_com # print the command /COM input.
self._cached_routine = None
self._geometry = None

# Setting up loggers
self._log = logger.add_instance_logger(
Expand Down Expand Up @@ -619,10 +620,11 @@ def geometry(self):
>>> mapdl.geometry.line_select([3, 4, 5], sel_type='R')

"""
if self._geometry == None:
self._geometry = self._create_geometry()
return self._geometry

@property
def _geometry(self): # pragma: no cover
def _create_geometry(self): # pragma: no cover
"""Return geometry cache"""
from ansys.mapdl.core.mapdl_geometry import Geometry

Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/mapdl_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def _reset_cache(self):
if self._mesh_rep is not None:
self._mesh_rep._reset_cache()

if self.geometry is not None:
if self._geometry is not None:
self._geometry._reset_cache()

@property
Expand Down