packages/SPn/mesh/Partitioner.cc
//---------------------------------------------------------------------------//
/*!
 * \brief Build non-uniform cell edges for a processor.
 *
 * \param index Index of this block along the direction
 * \param global_num_cells Global number of cells in the direction
 * \param global_edges Global edges in this direction
 * \param local_edges Resulting local edges
 */
\brief Build non-uniform cell edges for a processor.
\param index Index of this block along the direction
\param global_num_cells Global number of cells in the direction
\param global_edges Global edges in this direction
\param local_edges Resulting local edges
\ brief Build non - uniform cell edges for a processor . \ param index Index of this block along the direction \ param global_num_cells Global number of cells in the direction \ param global_edges Global edges in this direction \ param local_edges Resulting local edges
void Partitioner::set_local_edges(const unsigned int index,
                                  const Vec_Int&     global_num_cells,
                                  const Vec_Dbl&     global_edges,
                                  Vec_Dbl&           local_edges) const
{
    using def::I; using def::J; using def::K;
    REQUIRE(!global_num_cells.empty());
    REQUIRE(!global_edges.empty());
    REQUIRE(index < global_num_cells.size());
    int start = std::accumulate(
        global_num_cells.begin(), global_num_cells.begin() + index, 0);
    local_edges.assign(
        global_edges.begin() + start,
        global_edges.begin() + start + global_num_cells[index] + 1);
    ENSURE(!local_edges.empty());
}
void Partitioner :: set_local_edges ( const unsigned int index , const Vec_Int & global_num_cells , const Vec_Dbl & global_edges , Vec_Dbl & local_edges ) const { using def :: I ; using def :: J ; using def :: K ; REQUIRE ( ! global_num_cells . empty ( ) ) ; REQUIRE ( ! global_edges . empty ( ) ) ; REQUIRE ( index < global_num_cells . size ( ) ) ; int start = std :: accumulate ( global_num_cells . begin ( ) , global_num_cells . begin ( ) + index , 0 ) ; local_edges . assign ( global_edges . begin ( ) + start , global_edges . begin ( ) + start + global_num_cells [ index ] + 1 ) ; ENSURE ( ! local_edges . empty ( ) ) ; }
\brief Build non-uniform cell edges for a processor.
\ brief Build non - uniform cell edges for a processor .
// loop over directions and calculate the coordinates of this mesh block // partition