API Reference
Exported symbols
StructureSolver.DEF1_CouplingFunction — Type
DEF1 coupling function.
Typically parameterized by external parameters :α0 and :β0.
StructureSolver.DEF3_CouplingFunction — Type
DEF3 coupling function.
Typically parameterized by external parameters :α0 and :β0.
StructureSolver.DEFp_Model — Type
DEFp_Model{T}(cf, eos)Damour-Esposito-Farese scalar-tensor stellar-structure model.
cf is a coupling-function instance (e.g. DEF1_CouplingFunction()), and eos is an equation of state (e.g. PWP_EoS(...)). The model stores
- inner parameters
inparams(e.g.:pc,:φc), - external parameters
exparams/exparams_symbolic, - computed global
quantitiesandderivatives.
StructureSolver.FamilySimulation — Type
FamilySimulation(sample_model, regime, family_params, int_params)Scan one (or several) parameters and store results on an N-D grid.
Results are stored in sim.family.inparams, sim.family.quantities, and sim.family.derivatives.
StructureSolver.GeneralSimulation — Type
GeneralSimulation(model_type, regime, int_params)Run an N-D parameter scan with ShootingRegime and store outputs in sim.data.
Results are stored in sim.data.quantities and sim.data.derivatives as N-D arrays.
StructureSolver.GridSimulation — Type
GridSimulation(sample_model, sample_regime, family_params, grid_params, int_params)Grid-of-families simulation.
Typically you will use the convenience constructor:
sim = GridSimulation(family_constructor, family_params, grid_params, int_params)and then run:
calculate!(sim, family_constructor)StructureSolver.IntParams — Type
IntParams(; maxiters, dtmax, reltol, abstol)Integration / solver parameters used across simulations.
maxiters: maximum solver iterations.dtmax: maximum step size.reltol,abstol: relative/absolute tolerances.
StructureSolver.PWP_EoS — Type
Piecewise-polytropic equation of state.
PWP_EoS supports several constructors, including a convenient named form:
PWP_EoS(low_eos=:SLy, high_eos=:MPA1)The EoS provides get_density, get_pressure, get_energy_density, etc.
StructureSolver.ShootingRegime — Type
ShootingRegime(inparams_fixed, inparams_shooting, quantities_fixed, exparams)General shooting regime that supports mixing fixed values and grids.
Dict values can be either scalars (fixed) or vectors (grid dimensions). This regime is used together with GeneralSimulation.
StructureSolver.Simple_DirectRegime — Type
Simple_DirectRegime(inparams_fixed, exparams)Direct (non-shooting) regime.
inparams_fixed: fixed inner parameters (e.g.:pc,:φc).exparams: fixed external parameters (e.g.:α0,:β0).
Used with SingleSimulation / FamilySimulation.
StructureSolver.Simple_ShootingRegime — Type
Simple_ShootingRegime(inparams_fixed, exparams, exparams_symbolic, inparams_shooting, quantities_fixed)Shooting regime for a single model.
The solver varies parameters in inparams_shooting to satisfy target boundary conditions given by quantities_fixed.
Typical use: shoot on :φc to enforce :bc_φ∞ == 0.0.
StructureSolver.SingleSimulation — Type
SingleSimulation(model, regime, int_params)Solve a single stellar model for a given model and regime.
Run with calculate!(sim).
StructureSolver.Table_EoS — Type
Table_EoS(name::Symbol)Tabulated equation of state using simple linear interpolation in log-space.
This is the "known-working" table EoS implementation. The input tables are taken from table_eos_base in src/eos_data.jl.
Notes:
table_eos_baseuses number densitynin fm^-3, so this constructor convertsn -> ρviaρ = n * 10^39 * m_p(in g/cm^3).- The Hermite-based experimental implementation is kept as
Table_EoS_Hermite.
StructureSolver.LogRange — Method
LogRange(L, R, N)Return N logarithmically spaced points from L to R (inclusive).
Equivalent to 10 .^ LinRange(log10(L), log10(R), N).
StructureSolver.V_fun — Method
V_fun(cf, exparams, φ)Convenience potential-like function (implementation-specific) associated with the coupling.
StructureSolver.calculate! — Method
calculate!(simulation)Run a simulation in-place and return it.
Implemented for SingleSimulation, FamilySimulation, GridSimulation (with a constructor callback), and GeneralSimulation.
StructureSolver.calculate_old! — Method
calculate_old!(args...)Backward-compatible alias for calculate!.
StructureSolver.calculate_quantities — Method
calculate_quantities(rs_solution, model::DEFp_Model; save_to_model::Bool)Post-process an ODE solution and compute global quantities/diagnostics.
If save_to_model=true, results are written into model.quantities.
StructureSolver.find_max_pressure — Method
find_max_pressure(eos::PWP_EoS; c_max=c)Return an estimate of the maximum pressure (in CGS) for which the sound speed does not exceed c_max.
This is useful for building central-pressure grids that avoid superluminal sound speeds.
StructureSolver.get_energy_density — Method
get_energy_density(eos, val; from, units=:cgs)Return energy density corresponding to val.
In CGS, this is typically returned in erg/cm^3.
StructureSolver.get_internal_energy — Method
get_internal_energy(eos, val; from, units=:cgs)Return internal energy per unit mass (implementation-dependent normalization) corresponding to val.
StructureSolver.get_pressure — Method
get_pressure(eos, val; from, units=:cgs)Return pressure corresponding to val.
from specifies what val represents. In CGS, pressure is typically returned in dyn/cm^2.
StructureSolver.get_sound_velocity — Method
get_sound_velocity(eos, val; from, units=:cgs)Return the (adiabatic) sound speed corresponding to val.
In CGS, returned in cm/s.
StructureSolver.get_specific_enthalpy — Method
get_specific_enthalpy(eos, val; from, units=:cgs)Return specific enthalpy (implementation-dependent normalization) corresponding to val.
StructureSolver.internal_physics — Method
internal_physics(rs_vars::Vector, model::DEFp_Model, q::Real)Compute local matter quantities used by the ODE system.
Returns (A, α, ñ, ε̃) evaluated at the current state.
StructureSolver.ode_system! — Method
ode_system!(D_rs_vars::Vector, rs_vars::Vector, model::DEFp_Model, q::Real)Right-hand side for the stellar structure ODE system in DEF scalar-tensor gravity.
q is a dimensionless pressure coordinate used internally by the solver (with physical pressure p̃ = q * pc, where pc = model.inparams[:pc]).
StructureSolver.φ∞_const — Method
φ∞_const(cf, exparams)Asymptotic scalar-field value used as a reference for boundary conditions.
StructureSolver.G — Constant
GNewtonian gravitational constant in CGS units.
Unit: cm^3 g^-1 s^-2.
StructureSolver.c — Constant
cSpeed of light in vacuum in CGS units.
Unit: cm/s.
StructureSolver.high_pwp3_eos_names — Constant
high_pwp3_eos_namesNames (symbols) of built-in high-density piecewise-polytrope parameter sets available for PWP_EoS.
StructureSolver.mp — Constant
mpBaryon mass used by the package in CGS units.
Unit: g.
Experimental / non-exported
StructureSolver.Table_EoS_Hermite — Type
Table_EoS_Hermite(n, ε, p; name=:unknown)Experimental Hermite-interpolated table EoS.
This implementation is intentionally not the default Table_EoS because it is unfinished / not validated for the bundled tables.