diff --git a/src/scheme/AcousticSolver.cpp b/src/scheme/AcousticSolver.cpp index 76017501f2c26dc690b8c815a02ea4c0f35fa0f8..3336fd716822a86f86fc335a3f02cb80882a26fc 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 99e8a8617d8a7606deb56b56095b34f75b0a9629..2ed97075717f8984afb22799648b4b26fbc9327b 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 3095dcc864d5598e985290302ad94106adbd6b2e..0000000000000000000000000000000000000000 --- 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 38aef3262a39101fdc7607143a0bdb0e36d4cfe5..0000000000000000000000000000000000000000 --- 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 ec7e8851ed98b64971810cfccbf2b587615e8939..0000000000000000000000000000000000000000 --- 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