feat(poly): major work on preconditioner for block form of lane emden equation

working on a "smart" schur compliment preconditioner for the block form of the lane emden equation. Currently this is stub and should not be considered usable
This commit is contained in:
2025-04-09 15:17:55 -04:00
parent acf5367556
commit 08b68c22de
14 changed files with 525 additions and 118 deletions

View File

@@ -1,21 +1,22 @@
#ifndef POLYSOLVER_H
#define POLYSOLVER_H
#include "linalg/solvers.hpp"
#include "mfem.hpp"
#include <memory>
#include <utility>
#include "integrators.h"
#include "4DSTARTypes.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);
double thetaSeriesExpansion(double xi, double n, int order);
}
class PolySolver {
@@ -23,7 +24,7 @@ public: // Public methods
PolySolver(double n, double order);
~PolySolver();
void solve();
void solve() const;
double getN() { return m_polytropicIndex; }
double getOrder() { return m_feOrder; }
@@ -48,17 +49,22 @@ private: // Private Attributes
std::unique_ptr<PolytropeOperator> m_polytropOperator;
std::unique_ptr<mfem::OperatorJacobiSmoother> m_prec;
private: // Private methods
void assembleBlockSystem();
std::pair<mfem::Array<int>, mfem::Array<int>> getEssentialTrueDof();
mfem::Array<int> findCenterElement();
void setInitialGuess();
void saveAndViewSolution(const mfem::BlockVector& state_vector);
mfem::NewtonSolver setupNewtonSolver();
void setupOperator();
SSE::MFEMArrayPairSet getEssentialTrueDof() const;
std::pair<mfem::Array<int>, mfem::Array<int>> findCenterElement() const;
void setInitialGuess() const;
void saveAndViewSolution(const mfem::BlockVector& state_vector) const;
mfem::NewtonSolver setupNewtonSolver() const;
void setupOperator() const;
void LoadSolverUserParams(double &newtonRelTol, double &newtonAbsTol, int &newtonMaxIter, int &newtonPrintLevel,
double &gmresRelTol, double &gmresAbsTol, int &gmresMaxIter, int &gmresPrintLevel) const;
mfem::BlockDiagonalPreconditioner build_preconditioner() const;
};
#endif // POLYSOLVER_H