Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
particles.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This file is part of Vlasiator.
4 * Copyright 2010-2016 Finnish Meteorological Institute
5 *
6 * For details of usage, see the COPYING file and read the "Rules of the Road"
7 * at http://www.physics.helsinki.fi/vlasiator/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 */
23#include <vector>
24#include <Eigen/Dense>
25
26#define Vec3d Eigen::Vector3d
27#include "../definitions.h"
28#include "../memoryallocation.h"
29
30struct Particle {
35 char padding[128-sizeof(Vec3d)*2-sizeof(Real)*2];
36
37 Particle(Real mass, Real charge, const Vec3d& _x, const Vec3d& _v) :
38 x(_x),v(_v),m(mass),q(charge) {}
39
40 /* Particle propagation given E- and B-Field at the particle location
41 * with the Boris-Method */
42 void push(Vec3d& B, Vec3d& E, double dt);
43};
44
45typedef std::vector<Particle, aligned_allocator<Particle, 32>> ParticleContainer;
46
47void writeParticles(const ParticleContainer& p, const char* filename);
48
dt
Definition Dispersion.m:39
float Real
Definition definitions.h:41
#define Vec3d
std::vector< Particle, aligned_allocator< Particle, 32 > > ParticleContainer
Definition particles.h:45
#define Vec3d
Definition particles.h:26
void writeParticles(const ParticleContainer &p, const char *filename)
Definition particles.cpp:43
Real m
Definition particles.h:33
char padding[128-sizeof(Vec3d) *2-sizeof(Real) *2]
Definition particles.h:35
Vec3d v
Definition particles.h:32
void push(Vec3d &B, Vec3d &E, double dt)
Definition particles.cpp:31
Real q
Definition particles.h:34
Vec3d x
Definition particles.h:31
Particle(Real mass, Real charge, const Vec3d &_x, const Vec3d &_v)
Definition particles.h:37