Project

General

Profile

Meeting 2016 07 15

Agenda

  • Performance of bisection method to find boundary crossings
  • Continue brainstorming about location of boundary crossings
  • Next steps

GQLink + bisection

Outline of the algorithm

    double t0 = start_state->time;
    double t1 = end_state->time;
    double c_dq_min = 1e3 * dQMin;
    double v = GQLINK_VELOCITY(start_state);
    double t, s = -1;
    int iterations = 0, copy_no;
    void *volume;

    while(iterations < GQLINK_MAX_BS_ITERATIONS)
    {
        t = (t0 + t1) / 2;

        if(s > 0 && fabs(t-s)*v <= c_dq_min)
            break;

        // Evaluation of QSS polynomials to compute the particle state at time t.
        GQLink_getState(t, state_arr);
        // Find out the volume where the particle is located (this call relies on LocateGlobalPointAndSetup).
        GQLink_G4_getVolume(state_arr, &volume, &copy_no);

        if(GQLink_isNewVolume(volume, copy_no))
            t1 = t;
        else
            t0 = t;

        s = t;
        iterations++;
    }

Results