Skip to content

Commit

Permalink
Rename ".h" headers to ".hpp" (#208)
Browse files Browse the repository at this point in the history
* Rename all .h extensions to .hpp .

* Apply formatting to renamed files.

* converted remaining header file from .h to .hpp

---------

Co-authored-by: Will Saunders <[email protected]>
  • Loading branch information
oparry-ukaea and will-saunders-ukaea authored Apr 10, 2024
1 parent 5bc60b8 commit 40c3dfe
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 88 deletions.
2 changes: 1 addition & 1 deletion solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "PoissonPIC.h"
#include "PoissonPIC.hpp"

using namespace std;

Expand Down
56 changes: 0 additions & 56 deletions solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.h

This file was deleted.

53 changes: 53 additions & 0 deletions solvers/Electrostatic2D3V/EquationSystems/PoissonPIC.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#ifndef NEKTAR_SOLVERS_EQUATIONSYSTEMS_POISSON_PIC_H
#define NEKTAR_SOLVERS_EQUATIONSYSTEMS_POISSON_PIC_H

#include <map>
#include <string>

#include <SolverUtils/EquationSystem.h>
using namespace Nektar::SolverUtils;

namespace Nektar {
class PoissonPIC : public EquationSystem {
public:
std::map<std::string, int> field_to_index;

friend class MemoryManager<PoissonPIC>;

/// Creates an instance of this class
static EquationSystemSharedPtr
create(const LibUtilities::SessionReaderSharedPtr &pSession,
const SpatialDomains::MeshGraphSharedPtr &pGraph) {
EquationSystemSharedPtr p =
MemoryManager<PoissonPIC>::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<OneD, bool> v_GetSystemSingularChecks();
};
} // namespace Nektar

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <random>
#include <string>

#include "../EquationSystems/PoissonPIC.h"
#include "../EquationSystems/PoissonPIC.hpp"
#include "charged_particles.hpp"

using namespace Nektar;
Expand Down
2 changes: 1 addition & 1 deletion solvers/SimpleSOL/EquationSystems/SOLSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <boost/core/ignore_unused.hpp>

#include "SOLSystem.h"
#include "SOLSystem.hpp"

namespace Nektar {
std::string SOLSystem::className =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
//
// File SOLSystem.h
// File SOLSystem.hpp
//
// For more information, please see: http://www.nektar.info
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <boost/algorithm/string/predicate.hpp>

#include "SOLWithParticlesSystem.h"
#include "SOLWithParticlesSystem.hpp"

namespace Nektar {
string SOLWithParticlesSystem::className =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
//
// File SOLWithParticlesSystem.h
// File SOLWithParticlesSystem.hpp
//
// For more information, please see: http://www.nektar.info
//
Expand Down Expand Up @@ -37,9 +37,9 @@

#include "../Diagnostics/mass_conservation.hpp"
#include "../ParticleSystems/neutral_particles.hpp"
#include "SOLSystem.h"
#include <string>
#include "SOLSystem.hpp"
#include <solvers/solver_callback_handler.hpp>
#include <string>

namespace Nektar {
/**
Expand Down Expand Up @@ -92,9 +92,7 @@ class SOLWithParticlesSystem : public SOLSystem,
*/
std::shared_ptr<NeutralParticleSystem> GetNeutralParticleSystem();


protected:

// Flag to toggle mass conservation checking
bool m_diag_mass_recording_enabled;
// Map of field name to field index
Expand Down
2 changes: 1 addition & 1 deletion solvers/SimpleSOL/Forcing/SourceTerms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <boost/core/ignore_unused.hpp>

#include "SourceTerms.h"
#include "SourceTerms.hpp"

using namespace std;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: SourceTerms.h
// File: SourceTerms.hpp
//
// For more information, please see: http://www.nektar.info
//
Expand Down
2 changes: 1 addition & 1 deletion solvers/SimpleSOL/SimpleSOL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <SolverUtils/Driver.h>

#include "SimpleSOL.h"
#include "SimpleSOL.hpp"

using namespace Nektar;
using namespace Nektar::SolverUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
//
// File: SimpleSOL.h
// File: SimpleSOL.hpp
//
//
// Description: Header for the SimpleSOL solver.
Expand All @@ -10,4 +10,4 @@ namespace NESO {
namespace Solvers {
int run_SimpleSOL(int argc, char *argv[]);
}
}
} // namespace NESO
2 changes: 1 addition & 1 deletion solvers/SimpleSOL/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Description: Entrypoint for the SimpleSOL solver.
//
///////////////////////////////////////////////////////////////////////////////
#include "SimpleSOL.h"
#include "SimpleSOL.hpp"
#include <iostream>
#include <mpi.h>

Expand Down
4 changes: 2 additions & 2 deletions test/integration/solvers/H3LAPD/test_H3LAPD.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <gtest/gtest.h>

#include "H3LAPD.hpp"
#include "test_H3LAPD.h"
#include "test_H3LAPD.hpp"
/**
* Tests for the H3LAPD solver.
*/
Expand All @@ -12,4 +12,4 @@
*/
TEST_F(HWTest, 2Din3DHWGrowthRates) { check_growth_rates(); }

TEST_F(HWTest, Coupled2Din3DHWMassCons) { check_mass_cons(); }
TEST_F(HWTest, Coupled2Din3DHWMassCons) { check_mass_cons(); }
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions test/integration/solvers/SimpleSOL/test_SimpleSOL.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <gtest/gtest.h>

#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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>
#include <fstream>
#include <vector>
#include <gtest/gtest.h>
#include <vector>

#include <FieldUtils/Module.h>
#include <LibUtilities/BasicConst/NektarUnivTypeDefs.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Communication/CommSerial.h>

#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;
Expand Down Expand Up @@ -186,14 +186,15 @@ class SimpleSOLTest : public NektarSolverTest {
}
};


struct SOLWithParticlesMassConservationPre : public NESO::SolverCallback<SOLWithParticlesSystem> {
struct SOLWithParticlesMassConservationPre
: public NESO::SolverCallback<SOLWithParticlesSystem> {
void call(SOLWithParticlesSystem *state) {
state->m_diag_mass_recording->compute_initial_fluid_mass();
}
};

struct SOLWithParticlesMassConservationPost : public NESO::SolverCallback<SOLWithParticlesSystem> {
struct SOLWithParticlesMassConservationPost
: public NESO::SolverCallback<SOLWithParticlesSystem> {
std::vector<double> mass_error;
void call(SOLWithParticlesSystem *state) {
auto md = state->m_diag_mass_recording;
Expand All @@ -202,9 +203,9 @@ struct SOLWithParticlesMassConservationPost : public NESO::SolverCallback<SOLWit
const double mass_total = mass_particles + mass_fluid;
const double mass_added = md->compute_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
2 changes: 1 addition & 1 deletion test/integration/solvers/solver_test_utils.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "solver_test_utils.h"
#include "solver_test_utils.hpp"
#include <mpi.h>

// ============================= Helper functions =============================
Expand Down

0 comments on commit 40c3dfe

Please sign in to comment.