jesterTOV.tov.base.TOVSolverBase#

class TOVSolverBase[source]#

Bases: ABC

Abstract base class for TOV equation solvers.

All TOV solvers must implement: - solve(): Solve TOV equations for a given central pressure - get_required_parameters(): Return list of additional parameters beyond EOS

__init__()#

Methods

__init__()

construct_family(eos_data, ndat, min_nsat, ...)

Construct M-R-Λ curves by solving for multiple central pressures.

fetch_params(params)

Extract solver-specific parameters from the combined EOS+TOV parameter dict.

get_required_parameters()

Return additional parameters needed beyond EOS.

solve(eos_data, pc, tov_params)

Solve TOV equations for given central pressure.

construct_family(eos_data, ndat, min_nsat, tov_params)[source]#

Construct M-R-Λ curves by solving for multiple central pressures.

The central pressure grid spans from a minimum based on min_nsat to the maximum pressure where the EOS remains causal (\(c_s^2 < 1\)).

Parameters:
  • eos_data (EOSData) – EOS quantities in geometric units

  • ndat (int) – Number of points in central pressure grid

  • min_nsat (float) – Minimum central density in units of saturation density (assumed to be 0.16 \(\mathrm{fm}^{-3}\))

  • tov_params (dict[str, float]) – Solver-specific parameters returned by fetch_params(). Empty dict {} for GR; populated dict for modified-gravity solvers.

Return type:

FamilyData

Returns:

FamilyData – Mass-radius-tidal curves in physical units

fetch_params(params)[source]#

Extract solver-specific parameters from the combined EOS+TOV parameter dict.

Uses get_required_parameters() as the key list. For GR this returns an empty dict (no additional parameters needed).

Parameters:

params (dict[str, float]) – Full parameter dictionary from the prior (EOS + TOV combined).

Return type:

dict[str, float]

Returns:

dict[str, float] – Solver-specific subset of params.

get_required_parameters()[source]#

Return additional parameters needed beyond EOS.

Examples

  • GR TOV: [] (no extra params)

  • Anisotropic TOV: [“gamma”] (anisotropy parameter)

  • Scalar-tensor: [“beta_ST”, “phi_c”, “nu_c”]

Return type:

list[str]

Returns:

list[str] – Parameter names

abstractmethod solve(eos_data, pc, tov_params)[source]#

Solve TOV equations for given central pressure.

Parameters:
  • eos_data (EOSData) – EOS quantities (type-safe dataclass)

  • pc (float) – Central pressure [geometric units]

  • tov_params (dict[str, float]) – Solver-specific parameters returned by fetch_params(). Empty dict {} for GR; populated dict for modified-gravity solvers.

Return type:

TOVSolution

Returns:

TOVSolution – Mass, radius, and Love number k2 [geometric units]