forked from fmihpc/vlasiator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
particle_species.h
71 lines (60 loc) · 3.65 KB
/
particle_species.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* This file is part of Vlasiator.
* Copyright 2010-2016 Finnish Meteorological Institute
*
* For details of usage, see the COPYING file and read the "Rules of the Road"
* at http://www.physics.helsinki.fi/vlasiator/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* File: particle_species.h
* Author: sandroos
*
* Created on January 27, 2015.
*/
#ifndef PARTICLE_SPECIES_H
#define PARTICLE_SPECIES_H
#include <omp.h>
#include "definitions.h"
#include <array>
namespace species {
// Aliases for the maximum dt values stored in spatial_cell::Population::max_dt array.
enum Dt_Elements {
MAXRDT, /**< Maximum spatial translation dt.*/
MAXVDT, /**< Maximum acceleration dt.*/
SIZE_DT_ELEMENTS /**< Number of elements in array.*/
};
/** Variables common to a particle species.*/
struct Species {
std::string name; /**< Name of the species.*/
Real charge; /**< Particle species charge, in simulation units.*/
Real mass; /**< Particle species mass, in simulation units.*/
Real sparseMinValue; /**< Sparse mesh threshold value for the population.*/
size_t velocityMesh; /**< ID of the velocity mesh (parameters) this species uses.*/
int sparseBlockAddWidthV; /*!< Number of layers of blocks that are kept in velocity space around the blocks with content */
bool sparse_conserve_mass; /*!< If true, density is scaled to conserve mass when removing blocks*/
int sparseDynamicAlgorithm; /*!< Type of algorithm used for calculating the dynamic minValue; 0 = none, 1 = linear algorithm based on minValue and rho, 2 = linear algorithm based on minValue and Blocks, (Example linear algorithm: minValue = rho / sparse.dynamicValue * sparse.minValue)*/
Real sparseDynamicBulkValue1; /*!< Minimum value for the dynamic algorithm range, so for example if dynamicAlgorithm=1 then for sparse.dynamicMinValue = 1e3, sparse.dynamicMaxValue=1e5, we apply the algorithm to cells for which 1e3<cell.rho<1e5*/
Real sparseDynamicBulkValue2; /*!< Maximum value for the dynamic algorithm range, so for example if dynamicAlgorithm=1 then for sparse.dynamicMinValue = 1e3, sparse.dynamicMaxValue=1e5, we apply the algorithm to cells for which 1e3<cell.rho<1e5*/
Real sparseDynamicMinValue1; /*!< The minimum value for the minValue*/
Real sparseDynamicMinValue2; /*!< The maximum value for the minValue*/
Real backstreamRadius; /*!< Radius of sphere to split the distribution into backstreaming and non-backstreaming. 0 (default in cfg) disables the DRO. */
std::array<Real, 3> backstreamV; /*!< Centre of sphere to split the distribution into backstreaming and non-backstreaming. 0 (default in cfg) disables the DRO. */
Species();
Species(const Species& other);
~Species();
};
} // namespace species
#endif // PARTICLE_SPECIES_H