Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
definitions.h
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 DEFINITIONS_H
24#define DEFINITIONS_H
25
26#include <stdint.h>
27#include <limits>
28
29//set floating point precision for storing the distribution function here. Default is single precision, use -DDPF to set double precision
30#ifdef DPF
31typedef double Realf;
32#else
33typedef float Realf;
34#endif
35
36//set general floating point precision here. Default is single precision, use -DDP to set double precision
37#ifdef DP
38typedef double Real;
39typedef const double creal;
40#else
41typedef float Real;
42typedef const float creal;
43#endif
44
45typedef const int cint;
46typedef unsigned char uchar;
47typedef const unsigned char cuchar;
48
49typedef uint32_t uint;
50typedef const uint32_t cuint;
51
52typedef cuint csize;
53
54typedef uint64_t CellID;
55
56template<typename T> T convert(const T& number) {return number;}
57
58namespace vmesh {
59 typedef uint32_t GlobalID;
60 typedef uint32_t LocalID;
61
63 static const GlobalID INVALID_GLOBALID = std::numeric_limits<GlobalID>::max();
64
66 static const LocalID INVALID_LOCALID = std::numeric_limits<LocalID>::max();
67
70}
71
72//fieldsolver stencil.
73#define FS_STENCIL_WIDTH 2
74// Forward declare
75namespace fsgrid {
76template <int I> class FsGrid;
77}
79
80//Vlasov propagator stencils in ordinary space, velocity space may be
81//higher. Assume H4 (or H5) for PPM, H6 for PQM
82#ifdef TRANS_SEMILAG_PLM
83 #define VLASOV_STENCIL_WIDTH 1
84#endif
85#ifdef TRANS_SEMILAG_PPM
86 #define VLASOV_STENCIL_WIDTH 2
87#endif
88#ifdef TRANS_SEMILAG_PQM
89 #define VLASOV_STENCIL_WIDTH 3
90#endif
91
92// Max number of face neighbors per dimension with AMR
93#define MAX_NEIGHBORS_PER_DIM 8
94#define MAX_FACE_NEIGHBORS_PER_DIM 4
95
96#endif
const uint32_t cuint
Definition definitions.h:50
float Real
Definition definitions.h:41
const int cint
Definition definitions.h:45
uint64_t CellID
Definition definitions.h:54
T convert(const T &number)
Definition definitions.h:56
unsigned char uchar
Definition definitions.h:46
float Realf
Definition definitions.h:33
cuint csize
Definition definitions.h:52
fsgrid::FsGrid< FS_STENCIL_WIDTH > FieldSolverGrid
Definition definitions.h:78
const unsigned char cuchar
Definition definitions.h:47
const float creal
Definition definitions.h:42
static const LocalID INVALID_LOCALID
Definition definitions.h:66
static const GlobalID INVALID_GLOBALID
Definition definitions.h:63
uint32_t LocalID
Definition definitions.h:60
uint32_t GlobalID
Definition definitions.h:59
static const LocalID INVALID_VEL_BLOCK_INDEX
Definition definitions.h:69