From d27984596e5a9f1f98918897ef12f4c53a1037e1 Mon Sep 17 00:00:00 2001
From: Luca Heltai <luca.heltai@sissa.it>
Date: Thu, 28 Sep 2017 09:59:56 +0200
Subject: [PATCH] Switched order of arguments in SUNDIALS::* constructors.

---
 include/deal.II/sundials/arkode.h        | 6 +++---
 include/deal.II/sundials/ida.h           | 6 +++---
 source/sundials/arkode.cc                | 2 +-
 source/sundials/ida.cc                   | 2 +-
 tests/sundials/harmonic_oscillator_01.cc | 2 +-
 tests/sundials/harmonic_oscillator_02.cc | 2 +-
 tests/sundials/harmonic_oscillator_03.cc | 2 +-
 tests/sundials/harmonic_oscillator_04.cc | 2 +-
 tests/sundials/harmonic_oscillator_05.cc | 2 +-
 tests/sundials/harmonic_oscillator_06.cc | 2 +-
 10 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/deal.II/sundials/arkode.h b/include/deal.II/sundials/arkode.h
index 0ed5c85419..3f19773b6b 100644
--- a/include/deal.II/sundials/arkode.h
+++ b/include/deal.II/sundials/arkode.h
@@ -482,11 +482,11 @@ namespace SUNDIALS
      * passing an AdditionalData() object that sets all of the solver
      * parameters.
      *
-     * @param mpi_comm MPI communicator
      * @param data ARKode configuration data
+     * @param mpi_comm MPI communicator
      */
-    ARKode(const MPI_Comm mpi_comm = MPI_COMM_WORLD,
-           const AdditionalData &data=AdditionalData());
+    ARKode(const AdditionalData &data=AdditionalData(),
+           const MPI_Comm mpi_comm = MPI_COMM_WORLD);
 
     /**
      * Destructor.
diff --git a/include/deal.II/sundials/ida.h b/include/deal.II/sundials/ida.h
index a3a7c3a8b4..d705b250c0 100644
--- a/include/deal.II/sundials/ida.h
+++ b/include/deal.II/sundials/ida.h
@@ -557,11 +557,11 @@ namespace SUNDIALS
      * consistent. Then you can choose how these are made consistent, using the same three
      * options that you used for the initial conditions in `reset_type`.
      *
-     * @param mpi_comm MPI communicator
      * @param data IDA configuration data
+     * @param mpi_comm MPI communicator
      */
-    IDA(const MPI_Comm mpi_comm = MPI_COMM_WORLD,
-        const AdditionalData &data=AdditionalData());
+    IDA(const AdditionalData &data=AdditionalData(),
+        const MPI_Comm mpi_comm = MPI_COMM_WORLD);
 
     /**
      * Destructor.
diff --git a/source/sundials/arkode.cc b/source/sundials/arkode.cc
index 759bfe8cee..d3a488229c 100644
--- a/source/sundials/arkode.cc
+++ b/source/sundials/arkode.cc
@@ -208,7 +208,7 @@ namespace SUNDIALS
   }
 
   template <typename VectorType>
-  ARKode<VectorType>::ARKode(const MPI_Comm mpi_comm, const AdditionalData &data) :
+  ARKode<VectorType>::ARKode(const AdditionalData &data, const MPI_Comm mpi_comm) :
     data(data),
     arkode_mem(nullptr),
     communicator(Utilities::MPI::duplicate_communicator(mpi_comm))
diff --git a/source/sundials/ida.cc b/source/sundials/ida.cc
index e7b2591628..114b7dd231 100644
--- a/source/sundials/ida.cc
+++ b/source/sundials/ida.cc
@@ -138,7 +138,7 @@ namespace SUNDIALS
   }
 
   template <typename VectorType>
-  IDA<VectorType>::IDA(const MPI_Comm mpi_comm, const AdditionalData &data) :
+  IDA<VectorType>::IDA(const AdditionalData &data, const MPI_Comm mpi_comm) :
     data(data),
     ida_mem(nullptr),
     communicator(Utilities::MPI::duplicate_communicator(mpi_comm))
diff --git a/tests/sundials/harmonic_oscillator_01.cc b/tests/sundials/harmonic_oscillator_01.cc
index 1b609761ae..cfdf6369b3 100644
--- a/tests/sundials/harmonic_oscillator_01.cc
+++ b/tests/sundials/harmonic_oscillator_01.cc
@@ -56,7 +56,7 @@ class HarmonicOscillator
 
 public:
   HarmonicOscillator(double _kappa, const typename SUNDIALS::IDA<Vector<double>>::AdditionalData &data) :
-    time_stepper(MPI_COMM_WORLD, data),
+    time_stepper(data),
     y(2),
     y_dot(2),
     J(2,2),
diff --git a/tests/sundials/harmonic_oscillator_02.cc b/tests/sundials/harmonic_oscillator_02.cc
index 194cd2ca5f..7c839d58c6 100644
--- a/tests/sundials/harmonic_oscillator_02.cc
+++ b/tests/sundials/harmonic_oscillator_02.cc
@@ -70,7 +70,7 @@ int main (int argc, char **argv)
   std::ifstream ifile(SOURCE_DIR "/harmonic_oscillator_02.prm");
   prm.parse_input(ifile);
 
-  SUNDIALS::ARKode<VectorType> ode(MPI_COMM_WORLD,data);
+  SUNDIALS::ARKode<VectorType> ode(data);
 
   ode.reinit_vector = [&] (VectorType&v)
   {
diff --git a/tests/sundials/harmonic_oscillator_03.cc b/tests/sundials/harmonic_oscillator_03.cc
index b418602a7c..eb5a4a4048 100644
--- a/tests/sundials/harmonic_oscillator_03.cc
+++ b/tests/sundials/harmonic_oscillator_03.cc
@@ -63,7 +63,7 @@ int main (int argc, char **argv)
   std::ifstream ifile(SOURCE_DIR "/harmonic_oscillator_02.prm");
   prm.parse_input(ifile);
 
-  SUNDIALS::ARKode<VectorType> ode(MPI_COMM_WORLD,data);
+  SUNDIALS::ARKode<VectorType> ode(data);
 
   ode.reinit_vector = [&] (VectorType&v)
   {
diff --git a/tests/sundials/harmonic_oscillator_04.cc b/tests/sundials/harmonic_oscillator_04.cc
index dc6fcb59d0..b3cc67cab1 100644
--- a/tests/sundials/harmonic_oscillator_04.cc
+++ b/tests/sundials/harmonic_oscillator_04.cc
@@ -65,7 +65,7 @@ int main (int argc, char **argv)
   std::ifstream ifile(SOURCE_DIR "/harmonic_oscillator_04.prm");
   prm.parse_input(ifile);
 
-  SUNDIALS::ARKode<VectorType> ode(MPI_COMM_WORLD,data);
+  SUNDIALS::ARKode<VectorType> ode(data);
 
   ode.reinit_vector = [&] (VectorType&v)
   {
diff --git a/tests/sundials/harmonic_oscillator_05.cc b/tests/sundials/harmonic_oscillator_05.cc
index 09005c66ba..bd7a09d3e8 100644
--- a/tests/sundials/harmonic_oscillator_05.cc
+++ b/tests/sundials/harmonic_oscillator_05.cc
@@ -65,7 +65,7 @@ int main (int argc, char **argv)
   std::ifstream ifile(SOURCE_DIR "/harmonic_oscillator_05.prm");
   prm.parse_input(ifile);
 
-  SUNDIALS::ARKode<VectorType> ode(MPI_COMM_WORLD,data);
+  SUNDIALS::ARKode<VectorType> ode(data);
 
   ode.reinit_vector = [&] (VectorType&v)
   {
diff --git a/tests/sundials/harmonic_oscillator_06.cc b/tests/sundials/harmonic_oscillator_06.cc
index b25620c60c..01e0c9e820 100644
--- a/tests/sundials/harmonic_oscillator_06.cc
+++ b/tests/sundials/harmonic_oscillator_06.cc
@@ -65,7 +65,7 @@ int main (int argc, char **argv)
   std::ifstream ifile(SOURCE_DIR "/harmonic_oscillator_06.prm");
   prm.parse_input(ifile);
 
-  SUNDIALS::ARKode<VectorType> ode(MPI_COMM_WORLD,data);
+  SUNDIALS::ARKode<VectorType> ode(data);
 
   ode.reinit_vector = [&] (VectorType&v)
   {
-- 
2.39.5