packages/MC/geometry/RTK_Cell.cc
//---------------------------------------------------------------------------//
/*!
 * \brief Multiple shell constructor.
 */
\brief Multiple shell constructor.
\ brief Multiple shell constructor .
RTK_Cell::RTK_Cell(const Vec_Int &ids,
                   const Vec_Dbl &r,
                   int            mod_id,
                   double         pitch,
                   double         height,
                   int            segments)
    : d_mod_id(mod_id)
    , d_r(r)
    , d_ids(ids)
    , d_z(height)
    , d_num_shells(d_r.size())
    , d_num_regions(d_num_shells + 1)
    , d_segments(segments)
    , d_seg_faces(d_segments / 2)
    , d_num_int_faces(d_seg_faces + d_num_shells)
    , d_mod_region(d_num_regions - 1)
    , d_num_cells(d_num_regions * d_segments)
    , d_vessel(false)
{
    REQUIRE(!d_r.empty() ? d_r.front() > 0.0 : true);
    REQUIRE(d_z > 0.0);
    REQUIRE(d_segments == 1 || d_segments == 4);
    REQUIRE(d_r.size() == d_ids.size());
    REQUIRE(!d_r.empty() ? d_mod_region > 0 : d_mod_region == 0);
    d_xy[0] = pitch;
    d_xy[1] = pitch;
    d_extent[0][LO] = -d_xy[0] * 0.5;
    d_extent[0][HI] =  d_xy[0] * 0.5;
    d_extent[1][LO] = -d_xy[1] * 0.5;
    d_extent[1][HI] =  d_xy[1] * 0.5;
    ENSURE(!d_r.empty() ? d_r.back() <= d_extent[0][HI] : true);
    ENSURE(!d_r.empty() ? d_r.back() <= d_extent[1][HI] : true);
}
RTK_Cell :: RTK_Cell ( const Vec_Int & ids , const Vec_Dbl & r , int mod_id , double pitch , double height , int segments ) : d_mod_id ( mod_id ) , d_r ( r ) , d_ids ( ids ) , d_z ( height ) , d_num_shells ( d_r . size ( ) ) , d_num_regions ( d_num_shells + 1 ) , d_segments ( segments ) , d_seg_faces ( d_segments / 2 ) , d_num_int_faces ( d_seg_faces + d_num_shells ) , d_mod_region ( d_num_regions - 1 ) , d_num_cells ( d_num_regions * d_segments ) , d_vessel ( false ) { REQUIRE ( ! d_r . empty ( ) ? d_r . front ( ) > 0.0 : true ) ; REQUIRE ( d_z > 0.0 ) ; REQUIRE ( d_segments == 1 || d_segments == 4 ) ; REQUIRE ( d_r . size ( ) == d_ids . size ( ) ) ; REQUIRE ( ! d_r . empty ( ) ? d_mod_region > 0 : d_mod_region == 0 ) ; d_xy [ 0 ] = pitch ; d_xy [ 1 ] = pitch ; d_extent [ 0 ] [ LO ] = - d_xy [ 0 ] * 0.5 ; d_extent [ 0 ] [ HI ] = d_xy [ 0 ] * 0.5 ; d_extent [ 1 ] [ LO ] = - d_xy [ 1 ] * 0.5 ; d_extent [ 1 ] [ HI ] = d_xy [ 1 ] * 0.5 ; ENSURE ( ! d_r . empty ( ) ? d_r . back ( ) <= d_extent [ 0 ] [ HI ] : true ) ; ENSURE ( ! d_r . empty ( ) ? d_r . back ( ) <= d_extent [ 1 ] [ HI ] : true ) ; }
\brief Multiple shell constructor.
\ brief Multiple shell constructor .
// square cell