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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user