feat(poly): initial build system for polytrope
This commit is contained in:
@@ -3,16 +3,38 @@
|
||||
|
||||
#include "coeff.h"
|
||||
|
||||
double xi_coeff_func(const mfem::Vector &x) {
|
||||
/**
|
||||
* @brief Computes the xi coefficient function.
|
||||
*
|
||||
* @param x Input vector.
|
||||
* @return double The computed xi coefficient.
|
||||
*/
|
||||
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) {
|
||||
/**
|
||||
* @brief Computes the vector xi coefficient function.
|
||||
*
|
||||
* @param x Input vector.
|
||||
* @param v Output vector to store the computed xi coefficient.
|
||||
*/
|
||||
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) {
|
||||
/**
|
||||
* @brief Computes the initial guess for theta.
|
||||
*
|
||||
* @param x Input vector.
|
||||
* @param root Root value used in the computation.
|
||||
* @return double The initial guess for theta.
|
||||
*/
|
||||
double theta_initial_guess(const mfem::Vector &x, double root)
|
||||
{
|
||||
double xi = x[0];
|
||||
return 1-std::pow(xi/root, 2);
|
||||
return 1 - std::pow(xi / root, 2);
|
||||
}
|
||||
Reference in New Issue
Block a user