diff --git a/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.cpp b/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.cpp index 25943179..5e6d7c6d 100644 --- a/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.cpp +++ b/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.cpp @@ -1,4 +1,4 @@ -#include "PoissonPIC.h" +#include "PoissonPIC.hpp" using namespace std; diff --git a/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.h b/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.h deleted file mode 100644 index b709fe23..00000000 --- a/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef NEKTAR_SOLVERS_EQUATIONSYSTEMS_POISSON_PIC_H -#define NEKTAR_SOLVERS_EQUATIONSYSTEMS_POISSON_PIC_H - -#include -#include - -#include -using namespace Nektar::SolverUtils; - -namespace Nektar -{ -class PoissonPIC : public EquationSystem -{ -public: - std::map field_to_index; - - friend class MemoryManager; - - /// Creates an instance of this class - static EquationSystemSharedPtr create( - const LibUtilities::SessionReaderSharedPtr &pSession, - const SpatialDomains::MeshGraphSharedPtr &pGraph) - { - EquationSystemSharedPtr p = - MemoryManager::AllocateSharedPtr(pSession, pGraph); - p->InitObject(); - return p; - } - /// Name of class - static std::string className1; - static std::string className2; - - virtual ~PoissonPIC(); - /** - * Helper function to map from field name to field indices. - * - * @param name Field name (probably either "u" or "rho"). - * @returns index (probably 0 or 1). - */ - int GetFieldIndex(const std::string name); - -protected: - StdRegions::ConstFactorMap m_factors; - PoissonPIC(const LibUtilities::SessionReaderSharedPtr &pSession, - const SpatialDomains::MeshGraphSharedPtr &pGraph); - - virtual void v_InitObject(bool DeclareFields = true); - virtual void v_DoSolve(); - virtual void v_GenerateSummary(SolverUtils::SummaryList &s); - -private: - virtual Array v_GetSystemSingularChecks(); -}; -} // namespace Nektar - -#endif diff --git a/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.hpp b/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.hpp new file mode 100644 index 00000000..c7b5ce9a --- /dev/null +++ b/solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.hpp @@ -0,0 +1,53 @@ +#ifndef NEKTAR_SOLVERS_EQUATIONSYSTEMS_POISSON_PIC_H +#define NEKTAR_SOLVERS_EQUATIONSYSTEMS_POISSON_PIC_H + +#include +#include + +#include +using namespace Nektar::SolverUtils; + +namespace Nektar { +class PoissonPIC : public EquationSystem { +public: + std::map field_to_index; + + friend class MemoryManager; + + /// Creates an instance of this class + static EquationSystemSharedPtr + create(const LibUtilities::SessionReaderSharedPtr &pSession, + const SpatialDomains::MeshGraphSharedPtr &pGraph) { + EquationSystemSharedPtr p = + MemoryManager::AllocateSharedPtr(pSession, pGraph); + p->InitObject(); + return p; + } + /// Name of class + static std::string className1; + static std::string className2; + + virtual ~PoissonPIC(); + /** + * Helper function to map from field name to field indices. + * + * @param name Field name (probably either "u" or "rho"). + * @returns index (probably 0 or 1). + */ + int GetFieldIndex(const std::string name); + +protected: + StdRegions::ConstFactorMap m_factors; + PoissonPIC(const LibUtilities::SessionReaderSharedPtr &pSession, + const SpatialDomains::MeshGraphSharedPtr &pGraph); + + virtual void v_InitObject(bool DeclareFields = true); + virtual void v_DoSolve(); + virtual void v_GenerateSummary(SolverUtils::SummaryList &s); + +private: + virtual Array v_GetSystemSingularChecks(); +}; +} // namespace Nektar + +#endif diff --git a/solvers/Electrostatic2D3V/ParticleSystems/poisson_particle_coupling.hpp b/solvers/Electrostatic2D3V/ParticleSystems/poisson_particle_coupling.hpp index 0c921933..fa395023 100644 --- a/solvers/Electrostatic2D3V/ParticleSystems/poisson_particle_coupling.hpp +++ b/solvers/Electrostatic2D3V/ParticleSystems/poisson_particle_coupling.hpp @@ -21,7 +21,7 @@ #include #include -#include "../EquationSystems/PoissonPIC.h" +#include "../EquationSystems/PoissonPIC.hpp" #include "charged_particles.hpp" using namespace Nektar; diff --git a/solvers/SimpleSOL/EquationSystems/SOLSystem.cpp b/solvers/SimpleSOL/EquationSystems/SOLSystem.cpp index 5ca5cb37..bd153dbf 100644 --- a/solvers/SimpleSOL/EquationSystems/SOLSystem.cpp +++ b/solvers/SimpleSOL/EquationSystems/SOLSystem.cpp @@ -35,7 +35,7 @@ #include #include -#include "SOLSystem.h" +#include "SOLSystem.hpp" namespace Nektar { std::string SOLSystem::className = diff --git a/solvers/SimpleSOL/EquationSystems/SOLSystem.h b/solvers/SimpleSOL/EquationSystems/SOLSystem.hpp similarity index 99% rename from solvers/SimpleSOL/EquationSystems/SOLSystem.h rename to solvers/SimpleSOL/EquationSystems/SOLSystem.hpp index 16fc3689..52399274 100644 --- a/solvers/SimpleSOL/EquationSystems/SOLSystem.h +++ b/solvers/SimpleSOL/EquationSystems/SOLSystem.hpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -// File SOLSystem.h +// File SOLSystem.hpp // // For more information, please see: http://www.nektar.info // diff --git a/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.cpp b/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.cpp index 6d781bdb..c5068ae9 100644 --- a/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.cpp +++ b/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.cpp @@ -34,7 +34,7 @@ #include -#include "SOLWithParticlesSystem.h" +#include "SOLWithParticlesSystem.hpp" namespace Nektar { string SOLWithParticlesSystem::className = diff --git a/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.h b/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.hpp similarity index 98% rename from solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.h rename to solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.hpp index df0fdc44..e5169091 100644 --- a/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.h +++ b/solvers/SimpleSOL/EquationSystems/SOLWithParticlesSystem.hpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -// File SOLWithParticlesSystem.h +// File SOLWithParticlesSystem.hpp // // For more information, please see: http://www.nektar.info // @@ -37,9 +37,9 @@ #include "../Diagnostics/mass_conservation.hpp" #include "../ParticleSystems/neutral_particles.hpp" -#include "SOLSystem.h" -#include +#include "SOLSystem.hpp" #include +#include namespace Nektar { /** @@ -92,9 +92,7 @@ class SOLWithParticlesSystem : public SOLSystem, */ std::shared_ptr GetNeutralParticleSystem(); - protected: - // Flag to toggle mass conservation checking bool m_diag_mass_recording_enabled; // Map of field name to field index diff --git a/solvers/SimpleSOL/Forcing/SourceTerms.cpp b/solvers/SimpleSOL/Forcing/SourceTerms.cpp index 79497040..1f51f946 100644 --- a/solvers/SimpleSOL/Forcing/SourceTerms.cpp +++ b/solvers/SimpleSOL/Forcing/SourceTerms.cpp @@ -34,7 +34,7 @@ #include -#include "SourceTerms.h" +#include "SourceTerms.hpp" using namespace std; diff --git a/solvers/SimpleSOL/Forcing/SourceTerms.h b/solvers/SimpleSOL/Forcing/SourceTerms.hpp similarity index 99% rename from solvers/SimpleSOL/Forcing/SourceTerms.h rename to solvers/SimpleSOL/Forcing/SourceTerms.hpp index de9363f9..dbaf5114 100644 --- a/solvers/SimpleSOL/Forcing/SourceTerms.h +++ b/solvers/SimpleSOL/Forcing/SourceTerms.hpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -// File: SourceTerms.h +// File: SourceTerms.hpp // // For more information, please see: http://www.nektar.info // diff --git a/solvers/SimpleSOL/SimpleSOL.cpp b/solvers/SimpleSOL/SimpleSOL.cpp index 6c5c7b34..5b1624c5 100644 --- a/solvers/SimpleSOL/SimpleSOL.cpp +++ b/solvers/SimpleSOL/SimpleSOL.cpp @@ -10,7 +10,7 @@ #include #include -#include "SimpleSOL.h" +#include "SimpleSOL.hpp" using namespace Nektar; using namespace Nektar::SolverUtils; diff --git a/solvers/SimpleSOL/SimpleSOL.h b/solvers/SimpleSOL/SimpleSOL.hpp similarity index 87% rename from solvers/SimpleSOL/SimpleSOL.h rename to solvers/SimpleSOL/SimpleSOL.hpp index 2867f804..028e3cfd 100644 --- a/solvers/SimpleSOL/SimpleSOL.h +++ b/solvers/SimpleSOL/SimpleSOL.hpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -// File: SimpleSOL.h +// File: SimpleSOL.hpp // // // Description: Header for the SimpleSOL solver. @@ -10,4 +10,4 @@ namespace NESO { namespace Solvers { int run_SimpleSOL(int argc, char *argv[]); } -} \ No newline at end of file +} // namespace NESO \ No newline at end of file diff --git a/solvers/SimpleSOL/main.cpp b/solvers/SimpleSOL/main.cpp index ec1b50a8..2bc3a5e5 100644 --- a/solvers/SimpleSOL/main.cpp +++ b/solvers/SimpleSOL/main.cpp @@ -6,7 +6,7 @@ // Description: Entrypoint for the SimpleSOL solver. // /////////////////////////////////////////////////////////////////////////////// -#include "SimpleSOL.h" +#include "SimpleSOL.hpp" #include #include diff --git a/test/integration/solvers/H3LAPD/test_H3LAPD.cpp b/test/integration/solvers/H3LAPD/test_H3LAPD.cpp index e054740d..e7e3c0be 100644 --- a/test/integration/solvers/H3LAPD/test_H3LAPD.cpp +++ b/test/integration/solvers/H3LAPD/test_H3LAPD.cpp @@ -1,7 +1,7 @@ #include #include "H3LAPD.hpp" -#include "test_H3LAPD.h" +#include "test_H3LAPD.hpp" /** * Tests for the H3LAPD solver. */ @@ -12,4 +12,4 @@ */ TEST_F(HWTest, 2Din3DHWGrowthRates) { check_growth_rates(); } -TEST_F(HWTest, Coupled2Din3DHWMassCons) { check_mass_cons(); } \ No newline at end of file +TEST_F(HWTest, Coupled2Din3DHWMassCons) { check_mass_cons(); } diff --git a/test/integration/solvers/H3LAPD/test_H3LAPD.h b/test/integration/solvers/H3LAPD/test_H3LAPD.hpp similarity index 99% rename from test/integration/solvers/H3LAPD/test_H3LAPD.h rename to test/integration/solvers/H3LAPD/test_H3LAPD.hpp index 9f495373..ef2653c7 100644 --- a/test/integration/solvers/H3LAPD/test_H3LAPD.h +++ b/test/integration/solvers/H3LAPD/test_H3LAPD.hpp @@ -6,7 +6,7 @@ #include "EquationSystems/DriftReducedSystem.hpp" #include "EquationSystems/HW2Din3DSystem.hpp" #include "H3LAPD.hpp" -#include "solver_test_utils.h" +#include "solver_test_utils.hpp" #include "solvers/solver_callback_handler.hpp" #include "solvers/solver_runner.hpp" diff --git a/test/integration/solvers/SimpleSOL/test_SimpleSOL.cpp b/test/integration/solvers/SimpleSOL/test_SimpleSOL.cpp index 722ef37b..14a8c0ae 100644 --- a/test/integration/solvers/SimpleSOL/test_SimpleSOL.cpp +++ b/test/integration/solvers/SimpleSOL/test_SimpleSOL.cpp @@ -1,7 +1,7 @@ #include -#include "SimpleSOL.h" -#include "test_SimpleSOL.h" +#include "SimpleSOL.hpp" +#include "test_SimpleSOL.hpp" /** * Tests for SimpleSOL solver. Note that the test name itself is used to diff --git a/test/integration/solvers/SimpleSOL/test_SimpleSOL.h b/test/integration/solvers/SimpleSOL/test_SimpleSOL.hpp similarity index 95% rename from test/integration/solvers/SimpleSOL/test_SimpleSOL.h rename to test/integration/solvers/SimpleSOL/test_SimpleSOL.hpp index 6970ebe1..f8a423c5 100644 --- a/test/integration/solvers/SimpleSOL/test_SimpleSOL.h +++ b/test/integration/solvers/SimpleSOL/test_SimpleSOL.hpp @@ -4,19 +4,19 @@ #include #include #include -#include #include +#include #include #include #include #include -#include "SimpleSOL.h" -#include "solver_test_utils.h" -#include "solvers/solver_runner.hpp" +#include "EquationSystems/SOLWithParticlesSystem.hpp" +#include "SimpleSOL.hpp" +#include "solver_test_utils.hpp" #include "solvers/solver_callback_handler.hpp" -#include "EquationSystems/SOLWithParticlesSystem.h" +#include "solvers/solver_runner.hpp" namespace LU = Nektar::LibUtilities; namespace FU = Nektar::FieldUtils; @@ -186,14 +186,15 @@ class SimpleSOLTest : public NektarSolverTest { } }; - -struct SOLWithParticlesMassConservationPre : public NESO::SolverCallback { +struct SOLWithParticlesMassConservationPre + : public NESO::SolverCallback { void call(SOLWithParticlesSystem *state) { state->m_diag_mass_recording->compute_initial_fluid_mass(); } }; -struct SOLWithParticlesMassConservationPost : public NESO::SolverCallback { +struct SOLWithParticlesMassConservationPost + : public NESO::SolverCallback { std::vector mass_error; void call(SOLWithParticlesSystem *state) { auto md = state->m_diag_mass_recording; @@ -202,9 +203,9 @@ struct SOLWithParticlesMassConservationPost : public NESO::SolverCallbackcompute_total_added_mass(); const double correct_total = mass_added + md->get_initial_mass(); - this->mass_error.push_back(std::fabs(correct_total - mass_total)/std::fabs(correct_total)); + this->mass_error.push_back(std::fabs(correct_total - mass_total) / + std::fabs(correct_total)); } }; - #endif // SIMPLESOL_TESTS_COMMON diff --git a/test/integration/solvers/solver_test_utils.cpp b/test/integration/solvers/solver_test_utils.cpp index 54690658..0383a46d 100644 --- a/test/integration/solvers/solver_test_utils.cpp +++ b/test/integration/solvers/solver_test_utils.cpp @@ -1,4 +1,4 @@ -#include "solver_test_utils.h" +#include "solver_test_utils.hpp" #include // ============================= Helper functions ============================= diff --git a/test/integration/solvers/solver_test_utils.h b/test/integration/solvers/solver_test_utils.hpp similarity index 100% rename from test/integration/solvers/solver_test_utils.h rename to test/integration/solvers/solver_test_utils.hpp