PUMAS v0.14
This release improves the geometry callback mechanism, e.g. allowing more efficient integration of ray tracers. A bug has been corrected for non uniform magnetic fields as well.
Stepping algorithm update
The signature of the pumas_medium_cb
has changed. The step length is now an optional parameter provided by address. Old codes can be migrated as following:
double medium(struct pumas_context * context, struct pumas_state * state,
struct pumas_medium ** medium_p)
{
...
return step
}
must be changed to
void medium(struct pumas_context * context, struct pumas_state * state,
struct pumas_medium ** medium_p, double * step_p)
{
...
if (step_p != NULL) *step_p = step;
}
Note however that the new stepping algorithms allows better optimisations to be implemented, e.g. when using a ray tracer. The geometry callback gets called with 4 different cases, as following.
-
medium_p
andstep_p
are both nonNULL
.
This is an initialisation call. The stepping algorithm requires the start medium and an initial step length. -
medium_p
isNULL
butstep_p
is not.
This is a tracing call. The stepping algorithm requires a geometric step length. -
medium_p
is notNULL
butstep_p
isNULL
.
This is a location call. It always occurs along the direction of the last preceding tracing call and not farther than the provided step length, within a few μm. Those call are used by PUMAS in order to do an approximate stepping, e.g. using a binary search. If an exact geometry is use, one can cache the result of the last tracing cal and re-use it at this step. Note that due to Physics interactions the used stepping distance might be lower than the one proposed at the last tracing call. -
medium_p
andstep_p
areNULL
.
This is a compatibility case for non uniform media. It ensures that the medium callback is always called before querying the local properties of the medium. If you don't need this feature, it is safe to add the following at the begining of your medium callback:if ((medium_p == NULL) && (step_p == NULL)) return;
Bug patches
- Non uniform magnetic fields should be properly handled now.
Minor features
- Versioning was added to the CMake build. The PUMAS library should now be generated with its version number, e.g.
libpumas.so.0.14
on Linux.