API Reference

Exported symbols

StructureSolver.DEFp_ModelType
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 quantities and derivatives.
source
StructureSolver.FamilySimulationType
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.

source
StructureSolver.GeneralSimulationType
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.

source
StructureSolver.GridSimulationType
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)
source
StructureSolver.IntParamsType
IntParams(; maxiters, dtmax, reltol, abstol)

Integration / solver parameters used across simulations.

  • maxiters: maximum solver iterations.
  • dtmax: maximum step size.
  • reltol, abstol: relative/absolute tolerances.
source
StructureSolver.PWP_EoSType

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.

source
StructureSolver.ShootingRegimeType
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.

source
StructureSolver.Simple_DirectRegimeType
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.

source
StructureSolver.Simple_ShootingRegimeType
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.

source
StructureSolver.Table_EoSType
    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_base uses number density n in fm^-3, so this constructor converts n -> ρ via ρ = n * 10^39 * m_p (in g/cm^3).
  • The Hermite-based experimental implementation is kept as Table_EoS_Hermite.
source
StructureSolver.LogRangeMethod
LogRange(L, R, N)

Return N logarithmically spaced points from L to R (inclusive).

Equivalent to 10 .^ LinRange(log10(L), log10(R), N).

source
StructureSolver.V_funMethod
V_fun(cf, exparams, φ)

Convenience potential-like function (implementation-specific) associated with the coupling.

source
StructureSolver.calculate!Method
calculate!(simulation)

Run a simulation in-place and return it.

Implemented for SingleSimulation, FamilySimulation, GridSimulation (with a constructor callback), and GeneralSimulation.

source
StructureSolver.calculate_quantitiesMethod
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.

source
StructureSolver.find_max_pressureMethod
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.

source
StructureSolver.get_pressureMethod
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.

source
StructureSolver.internal_physicsMethod
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.

source
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]).

source

Experimental / non-exported

StructureSolver.Table_EoS_HermiteType
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.

source