Skip to content

Commit

Permalink
Use retrieve_ghost_zone from yt-project#2610
Browse files Browse the repository at this point in the history
  • Loading branch information
cphyc committed Aug 10, 2020
1 parent c313acc commit 73e8fbe
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions yt/frontends/ramses/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,23 @@ def retrieve_ghost_zones(self, ngz, fields, smoothed=False):
)
smoothed = False

new_subset = RAMSESDomainSubset(
self.base_region, self.domain, self.ds, num_ghost_zones=ngz, base_grid=self
)
try:
new_subset = self._subset_with_gz
mylog.debug(
"Reusing previous subset with ghost zone for domain %s", self.domain_id
)
except AttributeError:
new_subset = RAMSESDomainSubset(
self.base_region,
self.domain,
self.ds,
num_ghost_zones=ngz,
base_grid=self,
)
self._subset_with_gz = new_subset

# Cache the fields
new_subset.get_data(fields)
# Cache the fields
new_subset.get_data(fields)

return new_subset

Expand Down

0 comments on commit 73e8fbe

Please sign in to comment.