Documentation
¶
Overview ¶
Package orbit is celestial/orbit's stepping as a kernel on the gpu: every star at once, each on its own thread, in 32-bit floats, by the same kick, drift, kick. Its reference is celestial/orbit, and its tests measure how closely the two agree.
The tests hold the kernel to the reference on passes from a tenth of a kiloparsec out, and on a circle a parsec from the centre.
A plunge from kiloparsecs to parsecs, the regime a search for stars thrown from the centre is after, wants steps planned for its nearest pass and a galactic potential, and is not tested yet.
Index ¶
- func RanAway(err error) ([]int, bool)
- type Field
- type Runaway
- type Solver
- func (solver *Solver) Back(stars []orbit.State, span measure.Duration, steps int) ([]orbit.Pass, []orbit.State, error)
- func (solver *Solver) Close()
- func (solver *Solver) Field() Field
- func (solver *Solver) GPUTime() time.Duration
- func (solver *Solver) Pulls(places []orbit.Place) ([]orbit.Pull, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field is a potential as the kernel wants it: its pull in the Metal shading language, the numbers that pull reads, and the same potential in Go, for the kernel to be held to.
func MilkyWay ¶
MilkyWay is the galaxy's pull as orbit has it, in Metal: the bulge by the regularised lower incomplete gamma function summed in 32 bits, the disc, the halo with its small-distance series, and the hole, each as orbit's reference defines them, with the galaxy as the reference.
type Runaway ¶
type Runaway struct {
// contains filtered or unexported fields
}
Runaway is the refusal of a batch in which stars ran away: through the centre or past what a float holds, so that a place or a motion is not a number. It names the stars by their places in the batch, in order.
func NewRunaway ¶
NewRunaway is the refusal naming the stars given, as a solver that stands in for this one makes it; RanAway reads the stars back.
type Solver ¶
type Solver struct {
// contains filtered or unexported fields
}
Solver is the kernel open on a device over one field, with room for so many stars at once.
func Open ¶
Open compiles the kernel over a field on a device, with room for so many stars at once. It refuses room for none, and a field whose pull does not compile.
func (*Solver) Back ¶
func (solver *Solver) Back(stars []orbit.State, span measure.Duration, steps int) ([]orbit.Pass, []orbit.State, error)
Back runs every star's orbit back over a span, in so many steps, and reports each one's nearest pass to the centre over them and its state at the start of the span.
It refuses a span that is not positive, no steps, more stars than it has room for, and a star whose orbit ran away, through the centre or past what a float holds.
func (*Solver) Close ¶
func (solver *Solver) Close()
Close lets the kernel and its buffers go. Closing twice is harmless.
func (*Solver) Pulls ¶
Pulls is the field's pull at each place by the solver's kernel, for as many places as it has room for stars: a way to hold the kernel's pull to the reference's, and to ask the field. It borrows the solver's buffers, so a run's results are gone after it.
It refuses a closed solver and more places than it has room for.