feat(poly): added skeleton of polytrope model

the polytrope module will be used as an initial guess to the solver. A skeleton of this has been imported from https://github.com/tboudreaux/FEMPolytrope

This module will need major updates still to handle 3D, proper boundary conditions, and to incorporate it with the rest of our meshing scheme
This commit is contained in:
2025-02-12 16:44:10 -05:00
parent 112e626760
commit f4be5b3733
10 changed files with 317 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#include "mfem.hpp"
#include <cmath>
#include "coeff.h"
double xi_coeff_func(const mfem::Vector &x) {
return std::pow(x(0), 2);
}
void vec_xi_coeff_func(const mfem::Vector &x, mfem::Vector &v) {
v.SetSize(1);
v[0] = -std::pow(x(0), 2);
}
double theta_initial_guess(const mfem::Vector &x, double root) {
double xi = x[0];
return 1-std::pow(xi/root, 2);
}