Skip to content
Snippets Groups Projects

Switch index type from int32 to int64

Closed Markus Holzer requested to merge holzer/pystencils:int64 into master
Compare and
2 files
+ 8
8
Preferences
Compare changes
Files
2
@@ -28,17 +28,17 @@ boundary_index_array_coordinate_names = ["x", "y", "z"]
direction_member_name = "dir"
def numpy_data_type_for_boundary_object(boundary_object, dim):
def numpy_data_type_for_boundary_object(boundary_object, dim, data_type=np.int64):
coordinate_names = boundary_index_array_coordinate_names[:dim]
return np.dtype([(name, np.int32) for name in coordinate_names]
+ [(direction_member_name, np.int32)]
return np.dtype([(name, data_type) for name in coordinate_names]
+ [(direction_member_name, data_type)]
+ [(i[0], i[1].numpy_dtype) for i in boundary_object.additional_data], align=True)
def _create_boundary_neighbor_index_list_python(flag_field_arr, nr_of_ghost_layers, boundary_mask,
fluid_mask, stencil, single_link):
fluid_mask, stencil, single_link, data_type=np.int64):
coordinate_names = boundary_index_array_coordinate_names[:len(flag_field_arr.shape)]
index_arr_dtype = np.dtype([(name, np.int32) for name in coordinate_names] + [(direction_member_name, np.int32)])
index_arr_dtype = np.dtype([(name, data_type) for name in coordinate_names] + [(direction_member_name, data_type)])
result = []
gl = nr_of_ghost_layers
@@ -57,9 +57,9 @@ def _create_boundary_neighbor_index_list_python(flag_field_arr, nr_of_ghost_laye
def _create_boundary_cell_index_list_python(flag_field_arr, boundary_mask,
fluid_mask, stencil, single_link):
fluid_mask, stencil, single_link, data_type=np.int64):
coordinate_names = boundary_index_array_coordinate_names[:len(flag_field_arr.shape)]
index_arr_dtype = np.dtype([(name, np.int32) for name in coordinate_names] + [(direction_member_name, np.int32)])
index_arr_dtype = np.dtype([(name, data_type) for name in coordinate_names] + [(direction_member_name, data_type)])
result = []
for cell in itertools.product(*reversed([range(0, i) for i in flag_field_arr.shape])):