| 1 | /**
|
|---|
| 2 | * @file linked_cell_list.hpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Nov 21 13:27:22 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief A linked cell list implementation.
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #ifndef LINKED_CELL_LIST_HPP_
|
|---|
| 11 | #define LINKED_CELL_LIST_HPP_
|
|---|
| 12 |
|
|---|
| 13 | #include <list>
|
|---|
| 14 | #include <vector>
|
|---|
| 15 |
|
|---|
| 16 | #include "base/index.hpp"
|
|---|
| 17 | #include "base/particle.hpp"
|
|---|
| 18 | #include "grid/is_grid.hpp"
|
|---|
| 19 |
|
|---|
| 20 | namespace VMG
|
|---|
| 21 | {
|
|---|
| 22 |
|
|---|
| 23 | namespace Particle
|
|---|
| 24 | {
|
|---|
| 25 |
|
|---|
| 26 | class LinkedCellList : public IsGrid< std::list<Particle> >
|
|---|
| 27 | {
|
|---|
| 28 | public:
|
|---|
| 29 | typedef std::list<Particle>::iterator iterator;
|
|---|
| 30 | typedef std::list<Particle>::const_iterator const_iterator;
|
|---|
| 31 | typedef std::list<Particle>::reverse_iterator reverse_iterator;
|
|---|
| 32 | typedef std::list<Particle>::const_reverse_iterator const_reverse_iterator;
|
|---|
| 33 |
|
|---|
| 34 | LinkedCellList(const std::list<Particle>& particles,
|
|---|
| 35 | const int& near_field_cells, const Grid& grid);
|
|---|
| 36 |
|
|---|
| 37 | void AddParticle(const Particle& particle);
|
|---|
| 38 |
|
|---|
| 39 | void AddParticleToComplete(const vmg_float* pos, const vmg_float& charge,
|
|---|
| 40 | const vmg_float& pot, const vmg_float* force,
|
|---|
| 41 | const int& rank, const int& index);
|
|---|
| 42 |
|
|---|
| 43 | void AddParticleToComplete(const Vector& pos, const vmg_float& charge,
|
|---|
| 44 | const vmg_float& pot, const Vector& force,
|
|---|
| 45 | const int& rank, const int& index);
|
|---|
| 46 |
|
|---|
| 47 | void AddParticleToComplete(const vmg_float* pos, const vmg_float& charge);
|
|---|
| 48 |
|
|---|
| 49 | std::list<Particle>& NotMyParticles() {return not_my_particles;}
|
|---|
| 50 | const std::list<Particle>& NotMyParticles() const {return not_my_particles;}
|
|---|
| 51 |
|
|---|
| 52 | const Index& NearFieldCells() const {return near_field_cells_;}
|
|---|
| 53 |
|
|---|
| 54 | private:
|
|---|
| 55 | std::list<Particle> not_my_particles;
|
|---|
| 56 | Index near_field_cells_;
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 | }
|
|---|
| 60 |
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | #endif /* LINKED_CELL_LIST_HPP_ */
|
|---|