From: Jean-Paul Pelteret Date: Sat, 23 May 2020 18:58:19 +0000 (+0200) Subject: Update to deal.II 9.1: two_phase_flow X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F77%2Fhead;p=code-gallery.git Update to deal.II 9.1: two_phase_flow --- 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 #include +#include #include #include #include -#include #include #include #include @@ -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 &constraints, PETScWrappers::MPI::SparseMatrix &Matrix, std::shared_ptr preconditioner, PETScWrappers::MPI::Vector &completely_distributed_solution, @@ -245,7 +245,7 @@ private: PETScWrappers::MPI::Vector inverse_ML_vector; // CONSTRAINTS - ConstraintMatrix constraints; + AffineConstraints constraints; // TIME STEPPING double time_step; @@ -1532,7 +1532,7 @@ void LevelSetSolver::get_map_from_Q1_to_Q2() } template -void LevelSetSolver::solve(const ConstraintMatrix &constraints, +void LevelSetSolver::solve(const AffineConstraints &constraints, PETScWrappers::MPI::SparseMatrix &Matrix, std::shared_ptr 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 #include +#include #include #include #include -#include #include #include #include @@ -115,7 +115,7 @@ private: std::vector boundary_values_v; std::vector boundary_values_phi; - ConstraintMatrix constraints; + AffineConstraints 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 #include +#include #include #include #include -#include #include #include #include @@ -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 &constraints, PETScWrappers::MPI::SparseMatrix &Matrix, std::shared_ptr 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 &constraints, PETScWrappers::MPI::SparseMatrix &Matrix, std::shared_ptr 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 constraints; + AffineConstraints constraints_psi; std::vector boundary_values_id_u; std::vector boundary_values_id_v; @@ -984,7 +984,7 @@ void NavierStokesSolver::assemble_system_dpsi_q() /////////////////////// SOLVERS /////////////////////// /////////////////////////////////////////////////////// template -void NavierStokesSolver::solve_U(const ConstraintMatrix &constraints, +void NavierStokesSolver::solve_U(const AffineConstraints &constraints, PETScWrappers::MPI::SparseMatrix &Matrix, std::shared_ptr preconditioner, PETScWrappers::MPI::Vector &completely_distributed_solution, @@ -1005,7 +1005,7 @@ void NavierStokesSolver::solve_U(const ConstraintMatrix &constraints, } template -void NavierStokesSolver::solve_P(const ConstraintMatrix &constraints, +void NavierStokesSolver::solve_P(const AffineConstraints &constraints, PETScWrappers::MPI::SparseMatrix &Matrix, std::shared_ptr 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 #include +#include #include #include #include -#include -#include #include #include #include @@ -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 constraints; + AffineConstraints 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 #include +#include #include #include #include -#include -#include #include #include #include @@ -105,7 +104,7 @@ private: IndexSet locally_owned_dofs_P; IndexSet locally_relevant_dofs_P; - ConstraintMatrix constraints; + AffineConstraints 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 -double BoundaryPhi::value (const Point &p, const unsigned int) const +double BoundaryPhi::value (const Point &, const unsigned int) const { return -1.0; } @@ -122,7 +122,7 @@ public: }; template -double ExactW::value (const Point &p, const unsigned int) const +double ExactW::value (const Point &, 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 { public: RhoFunction (double t=0) : Function() {this->set_time(t);} - virtual double value (const Point &p, const unsigned int component=0) const; + virtual double value (const Point &p, const unsigned int component=0) const; }; template double RhoFunction::value (const Point &p, @@ -29,7 +29,7 @@ public: virtual double value (const Point &p, const unsigned int component=0) const; }; template -double NuFunction::value (const Point &p, const unsigned int) const +double NuFunction::value (const Point &, const unsigned int) const { return 1.; }