InterfaceΒΆ
There are two classes to represent neutron star sequences.
The basic one is star_seq
,
which represents sequences with an arbitrary range of central density.
The other is star_branch
, which represents
a stable branch where properties can be obtained also as function of
gravitational mass. The class star_branch
derives from star_seq
and can thus be
used as a sequence as well. Both classes store the units they use,
which can be freely specified during creation but are assumed to be
geometric. Each object provides a method
units_to_SI()
to query the units.
To compute a sequence of TOV stars, use the function
make_tov_seq()
, specifying
the EOS, the desired accuracy (see TOV solver),
the range of central pseudo-enthalpy, and the number
of sample points. The units are taken from the EOS.
To compute a stable branch for TOV stars, use the function
make_tov_branch_stable()
.
To select the correct branch in case there are several, one can provide
one central pseudo-enthalpy within the desired branch.
The default value should work for almost any remotely realistic NS EOS.
One can also specify a minimum mass that has to be covered by
the sequence. The units for the sequence are copied from the EOS.
To create a star sequence directly from data points,
use make_star_seq()
, specifying
vectors for the NS properties. Currently, those need to
be equally spaced in central pseudo enthalpy. For the latter,
only the range needs to be given, not a vector. Further,
one needs to specify the unit system to which the provided
data refers, which is assumed geometric.
The following example demonstrates basic use of stable TOV branches.
#include "reprimand/unitconv.h"
#include "reprimand/eos_barotropic.h"
#include "reprimand/eos_barotr_file.h"
#include "reprimand/star_sequence.h"
#include "reprimand/star_seq_file.h"
using namespace EOS_Toolkit;
int main() {
// Choose geometric units to work in
auto u = units::geom_solar();
//Load EOS from file
auto eos = load_eos_barotr("example.eos.h5", u);
// Specification for desired accuracy: using defaults
const auto acc = star_acc_simple();
// Create stable TOV branch
auto seq = make_tov_branch_stable(eos, acc);
// Save branch to file
save_star_branch("example.tovseq.h5", seq);
// Compute tidal deformability at 90% of maximum mass
double mass = 0.9 * seq.grav_mass_maximum();
double lambda09
= seq.lambda_tidal_from_grav_mass(mass);
}
Tip
NS sequences represented by star_sequence
or
star_branch
can be copied cheaply, and one
does not need to worry about memory management.
Internally, the data points for interpolation are managed by reference counted
shared pointers. Using sequences or branches is thread-save.