sailfish.mesh.LogSphericalMesh
- class sailfish.mesh.LogSphericalMesh(r0: float = 1.0, r1: float = 10.0, num_zones_per_decade: int = 1000, scale_factor_derivative: Optional[float] = None, polar_grid: bool = False, polar_extent: float = 3.141592653589793)[source]
Bases:
NamedTuple
A 1D or 2D mesh with logarithmic radial binning and homologous expansion.
The comoving coordinates are time-independent; proper distances are affected by the scale factor derivative.
- __init__()
Methods
__init__
()cell_coordinates
(t, i, j)Return the 2D (r, theta) zone center proper coordinates at index (i, j).
count
(value, /)Return number of occurrences of value.
faces
([i0, i1])Return radial face positions for zone indexes in the given range.
index
(value[, start, stop])Return first index of value.
min_spacing
([time])Return the smallest grid spacing.
radial_vertices
(time)Return a list of proper coordinates of the radial zone interfaces.
scale_factor
(time)Return the scale factor at a given time.
zone_center
(t, i)Return the proper radial coordinate of the ith zone center.
zone_centers
(t[, i0, i1])Attributes
num_polar_zones
num_radial_zones
num_total_zones
Alias for field number 2
Alias for field number 5
Alias for field number 4
polar_spacing
A list of the polar angles of the polar mesh faces
Alias for field number 0
Alias for field number 1
Alias for field number 3
shape
- cell_coordinates(t, i, j)[source]
Return the 2D (r, theta) zone center proper coordinates at index (i, j).
- count(value, /)
Return number of occurrences of value.
- faces(i0=0, i1=None)[source]
Return radial face positions for zone indexes in the given range.
The positions are given in comoving coordinates, i.e. are time-independent. The number of faces i1 - i0 + 1 is one more than the number of zones i1 - i0 in the index range.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- min_spacing(time=None)[source]
Return the smallest grid spacing.
If the time is provided, the result is a proper distance and the scale factor and its derivative are taken into account. Otherwise if no time is provided the result is the minimum comoving grid spacing.
- num_zones_per_decade: int
Alias for field number 2
- polar_extent: float
Alias for field number 5
- polar_grid: bool
Alias for field number 4
- property polar_vertices
A list of the polar angles of the polar mesh faces
- r0: float
Alias for field number 0
- r1: float
Alias for field number 1
- scale_factor(time)[source]
Return the scale factor at a given time.
If the scale factor is not changing, it’s always equal to one. Otherwise, it’s assumed that a=0 at t=0.
- scale_factor_derivative: float
Alias for field number 3