ls1-MarDyn
ls1-MarDyn molecular dynamics code
ParticleCellPointers.h
1/*
2 * ParticleCellPointers.h
3 *
4 * Created on: 20 Sep 2016
5 * Author: tchipevn
6 */
7
8#ifndef SRC_BHFMM_CONTAINERS_PARTICLECELLPOINTERS_H_
9#define SRC_BHFMM_CONTAINERS_PARTICLECELLPOINTERS_H_
10
11#include <vector>
12
13#include "particleContainer/Cell.h"
14#include "particleContainer/adapter/CellDataSoA.h"
15
16#include "molecules/MoleculeForwardDeclaration.h"
17
18#ifdef QUICKSCHED
19#include "quicksched.h"
20#endif
33namespace bhfmm {
34
35#ifdef QUICKSCHED
36struct taskData{
37 qsched_res_t _resourceId;
38 qsched_task_t _preprocessId;
39 qsched_task_t _postprocessId;
40 qsched_task_t _P2PId;
41};
42#endif
43
45public:
56
58 void removeAllParticles();
59
61 bool addParticle(Molecule* particle_ptr);
62
63 Molecule& moleculesAt(size_t i) {
64 return *_molecules.at(i);
65 }
66
67 bool isEmpty() const;
68
70 int getMoleculeCount() const;
71
77 return _cellDataSoA;
78 }
79
80#ifdef QUICKSCHED
81 taskData& getTaskData(){
82 return _taskData;
83 }
84 void setResourceId(qsched_res_t id){
85 _taskData._resourceId = id;
86 }
87 void setP2PId(qsched_res_t id){
88 _taskData._P2PId = id;
89 }
90 void setPreprocessId(qsched_res_t id){
91 _taskData._preprocessId = id;
92 }
93 void setPostprocessId(qsched_res_t id){
94 _taskData._postprocessId = id;
95 }
96#endif // QUICKSCHED
97
98 void assignCellToHaloRegion() { haloCell = true; }
99 void assignCellToBoundaryRegion() { boundaryCell = true; }
100 void assignCellToInnerRegion() { innerCell = true; }
101 void assignCellToInnerMostAndInnerRegion() { innerCell = true; innerMostCell = true; }
102
103 void skipCellFromHaloRegion() { haloCell = false; }
104 void skipCellFromBoundaryRegion() { boundaryCell = false; }
105 void skipCellFromInnerRegion() { innerCell = false; }
106 void skipCellFromInnerMostRegion() { innerMostCell = false; }
107
108 bool isHaloCell() const { return haloCell; }
109 bool isBoundaryCell() const { return boundaryCell; }
110 bool isInnerCell() const { return innerCell; }
111 bool isInnerMostCell() const { return innerMostCell; }
112
113 double getBoxMin(int d) const { return _boxMin[d]; }
114 double getBoxMax(int d) const { return _boxMax[d]; }
115 void setBoxMin(const double b[3]) { for (int d = 0; d < 3; ++d) { _boxMin[d] = b[d]; } }
116 void setBoxMax(const double b[3]) { for (int d = 0; d < 3; ++d) { _boxMax[d] = b[d]; } }
117
118private:
120 bool haloCell;
122 bool boundaryCell;
124 bool innerCell;
126 bool innerMostCell;
128 double _boxMin[3];
130 double _boxMax[3];
131
135 std::vector<Molecule *> _molecules;
136
141 CellDataSoA _cellDataSoA;
142
143#ifdef QUICKSCHED
144 struct taskData _taskData;
145#endif // QUICKSCHED
146};
147
148} /* namespace bhfmm */
149
150#endif /* SRC_BHFMM_CONTAINERS_PARTICLECELLPOINTERS_H_ */
Structure of Arrays for vectorized force calculation.
Definition: CellDataSoA.h:22
Definition: Cell.h:4
FullMolecule modeled as LJ sphere with point polarities.
Definition: FullMolecule.h:18
Definition: ParticleCellPointers.h:44
void removeAllParticles()
removes all elements from the list molecules without deallocating them
Definition: ParticleCellPointers.cpp:35
int getMoleculeCount() const
return the number of molecules contained in this cell
Definition: ParticleCellPointers.cpp:55
ParticleCellPointers()
Initialize data pointers to 0.
Definition: ParticleCellPointers.cpp:19
~ParticleCellPointers()
Destructor.
Definition: ParticleCellPointers.cpp:29
bool addParticle(Molecule *particle_ptr)
insert a single molecule into this cell
Definition: ParticleCellPointers.cpp:39
CellDataSoA & getCellDataSoA()
Get the structure of arrays for VectorizedCellProcessor.
Definition: ParticleCellPointers.h:76
Definition: L2PCellProcessor.cpp:15
::xsd::cxx::tree::id< char, ncname > id
C++ type corresponding to the ID XML Schema built-in type.
Definition: vtk-punstructured.h:322