From a41282c0cd17a83b43f53190afa8c9c75391c151 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 6 Feb 2024 16:36:13 +0100 Subject: [PATCH 1/5] Use precice/precice.hpp header --- cyprecice/Participant.pxd | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index ffe9783b..5241f09b 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -3,7 +3,7 @@ from libcpp.set cimport set from libcpp.string cimport string from libcpp.vector cimport vector -cdef extern from "precice/Participant.hpp" namespace "precice": +cdef extern from "precice/precice.hpp" namespace "precice": cdef cppclass Participant: # construction and configuration @@ -83,6 +83,4 @@ cdef extern from "precice/Participant.hpp" namespace "precice": void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) - -cdef extern from "precice/Tooling.hpp" namespace "precice": - string getVersionInformation() + string getVersionInformation() From f399fa30a8a2b9ea1b4c49a1631e15e8a622f290 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 6 Feb 2024 16:41:07 +0100 Subject: [PATCH 2/5] add get_version_information function into the Participant class --- cyprecice/cyprecice.pyx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index a2897186..3766e2ed 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -1041,10 +1041,10 @@ cdef class Participant: return np_ids, np_coordinates.reshape((size, dimensions)) -def get_version_information (): - """ - Returns - ------- - Current preCICE version information - """ - return CppParticipant.getVersionInformation() + def get_version_information (): + """ + Returns + ------- + Current preCICE version information + """ + return self.thisptr.getVersionInformation() From 943ac2c0fbc921efad28e4062896903e2b727ea7 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 6 Feb 2024 16:44:50 +0100 Subject: [PATCH 3/5] Pass self --- cyprecice/cyprecice.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index 3766e2ed..5b64d6f5 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -1041,7 +1041,7 @@ cdef class Participant: return np_ids, np_coordinates.reshape((size, dimensions)) - def get_version_information (): + def get_version_information (self): """ Returns ------- From c29af648ff1a3f036a38cab6c41597204b8e3d19 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Wed, 7 Feb 2024 13:41:50 +0100 Subject: [PATCH 4/5] Move getVersionInformation out of the class Participant --- cyprecice/Participant.pxd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index 5241f09b..8474b4cc 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -83,4 +83,4 @@ cdef extern from "precice/precice.hpp" namespace "precice": void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) - string getVersionInformation() + string getVersionInformation() From 7cbf46f8eee14dfc3eff2fde23b3912901fb4ec9 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 17 Mar 2025 06:07:49 +0100 Subject: [PATCH 5/5] Add CHANGELOG entry --- changelog-entries/193.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog-entries/193.md diff --git a/changelog-entries/193.md b/changelog-entries/193.md new file mode 100644 index 00000000..fe3f753d --- /dev/null +++ b/changelog-entries/193.md @@ -0,0 +1 @@ +- Use the newer `precice/precice.hpp` header to access C++ API