Skip to content

Commit

Permalink
Merge branch 'neighbour-search' into indep-octree-raytracing
Browse files Browse the repository at this point in the history
  • Loading branch information
cphyc committed May 29, 2020
2 parents 2eca672 + f5df0e8 commit 93a5036
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions yt/frontends/ramses/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def _fill_with_ghostzones(self, fd, fields, selector, file_handler, num_ghost_zo
def fwidth(self):
fwidth = super(RAMSESDomainSubset, self).fwidth
if self._num_ghost_zones > 0:
fwidth = super(RAMSESDomainSubset, self).fwidth.reshape(-1, 8, 3)
fwidth = fwidth.reshape(-1, 8, 3)
n_oct = fwidth.shape[0]
new_fwidth = np.zeros((n_oct, self.nz**3, 3), dtype=fwidth.dtype)
new_fwidth[:, :, :] = fwidth[:, 0:1, :]
Expand Down Expand Up @@ -353,14 +353,15 @@ def _detect_output_fields(self):
self.field_list = self.particle_field_list + self.fluid_field_list

def _identify_base_chunk(self, dobj):
ngz = dobj._num_ghost_zones
if getattr(dobj, "_chunk_info", None) is None:
domains = [dom for dom in self.domains if
dom.included(dobj.selector)]
base_region = getattr(dobj, "base_region", dobj)
if len(domains) > 1:
mylog.debug("Identified %s intersecting domains", len(domains))
subsets = [RAMSESDomainSubset(base_region, domain, self.dataset, num_ghost_zones=ngz)
subsets = [RAMSESDomainSubset(
base_region, domain, self.dataset,
num_ghost_zones=dobj._num_ghost_zones)
for domain in domains]
dobj._chunk_info = subsets
dobj._current_chunk = list(self._chunk_all(dobj))[0]
Expand Down
2 changes: 1 addition & 1 deletion yt/frontends/ramses/io_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def read_amr(FortranFile f, dict headers,
if n > 0:
max_level = max(ilevel - min_level, max_level)
if n != ng:
raise Exception('Expected %s octs, got %s' % (ng, n))
raise ValueError('Expected %s octs, got %s' % (ng, n))

return max_level

Expand Down

0 comments on commit 93a5036

Please sign in to comment.