From 2137c32388f9d9b1396b6f9771369946746595e6 Mon Sep 17 00:00:00 2001
From: Boris Martin <boris.martin@uliege.be>
Date: Thu, 17 Apr 2025 18:00:44 +0200
Subject: [PATCH] Preparing for upgrading toSend

---
 src/field/DistributedField.cpp | 5 +++--
 src/field/DistributedField.h   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/field/DistributedField.cpp b/src/field/DistributedField.cpp
index 5f1ea0d5..51ec71e2 100644
--- a/src/field/DistributedField.cpp
+++ b/src/field/DistributedField.cpp
@@ -258,9 +258,10 @@ namespace gmshfem::field
   }
 
   template< class T_Scalar, field::Form T_Form >
-  void DistributedField< T_Scalar, T_Form >::_computeToSend()
+  void DistributedField< T_Scalar, T_Form >::_computeToSend(const std::optional<std::vector<int>>& neighborRanks)
   {
 #ifdef HAVE_MPI
+    // What I have to send is what others have to read
 
     // Send all owned interfaces and inner dofs that are read by someone else
     std::vector< DofGlobalIndex > local, global;
@@ -339,7 +340,7 @@ namespace gmshfem::field
     timeOwnership.tick();
     msg::debug << '[' << gmshfem::common::GmshFem::getMPIRank() << "] synchronizes ownership of shared Dofs..." << msg::endl;
     _synchronizeInterfaceOwnership(neighboringRanks);
-    _computeToSend();
+    _computeToSend(neighboringRanks);
     timeOwnership.tock();
     msg::debug << "Dof ownership in " << timeOwnership << msg::endl;
   }
diff --git a/src/field/DistributedField.h b/src/field/DistributedField.h
index fe5bc175..b52a90f5 100644
--- a/src/field/DistributedField.h
+++ b/src/field/DistributedField.h
@@ -54,8 +54,8 @@ namespace gmshfem::field
 
    private:
     void _computeDofsSubsets(); // Computes the sets above, assuming this->_values is filled.    
-    void _synchronizeInterfaceOwnership(const std::optional<std::vector<int>>&  neighboringRanks = std::nullopt);
-    void _computeToSend();
+    void _synchronizeInterfaceOwnership(const std::optional<std::vector<int>>&  neighboringRanks);
+    void _computeToSend(const std::optional<std::vector<int>>&  neighboringRanks);
 
   public:
     virtual void preProMPI(const std::optional<std::vector<int>>&  neighboringRanks = std::nullopt) override;
-- 
GitLab