Discontinuous Galerkin Library
#include "dg/algorithm.h"
mpi_weights.h
Go to the documentation of this file.
1#pragma once
2
3#include "weights.h"
4#include "mpi_grid.h"
5
6
7
11namespace dg
12{
13namespace create
14{
15
18
21template<class real_type>
23{
24 thrust::host_vector<real_type> w = dg::create::weights( g.local());
26}
28template<class real_type>
30{
32 for( unsigned i=0; i<g.local().size(); i++)
33 v.data()[i] = 1./v.data()[i];
34 return v;
35}
36
38template<class real_type>
40{
41 thrust::host_vector<real_type> w = create::weights( g.local(), coo);
43}
46template<class real_type>
48{
49 thrust::host_vector<real_type> w = weights( g.local());
51}
53template<class real_type>
55{
57 for( unsigned i=0; i<g.local().size(); i++)
58 v.data()[i] = 1./v.data()[i];
59 return v;
60}
61
63template<class real_type>
65{
66 thrust::host_vector<real_type> w = weights( g.local(), coo);
68}
69
71}//namespace create
72
73}//namespace dg
coo3d
3d contra- and covariant coordinates
Definition: enums.h:177
coo2d
2d coordinates
Definition: enums.h:171
MPI_Vector< thrust::host_vector< real_type > > weights(const aRealMPITopology2d< real_type > &g)
Nodal weight coefficients.
Definition: mpi_weights.h:22
MPI_Vector< thrust::host_vector< real_type > > inv_weights(const aRealMPITopology2d< real_type > &g)
inverse nodal weight coefficients
Definition: mpi_weights.h:29
MPI Grid objects.
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
mpi Vector class
Definition: mpi_vector.h:32
const container & data() const
Get underlying data.
Definition: mpi_vector.h:66
2D MPI abstract grid class
Definition: mpi_grid.h:45
const RealGrid2d< real_type > & local() const
Return a non-MPI grid local for the calling process.
Definition: mpi_grid.h:252
MPI_Comm communicator() const
Return mpi cartesian communicator that is used in this grid.
Definition: mpi_grid.h:138
3D MPI Grid class
Definition: mpi_grid.h:329
MPI_Comm communicator() const
Return mpi cartesian communicator that is used in this grid.
Definition: mpi_grid.h:459
const RealGrid3d< real_type > & local() const
Return a non-MPI grid local for the calling process.
Definition: mpi_grid.h:560
Creation functions for integration weights and their inverse.