Commit d6c4f31f authored by Matthijs's avatar Matthijs
Browse files

bugfix, wrong zoom fraction used

parent 9517285b
......@@ -148,7 +148,6 @@ class Phase(Problem):
"""
Processes the solution and generates the output
"""
# TODO: compatibility with non-2d iterates, particularly 3D
# Center the solution (since position is a degree of freedom,
# and if desired, interpolate the results.
center = tuple([s//2 for s in self.config['u'].shape])
......@@ -157,15 +156,13 @@ class Phase(Problem):
self.output[key] = array_tools.roll_to_pos(self.output[key], pos=center)
# This sequence will work for objects *with a small support* even if they lie over the edge of the array
if 'interpolate_result' in self.config and self.config['interpolate_result']:
# TODO: compatibility with non-2d iterates, particularly 3D
self.output[key] = interpolation.fourier_interpolate(self.output[key])
if 'zoomin_on_result' in self.config and self.config['zoomin_on_result']:
# TODO: compatibility with non-2d iterates, particularly 3D
if self.output[key].ndim == 2:
zmy, zmx = self.output[key].shape # self.config['Ny'] // 4, self.config["Nx"] // 4
zmy, zmx = tuple([s//4 for s in self.output[key].shape])
self.output[key] = self.output[key][zmy:-zmy, zmx:-zmx]
elif self.output[key].ndim == 3:
zmy, zmx, zmz = self.output[key].shape
zmy, zmx, zmz = tuple([s//4 for s in self.output[key].shape])
# (self.config['Ny'] // 4, self.config["Nx"] // 4, self.config['Nz'] // 4)
self.output[key] = self.output[key][zmy:-zmy, zmx:-zmx, zmz:-zmz]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment