feat(poly): interpolating polynomial to find polytrope surface

Instead of treating the polytrope as a free boundary problem I have defined an interpolating polynominal, accurate to within 0.01 percent over n=[0,5) which is used to set the size of the domain for a given n
This commit is contained in:
2025-03-18 10:15:51 -04:00
parent ea0ff2a702
commit 8dcdf92414
4 changed files with 35 additions and 18 deletions

View File

@@ -1,16 +1,7 @@
#include "mfem.hpp"
#include <string>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <csignal>
#include <filesystem>
#include <vector>
#include <array>
#include <utility>
#include "meshIO.h"
#include "polySolver.h"
#include "polyMFEMUtils.h"
#include "polyCoeff.h"
@@ -19,7 +10,6 @@
#include "quill/LogMacros.h"
#include "warning_control.h"
namespace laneEmden {
@@ -122,7 +112,7 @@ void PolySolver::solve(){
nonlinearForm->SetEssentialTrueDofs(ess_tdof_list);
// Set the center elemID to be the Dirichlet boundary
double alpha = config.get<double>("Poly:Solver:Newton:Alpha", 1e2);
// double alpha = config.get<double>("Poly:Solver:Newton:Alpha", 1e2);
double newtonRelTol = config.get<double>("Poly:Solver:Newton:RelTol", 1e-7);
double newtonAbsTol = config.get<double>("Poly:Solver:Newton:AbsTol", 1e-7);
int newtonMaxIter = config.get<int>("Poly:Solver:Newton:MaxIter", 200);
@@ -137,7 +127,8 @@ void PolySolver::solve(){
LOG_INFO(logger, "GMRES Solver (relTol: {:0.2E}, absTol: {:0.2E}, maxIter: {}, printLevel: {})", gmresRelTol, gmresAbsTol, gmresMaxIter, gmresPrintLevel);
std::vector<double> zeroSlopeCoordinate = {0.0, 0.0, 0.0};
polyMFEMUtils::ZeroSlopeNewtonSolver newtonSolver(alpha, zeroSlopeCoordinate);
// polyMFEMUtils::ZeroSlopeNewtonSolver newtonSolver(alpha, zeroSlopeCoordinate);
mfem::NewtonSolver newtonSolver;
newtonSolver.SetRelTol(newtonRelTol);
newtonSolver.SetAbsTol(newtonAbsTol);
newtonSolver.SetMaxIter(newtonMaxIter);