Vlasiator
ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
gpu_1d_plm.hpp
Go to the documentation of this file.
1
/*
2
* This file is part of Vlasiator.
3
* Copyright 2010-2016 Finnish Meteorological Institute
4
*
5
* For details of usage, see the COPYING file and read the "Rules of the Road"
6
* at http://www.physics.helsinki.fi/vlasiator/
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License along
19
* with this program; if not, write to the Free Software Foundation, Inc.,
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
*/
22
23
#ifndef GPU_1D_PLM_H
24
#define GPU_1D_PLM_H
25
26
#include "
../arch/arch_device_api.h
"
27
#include "
gpu_slope_limiters.hpp
"
28
29
using namespace
std;
30
37
38
static
ARCH_DEV
inline
void
compute_plm_coeff
(
const
Realf
* __restrict__
const
values,
int
k
,
Realf
a[2],
const
Realf
threshold
,
const
int
index
,
const
int
stride)
39
{
40
// scale values closer to 1 for more accurate slope limiter calculation
41
const
Realf
scale = (
Realf
)(1.0)/
threshold
;
42
const
Realf
d_cv =
slope_limiter
( values[(
k
-1)*stride+
index
]*scale, values[
k
*stride+
index
]*scale, values[(
k
+1)*stride+
index
]*scale)*
threshold
;
43
a[0] = values[
k
*stride+
index
] - d_cv * (
Realf
)(0.5);
44
a[1] = d_cv * (
Realf
)(0.5);
45
}
46
47
48
#endif
arch_device_api.h
ARCH_DEV
#define ARCH_DEV
Definition
arch_device_api.h:11
Realf
float Realf
Definition
definitions.h:33
compute_plm_coeff
static ARCH_DEV void compute_plm_coeff(const Realf *__restrict__ const values, int k, Realf a[2], const Realf threshold, const int index, const int stride)
Definition
gpu_1d_plm.hpp:38
k
const int k
Definition
gpu_pitch_angle_diffusion.cpp:61
gpu_slope_limiters.hpp
threshold
__global__ void const Realf const uint *__restrict__ const uint *__restrict__ const vmesh::GlobalID *__restrict__ const uint const uint const uint const Realf threshold
Definition
gpu_trans_map_amr.cpp:84
index
#define index(i, j, k)
Definition
map_test_3d.cpp:5
slope_limiter
Real slope_limiter(const Real &l, const Real &m, const Real &r)
Definition
cpu_slope_limiters.hpp:16
vlasovsolver
gpu_1d_plm.hpp
Generated on
for Vlasiator by
1.16.1