Discontinuous Galerkin Library
#include "dg/algorithm.h"
Loading...
Searching...
No Matches
typedefs.h
Go to the documentation of this file.
1#ifndef _DG_TYPEDEFS_CUH_
2#define _DG_TYPEDEFS_CUH_
3#include <thrust/host_vector.h>
4#include <thrust/device_vector.h>
5#include "sparseblockmat.h"
6#include "sparsematrix.h"
7
12namespace dg{
13
16//vectors
17template<class T>
18using HVec_t = thrust::host_vector<T>;
19using HVec = thrust::host_vector<double>;
20using cHVec = thrust::host_vector<thrust::complex<double>>;
21using iHVec = thrust::host_vector<int>;
22using fHVec = thrust::host_vector<float>;
23
24using DVec = thrust::device_vector<double>;
25using iDVec = thrust::device_vector<int>;
26using cDVec = thrust::device_vector<thrust::complex<double>>;
27using fDVec = thrust::device_vector<float>;
28
29//derivative matrices
30template<class T>
36
37// Interpolation matrices
38template<class real_type>
40template<class real_type>
41#if THRUST_DEVICE_SYSTEM==THRUST_DEVICE_SYSTEM_CUDA
42//Ell matrix can be almost 3x faster than csr for GPU
43//However, sometimes matrices contain outlier rows that do not fit in ell
45#else
46// csr matrix can be much faster than ell for CPU (we have our own symv implementation!)
48#endif
51
53}//namespace dg
54
55#ifdef MPI_VERSION
56#include "mpi_vector.h"
57#include "mpi_matrix.h"
58
59namespace dg{
62//using MPI_Vector<thrust::device_vector<double> > MDVec; //!< MPI Device Vector s.a. dg::DVec
63template<class T>
73
74// TODO These may be private
75template< class T>
81
82template<class T>
88
89template<class real_type>
91template<class real_type>
95
96
98}//namespace dg
99#endif //MPI_VERSION
100
101//MPI-independent definitions
102namespace dg{
105//vectors
106namespace x{
107#ifdef MPI_VERSION
108using HVec = MHVec;
109using cHVec = cMHVec;
110using fHVec = fMHVec;
111using iHVec = iMHVec;
112
113using DVec = MDVec;
114using cDVec = cMDVec;
115using fDVec = fMDVec;
116using iDVec = iMDVec;
117
118//derivative matrices
123//interpolation matrices
126#else
127using HVec = HVec;
128using cHVec = cHVec;
129using fHVec = fHVec;
130using iHVec = iHVec;
131
132using DVec = DVec;
133using cDVec = cDVec;
134using fDVec = fDVec;
135using iDVec = iDVec;
136
137//derivative matrices
138using HMatrix = HMatrix;
139using fHMatrix = fHMatrix;
140using DMatrix = DMatrix;
141using fDMatrix = fDMatrix;
142//interpolation matrices
143using IHMatrix = IHMatrix;
144using IDMatrix = IDMatrix;
145#endif //MPI_VERSION
146}//namespace x
148}//namespace dg
149
151#ifdef MPI_VERSION
152#define DG_RANK0 if(rank==0)
153#else //MPI_VERSION
154#define DG_RANK0
155#endif //MPI_VERSION
156
157#endif//_DG_TYPEDEFS_CUH_
@ x
x direction
thrust::host_vector< float > fHVec
Host Vector.
Definition typedefs.h:22
dg::MPI_Vector< dg::cHVec > cMHVec
MPI Host Vector s.a. dg::cHVec.
Definition typedefs.h:66
thrust::device_vector< int > iDVec
integer Device Vector
Definition typedefs.h:25
dg::MPI_Vector< dg::DVec > MDVec
MPI Device Vector s.a. dg::DVec.
Definition typedefs.h:69
dg::MPISparseBlockMat< thrust::host_vector, dg::HMatrix, dg::CooMat > MHMatrix
MPI Host Matrix for derivatives.
Definition typedefs.h:84
thrust::device_vector< float > fDVec
Device Vector. The device can be an OpenMP parallelized cpu or a gpu. This depends on the value of th...
Definition typedefs.h:27
dg::MPISparseBlockMat< thrust::host_vector, dg::fHMatrix, dg::fCooMat > fMHMatrix
MPI Host Matrix for derivatives.
Definition typedefs.h:85
thrust::device_vector< thrust::complex< double > > cDVec
complex Device Vector
Definition typedefs.h:26
dg::MPI_Vector< dg::HVec > MHVec
MPI Host Vector s.a. dg::HVec.
Definition typedefs.h:65
thrust::device_vector< double > DVec
Device Vector. The device can be an OpenMP parallelized cpu or a gpu. This depends on the value of th...
Definition typedefs.h:24
dg::MPI_Vector< dg::fDVec > fMDVec
MPI Device Vector s.a. dg::fDVec.
Definition typedefs.h:71
thrust::host_vector< int > iHVec
integer Host Vector
Definition typedefs.h:21
dg::MPISparseBlockMat< thrust::device_vector, dg::DMatrix, dg::DCooMat > MDMatrix
MPI Device Matrix for derivatives.
Definition typedefs.h:86
MIHMatrix_t< double > MIHMatrix
Definition typedefs.h:93
thrust::host_vector< thrust::complex< double > > cHVec
complex Host Vector
Definition typedefs.h:20
dg::MPI_Vector< dg::iHVec > iMHVec
MPI Host Vector s.a. dg::iHVec.
Definition typedefs.h:68
dg::MPI_Vector< dg::fHVec > fMHVec
MPI Host Vector s.a. dg::fHVec.
Definition typedefs.h:67
thrust::host_vector< T > HVec_t
Host Vector.
Definition typedefs.h:18
dg::MPISparseBlockMat< thrust::device_vector, dg::fDMatrix, dg::fDCooMat > fMDMatrix
MPI Device Matrix for derivatives.
Definition typedefs.h:87
dg::MPI_Vector< dg::iDVec > iMDVec
MPI Device Vector s.a. dg::iDVec.
Definition typedefs.h:72
thrust::host_vector< double > HVec
Host Vector.
Definition typedefs.h:19
dg::MPI_Vector< dg::cDVec > cMDVec
MPI Device Vector s.a. dg::cDVec.
Definition typedefs.h:70
MIDMatrix_t< double > MIDMatrix
Definition typedefs.h:94
MPI matrix classes.
fMDMatrix fDMatrix
Definition typedefs.h:122
MIDMatrix IDMatrix
Definition typedefs.h:125
MHVec HVec
Definition typedefs.h:108
MIHMatrix IHMatrix
Definition typedefs.h:124
iMDVec iDVec
Definition typedefs.h:116
fMHVec fHVec
Definition typedefs.h:110
fMDVec fDVec
Definition typedefs.h:115
fMHMatrix fHMatrix
Definition typedefs.h:120
cMDVec cDVec
Definition typedefs.h:114
MHMatrix HMatrix
Definition typedefs.h:119
cMHVec cHVec
Definition typedefs.h:109
MDVec DVec
Definition typedefs.h:113
MDMatrix DMatrix
Definition typedefs.h:121
iMHVec iHVec
Definition typedefs.h:111
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Coo Sparse Block Matrix format.
Definition sparseblockmat.h:228
Ell Sparse Block Matrix format.
Definition sparseblockmat.h:46
A simple wrapper around a container object and an MPI_Comm.
Definition mpi_vector.h:37
Distributed memory matrix class, asynchronous communication.
Definition mpi_matrix.h:395
Distributed memory Sparse block matrix class, asynchronous communication.
Definition mpi_matrix.h:143
A CSR formatted sparse matrix.
Definition sparsematrix.h:102