refactor(poly): updated header guards to pragma once
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#ifndef POLYSOLVER_H
|
||||
#define POLYSOLVER_H
|
||||
#pragma once
|
||||
|
||||
#include "mfem.hpp"
|
||||
#include <memory>
|
||||
@@ -21,8 +20,8 @@ namespace laneEmden {
|
||||
|
||||
// Struct to persist lifetime of the linear and nonlinear solvers
|
||||
struct solverBundle {
|
||||
mfem::GMRESSolver solver;
|
||||
mfem::NewtonSolver newton;
|
||||
mfem::GMRESSolver solver; // Must be first so it lives longer than the newton solver
|
||||
mfem::NewtonSolver newton; // Must be second so that when it is destroyed the solver is still alive preventing a double delete
|
||||
};
|
||||
|
||||
class PolySolver {
|
||||
@@ -32,10 +31,10 @@ public: // Public methods
|
||||
|
||||
void solve() const;
|
||||
|
||||
double getN() { return m_polytropicIndex; }
|
||||
double getOrder() { return m_feOrder; }
|
||||
mfem::Mesh* getMesh() { return m_mesh.get(); }
|
||||
mfem::GridFunction& getSolution() { return *m_theta; }
|
||||
double getN() const { return m_polytropicIndex; }
|
||||
double getOrder() const { return m_feOrder; }
|
||||
mfem::Mesh* getMesh() const { return m_mesh.get(); }
|
||||
mfem::GridFunction& getSolution() const { return *m_theta; }
|
||||
|
||||
private: // Private Attributes
|
||||
Config& m_config = Config::getInstance();
|
||||
@@ -70,6 +69,4 @@ private: // Private methods
|
||||
void LoadSolverUserParams(double &newtonRelTol, double &newtonAbsTol, int &newtonMaxIter, int &newtonPrintLevel,
|
||||
double &gmresRelTol, double &gmresAbsTol, int &gmresMaxIter, int &gmresPrintLevel) const;
|
||||
|
||||
};
|
||||
|
||||
#endif // POLYSOLVER_H
|
||||
};
|
||||
Reference in New Issue
Block a user