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

@@ -19,7 +19,7 @@
//
// *********************************************************************** */
#include "mfem.hpp"
#include <cmath>
#include <iostream>
#include "polyCoeff.h"
@@ -35,4 +35,14 @@ namespace polycoeff{
v.SetSize(3);
for (int i = 0; i < 3; i++) { v(i) = -1; }
}
double x1(const double n)
{
double r = 0;
for (int i = 0; i < x1InterpCoeff::numTerms; i++) {
r += x1InterpCoeff::coeff[i] * std::pow(n, x1InterpCoeff::power[i]);
}
return r;
}
}