Discontinuous Galerkin Library
#include "dg/algorithm.h"
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mpi_evaluation.h
Go to the documentation of this file.
1#pragma once
2
4#include "mpi_grid.h"
5#include "evaluation.h"
6
10namespace dg
11{
12
21template<class real_type, class MPITopology>
23 const thrust::host_vector<real_type>& global, const MPITopology& g)
24{
25 assert( global.size() == g.global().size());
26 thrust::host_vector<real_type> temp(g.local().size());
27 int rank;
28 MPI_Comm_rank( g.communicator(), &rank);
29
30 for( unsigned idx = 0; idx<g.local().size(); idx++)
31 {
32 int gIdx = 0;
33 g.local2globalIdx( idx, rank, gIdx);
34 temp[idx] = global[gIdx];
35 }
36 return MPI_Vector<thrust::host_vector<real_type> >(temp, g.communicator());
37}
38
39}//namespace dg
40
Function discretization routines.
MPI_Vector< thrust::host_vector< real_type > > global2local(const thrust::host_vector< real_type > &global, const MPITopology &g)
Take the relevant local part of a global vector.
Definition mpi_evaluation.h:22
MPI Grid objects.
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
A simple wrapper around a container object and an MPI_Comm.
Definition mpi_vector.h:37