packages/MC/geometry/RTK_Cell.cc
//---------------------------------------------------------------------------//
// PRIVATE INTERFACE
//---------------------------------------------------------------------------//
/*!
 * \brief Process distance to vessel shells.
 */
PRIVATE INTERFACE
\brief Process distance to vessel shells.
PRIVATE INTERFACE \ brief Process distance to vessel shells .
void RTK_Cell::dist_to_vessel(const Space_Vector &r,
                              const Space_Vector &omega,
                              Geo_State_t        &state)
{
    using def::X; using def::Y;
    if (!d_vessel)
    {
        return;
    }
    REQUIRE(d_num_shells == 0);
    bool hit = false;
    if (d_inner)
    {
        if (state.face != Geo_State_t::R0_VESSEL)
        {
            dist_to_shell(l2g(r[X], X), l2g(r[Y], Y), omega[X], omega[Y], d_R0,
                          Geo_State_t::R0_VESSEL);
        }
        if (d_db > 0.0)
        {
            if (d_db < state.dist_to_next_region)
            {
                state.dist_to_next_region = d_db;
                state.next_face           = Geo_State_t::R0_VESSEL;
                state.exiting_face        = Geo_State_t::INTERNAL;
                hit                       = true;
            }
        }
    }
    if (d_outer)
    {
        if (state.face != Geo_State_t::R1_VESSEL)
        {
            dist_to_shell(l2g(r[X], X), l2g(r[Y], Y), omega[X], omega[Y], d_R1,
                          Geo_State_t::R1_VESSEL);
        }
        if (d_db > 0.0)
        {
            if (d_db < state.dist_to_next_region)
            {
                state.dist_to_next_region = d_db;
                state.next_face           = Geo_State_t::R1_VESSEL;
                state.exiting_face        = Geo_State_t::INTERNAL;
                hit                       = true;
            }
        }
    }
    if (hit)
    {
        if (state.region == Geo_State_t::VESSEL)
        {
            state.next_region = Geo_State_t::MODERATOR;
        }
        else
        {
            state.next_region = Geo_State_t::VESSEL;
        }
    }
}
void RTK_Cell :: dist_to_vessel ( const Space_Vector & r , const Space_Vector & omega , Geo_State_t & state ) { using def :: X ; using def :: Y ; if ( ! d_vessel ) { return ; } REQUIRE ( d_num_shells == 0 ) ; bool hit = false ; if ( d_inner ) { if ( state . face != Geo_State_t :: R0_VESSEL ) { dist_to_shell ( l2g ( r [ X ] , X ) , l2g ( r [ Y ] , Y ) , omega [ X ] , omega [ Y ] , d_R0 , Geo_State_t :: R0_VESSEL ) ; } if ( d_db > 0.0 ) { if ( d_db < state . dist_to_next_region ) { state . dist_to_next_region = d_db ; state . next_face = Geo_State_t :: R0_VESSEL ; state . exiting_face = Geo_State_t :: INTERNAL ; hit = true ; } } } if ( d_outer ) { if ( state . face != Geo_State_t :: R1_VESSEL ) { dist_to_shell ( l2g ( r [ X ] , X ) , l2g ( r [ Y ] , Y ) , omega [ X ] , omega [ Y ] , d_R1 , Geo_State_t :: R1_VESSEL ) ; } if ( d_db > 0.0 ) { if ( d_db < state . dist_to_next_region ) { state . dist_to_next_region = d_db ; state . next_face = Geo_State_t :: R1_VESSEL ; state . exiting_face = Geo_State_t :: INTERNAL ; hit = true ; } } } if ( hit ) { if ( state . region == Geo_State_t :: VESSEL ) { state . next_region = Geo_State_t :: MODERATOR ; } else { state . next_region = Geo_State_t :: VESSEL ; } } }
PRIVATE INTERFACE
 \brief Process distance to vessel shells.
PRIVATE INTERFACE \ brief Process distance to vessel shells .
// return if there is no vessel // local boolean for hitting a vessel wall // check distance to first shell // only check if we aren't currently on the vessel face // update the distance to boundary // check distance to second shell // only check if we aren't currently on the vessel face // update the distance to boundary // if we are in the vessel and we hit a surface turn off the vessel; // otherwise we enter the vessel