71 _physPos = this->
_pSys.getPhysPos();
72 _physExtend = this->
_pSys.getPhysExtend();
74 int intOverlap =
util::ceil(overlap / _spacing);
75 std::cout <<
"intOverlap: " << intOverlap << std::endl;
76 for (
int i = 0; i < 3; i++) {
77 _physPos[i] -= overlap;
78 _intExtend[i] =
util::ceil(_physExtend[i] / _spacing + 2 * intOverlap + 1);
79 std::cout <<
"intExtend[" << i <<
"]: " << _physExtend[i] << std::endl;
82 std::cout <<
"intOverlap: " << intOverlap << std::endl;
84 _pLattice.resize(_intExtend[0]);
85 for (
int iX = 0; iX < _intExtend[0]; ++iX) {
86 _pLattice[iX].resize(_intExtend[1]);
87 for (
int iY = 0; iY < _intExtend[1]; ++iY) {
88 _pLattice[iX][iY].resize(_intExtend[2]);
89 for (
int iZ = 0; iZ < _intExtend[2]; ++iZ) {
100 for (
int i = 0; i < _intExtend[0]; i++) {
101 for (
int j = 0; j < _intExtend[1]; j++) {
102 for (
int k = 0; k < _intExtend[2]; k++) {
103 _pLattice[i][j][k].clear();
108 std::vector<T> pos(3, T());
109 for (
unsigned int i = 0; i < this->_pSys.sizeInclShadow(); i++) {
110 pos = this->_pSys[i].getPos();
112 int aa = (pos[0] - _physPos[0]) / _spacing;
113 int bb = (pos[1] - _physPos[1]) / _spacing;
114 int cc = (pos[2] - _physPos[2]) / _spacing;
125 (pos[1] - _physPos[1]) / _spacing)][(int)
util::floor(
126 (pos[2] - _physPos[2]) / _spacing)].push_back(i);
129 int iX = 0, iY = 0, iZ = 0;
130 int x = 0, y = 0, z = 0;
131 for (
unsigned int s = 0; s < this->_pSys.size(); s++) {
132 pos = this->_pSys[s].getPos();
133 iX =
util::floor((pos[0] - _physPos[0]) / _spacing);
134 iY =
util::floor((pos[1] - _physPos[1]) / _spacing);
135 iZ =
util::floor((pos[2] - _physPos[2]) / _spacing);
137 if (_pLattice[iX][iY][iZ].back() != -1) {
139 int a = 1, b = 1, c = 1;
140 int d = -1, e = -1, f = -1;
150 if (iX >= _intExtend[0]) {
153 if (iY >= _intExtend[1]) {
156 if (iZ >= _intExtend[2]) {
160 typename std::list<int>::iterator it;
161 for (
int i = d; i <= a; i++) {
162 for (
int j = e; j <= b; j++) {
163 for (
int k = f; k <= c; k++) {
164 if (i != 0 || j != 0 || k != 0) {
165 it = _pLattice[iX + i][iY + j][iZ + k].begin();
166 int size = _pLattice[iX + i][iY + j][iZ + k].size();
167 for (
int lauf = 0; lauf < size; lauf++, it++) {
169 pos = this->_pSys[*it].getPos();
170 T rad = this->_pSys[*it].getRad();
171 x =
util::floor((pos[0] - _physPos[0] - i * rad) / _spacing);
172 y =
util::floor((pos[1] - _physPos[1] - j * rad) / _spacing);
173 z =
util::floor((pos[2] - _physPos[2] - k * rad) / _spacing);
174 if (x != iX || y != iY || z != iZ) {
175 _pLattice[iX][iY][iZ].push_back(*it);
183 _pLattice[iX][iY][iZ].push_back(-1);
190 std::vector<std::pair<size_t, T> >& matches)
193 PARTICLETYPE<T>& p = this->_pSys[pInt];
194 int iX =
util::floor((p.getPos()[0] - _physPos[0]) / _spacing);
195 int iY =
util::floor((p.getPos()[1] - _physPos[1]) / _spacing);
196 int iZ =
util::floor((p.getPos()[2] - _physPos[2]) / _spacing);
198 typename std::list<int>::iterator it = _pLattice[iX][iY][iZ].begin();
199 std::vector<T>& pos = p.getPos();
200 for (; it != _pLattice[iX][iY][iZ].end(); ++it) {
202 std::vector<T>& pos2 = this->_pSys[*it].getPos();
204 std::make_pair<size_t, T>(
210 return matches.size();