From 49ab9859a911c0d41d19fff9f36a33f2729169d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com>
Date: Tue, 9 Mar 2021 17:38:42 +0100
Subject: [PATCH] Perform a few clean-up. Getting ride of obsolete classes.

---
 src/scheme/AcousticSolver.cpp             |   1 +
 src/scheme/AcousticSolver.hpp             |  23 +---
 src/scheme/AcousticSolverType.hpp         |  10 --
 src/scheme/BlockPerfectGas.hpp            |  59 ---------
 src/scheme/FiniteVolumesEulerUnknowns.hpp | 152 ----------------------
 5 files changed, 5 insertions(+), 240 deletions(-)
 delete mode 100644 src/scheme/AcousticSolverType.hpp
 delete mode 100644 src/scheme/BlockPerfectGas.hpp
 delete mode 100644 src/scheme/FiniteVolumesEulerUnknowns.hpp

diff --git a/src/scheme/AcousticSolver.cpp b/src/scheme/AcousticSolver.cpp
index 76017501f..3336fd716 100644
--- a/src/scheme/AcousticSolver.cpp
+++ b/src/scheme/AcousticSolver.cpp
@@ -1,5 +1,6 @@
 #include <scheme/AcousticSolver.hpp>
 
+#include <mesh/ItemValueUtils.hpp>
 #include <mesh/MeshNodeBoundary.hpp>
 #include <scheme/DirichletBoundaryConditionDescriptor.hpp>
 #include <scheme/DiscreteFunctionP0.hpp>
diff --git a/src/scheme/AcousticSolver.hpp b/src/scheme/AcousticSolver.hpp
index 99e8a8617..2ed970757 100644
--- a/src/scheme/AcousticSolver.hpp
+++ b/src/scheme/AcousticSolver.hpp
@@ -1,28 +1,13 @@
 #ifndef ACOUSTIC_SOLVER_HPP
 #define ACOUSTIC_SOLVER_HPP
 
-#include <algebra/TinyMatrix.hpp>
-#include <algebra/TinyVector.hpp>
-#include <mesh/ItemValueUtils.hpp>
-#include <mesh/Mesh.hpp>
-#include <mesh/MeshData.hpp>
-#include <mesh/MeshDataManager.hpp>
-#include <mesh/MeshNodeBoundary.hpp>
-#include <mesh/SubItemValuePerItem.hpp>
-#include <scheme/AcousticSolverType.hpp>
-#include <scheme/BlockPerfectGas.hpp>
-#include <scheme/FiniteVolumesEulerUnknowns.hpp>
-#include <utils/ArrayUtils.hpp>
-#include <utils/Exceptions.hpp>
-#include <utils/Messenger.hpp>
-#include <utils/PugsAssert.hpp>
-
-#include <rang.hpp>
-
-#include <iostream>
+#include <memory>
+#include <tuple>
+#include <vector>
 
 class IDiscreteFunction;
 class IBoundaryConditionDescriptor;
+class IMesh;
 
 double acoustic_dt(const std::shared_ptr<const IDiscreteFunction>& c);
 
diff --git a/src/scheme/AcousticSolverType.hpp b/src/scheme/AcousticSolverType.hpp
deleted file mode 100644
index 3095dcc86..000000000
--- a/src/scheme/AcousticSolverType.hpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef ACOUSTIC_SOLVER_TYPE_HPP
-#define ACOUSTIC_SOLVER_TYPE_HPP
-
-enum class AcousticSolverType
-{
-  Eucclhyd,
-  Glace
-};
-
-#endif   // ACOUSTIC_SOLVER_TYPE_HPP
diff --git a/src/scheme/BlockPerfectGas.hpp b/src/scheme/BlockPerfectGas.hpp
deleted file mode 100644
index 38aef3262..000000000
--- a/src/scheme/BlockPerfectGas.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef BLOCK_PERFECTGAS_HPP
-#define BLOCK_PERFECTGAS_HPP
-
-#include <mesh/ItemValue.hpp>
-
-struct BlockPerfectGas
-{
- private:
-  CellValue<double>& m_rhoj;
-  CellValue<double>& m_ej;
-  CellValue<double>& m_pj;
-  CellValue<double>& m_gammaj;
-  CellValue<double>& m_cj;
-
- public:
-  BlockPerfectGas(CellValue<double>& rhoj,
-                  CellValue<double>& ej,
-                  CellValue<double>& pj,
-                  CellValue<double>& gammaj,
-                  CellValue<double>& cj)
-    : m_rhoj(rhoj), m_ej(ej), m_pj(pj), m_gammaj(gammaj), m_cj(cj)
-  {
-    ;
-  }
-
-  void
-  updatePandCFromRhoE()
-  {
-    const size_t nj                      = m_ej.size();
-    const CellValue<const double>& rho   = m_rhoj;
-    const CellValue<const double>& e     = m_ej;
-    const CellValue<const double>& gamma = m_gammaj;
-
-    parallel_for(
-      nj, PUGS_LAMBDA(CellId j) {
-        const double gamma_minus_one = gamma[j] - 1;
-        m_pj[j]                      = gamma_minus_one * rho[j] * e[j];
-        m_cj[j]                      = std::sqrt(gamma[j] * gamma_minus_one * e[j]);
-      });
-  }
-
-  void
-  updateEandCFromRhoP()
-  {
-    const size_t nj                      = m_ej.size();
-    const CellValue<const double>& rho   = m_rhoj;
-    const CellValue<const double>& p     = m_pj;
-    const CellValue<const double>& gamma = m_gammaj;
-
-    parallel_for(
-      nj, PUGS_LAMBDA(CellId j) { m_ej[j] = p[j] / (rho[j] * (gamma[j] - 1)); });
-
-    const CellValue<const double>& e = m_ej;
-    parallel_for(
-      nj, PUGS_LAMBDA(CellId j) { m_cj[j] = std::sqrt(gamma[j] * (gamma[j] - 1) * e[j]); });
-  }
-};
-
-#endif   // BLOCK_PERFECTGAS_HPP
diff --git a/src/scheme/FiniteVolumesEulerUnknowns.hpp b/src/scheme/FiniteVolumesEulerUnknowns.hpp
deleted file mode 100644
index ec7e8851e..000000000
--- a/src/scheme/FiniteVolumesEulerUnknowns.hpp
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifndef FINITE_VOLUMES_EULER_UNKNOWNS_HPP
-#define FINITE_VOLUMES_EULER_UNKNOWNS_HPP
-
-#include <algebra/TinyVector.hpp>
-#include <mesh/ItemValue.hpp>
-#include <scheme/BlockPerfectGas.hpp>
-
-template <typename MeshType>
-class FiniteVolumesEulerUnknowns
-{
- public:
-  static constexpr size_t Dimension = MeshType::Dimension;
-
-  using Rd = TinyVector<Dimension>;
-
- private:
-  CellValue<double> m_rhoj;
-  CellValue<Rd> m_uj;
-  CellValue<double> m_Ej;
-
-  CellValue<double> m_ej;
-  CellValue<double> m_pj;
-  CellValue<double> m_gammaj;
-  CellValue<double> m_cj;
-  CellValue<double> m_mj;
-  CellValue<double> m_inv_mj;
-
- public:
-  CellValue<double>&
-  rhoj()
-  {
-    return m_rhoj;
-  }
-
-  const CellValue<const double>
-  rhoj() const
-  {
-    return m_rhoj;
-  }
-
-  CellValue<Rd>&
-  uj()
-  {
-    return m_uj;
-  }
-
-  const CellValue<const Rd>
-  uj() const
-  {
-    return m_uj;
-  }
-
-  CellValue<double>&
-  Ej()
-  {
-    return m_Ej;
-  }
-
-  const CellValue<const double>
-  Ej() const
-  {
-    return m_Ej;
-  }
-
-  CellValue<double>&
-  ej()
-  {
-    return m_ej;
-  }
-
-  const CellValue<const double>
-  ej() const
-  {
-    return m_ej;
-  }
-
-  CellValue<double>&
-  pj()
-  {
-    return m_pj;
-  }
-
-  const CellValue<const double>
-  pj() const
-  {
-    return m_pj;
-  }
-
-  CellValue<double>&
-  gammaj()
-  {
-    return m_gammaj;
-  }
-
-  const CellValue<const double>
-  gammaj() const
-  {
-    return m_gammaj;
-  }
-
-  CellValue<double>&
-  cj()
-  {
-    return m_cj;
-  }
-
-  const CellValue<const double>
-  cj() const
-  {
-    return m_cj;
-  }
-
-  CellValue<double>&
-  mj()
-  {
-    return m_mj;
-  }
-
-  const CellValue<const double>
-  mj() const
-  {
-    return m_mj;
-  }
-
-  CellValue<double>&
-  invMj()
-  {
-    return m_inv_mj;
-  }
-
-  const CellValue<const double>
-  invMj() const
-  {
-    return m_inv_mj;
-  }
-
-  FiniteVolumesEulerUnknowns(const MeshType& mesh)
-    : m_rhoj(mesh.connectivity()),
-      m_uj(mesh.connectivity()),
-      m_Ej(mesh.connectivity()),
-      m_ej(mesh.connectivity()),
-      m_pj(mesh.connectivity()),
-      m_gammaj(mesh.connectivity()),
-      m_cj(mesh.connectivity()),
-      m_mj(mesh.connectivity()),
-      m_inv_mj(mesh.connectivity())
-  {
-    ;
-  }
-};
-
-#endif   // FINITE_VOLUMES_EULER_UNKNOWNS_HPP
-- 
GitLab