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:
18
src/poly/coeff/private/polyCoeff.cpp
Normal file
18
src/poly/coeff/private/polyCoeff.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user