packages/MC/geometry/Cartesian_Mesh.cc
//---------------------------------------------------------------------------//
/*!
 * \brief Locate position's ijk coordinates.
 *
 * If the position is on an edge, return the negative cell index. See kba mesh
 * for a description.
 */
\brief Locate position's ijk coordinates.
If the position is on an edge, return the negative cell index. See kba mesh
for a description.
\ brief Locate position ' s ijk coordinates . If the position is on an edge return the negative cell index . See kba mesh for a description .
bool Cartesian_Mesh::find(const Space_Vector& r, Dim_Vector& ijk) const
{
    using def::I; using def::J; using def::K;
    if (    r[I] < d_edges[I].front() || r[I] >= d_edges[I].back()
         || r[J] < d_edges[J].front() || r[J] >= d_edges[J].back()
         || r[K] < d_edges[K].front() || r[K] >= d_edges[K].back())
        return false;
    ijk[I] = edge_signed_index(d_edges[I], r[I]);
    ijk[J] = edge_signed_index(d_edges[J], r[J]);
    ijk[K] = edge_signed_index(d_edges[K], r[K]);
    return true;
}
bool Cartesian_Mesh :: find ( const Space_Vector & r , Dim_Vector & ijk ) const { using def :: I ; using def :: J ; using def :: K ; if ( r [ I ] < d_edges [ I ] . front ( ) || r [ I ] >= d_edges [ I ] . back ( ) || r [ J ] < d_edges [ J ] . front ( ) || r [ J ] >= d_edges [ J ] . back ( ) || r [ K ] < d_edges [ K ] . front ( ) || r [ K ] >= d_edges [ K ] . back ( ) ) return false ; ijk [ I ] = edge_signed_index ( d_edges [ I ] , r [ I ] ) ; ijk [ J ] = edge_signed_index ( d_edges [ J ] , r [ J ] ) ; ijk [ K ] = edge_signed_index ( d_edges [ K ] , r [ K ] ) ; return true ; }
\brief Locate position's ijk coordinates.
\ brief Locate position ' s ijk coordinates .
// Test for being inside the edges