#ifndef POLYSOLVER_H #define POLYSOLVER_H #include "mfem.hpp" #include #include #include "integrators.h" #include "operator.h" #include "config.h" #include "probe.h" #include "quill/Logger.h" namespace laneEmden { double a (int k, double n); double c(int m, double n); double thetaSerieseExpansion(double xi, double n, int order); } class PolySolver { public: // Public methods PolySolver(double n, double order); ~PolySolver(); void solve(); double getN() { return m_polytropicIndex; } double getOrder() { return m_feOrder; } mfem::Mesh* getMesh() { return m_mesh.get(); } mfem::GridFunction& getSolution() { return *m_theta; } private: // Private Attributes Config& m_config = Config::getInstance(); Probe::LogManager& m_logManager = Probe::LogManager::getInstance(); quill::Logger* m_logger = m_logManager.getLogger("log"); double m_polytropicIndex, m_feOrder; std::unique_ptr m_mesh; std::unique_ptr m_fecH1; std::unique_ptr m_fecRT; std::unique_ptr m_feTheta; std::unique_ptr m_fePhi; std::unique_ptr m_theta; std::unique_ptr m_phi; std::unique_ptr m_polytropOperator; private: // Private methods void assembleBlockSystem(); std::pair, mfem::Array> getEssentialTrueDof(); mfem::Array findCenterElement(); void setInitialGuess(); void saveAndViewSolution(); }; #endif // POLYSOLVER_H