From aaee1a0cae3d1fd400783bab462999955340bb56 Mon Sep 17 00:00:00 2001
From: Jean-Paul Pelteret <jppelteret@gmail.com>
Date: Sat, 23 May 2020 20:58:19 +0200
Subject: [PATCH] Update to deal.II 9.1: two_phase_flow

---
 two_phase_flow/CMakeLists.txt        |  2 +-
 two_phase_flow/LevelSetSolver.cc     |  8 ++++----
 two_phase_flow/MultiPhase.cc         |  4 ++--
 two_phase_flow/NavierStokesSolver.cc | 14 +++++++-------
 two_phase_flow/TestLevelSet.cc       |  7 +++----
 two_phase_flow/TestNavierStokes.cc   |  5 ++---
 two_phase_flow/utilities_test_LS.cc  |  4 ++--
 two_phase_flow/utilities_test_NS.cc  |  4 ++--
 8 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/two_phase_flow/CMakeLists.txt b/two_phase_flow/CMakeLists.txt
index 259eba6..33ad8aa 100644
--- a/two_phase_flow/CMakeLists.txt
+++ b/two_phase_flow/CMakeLists.txt
@@ -28,7 +28,7 @@ SET(TARGET_SRC
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
 
-FIND_PACKAGE(deal.II 8.4 QUIET
+FIND_PACKAGE(deal.II 9.1 QUIET
   HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
   )
 IF(NOT ${deal.II_FOUND})
diff --git a/two_phase_flow/LevelSetSolver.cc b/two_phase_flow/LevelSetSolver.cc
index af18d86..d2c445e 100644
--- a/two_phase_flow/LevelSetSolver.cc
+++ b/two_phase_flow/LevelSetSolver.cc
@@ -1,9 +1,9 @@
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/solver_cg.h>
-#include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 #include <deal.II/lac/petsc_sparse_matrix.h>
 #include <deal.II/lac/petsc_parallel_vector.h>
@@ -160,7 +160,7 @@ private:
   ///////////////
   void get_sparsity_pattern();
   void get_map_from_Q1_to_Q2();
-  void solve(const ConstraintMatrix &constraints,
+  void solve(const AffineConstraints<double> &constraints,
              PETScWrappers::MPI::SparseMatrix &Matrix,
              std::shared_ptr<PETScWrappers::PreconditionBoomerAMG> preconditioner,
              PETScWrappers::MPI::Vector &completely_distributed_solution,
@@ -245,7 +245,7 @@ private:
   PETScWrappers::MPI::Vector inverse_ML_vector;
 
   // CONSTRAINTS
-  ConstraintMatrix     constraints;
+  AffineConstraints<double> constraints;
 
   // TIME STEPPING
   double time_step;
@@ -1532,7 +1532,7 @@ void LevelSetSolver<dim>::get_map_from_Q1_to_Q2()
 }
 
 template <int dim>
-void LevelSetSolver<dim>::solve(const ConstraintMatrix &constraints,
+void LevelSetSolver<dim>::solve(const AffineConstraints<double> &constraints,
                                 PETScWrappers::MPI::SparseMatrix &Matrix,
                                 std::shared_ptr<PETScWrappers::PreconditionBoomerAMG> preconditioner,
                                 PETScWrappers::MPI::Vector &completely_distributed_solution,
diff --git a/two_phase_flow/MultiPhase.cc b/two_phase_flow/MultiPhase.cc
index 00dbf55..3e0e71d 100644
--- a/two_phase_flow/MultiPhase.cc
+++ b/two_phase_flow/MultiPhase.cc
@@ -1,9 +1,9 @@
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/solver_cg.h>
-#include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 #include <deal.II/lac/petsc_parallel_vector.h>
 #include <deal.II/lac/petsc_solver.h>
@@ -115,7 +115,7 @@ private:
   std::vector<double> boundary_values_v;
   std::vector<double> boundary_values_phi;
 
-  ConstraintMatrix     constraints;
+  AffineConstraints<double> constraints;
 
   double time;
   double time_step;
diff --git a/two_phase_flow/NavierStokesSolver.cc b/two_phase_flow/NavierStokesSolver.cc
index 7acd19a..3f013b2 100644
--- a/two_phase_flow/NavierStokesSolver.cc
+++ b/two_phase_flow/NavierStokesSolver.cc
@@ -1,9 +1,9 @@
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/solver_cg.h>
-#include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 #include <deal.II/lac/petsc_parallel_vector.h>
 #include <deal.II/lac/petsc_solver.h>
@@ -120,11 +120,11 @@ private:
   void assemble_system_U();
   void assemble_system_dpsi_q();
   // SOLVERS //
-  void solve_U(const ConstraintMatrix &constraints, PETScWrappers::MPI::SparseMatrix &Matrix,
+  void solve_U(const AffineConstraints<double> &constraints, PETScWrappers::MPI::SparseMatrix &Matrix,
                std::shared_ptr<PETScWrappers::PreconditionBoomerAMG> preconditioner,
                PETScWrappers::MPI::Vector &completely_distributed_solution,
                const PETScWrappers::MPI::Vector &rhs);
-  void solve_P(const ConstraintMatrix &constraints, PETScWrappers::MPI::SparseMatrix &Matrix,
+  void solve_P(const AffineConstraints<double> &constraints, PETScWrappers::MPI::SparseMatrix &Matrix,
                std::shared_ptr<PETScWrappers::PreconditionBoomerAMG> preconditioner,
                PETScWrappers::MPI::Vector &completely_distributed_solution,
                const PETScWrappers::MPI::Vector &rhs);
@@ -182,8 +182,8 @@ private:
 
   int degree_MAX;
 
-  ConstraintMatrix constraints;
-  ConstraintMatrix constraints_psi;
+  AffineConstraints<double> constraints;
+  AffineConstraints<double> constraints_psi;
 
   std::vector<types::global_dof_index> boundary_values_id_u;
   std::vector<types::global_dof_index> boundary_values_id_v;
@@ -984,7 +984,7 @@ void NavierStokesSolver<dim>::assemble_system_dpsi_q()
 /////////////////////// SOLVERS ///////////////////////
 ///////////////////////////////////////////////////////
 template<int dim>
-void NavierStokesSolver<dim>::solve_U(const ConstraintMatrix &constraints,
+void NavierStokesSolver<dim>::solve_U(const AffineConstraints<double> &constraints,
                                       PETScWrappers::MPI::SparseMatrix &Matrix,
                                       std::shared_ptr<PETScWrappers::PreconditionBoomerAMG> preconditioner,
                                       PETScWrappers::MPI::Vector &completely_distributed_solution,
@@ -1005,7 +1005,7 @@ void NavierStokesSolver<dim>::solve_U(const ConstraintMatrix &constraints,
 }
 
 template<int dim>
-void NavierStokesSolver<dim>::solve_P(const ConstraintMatrix &constraints,
+void NavierStokesSolver<dim>::solve_P(const AffineConstraints<double> &constraints,
                                       PETScWrappers::MPI::SparseMatrix &Matrix,
                                       std::shared_ptr<PETScWrappers::PreconditionBoomerAMG> preconditioner,
                                       PETScWrappers::MPI::Vector &completely_distributed_solution,
diff --git a/two_phase_flow/TestLevelSet.cc b/two_phase_flow/TestLevelSet.cc
index 15d2abd..00f58fa 100644
--- a/two_phase_flow/TestLevelSet.cc
+++ b/two_phase_flow/TestLevelSet.cc
@@ -1,10 +1,9 @@
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/solver_cg.h>
-#include <deal.II/lac/constraint_matrix.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
 #include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 #include <deal.II/lac/petsc_parallel_vector.h>
 #include <deal.II/lac/petsc_solver.h>
@@ -120,8 +119,8 @@ private:
   IndexSet             locally_owned_dofs_U_disp_field;
   IndexSet             locally_relevant_dofs_U_disp_field;
 
-  ConstraintMatrix     constraints;
-  ConstraintMatrix     constraints_disp_field;
+  AffineConstraints<double> constraints;
+  AffineConstraints<double> constraints_disp_field;
 
   double time;
   double time_step;
diff --git a/two_phase_flow/TestNavierStokes.cc b/two_phase_flow/TestNavierStokes.cc
index f812589..651da17 100644
--- a/two_phase_flow/TestNavierStokes.cc
+++ b/two_phase_flow/TestNavierStokes.cc
@@ -1,10 +1,9 @@
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/solver_cg.h>
-#include <deal.II/lac/constraint_matrix.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
 #include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 #include <deal.II/lac/petsc_parallel_vector.h>
 #include <deal.II/lac/petsc_solver.h>
@@ -105,7 +104,7 @@ private:
   IndexSet             locally_owned_dofs_P;
   IndexSet             locally_relevant_dofs_P;
 
-  ConstraintMatrix     constraints;
+  AffineConstraints<double> constraints;
 
   //TimerOutput timer;
 
diff --git a/two_phase_flow/utilities_test_LS.cc b/two_phase_flow/utilities_test_LS.cc
index 0802bcf..cd8e26e 100644
--- a/two_phase_flow/utilities_test_LS.cc
+++ b/two_phase_flow/utilities_test_LS.cc
@@ -62,7 +62,7 @@ public:
 };
 
 template <int dim>
-double BoundaryPhi<dim>::value (const Point<dim> &p, const unsigned int) const
+double BoundaryPhi<dim>::value (const Point<dim> &, const unsigned int) const
 {
   return -1.0;
 }
@@ -122,7 +122,7 @@ public:
 };
 
 template <int dim>
-double ExactW<dim>::value (const Point<dim> &p, const unsigned int) const
+double ExactW<dim>::value (const Point<dim> &, const unsigned int) const
 {
   // PROBLEM = 3D_DIAGONAL_ADVECTION
   return 1.0;
diff --git a/two_phase_flow/utilities_test_NS.cc b/two_phase_flow/utilities_test_NS.cc
index 85302b0..2c04f62 100644
--- a/two_phase_flow/utilities_test_NS.cc
+++ b/two_phase_flow/utilities_test_NS.cc
@@ -6,7 +6,7 @@ class RhoFunction : public Function <dim>
 {
 public:
   RhoFunction (double t=0) : Function<dim>() {this->set_time(t);}
-  virtual double value (const Point<dim>   &p, const unsigned int component=0) const;
+  virtual double value (const Point<dim> &p, const unsigned int component=0) const;
 };
 template <int dim>
 double RhoFunction<dim>::value (const Point<dim> &p,
@@ -29,7 +29,7 @@ public:
   virtual double value (const Point<dim>   &p, const unsigned int component=0) const;
 };
 template <int dim>
-double NuFunction<dim>::value (const Point<dim> &p, const unsigned int) const
+double NuFunction<dim>::value (const Point<dim> &, const unsigned int) const
 {
   return 1.;
 }
-- 
2.39.5