2025-02-12 16:44:10 -05:00
|
|
|
#include "mfem.hpp"
|
|
|
|
|
#include <cmath>
|
|
|
|
|
|
|
|
|
|
#include "coeff.h"
|
|
|
|
|
|
2025-02-14 10:50:07 -05:00
|
|
|
/**
|
|
|
|
|
* @brief Computes the xi coefficient function.
|
|
|
|
|
*
|
|
|
|
|
* @param x Input vector.
|
|
|
|
|
* @return double The computed xi coefficient.
|
|
|
|
|
*/
|
|
|
|
|
double xi_coeff_func(const mfem::Vector &x)
|
|
|
|
|
{
|
2025-02-12 16:44:10 -05:00
|
|
|
return std::pow(x(0), 2);
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-14 10:50:07 -05:00
|
|
|
/**
|
|
|
|
|
* @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)
|
|
|
|
|
{
|
2025-02-12 16:44:10 -05:00
|
|
|
v.SetSize(1);
|
|
|
|
|
v[0] = -std::pow(x(0), 2);
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-14 10:50:07 -05:00
|
|
|
/**
|
|
|
|
|
* @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)
|
|
|
|
|
{
|
2025-02-12 16:44:10 -05:00
|
|
|
double xi = x[0];
|
2025-02-14 10:50:07 -05:00
|
|
|
return 1 - std::pow(xi / root, 2);
|
2025-02-12 16:44:10 -05:00
|
|
|
}
|