Commit bcc92b60 authored by Martin Bauer's avatar Martin Bauer
Browse files

Added data handling tests for VTK output and reduction

parent 20897779
...@@ -318,7 +318,7 @@ class SerialDataHandling(DataHandling): ...@@ -318,7 +318,7 @@ class SerialDataHandling(DataHandling):
for name in data_names: for name in data_names:
field = self._get_field_with_given_number_of_ghost_layers(name, ghost_layers) field = self._get_field_with_given_number_of_ghost_layers(name, ghost_layers)
if self.dim == 2: if self.dim == 2:
cell_data[name] = field[:, :, np.newaxis] field = field[:, :, np.newaxis]
if len(field.shape) == 3: if len(field.shape) == 3:
cell_data[name] = np.ascontiguousarray(field) cell_data[name] = np.ascontiguousarray(field)
elif len(field.shape) == 4: elif len(field.shape) == 4:
...@@ -344,7 +344,7 @@ class SerialDataHandling(DataHandling): ...@@ -344,7 +344,7 @@ class SerialDataHandling(DataHandling):
field = self._get_field_with_given_number_of_ghost_layers(data_name, ghost_layers) field = self._get_field_with_given_number_of_ghost_layers(data_name, ghost_layers)
if self.dim == 2: if self.dim == 2:
field = field[:, :, np.newaxis] field = field[:, :, np.newaxis]
cell_data = {name: np.ascontiguousarray(np.bitwise_and(field, mask) > 0, dtype=np.uint8) cell_data = {name: np.ascontiguousarray(np.bitwise_and(field, field.dtype.type(mask)) > 0, dtype=np.uint8)
for mask, name in masks_to_name.items()} for mask, name in masks_to_name.items()}
image_to_vtk(full_file_name, cell_data=cell_data) image_to_vtk(full_file_name, cell_data=cell_data)
......
from collections import defaultdict, OrderedDict from collections import defaultdict, OrderedDict
from operator import attrgetter
from copy import deepcopy from copy import deepcopy
import functools
import sympy as sp import sympy as sp
from sympy.logic.boolalg import Boolean from sympy.logic.boolalg import Boolean
......
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