コード例 #1
0
ファイル: istl_test.cpp プロジェクト: hnil/opm-porsol
int main(int argc, char** argv)
{
    int mpi_rank = Dune::MPIHelper::instance(argc,argv).rank();
    int mpi_size = Dune::MPIHelper::instance(argc,argv).size();
    std::cout << "Hello from rank " << mpi_rank << "   total mpi size is " << mpi_size << std::endl;

    typedef int LocalId;
    typedef int GlobalId;
    typedef Dune::OwnerOverlapCopyCommunication<LocalId,GlobalId> Communication;
    typedef Dune::OwnerOverlapCopyAttributeSet GridAttributes;
    typedef GridAttributes::AttributeSet GridFlag;
    typedef Dune::ParallelLocalIndex<GridFlag> LocalIndex;
    Communication comm;

    Communication::PIS& pis = comm.indexSet();
    pis.beginResize();
    for (int i = 0; i < ltg_size; ++i) {
        GridFlag flag = GridAttributes::owner;
        bool is_public = false;
        pis.add(local_to_global[i], LocalIndex(i, flag, is_public));
    }
    pis.endResize();
}