Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
class_particles.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 #include "stdafx.h"
11 #include "class_vec_3d.hpp"
12 
21 template<typename T>
23 {
24 public:
25  // CONSTRUCTORS
27  template<typename U>
29  position(position) {};
30 
31  // VARIABLES
33 
40  T &operator[](unsigned int i){ return position[i]; }
41  const T& operator[](unsigned int i) const{ return position[i]; }
42 };
43 
54 template<typename T>
55 class Particle_v : public Particle_x<T>
56 {
57 public:
58  // CONSTRUCTORS
60  template<typename U, typename V>
62  Particle_x<T>(position), velocity(velocity) {};
63 
64  // VARIABLES
66 
67  // OPERATORS
68  T &operator()(unsigned int i){ return velocity[i]; }
69  const T& operator()(unsigned int i) const{ return velocity[i]; }
70 };
const T & operator()(unsigned int i) const
define container Vec_3D
class handling particles (position only)
T & operator()(unsigned int i)
class handling particles (position only)
system include files and for project-specific include files that are used frequently but are changed ...
const T & operator[](unsigned int i) const
Particle_v(Vec_3D< U > position, Vec_3D< V > velocity)
Vec_3D< T > position
Particle_x(Vec_3D< U > position)
Vec_3D< T > velocity
: class handling basic 3D-vector functions, definitions
T & operator[](unsigned int i)
get position coordinates