From 7bd84225e19a6cc41a1c1b21cc0aca07b9ad16e3 Mon Sep 17 00:00:00 2001 From: Robin Walloner Date: Fri, 4 Apr 2025 14:45:25 +0000 Subject: [PATCH 1/2] Flatten coordinate array in map_and_read_data --- cyprecice/cyprecice.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index c2519478..4cca67eb 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -997,7 +997,7 @@ cdef class Participant: size = coordinates.shape[0] dimensions = self.get_data_dimensions(mesh_name, data_name) - cdef vector[double] cpp_coordinates = coordinates + cdef vector[double] cpp_coordinates = [coord for point in coordinates for coord in point] cdef vector[double] cpp_values = [-1 for _ in range(size * dimensions)] self.thisptr.mapAndReadData (convert(mesh_name), convert(data_name), cpp_coordinates, relative_read_time, cpp_values) From 009ef144c56bb8c3019b909064992399510476cd Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 7 Apr 2025 13:57:00 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- cyprecice/cyprecice.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index 4cca67eb..29120a2c 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -997,7 +997,7 @@ cdef class Participant: size = coordinates.shape[0] dimensions = self.get_data_dimensions(mesh_name, data_name) - cdef vector[double] cpp_coordinates = [coord for point in coordinates for coord in point] + cdef vector[double] cpp_coordinates = coordinates.flatten() cdef vector[double] cpp_values = [-1 for _ in range(size * dimensions)] self.thisptr.mapAndReadData (convert(mesh_name), convert(data_name), cpp_coordinates, relative_read_time, cpp_values)