goupil_geometry_tracer

This objects enables tracing operations on a Monte Carlo geometry. For information on the geometry, refer to the related goupil_geometry_definition object.

struct goupil_geometry_tracer
const struct goupil_geometry_definition *definition

The related geometry definition.

void destroy(struct goupil_geometry_definition *self)

Destroys the geometry tracer, e.g. freeing any dynamically allocated memory.

Warning

The tracer object should not be accessed anymore after invocation of this function.

struct goupil_float3 position(const struct goupil_geometry_tracer *self)

Returns the current position of the ray tracer.

void reset(struct goupil_geometry_tracer *self, struct goupil_float3 position, struct goupil_float3 direction)

Reset the ray tracer in preparation for a new geometry traversal using the position and direction arguments to set the starting position and direction of the ray.

size_t sector(const struct goupil_geometry_tracer *self)

Returns the index of the current geometry sector.

goupil_float_t trace(struct goupil_geometry_tracer *self, goupil_float_t max_length)

Returns the length \(s\) of the next tracing step, which must satisfy

\[s \leq \min\left(s_\text{geo}, s_\text{max}\right),\]

where \(s_\text{geo}\) represents the distance to the closest geometry interface along the ray, and \(s_\text{max}\) represents the maximum allowed step length given by max_length.

void update(struct goupil_geometry_tracer *self, goupil_float_t length, struct goupil_float3 direction)

Applies a tracing step with the specified length. After completion, the direction of the ray is updated to the specified value.