feat(poly): added first pass implimentation of 3D constrained lane-emden solver
This has not currently been tested and this commit should not be viewed as scientifically complete
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
polyCoeff_sources = files(
|
||||
'private/coeff.cpp'
|
||||
'private/polyCoeff.cpp'
|
||||
)
|
||||
|
||||
polyCoeff_headers = files(
|
||||
'public/coeff.h'
|
||||
'public/polyCoeff.h'
|
||||
)
|
||||
|
||||
libPolyCoeff = static_library('polyCoeff',
|
||||
polyCoeff_sources,
|
||||
include_directories : include_directories('.'),
|
||||
include_directories : include_directories('./public'),
|
||||
cpp_args: ['-fvisibility=default'],
|
||||
dependencies: [mfem_dep],
|
||||
install: true
|
||||
)
|
||||
|
||||
|
||||
polyCoeff_dep = declare_dependency(
|
||||
include_directories : include_directories('.'),
|
||||
polycoeff_dep = declare_dependency(
|
||||
include_directories : include_directories('./public'),
|
||||
link_with : libPolyCoeff,
|
||||
sources : polyCoeff_sources,
|
||||
dependencies : [mfem_dep]
|
||||
|
||||
@@ -1,40 +1,23 @@
|
||||
#include "mfem.hpp"
|
||||
#include <cmath>
|
||||
|
||||
#include "coeff.h"
|
||||
#include "polyCoeff.h"
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
namespace polycoeff{
|
||||
double xi_coeff_func(const mfem::Vector &x)
|
||||
{
|
||||
return std::pow(x(0), 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
void vec_xi_coeff_func(const mfem::Vector &x, mfem::Vector &v)
|
||||
{
|
||||
v.SetSize(1);
|
||||
v[0] = -std::pow(x(0), 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
double theta_initial_guess(const mfem::Vector &x, double root)
|
||||
{
|
||||
double xi = x[0];
|
||||
return 1 - std::pow(xi / root, 2);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,35 @@
|
||||
#ifndef POLYCOEFF_H
|
||||
#define POLYCOEFF_H
|
||||
|
||||
#include "mfem.hpp"
|
||||
#include <cmath>
|
||||
|
||||
double xi_coeff_func(const mfem::Vector &x);
|
||||
namespace polycoeff
|
||||
{
|
||||
/**
|
||||
* @brief Computes the xi coefficient function.
|
||||
*
|
||||
* @param x Input vector.
|
||||
* @return double The computed xi coefficient.
|
||||
*/
|
||||
double xi_coeff_func(const mfem::Vector &x);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
} // namespace polyCoeff
|
||||
|
||||
#endif // POLYCOEFF_H
|
||||
Reference in New Issue
Block a user