2#include <thrust/host_vector.h> 
    3#include <thrust/device_vector.h> 
    4#include "dg/backend/blas1_dispatch_shared.h" 
   31template<
class SharedContainer, 
class real_type>
 
   34    assert( out.size() == grid.
shape(2));
 
   36    for(
unsigned i=0; i<grid.
shape(2); i++)
 
   37        out[i].
construct( thrust::raw_pointer_cast(in.data()) + i*size2d, size2d);
 
 
   48template<
class SharedContainer, 
class real_type>
 
   51    std::vector<View<SharedContainer>> out;
 
   53    out.resize( grid.
shape(2));
 
   54    for(
unsigned i=0; i<grid.
shape(2); i++)
 
   55        out[i].
construct( thrust::raw_pointer_cast(in.data()) + i*size2d, size2d);
 
 
   70template<
class Container, 
class host_vector, 
class Topology>
 
   72        out, 
const Topology& grid)
 
 
   80template<
class MPIContainer>
 
   82    std::conditional_t< std::is_const<MPIContainer>::value,
 
   98template<
class MPIContainer, 
class real_type>
 
  105    for(
unsigned i=0; i<l.
shape(2); i++)
 
  107        out[i].data().construct( thrust::raw_pointer_cast(in.data().data()) +
 
 
  120template< 
class MPIContainer, 
class real_type>
 
  121std::vector<get_mpi_view_type<MPIContainer> > 
split(
 
  124    std::vector<get_mpi_view_type<MPIContainer>> out;
 
  126    MPI_Comm_compare( in.communicator(), grid.
communicator(), &result);
 
  127    assert( result == MPI_CONGRUENT || result == MPI_IDENT);
 
  132    out.resize( l.
shape(2));
 
  133    for(
unsigned i=0; i<l.
shape(2); i++)
 
  135        out[i].data().construct( thrust::raw_pointer_cast(in.data().data())
 
  137        out[i].set_communicator( planeComm);
 
 
DG_DEVICE double cooX2d(double x, double)
Definition functions.h:62
auto kronecker(Functor &&f, const ContainerType &x0, const ContainerTypes &... xs)
Memory allocating version of dg::blas1::kronecker
Definition blas1.h:857
ContainerType construct(const from_ContainerType &from, Params &&... ps)
Generic way to construct an object of ContainerType given a from_ContainerType object and optional ad...
Definition blas1.h:792
void assign3dfrom2d(const host_vector &in2d, Container &out, const Topology &grid)
Construct a 3d vector given a 2d host vector.
Definition split_and_join.h:71
void split(SharedContainer &in, std::vector< View< SharedContainer > > &out, const aRealTopology3d< real_type > &grid)
Split a vector into planes along the last dimension (fast version)
Definition split_and_join.h:32
std::conditional_t< std::is_const< MPIContainer >::value, MPI_Vector< View< const typename MPIContainer::container_type > >, MPI_Vector< View< typename MPIContainer::container_type > > > get_mpi_view_type
Definition split_and_join.h:81
Function discretization routines for mpi vectors.
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
The simplest implementation of aRealTopology.
Definition grid.h:710
A vector view class, usable in dg functions.
Definition view.h:45
An abstract base class for MPI distributed Nd-dimensional dG grids.
Definition mpi_grid.h:91
MPI_Comm communicator() const
Return Nd dimensional MPI cartesian communicator that is used in this grid.
Definition mpi_grid.h:248
std::enable_if_t<(Md >=2), MPI_Comm > get_perp_comm() const
MPI Cartesian communicator in the first two dimensions (x and y)
Definition mpi_grid.h:255
const RealGrid< real_type, Nd > & local() const
The local grid as a shared memory grid.
Definition mpi_grid.h:274
An abstract base class for Nd-dimensional dG grids.
Definition grid.h:95
unsigned shape(unsigned u=0) const
the total number of points of an axis
Definition grid.h:114