Merge lp:~jonmcc/esys-particle/remote-force-periodicity into lp:~llaniewski/esys-particle/remote-force
- remote-force-periodicity
- Merge into remote-force
Proposed by
Jon McCullough
Status: | Merged |
---|---|
Merged at revision: | 1190 |
Proposed branch: | lp:~jonmcc/esys-particle/remote-force-periodicity |
Merge into: | lp:~llaniewski/esys-particle/remote-force |
Diff against target: |
1351 lines (+450/-91) 35 files modified
Geometry/CircularNeighbourTable.h (+4/-0) Geometry/CircularNeighbourTable.hpp (+117/-34) Geometry/FaultedBlock2d.cpp (+4/-0) Geometry/GougeBlock3D.cpp (+4/-1) Geometry/GougeConfig.hpp (+4/-1) Geometry/SimpleNTable.cpp (+17/-0) Geometry/SimpleNTable3D.cpp (+32/-1) Geometry/SphAggGougeBlock.cpp (+4/-1) Geometry/SplitBlock3D.cpp (+4/-0) Model/Particle.cpp (+24/-8) Model/Particle.h (+8/-3) Model/RotParticle.cpp (+16/-7) Model/RotParticle.h (+12/-4) Model/RotParticleVi.cpp (+6/-4) Model/RotParticleVi.h (+3/-1) Model/RotThermParticle.cpp (+3/-2) Model/RotThermParticle.h (+2/-1) Parallel/ASubLattice.h (+1/-0) Parallel/LatticeMaster.cpp (+16/-0) Parallel/LatticeMaster.h (+1/-0) Parallel/SubLattice.h (+1/-0) Parallel/SubLattice.hpp (+28/-4) Parallel/SubLatticeControler.cpp (+1/-0) Parallel/sublattice_cmd.h (+1/-1) Python/esys/lsm/LsmMpiPy.cpp (+17/-0) Python/esys/lsm/LsmMpiPy.h (+1/-0) Python/esys/lsm/ParticlePy.cpp (+1/-1) Python/esys/lsm/RotParticlePy.cpp (+1/-1) Python/esys/lsm/RotParticleViPy.cpp (+1/-1) Python/esys/lsm/RotThermalParticlePy.cpp (+1/-1) Tools/dump2vtk/frame_vtk.cpp (+20/-0) ppa/src/pp_array.h (+1/-1) ppa/src/pp_array.hpp (+92/-11) tml/comm/cart_comm.hpp (+1/-1) tml/comm/comm.hpp (+1/-1) |
To merge this branch: | bzr merge lp:~jonmcc/esys-particle/remote-force-periodicity |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Łukasz Łaniewski-Wołłk | Pending | ||
Review via email: mp+359569@code.launchpad.net |
Commit message
Hopeful merge of Jon's and Lukasz's esys-particle codes for coupling with TCLB
Description of the change
- Introduction of full periodicity to esys in the remote force periodicity framework.
- should ensure it works when periodicity is not required. Anecdotally this works but I am skeptical.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Geometry/CircularNeighbourTable.h' | |||
2 | --- Geometry/CircularNeighbourTable.h 2017-01-04 08:26:43 +0000 | |||
3 | +++ Geometry/CircularNeighbourTable.h 2018-11-27 02:58:52 +0000 | |||
4 | @@ -109,6 +109,10 @@ | |||
5 | 109 | ParticleSet m_clonedParticleSet; | 109 | ParticleSet m_clonedParticleSet; |
6 | 110 | int m_circGridWidth; | 110 | int m_circGridWidth; |
7 | 111 | int m_periodicDimIndex; | 111 | int m_periodicDimIndex; |
8 | 112 | |||
9 | 113 | //JM | ||
10 | 114 | int m_periodicDimList[3];// = {-1,-1,-1}; | ||
11 | 115 | int m_circGridList[3];// = {0,0,0}; | ||
12 | 112 | }; | 116 | }; |
13 | 113 | } | 117 | } |
14 | 114 | } | 118 | } |
15 | 115 | 119 | ||
16 | === modified file 'Geometry/CircularNeighbourTable.hpp' | |||
17 | --- Geometry/CircularNeighbourTable.hpp 2017-01-04 08:26:43 +0000 | |||
18 | +++ Geometry/CircularNeighbourTable.hpp 2018-11-27 02:58:52 +0000 | |||
19 | @@ -48,6 +48,21 @@ | |||
20 | 48 | circBorderWidth = this->getGridSpacing(); | 48 | circBorderWidth = this->getGridSpacing(); |
21 | 49 | } | 49 | } |
22 | 50 | setCircularBorderWidth(circBorderWidth, this->getGridSpacing()); | 50 | setCircularBorderWidth(circBorderWidth, this->getGridSpacing()); |
23 | 51 | |||
24 | 52 | //JM | ||
25 | 53 | for (int i = 0; i < 3; i++) { | ||
26 | 54 | double checkcircBorderWidth = | ||
27 | 55 | min( | ||
28 | 56 | (bBox.getSizes()[i]), | ||
29 | 57 | circBorderWidth | ||
30 | 58 | ); | ||
31 | 59 | |||
32 | 60 | m_circGridList[i] = int(ceil(checkcircBorderWidth/gridSpacing)); | ||
33 | 61 | //m_circGridList[i] = m_circGridWidth; | ||
34 | 62 | } | ||
35 | 63 | |||
36 | 64 | //JM | ||
37 | 65 | cerr << "init1 circGridlist = " << m_circGridList[0] << "," << m_circGridList[1] << "," << m_circGridList[2] << endl; | ||
38 | 51 | } | 66 | } |
39 | 52 | 67 | ||
40 | 53 | template <class TmplParticle> | 68 | template <class TmplParticle> |
41 | @@ -70,6 +85,14 @@ | |||
42 | 70 | circBorderWidth = this->getGridSpacing(); | 85 | circBorderWidth = this->getGridSpacing(); |
43 | 71 | } | 86 | } |
44 | 72 | setCircularBorderWidth(circBorderWidth, this->getGridSpacing()); | 87 | setCircularBorderWidth(circBorderWidth, this->getGridSpacing()); |
45 | 88 | |||
46 | 89 | //JM | ||
47 | 90 | for (int i = 0; i < 3; i++) { | ||
48 | 91 | m_circGridList[i] = m_circGridWidth; | ||
49 | 92 | } | ||
50 | 93 | |||
51 | 94 | //JM | ||
52 | 95 | cerr << "init2 circGridlist = " << m_circGridList[0] << "," << m_circGridList[1] << "," << m_circGridList[2] << endl; | ||
53 | 73 | } | 96 | } |
54 | 74 | 97 | ||
55 | 75 | template <class TmplParticle> | 98 | template <class TmplParticle> |
56 | @@ -86,20 +109,26 @@ | |||
57 | 86 | } | 109 | } |
58 | 87 | int numPeriodic = 0; | 110 | int numPeriodic = 0; |
59 | 88 | for (int i = 0; i < 3; i++) { | 111 | for (int i = 0; i < 3; i++) { |
60 | 112 | m_periodicDimList[i] = -1; | ||
61 | 89 | if (m_periodicDimensions[i]) | 113 | if (m_periodicDimensions[i]) |
62 | 90 | { | 114 | { |
64 | 91 | m_periodicDimIndex = i; | 115 | m_periodicDimIndex = i; // JM need to select multiple indices here |
65 | 92 | numPeriodic++; | 116 | numPeriodic++; |
66 | 117 | |||
67 | 118 | //JM | ||
68 | 119 | m_periodicDimList[i] = i; | ||
69 | 93 | } | 120 | } |
70 | 94 | } | 121 | } |
72 | 95 | 122 | cerr << "dimlist = " << m_periodicDimList[0] << "," << m_periodicDimList[1] << "," << m_periodicDimList[2] << endl; | |
73 | 123 | |||
74 | 96 | if (numPeriodic > 1) { | 124 | if (numPeriodic > 1) { |
75 | 97 | std::stringstream msg; | 125 | std::stringstream msg; |
76 | 98 | msg | 126 | msg |
77 | 99 | << "CircularNeighbourTable::CircularNeighbourTable -" | 127 | << "CircularNeighbourTable::CircularNeighbourTable -" |
78 | 100 | << " only a single dimension may be periodic."; | 128 | << " only a single dimension may be periodic."; |
81 | 101 | throw std::runtime_error(msg.str()); | 129 | //throw std::runtime_error(msg.str()); |
82 | 102 | } | 130 | } |
83 | 131 | |||
84 | 103 | } | 132 | } |
85 | 104 | 133 | ||
86 | 105 | template <class TmplParticle> | 134 | template <class TmplParticle> |
87 | @@ -133,13 +162,30 @@ | |||
88 | 133 | { | 162 | { |
89 | 134 | if (havePeriodicDimensions()) | 163 | if (havePeriodicDimensions()) |
90 | 135 | { | 164 | { |
92 | 136 | circBorderWidth = | 165 | //JM repeat for each periodic direction |
93 | 166 | /* circBorderWidth = | ||
94 | 137 | min( | 167 | min( |
95 | 138 | (bBox.getSizes()[m_periodicDimIndex])/2.0, | 168 | (bBox.getSizes()[m_periodicDimIndex])/2.0, |
96 | 139 | circBorderWidth | 169 | circBorderWidth |
98 | 140 | ); | 170 | ); */ |
99 | 171 | // end loop | ||
100 | 172 | |||
101 | 173 | for (int i = 0; i < 3; i++) { | ||
102 | 174 | if (m_periodicDimList[i] != -1) { | ||
103 | 175 | circBorderWidth = | ||
104 | 176 | min( | ||
105 | 177 | (bBox.getSizes()[m_periodicDimList[i]])/2.0, | ||
106 | 178 | circBorderWidth | ||
107 | 179 | ); | ||
108 | 180 | |||
109 | 181 | m_circGridList[i] = int(ceil(circBorderWidth/gridSpacing)); //JM direct use of setCircularBorderWidth(circBorderWidth, gridSpacing); | ||
110 | 182 | } | ||
111 | 183 | } | ||
112 | 184 | } | ||
113 | 185 | else { //JM | ||
114 | 186 | setCircularBorderWidth(circBorderWidth, gridSpacing); //JM now included in loop above when periodic in place. | ||
115 | 141 | } | 187 | } |
117 | 142 | setCircularBorderWidth(circBorderWidth, gridSpacing); | 188 | //JM setCircularBorderWidth(circBorderWidth, gridSpacing); |
118 | 143 | ParticleVector particles = getNonClonedParticles(); | 189 | ParticleVector particles = getNonClonedParticles(); |
119 | 144 | clearClonedParticles(); | 190 | clearClonedParticles(); |
120 | 145 | this->clearAndRecomputeGrid(bBox, gridSpacing); | 191 | this->clearAndRecomputeGrid(bBox, gridSpacing); |
121 | @@ -151,6 +197,9 @@ | |||
122 | 151 | { | 197 | { |
123 | 152 | this->insert(*it); | 198 | this->insert(*it); |
124 | 153 | } | 199 | } |
125 | 200 | |||
126 | 201 | //JM | ||
127 | 202 | cerr << "Resize circGridlist = " << m_circGridList[0] << "," << m_circGridList[1] << "," << m_circGridList[2] << endl; | ||
128 | 154 | } | 203 | } |
129 | 155 | 204 | ||
130 | 156 | template <class TmplParticle> | 205 | template <class TmplParticle> |
131 | @@ -189,33 +238,45 @@ | |||
132 | 189 | havePeriodicDimensions() | 238 | havePeriodicDimensions() |
133 | 190 | ) | 239 | ) |
134 | 191 | { | 240 | { |
162 | 192 | const int &dimIdx = m_periodicDimIndex; | 241 | |
163 | 193 | if ( | 242 | Vec3 moddedPosn = posn; |
164 | 194 | (posn[dimIdx] < this->getBBox().getMinPt()[dimIdx]) | 243 | |
165 | 195 | || | 244 | for (int i = 0; i < 3; i++) { |
166 | 196 | (posn[dimIdx] > this->getBBox().getMaxPt()[dimIdx]) | 245 | if (m_periodicDimList[i] != -1) { |
167 | 197 | ) | 246 | |
168 | 198 | { | 247 | //JM repeat this loop over each periodic direction |
169 | 199 | Vec3 moddedPosn = posn; | 248 | //const int &dimIdx = m_periodicDimIndex; |
170 | 200 | const double dimSize = this->getBBox().getSizes()[dimIdx]; | 249 | const int &dimIdx = m_periodicDimList[i]; |
171 | 201 | moddedPosn[dimIdx] -= this->getBBox().getMinPt()[dimIdx]; | 250 | |
172 | 202 | moddedPosn[dimIdx] = | 251 | if ( |
173 | 203 | (moddedPosn[dimIdx] > 0.0) | 252 | (posn[dimIdx] < this->getBBox().getMinPt()[dimIdx]) |
174 | 204 | ? | 253 | || |
175 | 205 | ( | 254 | (posn[dimIdx] > this->getBBox().getMaxPt()[dimIdx]) |
176 | 206 | this->getBBox().getMinPt()[dimIdx] | 255 | ) |
177 | 207 | + | 256 | { |
178 | 208 | moddedPosn[dimIdx] - (floor(moddedPosn[dimIdx]/dimSize)*dimSize) | 257 | //Vec3 moddedPosn = posn; |
179 | 209 | ) | 258 | const double dimSize = this->getBBox().getSizes()[dimIdx]; |
180 | 210 | : | 259 | moddedPosn[dimIdx] -= this->getBBox().getMinPt()[dimIdx]; |
181 | 211 | ( | 260 | moddedPosn[dimIdx] = |
182 | 212 | this->getBBox().getMaxPt()[dimIdx] | 261 | (moddedPosn[dimIdx] > 0.0) |
183 | 213 | - | 262 | ? |
184 | 214 | (fabs(moddedPosn[dimIdx]) - (floor(fabs(moddedPosn[dimIdx])/dimSize)*dimSize)) | 263 | ( |
185 | 215 | ); | 264 | this->getBBox().getMinPt()[dimIdx] |
186 | 216 | 265 | + | |
187 | 217 | return moddedPosn; | 266 | moddedPosn[dimIdx] - (floor(moddedPosn[dimIdx]/dimSize)*dimSize) |
188 | 218 | } | 267 | ) |
189 | 268 | : | ||
190 | 269 | ( | ||
191 | 270 | this->getBBox().getMaxPt()[dimIdx] | ||
192 | 271 | - | ||
193 | 272 | (fabs(moddedPosn[dimIdx]) - (floor(fabs(moddedPosn[dimIdx])/dimSize)*dimSize)) | ||
194 | 273 | ); | ||
195 | 274 | } | ||
196 | 275 | } | ||
197 | 276 | } | ||
198 | 277 | //JM end periodic repeat here | ||
199 | 278 | return moddedPosn; | ||
200 | 279 | //} | ||
201 | 219 | } | 280 | } |
202 | 220 | return posn; | 281 | return posn; |
203 | 221 | } | 282 | } |
204 | @@ -223,6 +284,9 @@ | |||
205 | 223 | template <class TmplParticle> | 284 | template <class TmplParticle> |
206 | 224 | void CircularNeighbourTable<TmplParticle>::insert(Particle *pParticle) | 285 | void CircularNeighbourTable<TmplParticle>::insert(Particle *pParticle) |
207 | 225 | { | 286 | { |
208 | 287 | //JM | ||
209 | 288 | //cerr << "insert circGridlist = " << m_circGridList[0] << "," << m_circGridList[1] << "," << m_circGridList[2] << endl; | ||
210 | 289 | |||
211 | 226 | pParticle->moveTo(getModdedPosn(pParticle->getPos())); | 290 | pParticle->moveTo(getModdedPosn(pParticle->getPos())); |
212 | 227 | const Vec3L minIdx = this->getVecIndex(pParticle->getPos() - pParticle->getRad()); | 291 | const Vec3L minIdx = this->getVecIndex(pParticle->getPos() - pParticle->getRad()); |
213 | 228 | const Vec3L maxIdx = this->getVecIndex(pParticle->getPos() + pParticle->getRad()); | 292 | const Vec3L maxIdx = this->getVecIndex(pParticle->getPos() + pParticle->getRad()); |
214 | @@ -230,6 +294,7 @@ | |||
215 | 230 | this->insertInTable(pParticle, minIdx, maxIdx); | 294 | this->insertInTable(pParticle, minIdx, maxIdx); |
216 | 231 | this->addInserted(pParticle); | 295 | this->addInserted(pParticle); |
217 | 232 | 296 | ||
218 | 297 | //original | ||
219 | 233 | if (havePeriodicDimensions()) | 298 | if (havePeriodicDimensions()) |
220 | 234 | { | 299 | { |
221 | 235 | for (int dimIdx = 0; dimIdx < 3; dimIdx++) { | 300 | for (int dimIdx = 0; dimIdx < 3; dimIdx++) { |
222 | @@ -247,6 +312,24 @@ | |||
223 | 247 | } | 312 | } |
224 | 248 | } | 313 | } |
225 | 249 | } | 314 | } |
226 | 315 | |||
227 | 316 | /* //modified | ||
228 | 317 | if (havePeriodicDimensions()) | ||
229 | 318 | { | ||
230 | 319 | Vec3 shift = Vec3::ZERO; | ||
231 | 320 | for (int dimIdx = 0; dimIdx < 3; dimIdx++) { | ||
232 | 321 | if (m_periodicDimensions[dimIdx]) { | ||
233 | 322 | if (minIdx[dimIdx] < (this->getMinVecIndex()[dimIdx] + m_circGridList[dimIdx])) { //JM | ||
234 | 323 | shift[dimIdx] = this->getBBox().getSizes()[dimIdx]; | ||
235 | 324 | } | ||
236 | 325 | if (maxIdx[dimIdx] > (this->getMaxVecIndex()[dimIdx] - m_circGridList[dimIdx])) { //JM | ||
237 | 326 | shift[dimIdx] = -1.0d*this->getBBox().getSizes()[dimIdx]; | ||
238 | 327 | } | ||
239 | 328 | } | ||
240 | 329 | } | ||
241 | 330 | this->insertClone(pParticle, pParticle->getPos() + shift); | ||
242 | 331 | } | ||
243 | 332 | */ | ||
244 | 250 | } | 333 | } |
245 | 251 | 334 | ||
246 | 252 | template <class TmplParticle> | 335 | template <class TmplParticle> |
247 | 253 | 336 | ||
248 | === modified file 'Geometry/FaultedBlock2d.cpp' | |||
249 | --- Geometry/FaultedBlock2d.cpp 2017-01-04 08:26:43 +0000 | |||
250 | +++ Geometry/FaultedBlock2d.cpp 2018-11-27 02:58:52 +0000 | |||
251 | @@ -29,6 +29,10 @@ | |||
252 | 29 | \param rmax maximum particle radius | 29 | \param rmax maximum particle radius |
253 | 30 | \param pad thickness of the padding region at each diving edge | 30 | \param pad thickness of the padding region at each diving edge |
254 | 31 | \param circ_x circular boudary condition in x-direction | 31 | \param circ_x circular boudary condition in x-direction |
255 | 32 | |||
256 | 33 | JM | ||
257 | 34 | \param circ_y circular or open boundary conditions in y-direction | ||
258 | 35 | \param circ_z circular or open boundary conditions in z-direction | ||
259 | 32 | */ | 36 | */ |
260 | 33 | FaultedBlock2D::FaultedBlock2D(double xmin,double xmax,double ymin,double ymax,double rmin,double rmax,double pad,bool circ_x) : | 37 | FaultedBlock2D::FaultedBlock2D(double xmin,double xmax,double ymin,double ymax,double rmin,double rmax,double pad,bool circ_x) : |
261 | 34 | CRandomBlock2D(xmin,xmax,ymin,ymax,rmin,rmax,circ_x) | 38 | CRandomBlock2D(xmin,xmax,ymin,ymax,rmin,rmax,circ_x) |
262 | 35 | 39 | ||
263 | === modified file 'Geometry/GougeBlock3D.cpp' | |||
264 | --- Geometry/GougeBlock3D.cpp 2017-01-04 08:26:43 +0000 | |||
265 | +++ Geometry/GougeBlock3D.cpp 2018-11-27 02:58:52 +0000 | |||
266 | @@ -454,7 +454,10 @@ | |||
267 | 454 | m_prms.getPeriodicDimensions()[2] ? 1 : 0 | 454 | m_prms.getPeriodicDimensions()[2] ? 1 : 0 |
268 | 455 | )*m_prms.getMaxRadius(); | 455 | )*m_prms.getMaxRadius(); |
269 | 456 | if (m_prms.getBBox().getSizes().Z() >= 4*m_prms.getMaxRadius()) { | 456 | if (m_prms.getBBox().getSizes().Z() >= 4*m_prms.getMaxRadius()) { |
271 | 457 | ntableAdjust += Vec3(m_prms.getMaxRadius(), 0, 0); | 457 | //ntableAdjust += Vec3(m_prms.getMaxRadius(), 0, 0); |
272 | 458 | |||
273 | 459 | //JM For y/z circular bounds | ||
274 | 460 | ntableAdjust += Vec3(m_prms.getMaxRadius(), m_prms.getMaxRadius(), m_prms.getMaxRadius()); | ||
275 | 458 | } | 461 | } |
276 | 459 | const BoundingBox nTableBBox(bBox.getMinPt(), bBox.getMaxPt() - ntableAdjust); | 462 | const BoundingBox nTableBBox(bBox.getMinPt(), bBox.getMaxPt() - ntableAdjust); |
277 | 460 | m_nTablePtr = | 463 | m_nTablePtr = |
278 | 461 | 464 | ||
279 | === modified file 'Geometry/GougeConfig.hpp' | |||
280 | --- Geometry/GougeConfig.hpp 2017-01-04 08:26:43 +0000 | |||
281 | +++ Geometry/GougeConfig.hpp 2018-11-27 02:58:52 +0000 | |||
282 | @@ -652,7 +652,10 @@ | |||
283 | 652 | m_prms.getPeriodicDimensions()[2] ? 1 : 0 | 652 | m_prms.getPeriodicDimensions()[2] ? 1 : 0 |
284 | 653 | )*m_prms.getMaxRadius(); | 653 | )*m_prms.getMaxRadius(); |
285 | 654 | if (m_prms.getBBox().getSizes().Z() >= 4*m_prms.getMaxRadius()) { | 654 | if (m_prms.getBBox().getSizes().Z() >= 4*m_prms.getMaxRadius()) { |
287 | 655 | ntableAdjust += Vec3(m_prms.getMaxRadius(), 0, 0); | 655 | //ntableAdjust += Vec3(m_prms.getMaxRadius(), 0, 0); |
288 | 656 | |||
289 | 657 | //JM For y/z circular bounds | ||
290 | 658 | ntableAdjust += Vec3(m_prms.getMaxRadius(), m_prms.getMaxRadius(), m_prms.getMaxRadius()); | ||
291 | 656 | } | 659 | } |
292 | 657 | const BoundingBox nTableBBox(bBox.getMinPt(), bBox.getMaxPt() - ntableAdjust); | 660 | const BoundingBox nTableBBox(bBox.getMinPt(), bBox.getMaxPt() - ntableAdjust); |
293 | 658 | m_nTablePtr = | 661 | m_nTablePtr = |
294 | 659 | 662 | ||
295 | === modified file 'Geometry/SimpleNTable.cpp' | |||
296 | --- Geometry/SimpleNTable.cpp 2017-01-04 08:26:43 +0000 | |||
297 | +++ Geometry/SimpleNTable.cpp 2018-11-27 02:58:52 +0000 | |||
298 | @@ -142,6 +142,23 @@ | |||
299 | 142 | } | 142 | } |
300 | 143 | } | 143 | } |
301 | 144 | } | 144 | } |
302 | 145 | |||
303 | 146 | // JM Circular y bound addition | ||
304 | 147 | if(m_ycirc){ | ||
305 | 148 | if (int((cbp.getPos().Y()-m_p0.Y())/m_dim)==1) { | ||
306 | 149 | cbp.moveTo(cbp.getPos()+m_yshift); | ||
307 | 150 | const vector<int> idy=allidx(cbp.getPos()); | ||
308 | 151 | for(vector<int>::const_iterator citer=idy.begin();citer!=idy.end();citer++){ | ||
309 | 152 | m_data[*citer].push_back(cbp); | ||
310 | 153 | } | ||
311 | 154 | } else if (int((cbp.getPos().Y()-m_p0.Y())/m_dim)==m_ysize-2) { | ||
312 | 155 | cbp.moveTo(cbp.getPos()-m_yshift); | ||
313 | 156 | const vector<int> idy=allidx(cbp.getPos()); | ||
314 | 157 | for(vector<int>::const_iterator citer=idy.begin();citer!=idy.end();citer++){ | ||
315 | 158 | m_data[*citer].push_back(cbp); | ||
316 | 159 | } | ||
317 | 160 | } | ||
318 | 161 | } | ||
319 | 145 | } | 162 | } |
320 | 146 | 163 | ||
321 | 147 | /*! | 164 | /*! |
322 | 148 | 165 | ||
323 | === modified file 'Geometry/SimpleNTable3D.cpp' | |||
324 | --- Geometry/SimpleNTable3D.cpp 2017-01-04 08:26:43 +0000 | |||
325 | +++ Geometry/SimpleNTable3D.cpp 2018-11-27 02:58:52 +0000 | |||
326 | @@ -152,6 +152,37 @@ | |||
327 | 152 | } | 152 | } |
328 | 153 | } | 153 | } |
329 | 154 | } | 154 | } |
330 | 155 | // JM Circular y/z bound addition | ||
331 | 156 | if(m_ycirc){ | ||
332 | 157 | if (int((cbp.getPos().Y()-m_p0.Y())/m_dim)==1) { | ||
333 | 158 | cbp.moveTo(cbp.getPos()+m_yshift); | ||
334 | 159 | const vector<int> idy=allidx(cbp.getPos()); | ||
335 | 160 | for(vector<int>::const_iterator citer=idy.begin();citer!=idy.end();citer++){ | ||
336 | 161 | m_data[*citer].push_back(cbp); | ||
337 | 162 | } | ||
338 | 163 | } else if (int((cbp.getPos().Y()-m_p0.Y())/m_dim)==m_ysize-2) { | ||
339 | 164 | cbp.moveTo(cbp.getPos()-m_yshift); | ||
340 | 165 | const vector<int> idy=allidx(cbp.getPos()); | ||
341 | 166 | for(vector<int>::const_iterator citer=idy.begin();citer!=idy.end();citer++){ | ||
342 | 167 | m_data[*citer].push_back(cbp); | ||
343 | 168 | } | ||
344 | 169 | } | ||
345 | 170 | } | ||
346 | 171 | if(m_zcirc){ | ||
347 | 172 | if (int((cbp.getPos().Z()-m_p0.Z())/m_dim)==1) { | ||
348 | 173 | cbp.moveTo(cbp.getPos()+m_zshift); | ||
349 | 174 | const vector<int> idz=allidx(cbp.getPos()); | ||
350 | 175 | for(vector<int>::const_iterator citer=idz.begin();citer!=idz.end();citer++){ | ||
351 | 176 | m_data[*citer].push_back(cbp); | ||
352 | 177 | } | ||
353 | 178 | } else if (int((cbp.getPos().Z()-m_p0.Z())/m_dim)==m_zsize-2) { | ||
354 | 179 | cbp.moveTo(cbp.getPos()-m_zshift); | ||
355 | 180 | const vector<int> idz=allidx(cbp.getPos()); | ||
356 | 181 | for(vector<int>::const_iterator citer=idz.begin();citer!=idz.end();citer++){ | ||
357 | 182 | m_data[*citer].push_back(cbp); | ||
358 | 183 | } | ||
359 | 184 | } | ||
360 | 185 | } | ||
361 | 155 | } | 186 | } |
362 | 156 | 187 | ||
363 | 157 | 188 | ||
364 | @@ -187,7 +218,7 @@ | |||
365 | 187 | if (m_zcirc) { | 218 | if (m_zcirc) { |
366 | 188 | m_zsize+=2; | 219 | m_zsize+=2; |
367 | 189 | m_p0-=Vec3(0.0,0.0,r); | 220 | m_p0-=Vec3(0.0,0.0,r); |
369 | 190 | m_yshift=Vec3(0.0,0.0,dim.Z()); | 221 | m_zshift=Vec3(0.0,0.0,dim.Z()); |
370 | 191 | } | 222 | } |
371 | 192 | //cout << "NT size : " << m_xsize << " , " << m_ysize << " , " << m_zsize << endl; | 223 | //cout << "NT size : " << m_xsize << " , " << m_ysize << " , " << m_zsize << endl; |
372 | 193 | m_data=new vector<SimpleParticle>[m_xsize*m_ysize*m_zsize]; | 224 | m_data=new vector<SimpleParticle>[m_xsize*m_ysize*m_zsize]; |
373 | 194 | 225 | ||
374 | === modified file 'Geometry/SphAggGougeBlock.cpp' | |||
375 | --- Geometry/SphAggGougeBlock.cpp 2017-01-04 08:26:43 +0000 | |||
376 | +++ Geometry/SphAggGougeBlock.cpp 2018-11-27 02:58:52 +0000 | |||
377 | @@ -162,7 +162,10 @@ | |||
378 | 162 | const BoundingBox bBox = m_prms.getBBox(); | 162 | const BoundingBox bBox = m_prms.getBBox(); |
379 | 163 | Vec3 ntableAdjust = Vec3(0.0,0.0,0.0); | 163 | Vec3 ntableAdjust = Vec3(0.0,0.0,0.0); |
380 | 164 | if (m_prms.getBBox().getSizes().Z() >= 4*m_prms.getMaxRadius()) { | 164 | if (m_prms.getBBox().getSizes().Z() >= 4*m_prms.getMaxRadius()) { |
382 | 165 | ntableAdjust += Vec3(m_prms.getMaxRadius(), 0, 0); | 165 | //ntableAdjust += Vec3(m_prms.getMaxRadius(), 0, 0); |
383 | 166 | |||
384 | 167 | //JM For y/z circular bounds | ||
385 | 168 | ntableAdjust += Vec3(m_prms.getMaxRadius(), m_prms.getMaxRadius(), m_prms.getMaxRadius()); | ||
386 | 166 | } | 169 | } |
387 | 167 | const BoundingBox nTableBBox(bBox.getMinPt(), bBox.getMaxPt() - ntableAdjust); | 170 | const BoundingBox nTableBBox(bBox.getMinPt(), bBox.getMaxPt() - ntableAdjust); |
388 | 168 | m_nTablePtr2 = | 171 | m_nTablePtr2 = |
389 | 169 | 172 | ||
390 | === modified file 'Geometry/SplitBlock3D.cpp' | |||
391 | --- Geometry/SplitBlock3D.cpp 2017-01-04 08:26:43 +0000 | |||
392 | +++ Geometry/SplitBlock3D.cpp 2018-11-27 02:58:52 +0000 | |||
393 | @@ -27,6 +27,10 @@ | |||
394 | 27 | \param ysplit the position of the split plane | 27 | \param ysplit the position of the split plane |
395 | 28 | \param dir the direction of the split plane (2=y,3=z) | 28 | \param dir the direction of the split plane (2=y,3=z) |
396 | 29 | \param circ_x circular or open boundary conditions in x-direction | 29 | \param circ_x circular or open boundary conditions in x-direction |
397 | 30 | |||
398 | 31 | JM | ||
399 | 32 | \param circ_y circular or open boundary conditions in y-direction | ||
400 | 33 | \param circ_z circular or open boundary conditions in z-direction | ||
401 | 30 | */ | 34 | */ |
402 | 31 | CSplitBlock3D::CSplitBlock3D(double xmin,double xmax,double ymin,double ymax,double zmin,double zmax,double rmin,double rmax,double ysplit,int dir, bool circ_x,bool rough):CRandomBlock3D(xmin,xmax,ymin,ymax,zmin,zmax,rmin,rmax,1.05,circ_x) | 35 | CSplitBlock3D::CSplitBlock3D(double xmin,double xmax,double ymin,double ymax,double zmin,double zmax,double rmin,double rmax,double ysplit,int dir, bool circ_x,bool rough):CRandomBlock3D(xmin,xmax,ymin,ymax,zmin,zmax,rmin,rmax,1.05,circ_x) |
403 | 32 | { | 36 | { |
404 | 33 | 37 | ||
405 | === modified file 'Model/Particle.cpp' | |||
406 | --- Model/Particle.cpp 2017-01-04 08:26:43 +0000 | |||
407 | +++ Model/Particle.cpp 2018-11-27 02:58:52 +0000 | |||
408 | @@ -34,7 +34,8 @@ | |||
409 | 34 | m_mass(0.0), | 34 | m_mass(0.0), |
410 | 35 | m_div_mass(0.0), | 35 | m_div_mass(0.0), |
411 | 36 | flag(false), | 36 | flag(false), |
413 | 37 | m_is_dynamic(true) | 37 | m_is_dynamic(true), |
414 | 38 | m_is_acc(true) | ||
415 | 38 | { | 39 | { |
416 | 39 | } | 40 | } |
417 | 40 | 41 | ||
418 | @@ -49,7 +50,8 @@ | |||
419 | 49 | m_mass(data.getMass()), | 50 | m_mass(data.getMass()), |
420 | 50 | m_div_mass((data.getMass() != 0) ? 1.0/data.getMass() : 0.0), | 51 | m_div_mass((data.getMass() != 0) ? 1.0/data.getMass() : 0.0), |
421 | 51 | flag(false), | 52 | flag(false), |
423 | 52 | m_is_dynamic(true) //! SimpleParticleData has no is_dynamic info -> default to true | 53 | m_is_dynamic(true), //! SimpleParticleData has no is_dynamic info -> default to true |
424 | 54 | m_is_acc(true) //! SimpleParticleData has no is_dynamic info -> default to true | ||
425 | 53 | { | 55 | { |
426 | 54 | } | 56 | } |
427 | 55 | 57 | ||
428 | @@ -63,7 +65,7 @@ | |||
429 | 63 | \param force currently applied force | 65 | \param force currently applied force |
430 | 64 | \param id particle id | 66 | \param id particle id |
431 | 65 | */ | 67 | */ |
433 | 66 | CParticle::CParticle(double rad,double mass,const Vec3& pos,const Vec3& vel,const Vec3& force,int id,bool is_dyn) : CBasicParticle(pos,rad) | 68 | CParticle::CParticle(double rad,double mass,const Vec3& pos,const Vec3& vel,const Vec3& force,int id,bool is_dyn,bool is_acc) : CBasicParticle(pos,rad) |
434 | 67 | { | 69 | { |
435 | 68 | m_oldpos=pos; | 70 | m_oldpos=pos; |
436 | 69 | m_initpos=pos; | 71 | m_initpos=pos; |
437 | @@ -79,9 +81,10 @@ | |||
438 | 79 | m_circular_shift = zeroVec3; | 81 | m_circular_shift = zeroVec3; |
439 | 80 | flag=false; | 82 | flag=false; |
440 | 81 | m_is_dynamic=is_dyn; | 83 | m_is_dynamic=is_dyn; |
441 | 84 | m_is_acc=is_acc; | ||
442 | 82 | } | 85 | } |
443 | 83 | 86 | ||
445 | 84 | CParticle::CParticle(double rad,double mass,const Vec3& pos,const Vec3& oldpos,const Vec3& initpos,const Vec3& vel,const Vec3& force,int id,bool is_dyn) : CBasicParticle(pos,rad) | 87 | CParticle::CParticle(double rad,double mass,const Vec3& pos,const Vec3& oldpos,const Vec3& initpos,const Vec3& vel,const Vec3& force,int id,bool is_dyn,bool is_acc) : CBasicParticle(pos,rad) |
446 | 85 | { | 88 | { |
447 | 86 | m_oldpos=oldpos; | 89 | m_oldpos=oldpos; |
448 | 87 | m_initpos=initpos; | 90 | m_initpos=initpos; |
449 | @@ -97,6 +100,7 @@ | |||
450 | 97 | m_circular_shift = zeroVec3; | 100 | m_circular_shift = zeroVec3; |
451 | 98 | flag=false; | 101 | flag=false; |
452 | 99 | m_is_dynamic=is_dyn; | 102 | m_is_dynamic=is_dyn; |
453 | 103 | m_is_acc=is_acc; | ||
454 | 100 | } | 104 | } |
455 | 101 | 105 | ||
456 | 102 | /*! | 106 | /*! |
457 | @@ -211,6 +215,7 @@ | |||
458 | 211 | append(p.m_rad); | 215 | append(p.m_rad); |
459 | 212 | append(p.m_mass); | 216 | append(p.m_mass); |
460 | 213 | append(p.m_is_dynamic); | 217 | append(p.m_is_dynamic); |
461 | 218 | append(p.m_is_acc); | ||
462 | 214 | } | 219 | } |
463 | 215 | 220 | ||
464 | 216 | /*! | 221 | /*! |
465 | @@ -240,6 +245,7 @@ | |||
466 | 240 | p.m_div_mass=0.0; | 245 | p.m_div_mass=0.0; |
467 | 241 | } | 246 | } |
468 | 242 | p.m_is_dynamic=pop_bool(); | 247 | p.m_is_dynamic=pop_bool(); |
469 | 248 | p.m_is_acc=pop_bool(); | ||
470 | 243 | } | 249 | } |
471 | 244 | 250 | ||
472 | 245 | /*! | 251 | /*! |
473 | @@ -253,6 +259,9 @@ | |||
474 | 253 | if (getDo2dCalculations()) { | 259 | if (getDo2dCalculations()) { |
475 | 254 | m_force = Vec3(m_force.X(), m_force.Y(), 0); | 260 | m_force = Vec3(m_force.X(), m_force.Y(), 0); |
476 | 255 | } | 261 | } |
477 | 262 | if (!m_is_acc) { | ||
478 | 263 | m_force = Vec3(0.0,0.0,0.0); | ||
479 | 264 | } | ||
480 | 256 | #if 1 | 265 | #if 1 |
481 | 257 | // 1st order scheme, 13 Flops | 266 | // 1st order scheme, 13 Flops |
482 | 258 | m_vel+=m_force*m_div_mass*dt; // 7 Flops | 267 | m_vel+=m_force*m_div_mass*dt; // 7 Flops |
483 | @@ -303,7 +312,8 @@ | |||
484 | 303 | m_initpos - m_circular_shift, | 312 | m_initpos - m_circular_shift, |
485 | 304 | m_oldpos - m_circular_shift, | 313 | m_oldpos - m_circular_shift, |
486 | 305 | m_vel, | 314 | m_vel, |
488 | 306 | m_is_dynamic | 315 | m_is_dynamic, |
489 | 316 | m_is_acc | ||
490 | 307 | ); | 317 | ); |
491 | 308 | } | 318 | } |
492 | 309 | 319 | ||
493 | @@ -319,6 +329,7 @@ | |||
494 | 319 | m_oldpos = E.m_oldPos + m_circular_shift; | 329 | m_oldpos = E.m_oldPos + m_circular_shift; |
495 | 320 | m_vel = E.m_vel; | 330 | m_vel = E.m_vel; |
496 | 321 | m_is_dynamic = E.m_is_dynamic; | 331 | m_is_dynamic = E.m_is_dynamic; |
497 | 332 | m_is_acc = E.m_is_acc; | ||
498 | 322 | } | 333 | } |
499 | 323 | 334 | ||
500 | 324 | /*! | 335 | /*! |
501 | @@ -355,6 +366,7 @@ | |||
502 | 355 | append(p.m_vel.Y()); | 366 | append(p.m_vel.Y()); |
503 | 356 | append(p.m_vel.Z()); | 367 | append(p.m_vel.Z()); |
504 | 357 | append(p.m_is_dynamic); | 368 | append(p.m_is_dynamic); |
505 | 369 | append(p.m_is_acc); | ||
506 | 358 | } | 370 | } |
507 | 359 | 371 | ||
508 | 360 | /*! | 372 | /*! |
509 | @@ -372,6 +384,7 @@ | |||
510 | 372 | p.m_oldPos = Vec3(db[6], db[7], db[8]); | 384 | p.m_oldPos = Vec3(db[6], db[7], db[8]); |
511 | 373 | p.m_vel = Vec3(db[9], db[10], db[11]); | 385 | p.m_vel = Vec3(db[9], db[10], db[11]); |
512 | 374 | p.m_is_dynamic=pop_bool(); | 386 | p.m_is_dynamic=pop_bool(); |
513 | 387 | p.m_is_acc=pop_bool(); | ||
514 | 375 | } | 388 | } |
515 | 376 | 389 | ||
516 | 377 | 390 | ||
517 | @@ -448,7 +461,8 @@ | |||
518 | 448 | << getVel() << delim // 13,14,15 | 461 | << getVel() << delim // 13,14,15 |
519 | 449 | << getForce() << delim // 16,17,18 | 462 | << getForce() << delim // 16,17,18 |
520 | 450 | << m_circular_shift << delim // 19,20,21 | 463 | << m_circular_shift << delim // 19,20,21 |
522 | 451 | << m_is_dynamic; | 464 | << m_is_dynamic << delim |
523 | 465 | << m_is_acc; | ||
524 | 452 | } | 466 | } |
525 | 453 | 467 | ||
526 | 454 | /*! | 468 | /*! |
527 | @@ -467,6 +481,7 @@ | |||
528 | 467 | int id; | 481 | int id; |
529 | 468 | int tag; | 482 | int tag; |
530 | 469 | bool is_dyn; | 483 | bool is_dyn; |
531 | 484 | bool is_acc; | ||
532 | 470 | 485 | ||
533 | 471 | iStream | 486 | iStream |
534 | 472 | >> pos | 487 | >> pos |
535 | @@ -479,7 +494,8 @@ | |||
536 | 479 | >> vel | 494 | >> vel |
537 | 480 | >> force | 495 | >> force |
538 | 481 | >> circular_shift | 496 | >> circular_shift |
540 | 482 | >> is_dyn; | 497 | >> is_dyn |
541 | 498 | >> is_acc; | ||
542 | 483 | 499 | ||
543 | 484 | CParticle | 500 | CParticle |
544 | 485 | particle | 501 | particle |
545 | @@ -491,7 +507,7 @@ | |||
546 | 491 | initpos + circular_shift, | 507 | initpos + circular_shift, |
547 | 492 | vel, | 508 | vel, |
548 | 493 | force, | 509 | force, |
550 | 494 | id, is_dyn | 510 | id, is_dyn, is_acc |
551 | 495 | ); | 511 | ); |
552 | 496 | particle.setTag(tag); | 512 | particle.setTag(tag); |
553 | 497 | 513 | ||
554 | 498 | 514 | ||
555 | === modified file 'Model/Particle.h' | |||
556 | --- Model/Particle.h 2017-01-04 08:26:43 +0000 | |||
557 | +++ Model/Particle.h 2018-11-27 02:58:52 +0000 | |||
558 | @@ -60,15 +60,17 @@ | |||
559 | 60 | m_vel() | 60 | m_vel() |
560 | 61 | { | 61 | { |
561 | 62 | m_is_dynamic=true; | 62 | m_is_dynamic=true; |
562 | 63 | m_is_acc=true; | ||
563 | 63 | } | 64 | } |
564 | 64 | 65 | ||
566 | 65 | exchangeType(const Vec3 &pos, const Vec3 &initPos, const Vec3 &oldPos, const Vec3 &vel,bool is_dyn) | 66 | exchangeType(const Vec3 &pos, const Vec3 &initPos, const Vec3 &oldPos, const Vec3 &vel,bool is_dyn,bool is_acc) |
567 | 66 | : m_pos(pos), | 67 | : m_pos(pos), |
568 | 67 | m_initPos(initPos), | 68 | m_initPos(initPos), |
569 | 68 | m_oldPos(oldPos), | 69 | m_oldPos(oldPos), |
570 | 69 | m_vel(vel) | 70 | m_vel(vel) |
571 | 70 | { | 71 | { |
572 | 71 | m_is_dynamic=is_dyn; | 72 | m_is_dynamic=is_dyn; |
573 | 73 | m_is_acc=is_acc; | ||
574 | 72 | } | 74 | } |
575 | 73 | 75 | ||
576 | 74 | Vec3 m_pos; | 76 | Vec3 m_pos; |
577 | @@ -76,6 +78,7 @@ | |||
578 | 76 | Vec3 m_oldPos; | 78 | Vec3 m_oldPos; |
579 | 77 | Vec3 m_vel; | 79 | Vec3 m_vel; |
580 | 78 | bool m_is_dynamic; | 80 | bool m_is_dynamic; |
581 | 81 | bool m_is_acc; | ||
582 | 79 | }; | 82 | }; |
583 | 80 | 83 | ||
584 | 81 | typedef double (CParticle::* ScalarFieldFunction)() const; | 84 | typedef double (CParticle::* ScalarFieldFunction)() const; |
585 | @@ -92,13 +95,14 @@ | |||
586 | 92 | 95 | ||
587 | 93 | bool flag; | 96 | bool flag; |
588 | 94 | bool m_is_dynamic; | 97 | bool m_is_dynamic; |
589 | 98 | bool m_is_acc; | ||
590 | 95 | 99 | ||
591 | 96 | void setForce(const Vec3 &force) {m_force = force;} | 100 | void setForce(const Vec3 &force) {m_force = force;} |
592 | 97 | 101 | ||
593 | 98 | public: | 102 | public: |
594 | 99 | CParticle(); | 103 | CParticle(); |
597 | 100 | CParticle(double,double,const Vec3&,const Vec3&,const Vec3&,int,bool); | 104 | CParticle(double,double,const Vec3&,const Vec3&,const Vec3&,int,bool,bool); |
598 | 101 | CParticle(double,double,const Vec3&,const Vec3&,const Vec3&,const Vec3&,const Vec3&,int,bool); // including oldpos | 105 | CParticle(double,double,const Vec3&,const Vec3&,const Vec3&,const Vec3&,const Vec3&,int,bool,bool); // including oldpos |
599 | 102 | CParticle(const esys::lsm::SimpleParticleData &particleData); | 106 | CParticle(const esys::lsm::SimpleParticleData &particleData); |
600 | 103 | virtual ~CParticle(){}; | 107 | virtual ~CParticle(){}; |
601 | 104 | 108 | ||
602 | @@ -136,6 +140,7 @@ | |||
603 | 136 | virtual void setNonDynamic() {m_is_dynamic=false;}; | 140 | virtual void setNonDynamic() {m_is_dynamic=false;}; |
604 | 137 | virtual void setNonDynamicLinear() {m_is_dynamic=false;}; | 141 | virtual void setNonDynamicLinear() {m_is_dynamic=false;}; |
605 | 138 | virtual void setNonDynamicRot(){}; // do nothing | 142 | virtual void setNonDynamicRot(){}; // do nothing |
606 | 143 | virtual void setNonDynamicAcc(){m_is_dynamic=true; m_is_acc=false;}; // JM | ||
607 | 139 | 144 | ||
608 | 140 | void setFlag(bool b=true){flag=b;}; | 145 | void setFlag(bool b=true){flag=b;}; |
609 | 141 | bool isFlagged() const {return flag;}; | 146 | bool isFlagged() const {return flag;}; |
610 | 142 | 147 | ||
611 | === modified file 'Model/RotParticle.cpp' | |||
612 | --- Model/RotParticle.cpp 2017-01-04 08:26:43 +0000 | |||
613 | +++ Model/RotParticle.cpp 2018-11-27 02:58:52 +0000 | |||
614 | @@ -66,8 +66,9 @@ | |||
615 | 66 | const Vec3& force, | 66 | const Vec3& force, |
616 | 67 | int id, | 67 | int id, |
617 | 68 | bool is_dyn, | 68 | bool is_dyn, |
620 | 69 | bool is_rot | 69 | bool is_rot, |
621 | 70 | ) : CParticle(rad, mass, pos, vel, force, id, is_dyn) | 70 | bool is_acc |
622 | 71 | ) : CParticle(rad, mass, pos, vel, force, id, is_dyn, is_acc) | ||
623 | 71 | { | 72 | { |
624 | 72 | m_quat = Quaternion(1.0,Vec3(0.0,0.0,0.0)); | 73 | m_quat = Quaternion(1.0,Vec3(0.0,0.0,0.0)); |
625 | 73 | m_initquat = m_quat; | 74 | m_initquat = m_quat; |
626 | @@ -109,8 +110,9 @@ | |||
627 | 109 | const Vec3& moment, | 110 | const Vec3& moment, |
628 | 110 | const Vec3& angvel, | 111 | const Vec3& angvel, |
629 | 111 | bool is_dyn, | 112 | bool is_dyn, |
632 | 112 | bool is_rot | 113 | bool is_rot, |
633 | 113 | ) :CParticle(rad, mass,pos,vel,force,id,is_dyn) | 114 | bool is_acc |
634 | 115 | ) :CParticle(rad, mass,pos,vel,force,id,is_dyn,is_acc) | ||
635 | 114 | { | 116 | { |
636 | 115 | m_circular_shift=Vec3(0.0,0.0,0.0); | 117 | m_circular_shift=Vec3(0.0,0.0,0.0); |
637 | 116 | flag=false; | 118 | flag=false; |
638 | @@ -139,8 +141,9 @@ | |||
639 | 139 | const Vec3& moment, | 141 | const Vec3& moment, |
640 | 140 | const Vec3& angvel, | 142 | const Vec3& angvel, |
641 | 141 | bool is_dyn, | 143 | bool is_dyn, |
644 | 142 | bool is_rot | 144 | bool is_rot, |
645 | 143 | ) :CParticle(rad, mass,pos,oldpos, initpos,vel,force,id,is_dyn) | 145 | bool is_acc |
646 | 146 | ) :CParticle(rad, mass,pos,oldpos, initpos,vel,force,id,is_dyn,is_acc) | ||
647 | 144 | { | 147 | { |
648 | 145 | m_circular_shift=Vec3(0.0,0.0,0.0); | 148 | m_circular_shift=Vec3(0.0,0.0,0.0); |
649 | 146 | flag=false; | 149 | flag=false; |
650 | @@ -228,6 +231,7 @@ | |||
651 | 228 | 231 | ||
652 | 229 | append(p.m_is_dynamic); | 232 | append(p.m_is_dynamic); |
653 | 230 | append(p.m_is_rot); | 233 | append(p.m_is_rot); |
654 | 234 | append(p.m_is_acc); | ||
655 | 231 | } | 235 | } |
656 | 232 | 236 | ||
657 | 233 | 237 | ||
658 | @@ -265,6 +269,7 @@ | |||
659 | 265 | p.m_global_id=pop_int(); | 269 | p.m_global_id=pop_int(); |
660 | 266 | p.m_is_dynamic=pop_bool(); | 270 | p.m_is_dynamic=pop_bool(); |
661 | 267 | p.m_is_rot=pop_bool(); | 271 | p.m_is_rot=pop_bool(); |
662 | 272 | p.m_is_acc=pop_bool(); | ||
663 | 268 | } | 273 | } |
664 | 269 | 274 | ||
665 | 270 | /*! | 275 | /*! |
666 | @@ -339,7 +344,8 @@ | |||
667 | 339 | m_angVel, | 344 | m_angVel, |
668 | 340 | m_quat, | 345 | m_quat, |
669 | 341 | m_is_dynamic, | 346 | m_is_dynamic, |
671 | 342 | m_is_rot | 347 | m_is_rot, |
672 | 348 | m_is_acc | ||
673 | 343 | ); | 349 | ); |
674 | 344 | } | 350 | } |
675 | 345 | 351 | ||
676 | @@ -357,6 +363,7 @@ | |||
677 | 357 | m_quat = E.m_quat; | 363 | m_quat = E.m_quat; |
678 | 358 | m_is_dynamic = E.m_is_dynamic; | 364 | m_is_dynamic = E.m_is_dynamic; |
679 | 359 | m_is_rot = E.m_is_rot; | 365 | m_is_rot = E.m_is_rot; |
680 | 366 | m_is_acc = E.m_is_acc; | ||
681 | 360 | } | 367 | } |
682 | 361 | 368 | ||
683 | 362 | template<> | 369 | template<> |
684 | @@ -380,6 +387,7 @@ | |||
685 | 380 | append(p.m_quat.return_vec().Z()); | 387 | append(p.m_quat.return_vec().Z()); |
686 | 381 | append(p.m_is_dynamic); | 388 | append(p.m_is_dynamic); |
687 | 382 | append(p.m_is_rot); | 389 | append(p.m_is_rot); |
688 | 390 | append(p.m_is_acc); | ||
689 | 383 | } | 391 | } |
690 | 384 | 392 | ||
691 | 385 | /*! | 393 | /*! |
692 | @@ -399,6 +407,7 @@ | |||
693 | 399 | p.m_quat = Quaternion(db[12],Vec3(db[13],db[14],db[15])); | 407 | p.m_quat = Quaternion(db[12],Vec3(db[13],db[14],db[15])); |
694 | 400 | p.m_is_dynamic = pop_bool(); | 408 | p.m_is_dynamic = pop_bool(); |
695 | 401 | p.m_is_rot = pop_bool(); | 409 | p.m_is_rot = pop_bool(); |
696 | 410 | p.m_is_acc = pop_bool(); | ||
697 | 402 | } | 411 | } |
698 | 403 | 412 | ||
699 | 404 | CRotParticle::ScalarFieldFunction CRotParticle::getScalarFieldFunction(const string& name) | 413 | CRotParticle::ScalarFieldFunction CRotParticle::getScalarFieldFunction(const string& name) |
700 | 405 | 414 | ||
701 | === modified file 'Model/RotParticle.h' | |||
702 | --- Model/RotParticle.h 2017-01-04 08:26:43 +0000 | |||
703 | +++ Model/RotParticle.h 2018-11-27 02:58:52 +0000 | |||
704 | @@ -66,6 +66,7 @@ | |||
705 | 66 | { | 66 | { |
706 | 67 | m_is_dynamic=true; | 67 | m_is_dynamic=true; |
707 | 68 | m_is_rot=true; | 68 | m_is_rot=true; |
708 | 69 | m_is_acc=true; | ||
709 | 69 | } | 70 | } |
710 | 70 | 71 | ||
711 | 71 | exchangeType( | 72 | exchangeType( |
712 | @@ -75,7 +76,8 @@ | |||
713 | 75 | const Vec3 &currAngVel, | 76 | const Vec3 &currAngVel, |
714 | 76 | const Quaternion &quat, | 77 | const Quaternion &quat, |
715 | 77 | const bool is_dyn, | 78 | const bool is_dyn, |
717 | 78 | const bool is_rot | 79 | const bool is_rot, |
718 | 80 | const bool is_acc | ||
719 | 79 | ) | 81 | ) |
720 | 80 | : m_pos(pos), | 82 | : m_pos(pos), |
721 | 81 | m_initPos(initPos), | 83 | m_initPos(initPos), |
722 | @@ -85,6 +87,7 @@ | |||
723 | 85 | { | 87 | { |
724 | 86 | m_is_dynamic=is_dyn; | 88 | m_is_dynamic=is_dyn; |
725 | 87 | m_is_rot=is_rot; | 89 | m_is_rot=is_rot; |
726 | 90 | m_is_acc=is_acc; | ||
727 | 88 | } | 91 | } |
728 | 89 | public: | 92 | public: |
729 | 90 | Vec3 m_pos; | 93 | Vec3 m_pos; |
730 | @@ -94,6 +97,7 @@ | |||
731 | 94 | Quaternion m_quat; | 97 | Quaternion m_quat; |
732 | 95 | bool m_is_dynamic; | 98 | bool m_is_dynamic; |
733 | 96 | bool m_is_rot; | 99 | bool m_is_rot; |
734 | 100 | bool m_is_acc; | ||
735 | 97 | 101 | ||
736 | 98 | friend class TML_PackedMessageInterface; | 102 | friend class TML_PackedMessageInterface; |
737 | 99 | }; | 103 | }; |
738 | @@ -124,7 +128,8 @@ | |||
739 | 124 | const Vec3& force, | 128 | const Vec3& force, |
740 | 125 | int id, | 129 | int id, |
741 | 126 | bool is_dyn, | 130 | bool is_dyn, |
743 | 127 | bool is_rot | 131 | bool is_rot, |
744 | 132 | bool is_acc | ||
745 | 128 | ); | 133 | ); |
746 | 129 | CRotParticle( | 134 | CRotParticle( |
747 | 130 | double rad, | 135 | double rad, |
748 | @@ -138,7 +143,8 @@ | |||
749 | 138 | const Vec3& moment, | 143 | const Vec3& moment, |
750 | 139 | const Vec3& angvel, | 144 | const Vec3& angvel, |
751 | 140 | bool is_dyn, | 145 | bool is_dyn, |
753 | 141 | bool is_rot | 146 | bool is_rot, |
754 | 147 | bool is_acc | ||
755 | 142 | ); | 148 | ); |
756 | 143 | CRotParticle( | 149 | CRotParticle( |
757 | 144 | double rad, | 150 | double rad, |
758 | @@ -155,7 +161,8 @@ | |||
759 | 155 | const Vec3& moment, | 161 | const Vec3& moment, |
760 | 156 | const Vec3& angvel, | 162 | const Vec3& angvel, |
761 | 157 | bool is_dyn, | 163 | bool is_dyn, |
763 | 158 | bool is_rot | 164 | bool is_rot, |
764 | 165 | bool is_acc | ||
765 | 159 | ); | 166 | ); |
766 | 160 | 167 | ||
767 | 161 | virtual ~CRotParticle(){}; | 168 | virtual ~CRotParticle(){}; |
768 | @@ -200,6 +207,7 @@ | |||
769 | 200 | virtual void setNonDynamic() {m_is_dynamic=false;m_is_rot=false;}; | 207 | virtual void setNonDynamic() {m_is_dynamic=false;m_is_rot=false;}; |
770 | 201 | virtual void setNonDynamicLinear() {m_is_dynamic=false;}; | 208 | virtual void setNonDynamicLinear() {m_is_dynamic=false;}; |
771 | 202 | virtual void setNonDynamicRot() {m_is_rot=false;}; | 209 | virtual void setNonDynamicRot() {m_is_rot=false;}; |
772 | 210 | virtual void setNonDynamicAcc() {m_is_dynamic=true; m_is_acc=false;}; | ||
773 | 203 | 211 | ||
774 | 204 | inline Quaternion getQuatFromRotVec(const Vec3 &vec) const | 212 | inline Quaternion getQuatFromRotVec(const Vec3 &vec) const |
775 | 205 | { | 213 | { |
776 | 206 | 214 | ||
777 | === modified file 'Model/RotParticleVi.cpp' | |||
778 | --- Model/RotParticleVi.cpp 2017-01-04 08:26:43 +0000 | |||
779 | +++ Model/RotParticleVi.cpp 2018-11-27 02:58:52 +0000 | |||
780 | @@ -42,8 +42,9 @@ | |||
781 | 42 | const Vec3& vel, | 42 | const Vec3& vel, |
782 | 43 | const Vec3& force, | 43 | const Vec3& force, |
783 | 44 | int id, | 44 | int id, |
786 | 45 | bool is_dyn | 45 | bool is_dyn, |
787 | 46 | ) : CParticle(rad, mass, pos, vel, force, id, is_dyn) | 46 | bool is_acc |
788 | 47 | ) : CParticle(rad, mass, pos, vel, force, id, is_dyn,is_acc) | ||
789 | 47 | { | 48 | { |
790 | 48 | m_quat = Quaternion(1.0,Vec3(0.0,0.0,0.0)); | 49 | m_quat = Quaternion(1.0,Vec3(0.0,0.0,0.0)); |
791 | 49 | m_initquat = m_quat; | 50 | m_initquat = m_quat; |
792 | @@ -53,6 +54,7 @@ | |||
793 | 53 | m_angVel_t = Vec3(0.0,0.0,0.0) ; | 54 | m_angVel_t = Vec3(0.0,0.0,0.0) ; |
794 | 54 | m_moment = Vec3(0.0,0.0,0.0); | 55 | m_moment = Vec3(0.0,0.0,0.0); |
795 | 55 | m_is_dynamic=is_dyn; | 56 | m_is_dynamic=is_dyn; |
796 | 57 | m_is_acc=is_acc; | ||
797 | 56 | } | 58 | } |
798 | 57 | 59 | ||
799 | 58 | CRotParticleVi::CRotParticleVi(const CParticle &particle) : CParticle(particle) | 60 | CRotParticleVi::CRotParticleVi(const CParticle &particle) : CParticle(particle) |
800 | @@ -91,7 +93,7 @@ | |||
801 | 91 | const Vec3& moment, | 93 | const Vec3& moment, |
802 | 92 | const Vec3& angvel, | 94 | const Vec3& angvel, |
803 | 93 | const Vec3& angvel_t | 95 | const Vec3& angvel_t |
805 | 94 | ) :CParticle(rad, mass,pos,vel,force,id,true) | 96 | ) :CParticle(rad, mass,pos,vel,force,id,true,true) |
806 | 95 | { | 97 | { |
807 | 96 | m_circular_shift=Vec3(0.0,0.0,0.0); | 98 | m_circular_shift=Vec3(0.0,0.0,0.0); |
808 | 97 | flag=false; | 99 | flag=false; |
809 | @@ -120,7 +122,7 @@ | |||
810 | 120 | const Vec3& moment, | 122 | const Vec3& moment, |
811 | 121 | const Vec3& angvel, | 123 | const Vec3& angvel, |
812 | 122 | const Vec3& angvel_t | 124 | const Vec3& angvel_t |
814 | 123 | ) :CParticle(rad, mass,pos,oldpos, initpos,vel,force,id,true) | 125 | ) :CParticle(rad, mass,pos,oldpos, initpos,vel,force,id,true,true) |
815 | 124 | { | 126 | { |
816 | 125 | m_circular_shift=Vec3(0.0,0.0,0.0); | 127 | m_circular_shift=Vec3(0.0,0.0,0.0); |
817 | 126 | flag=false; | 128 | flag=false; |
818 | 127 | 129 | ||
819 | === modified file 'Model/RotParticleVi.h' | |||
820 | --- Model/RotParticleVi.h 2017-01-04 08:26:43 +0000 | |||
821 | +++ Model/RotParticleVi.h 2018-11-27 02:58:52 +0000 | |||
822 | @@ -105,6 +105,7 @@ | |||
823 | 105 | double m_inertRot; | 105 | double m_inertRot; |
824 | 106 | double m_div_inertRot; | 106 | double m_div_inertRot; |
825 | 107 | bool m_is_dynamic; | 107 | bool m_is_dynamic; |
826 | 108 | bool m_is_acc; | ||
827 | 108 | 109 | ||
828 | 109 | public: | 110 | public: |
829 | 110 | CRotParticleVi(); | 111 | CRotParticleVi(); |
830 | @@ -116,7 +117,8 @@ | |||
831 | 116 | const Vec3& vel, | 117 | const Vec3& vel, |
832 | 117 | const Vec3& force, | 118 | const Vec3& force, |
833 | 118 | int id, | 119 | int id, |
835 | 119 | bool is_dyn | 120 | bool is_dyn, |
836 | 121 | bool is_acc | ||
837 | 120 | ); | 122 | ); |
838 | 121 | CRotParticleVi( | 123 | CRotParticleVi( |
839 | 122 | double rad, | 124 | double rad, |
840 | 123 | 125 | ||
841 | === modified file 'Model/RotThermParticle.cpp' | |||
842 | --- Model/RotThermParticle.cpp 2017-01-04 08:26:43 +0000 | |||
843 | +++ Model/RotThermParticle.cpp 2018-11-27 02:58:52 +0000 | |||
844 | @@ -52,9 +52,10 @@ | |||
845 | 52 | const Vec3& vel, | 52 | const Vec3& vel, |
846 | 53 | const Vec3& force, | 53 | const Vec3& force, |
847 | 54 | int id, | 54 | int id, |
849 | 55 | bool is_dyn | 55 | bool is_dyn, |
850 | 56 | bool is_acc | ||
851 | 56 | ) : | 57 | ) : |
853 | 57 | CRotParticleVi(rad, mass, pos, vel, force, id, is_dyn), | 58 | CRotParticleVi(rad, mass, pos, vel, force, id, is_dyn, is_acc), |
854 | 58 | CThermParticle(rad) | 59 | CThermParticle(rad) |
855 | 59 | { | 60 | { |
856 | 60 | } | 61 | } |
857 | 61 | 62 | ||
858 | === modified file 'Model/RotThermParticle.h' | |||
859 | --- Model/RotThermParticle.h 2017-01-04 08:26:43 +0000 | |||
860 | +++ Model/RotThermParticle.h 2018-11-27 02:58:52 +0000 | |||
861 | @@ -136,7 +136,8 @@ | |||
862 | 136 | const Vec3& vel, | 136 | const Vec3& vel, |
863 | 137 | const Vec3& force, | 137 | const Vec3& force, |
864 | 138 | int id, | 138 | int id, |
866 | 139 | bool is_dyn | 139 | bool is_dyn, |
867 | 140 | bool is_acc | ||
868 | 140 | ); | 141 | ); |
869 | 141 | 142 | ||
870 | 142 | CRotThermParticle( | 143 | CRotThermParticle( |
871 | 143 | 144 | ||
872 | === modified file 'Parallel/ASubLattice.h' | |||
873 | --- Parallel/ASubLattice.h 2017-09-07 08:07:19 +0000 | |||
874 | +++ Parallel/ASubLattice.h 2018-11-27 02:58:52 +0000 | |||
875 | @@ -131,6 +131,7 @@ | |||
876 | 131 | virtual void setParticleAngularVelocity(){}; | 131 | virtual void setParticleAngularVelocity(){}; |
877 | 132 | virtual void setParticleNonDynamic()=0; | 132 | virtual void setParticleNonDynamic()=0; |
878 | 133 | virtual void setParticleNonRot()=0; | 133 | virtual void setParticleNonRot()=0; |
879 | 134 | virtual void setParticleNonAcc()=0; | ||
880 | 134 | virtual void tagParticleNearestTo()=0; | 135 | virtual void tagParticleNearestTo()=0; |
881 | 135 | virtual void moveSingleNode()=0; | 136 | virtual void moveSingleNode()=0; |
882 | 136 | virtual void moveTaggedNodes()=0; | 137 | virtual void moveTaggedNodes()=0; |
883 | 137 | 138 | ||
884 | === modified file 'Parallel/LatticeMaster.cpp' | |||
885 | --- Parallel/LatticeMaster.cpp 2017-12-11 00:23:07 +0000 | |||
886 | +++ Parallel/LatticeMaster.cpp 2018-11-27 02:58:52 +0000 | |||
887 | @@ -1091,6 +1091,22 @@ | |||
888 | 1091 | } | 1091 | } |
889 | 1092 | 1092 | ||
890 | 1093 | /*! | 1093 | /*! |
891 | 1094 | Set all particles with a given tag to be linear non-dynamic, i.e. switch off velocity updates JM version | ||
892 | 1095 | |||
893 | 1096 | \param tag the tag | ||
894 | 1097 | */ | ||
895 | 1098 | void CLatticeMaster::setParticleNonAcc(int tag) | ||
896 | 1099 | { | ||
897 | 1100 | CMPILCmdBuffer cmd_buffer(m_global_comm,m_global_rank); | ||
898 | 1101 | CVarMPIBuffer buffer(m_global_comm); | ||
899 | 1102 | CMPIBarrier barrier(m_global_comm); | ||
900 | 1103 | |||
901 | 1104 | cmd_buffer.broadcast(CMD_PSETNA); | ||
902 | 1105 | buffer.append(tag); | ||
903 | 1106 | buffer.broadcast(m_global_rank); | ||
904 | 1107 | barrier.wait("setParticleNonAcc"); | ||
905 | 1108 | } | ||
906 | 1109 | /*! | ||
907 | 1094 | Set all particles with a given tag to be linear non-dynamic, i.e. switch off velocity updates | 1110 | Set all particles with a given tag to be linear non-dynamic, i.e. switch off velocity updates |
908 | 1095 | 1111 | ||
909 | 1096 | \param tag the tag | 1112 | \param tag the tag |
910 | 1097 | 1113 | ||
911 | === modified file 'Parallel/LatticeMaster.h' | |||
912 | --- Parallel/LatticeMaster.h 2017-12-11 00:23:07 +0000 | |||
913 | +++ Parallel/LatticeMaster.h 2018-11-27 02:58:52 +0000 | |||
914 | @@ -303,6 +303,7 @@ | |||
915 | 303 | void setParticleNonDynamic(int); | 303 | void setParticleNonDynamic(int); |
916 | 304 | void setParticleNonRot(int); | 304 | void setParticleNonRot(int); |
917 | 305 | void setParticleNonTrans(int); | 305 | void setParticleNonTrans(int); |
918 | 306 | void setParticleNonAcc(int); | ||
919 | 306 | void setParticleVel(int,const Vec3&); | 307 | void setParticleVel(int,const Vec3&); |
920 | 307 | void setParticleAngVel(int,const Vec3&); | 308 | void setParticleAngVel(int,const Vec3&); |
921 | 308 | void setParticleDensity(int tag,int mask,double rho); | 309 | void setParticleDensity(int tag,int mask,double rho); |
922 | 309 | 310 | ||
923 | === modified file 'Parallel/SubLattice.h' | |||
924 | --- Parallel/SubLattice.h 2017-09-07 08:07:19 +0000 | |||
925 | +++ Parallel/SubLattice.h 2018-11-27 02:58:52 +0000 | |||
926 | @@ -226,6 +226,7 @@ | |||
927 | 226 | virtual void setParticleNonDynamic(); | 226 | virtual void setParticleNonDynamic(); |
928 | 227 | virtual void setParticleNonRot(); | 227 | virtual void setParticleNonRot(); |
929 | 228 | virtual void setParticleNonTrans(); | 228 | virtual void setParticleNonTrans(); |
930 | 229 | virtual void setParticleNonAcc(); | ||
931 | 229 | virtual void setParticleDensity(); | 230 | virtual void setParticleDensity(); |
932 | 230 | virtual void setTaggedParticleVel(); | 231 | virtual void setTaggedParticleVel(); |
933 | 231 | virtual void tagParticleNearestTo(); | 232 | virtual void tagParticleNearestTo(); |
934 | 232 | 233 | ||
935 | === modified file 'Parallel/SubLattice.hpp' | |||
936 | --- Parallel/SubLattice.hpp 2017-12-11 00:23:07 +0000 | |||
937 | +++ Parallel/SubLattice.hpp 2018-11-27 02:58:52 +0000 | |||
938 | @@ -293,9 +293,13 @@ | |||
939 | 293 | ysize=max.Y()-min.Y(); | 293 | ysize=max.Y()-min.Y(); |
940 | 294 | if(fabs(ysize/m_nrange-lrint(ysize/m_nrange))>1e-6) | 294 | if(fabs(ysize/m_nrange-lrint(ysize/m_nrange))>1e-6) |
941 | 295 | { | 295 | { |
943 | 296 | console.Critical() << "circular y-dimension doesn't fit range !\n"; | 296 | //JM as per x-dim |
944 | 297 | //console.Critical() << "circular y-dimension doesn't fit range !\n"; | ||
945 | 298 | console.Info() << "Circular y-size incompatible with range, adjusting...\n"; | ||
946 | 299 | m_nrange = ysize/floor(ysize/m_nrange); | ||
947 | 300 | console.Info() << "New range = " << m_nrange << "\n"; | ||
948 | 297 | } | 301 | } |
950 | 298 | ysize+=2.0*m_nrange; // padding on the circular ends | 302 | //ysize+=2.0*m_nrange; // padding on the circular ends |
951 | 299 | } | 303 | } |
952 | 300 | else | 304 | else |
953 | 301 | { | 305 | { |
954 | @@ -308,9 +312,13 @@ | |||
955 | 308 | zsize=max.Z()-min.Z(); | 312 | zsize=max.Z()-min.Z(); |
956 | 309 | if(fabs(zsize/m_nrange-lrint(zsize/m_nrange))>1e-6) | 313 | if(fabs(zsize/m_nrange-lrint(zsize/m_nrange))>1e-6) |
957 | 310 | { | 314 | { |
959 | 311 | console.Critical() << "circular z-dimension doesn't fit range !\n"; | 315 | //JM as per x-dim |
960 | 316 | //console.Critical() << "circular z-dimension doesn't fit range !\n"; | ||
961 | 317 | console.Info() << "Circular z-size incompatible with range, adjusting...\n"; | ||
962 | 318 | m_nrange = zsize/floor(zsize/m_nrange); | ||
963 | 319 | console.Info() << "New range = " << m_nrange << "\n"; | ||
964 | 312 | } | 320 | } |
966 | 313 | zsize+=2.0*m_nrange; // padding on the circular ends | 321 | //zsize+=2.0*m_nrange; // padding on the circular ends |
967 | 314 | } | 322 | } |
968 | 315 | else | 323 | else |
969 | 316 | { | 324 | { |
970 | @@ -2537,6 +2545,22 @@ | |||
971 | 2537 | } | 2545 | } |
972 | 2538 | 2546 | ||
973 | 2539 | /*! | 2547 | /*! |
974 | 2548 | Make tagged particles non-accelerating, i.e. don't change velocity based on forces JM | ||
975 | 2549 | Parameters (tag) are received from master. | ||
976 | 2550 | */ | ||
977 | 2551 | template <class T> | ||
978 | 2552 | void TSubLattice<T>::setParticleNonAcc() | ||
979 | 2553 | { | ||
980 | 2554 | console.Debug() << "TSubLattice<T>::setParticleNonAcc()\n"; | ||
981 | 2555 | CVarMPIBuffer buffer(m_comm); | ||
982 | 2556 | |||
983 | 2557 | buffer.receiveBroadcast(0); // get data from master | ||
984 | 2558 | int tag=buffer.pop_int(); | ||
985 | 2559 | m_ppa->forParticleTag(tag,(void (T::*)())(&T::setNonDynamicAcc)); | ||
986 | 2560 | console.Debug() << "end TSubLattice<T>::setParticleNonAcc()\n"; | ||
987 | 2561 | } | ||
988 | 2562 | |||
989 | 2563 | /*! | ||
990 | 2540 | Make tagged particles lieanr non-dynamic, i.e. don't update linear velocity | 2564 | Make tagged particles lieanr non-dynamic, i.e. don't update linear velocity |
991 | 2541 | Parameters (tag) are received from master. | 2565 | Parameters (tag) are received from master. |
992 | 2542 | */ | 2566 | */ |
993 | 2543 | 2567 | ||
994 | === modified file 'Parallel/SubLatticeControler.cpp' | |||
995 | --- Parallel/SubLatticeControler.cpp 2017-12-11 00:23:07 +0000 | |||
996 | +++ Parallel/SubLatticeControler.cpp 2018-11-27 02:58:52 +0000 | |||
997 | @@ -551,6 +551,7 @@ | |||
998 | 551 | case CMD_PMOVETAGGEDBY : m_lattice->moveTaggedParticlesBy(); break; | 551 | case CMD_PMOVETAGGEDBY : m_lattice->moveTaggedParticlesBy(); break; |
999 | 552 | case CMD_PSETND : m_lattice->setParticleNonDynamic(); break; | 552 | case CMD_PSETND : m_lattice->setParticleNonDynamic(); break; |
1000 | 553 | case CMD_PSETNR : m_lattice->setParticleNonRot(); break; | 553 | case CMD_PSETNR : m_lattice->setParticleNonRot(); break; |
1001 | 554 | case CMD_PSETNA : m_lattice->setParticleNonAcc(); break; | ||
1002 | 554 | case CMD_PVEL : m_lattice->setParticleVelocity(); break; | 555 | case CMD_PVEL : m_lattice->setParticleVelocity(); break; |
1003 | 555 | case CMD_PANGVEL : m_lattice->setParticleAngularVelocity(); break; | 556 | case CMD_PANGVEL : m_lattice->setParticleAngularVelocity(); break; |
1004 | 556 | case CMD_PDENS : m_lattice->setParticleDensity(); break; | 557 | case CMD_PDENS : m_lattice->setParticleDensity(); break; |
1005 | 557 | 558 | ||
1006 | === modified file 'Parallel/sublattice_cmd.h' | |||
1007 | --- Parallel/sublattice_cmd.h 2017-09-07 08:07:19 +0000 | |||
1008 | +++ Parallel/sublattice_cmd.h 2018-11-27 02:58:52 +0000 | |||
1009 | @@ -101,7 +101,7 @@ | |||
1010 | 101 | const int CMD_SETCONSOLEFNAME=1113; | 101 | const int CMD_SETCONSOLEFNAME=1113; |
1011 | 102 | const int CMD_SETCONSOLEBUFF=1114; | 102 | const int CMD_SETCONSOLEBUFF=1114; |
1012 | 103 | const int CMD_SETINTERACTIONPARAMS=1115; | 103 | const int CMD_SETINTERACTIONPARAMS=1115; |
1014 | 104 | 104 | const int CMD_PSETNA = 1116; | |
1015 | 105 | 105 | ||
1016 | 106 | 106 | ||
1017 | 107 | // --------------------------------- | 107 | // --------------------------------- |
1018 | 108 | 108 | ||
1019 | === modified file 'Python/esys/lsm/LsmMpiPy.cpp' | |||
1020 | --- Python/esys/lsm/LsmMpiPy.cpp 2017-12-11 00:49:38 +0000 | |||
1021 | +++ Python/esys/lsm/LsmMpiPy.cpp 2018-11-27 02:58:52 +0000 | |||
1022 | @@ -1134,6 +1134,12 @@ | |||
1023 | 1134 | { | 1134 | { |
1024 | 1135 | getLatticeMaster().setParticleNonTrans(id); | 1135 | getLatticeMaster().setParticleNonTrans(id); |
1025 | 1136 | } | 1136 | } |
1026 | 1137 | |||
1027 | 1138 | //JM non-accelerative flag for fluid coupling | ||
1028 | 1139 | void LsmMpiPy::setParticleNonAcc(int id) | ||
1029 | 1140 | { | ||
1030 | 1141 | getLatticeMaster().setParticleNonAcc(id); | ||
1031 | 1142 | } | ||
1032 | 1137 | 1143 | ||
1033 | 1138 | // --- modifying interaction parameters --- | 1144 | // --- modifying interaction parameters --- |
1034 | 1139 | void LsmMpiPy::setInteractionParameter(const std::string& igname,const std::string& pname,double val) | 1145 | void LsmMpiPy::setInteractionParameter(const std::string& igname,const std::string& pname,double val) |
1035 | @@ -2879,6 +2885,17 @@ | |||
1036 | 2879 | "@type tag: int\n" | 2885 | "@type tag: int\n" |
1037 | 2880 | "@kwarg tag: the tag of the particle." | 2886 | "@kwarg tag: the tag of the particle." |
1038 | 2881 | ) | 2887 | ) |
1039 | 2888 | //JM | ||
1040 | 2889 | .def( | ||
1041 | 2890 | "setParticleNonAccelerating", | ||
1042 | 2891 | &LsmMpiPy::setParticleNonAcc, | ||
1043 | 2892 | (arg("tag")), | ||
1044 | 2893 | "Set the particle with tag C{tag} to be non-accelerating," | ||
1045 | 2894 | " this is to allow for fluid coupled particles to mainain\n" | ||
1046 | 2895 | " a constant velocity e.g. for shear platen tests" | ||
1047 | 2896 | "@type tag: int\n" | ||
1048 | 2897 | "@kwarg tag: the tag of the particle." | ||
1049 | 2898 | ) | ||
1050 | 2882 | .def( | 2899 | .def( |
1051 | 2883 | "addPreTimeStepRunnable", | 2900 | "addPreTimeStepRunnable", |
1052 | 2884 | &LsmMpiPy::addPreTimeStepRunnable, | 2901 | &LsmMpiPy::addPreTimeStepRunnable, |
1053 | 2885 | 2902 | ||
1054 | === modified file 'Python/esys/lsm/LsmMpiPy.h' | |||
1055 | --- Python/esys/lsm/LsmMpiPy.h 2017-12-11 00:23:07 +0000 | |||
1056 | +++ Python/esys/lsm/LsmMpiPy.h 2018-11-27 02:58:52 +0000 | |||
1057 | @@ -205,6 +205,7 @@ | |||
1058 | 205 | void setParticleNonDynamic(int); | 205 | void setParticleNonDynamic(int); |
1059 | 206 | void setParticleNonRot(int); | 206 | void setParticleNonRot(int); |
1060 | 207 | void setParticleNonTrans(int); | 207 | void setParticleNonTrans(int); |
1061 | 208 | void setParticleNonAcc(int); //JM non-accelerating to allow constant velocity in fluid | ||
1062 | 208 | 209 | ||
1063 | 209 | // --- modifying interaction parameters --- | 210 | // --- modifying interaction parameters --- |
1064 | 210 | void setInteractionParameter(const std::string&,const std::string&,double); | 211 | void setInteractionParameter(const std::string&,const std::string&,double); |
1065 | 211 | 212 | ||
1066 | === modified file 'Python/esys/lsm/ParticlePy.cpp' | |||
1067 | --- Python/esys/lsm/ParticlePy.cpp 2017-12-04 00:00:38 +0000 | |||
1068 | +++ Python/esys/lsm/ParticlePy.cpp 2018-11-27 02:58:52 +0000 | |||
1069 | @@ -23,7 +23,7 @@ | |||
1070 | 23 | } | 23 | } |
1071 | 24 | 24 | ||
1072 | 25 | ParticlePy::ParticlePy(int id, const Vec3Py &posn, double radius, double mass) | 25 | ParticlePy::ParticlePy(int id, const Vec3Py &posn, double radius, double mass) |
1074 | 26 | : CParticle(radius, mass, posn, Vec3(), Vec3(), id, true) | 26 | : CParticle(radius, mass, posn, Vec3(), Vec3(), id, true,true) |
1075 | 27 | { | 27 | { |
1076 | 28 | } | 28 | } |
1077 | 29 | 29 | ||
1078 | 30 | 30 | ||
1079 | === modified file 'Python/esys/lsm/RotParticlePy.cpp' | |||
1080 | --- Python/esys/lsm/RotParticlePy.cpp 2017-01-04 08:26:43 +0000 | |||
1081 | +++ Python/esys/lsm/RotParticlePy.cpp 2018-11-27 02:58:52 +0000 | |||
1082 | @@ -34,7 +34,7 @@ | |||
1083 | 34 | 34 | ||
1084 | 35 | // dynamic & rotational default to true | 35 | // dynamic & rotational default to true |
1085 | 36 | RotParticlePy::RotParticlePy(int id, const Vec3Py &posn, double radius, double mass) | 36 | RotParticlePy::RotParticlePy(int id, const Vec3Py &posn, double radius, double mass) |
1087 | 37 | : CRotParticle(radius, mass, posn, Vec3(), Vec3(), id,true,true) | 37 | : CRotParticle(radius, mass, posn, Vec3(), Vec3(), id,true,true,true) |
1088 | 38 | { | 38 | { |
1089 | 39 | } | 39 | } |
1090 | 40 | 40 | ||
1091 | 41 | 41 | ||
1092 | === modified file 'Python/esys/lsm/RotParticleViPy.cpp' | |||
1093 | --- Python/esys/lsm/RotParticleViPy.cpp 2017-01-04 08:26:43 +0000 | |||
1094 | +++ Python/esys/lsm/RotParticleViPy.cpp 2018-11-27 02:58:52 +0000 | |||
1095 | @@ -24,7 +24,7 @@ | |||
1096 | 24 | } | 24 | } |
1097 | 25 | 25 | ||
1098 | 26 | RotParticleViPy::RotParticleViPy(int id, const Vec3Py &posn, double radius, double mass) | 26 | RotParticleViPy::RotParticleViPy(int id, const Vec3Py &posn, double radius, double mass) |
1100 | 27 | : CRotParticleVi(radius, mass, posn, Vec3(), Vec3(), id, true) | 27 | : CRotParticleVi(radius, mass, posn, Vec3(), Vec3(), id, true,true) |
1101 | 28 | { | 28 | { |
1102 | 29 | } | 29 | } |
1103 | 30 | 30 | ||
1104 | 31 | 31 | ||
1105 | === modified file 'Python/esys/lsm/RotThermalParticlePy.cpp' | |||
1106 | --- Python/esys/lsm/RotThermalParticlePy.cpp 2017-01-04 08:26:43 +0000 | |||
1107 | +++ Python/esys/lsm/RotThermalParticlePy.cpp 2018-11-27 02:58:52 +0000 | |||
1108 | @@ -24,7 +24,7 @@ | |||
1109 | 24 | } | 24 | } |
1110 | 25 | 25 | ||
1111 | 26 | RotThermalParticlePy::RotThermalParticlePy(int id, const Vec3Py &posn, double radius, double mass) | 26 | RotThermalParticlePy::RotThermalParticlePy(int id, const Vec3Py &posn, double radius, double mass) |
1113 | 27 | : CRotThermParticle(radius, mass, posn, Vec3(), Vec3(), id, true) | 27 | : CRotThermParticle(radius, mass, posn, Vec3(), Vec3(), id, true, true) |
1114 | 28 | { | 28 | { |
1115 | 29 | } | 29 | } |
1116 | 30 | 30 | ||
1117 | 31 | 31 | ||
1118 | === modified file 'Tools/dump2vtk/frame_vtk.cpp' | |||
1119 | --- Tools/dump2vtk/frame_vtk.cpp 2017-09-07 08:07:19 +0000 | |||
1120 | +++ Tools/dump2vtk/frame_vtk.cpp 2018-11-27 02:58:52 +0000 | |||
1121 | @@ -345,6 +345,16 @@ | |||
1122 | 345 | vtkfile << (iter->second).angvel << endl;; | 345 | vtkfile << (iter->second).angvel << endl;; |
1123 | 346 | } | 346 | } |
1124 | 347 | vtkfile << "</DataArray>\n"; | 347 | vtkfile << "</DataArray>\n"; |
1125 | 348 | |||
1126 | 349 | // force - JM addition | ||
1127 | 350 | vtkfile << "<DataArray type=\"Float64\" Name=\"force\" NumberOfComponents=\"3\" format=\"ascii\">\n"; | ||
1128 | 351 | for(map<int,r_part>::iterator iter=datamap.begin(); | ||
1129 | 352 | iter!=datamap.end(); | ||
1130 | 353 | iter++){ | ||
1131 | 354 | vtkfile << (iter->second).force << endl;; | ||
1132 | 355 | } | ||
1133 | 356 | vtkfile << "</DataArray>\n"; | ||
1134 | 357 | |||
1135 | 348 | // displacement | 358 | // displacement |
1136 | 349 | vtkfile << "<DataArray type=\"Float64\" Name=\"displacement\" NumberOfComponents=\"3\" format=\"ascii\">\n"; | 359 | vtkfile << "<DataArray type=\"Float64\" Name=\"displacement\" NumberOfComponents=\"3\" format=\"ascii\">\n"; |
1137 | 350 | for(map<int,r_part>::iterator iter=datamap.begin(); | 360 | for(map<int,r_part>::iterator iter=datamap.begin(); |
1138 | @@ -440,6 +450,16 @@ | |||
1139 | 440 | vtkfile << (iter->second).vel << endl;; | 450 | vtkfile << (iter->second).vel << endl;; |
1140 | 441 | } | 451 | } |
1141 | 442 | vtkfile << "</DataArray>\n"; | 452 | vtkfile << "</DataArray>\n"; |
1142 | 453 | |||
1143 | 454 | // force - JM addition | ||
1144 | 455 | vtkfile << "<DataArray type=\"Float64\" Name=\"force\" NumberOfComponents=\"3\" format=\"ascii\">\n"; | ||
1145 | 456 | for(map<int,nr_part>::iterator iter=datamap.begin(); | ||
1146 | 457 | iter!=datamap.end(); | ||
1147 | 458 | iter++){ | ||
1148 | 459 | vtkfile << (iter->second).force << endl;; | ||
1149 | 460 | } | ||
1150 | 461 | vtkfile << "</DataArray>\n"; | ||
1151 | 462 | |||
1152 | 443 | // displacement | 463 | // displacement |
1153 | 444 | vtkfile << "<DataArray type=\"Float64\" Name=\"displacement\" NumberOfComponents=\"3\" format=\"ascii\">\n"; | 464 | vtkfile << "<DataArray type=\"Float64\" Name=\"displacement\" NumberOfComponents=\"3\" format=\"ascii\">\n"; |
1154 | 445 | for(map<int,nr_part>::iterator iter=datamap.begin(); | 465 | for(map<int,nr_part>::iterator iter=datamap.begin(); |
1155 | 446 | 466 | ||
1156 | === modified file 'ppa/src/pp_array.h' | |||
1157 | --- ppa/src/pp_array.h 2017-12-11 00:23:07 +0000 | |||
1158 | +++ ppa/src/pp_array.h 2018-11-27 02:58:52 +0000 | |||
1159 | @@ -84,7 +84,7 @@ | |||
1160 | 84 | NeighborTable<T>* m_nt; | 84 | NeighborTable<T>* m_nt; |
1161 | 85 | Vec3 m_minpos,m_maxpos; //!< local minimum and maximum positions | 85 | Vec3 m_minpos,m_maxpos; //!< local minimum and maximum positions |
1162 | 86 | double m_xshift,m_yshift,m_zshift; //!< circular shift values | 86 | double m_xshift,m_yshift,m_zshift; //!< circular shift values |
1164 | 87 | bool m_circ_edge_x_up,m_circ_edge_x_down; //!< circular edge flags | 87 | bool m_circ_edge_x_up,m_circ_edge_x_down,m_circ_edge_y_up,m_circ_edge_y_down,m_circ_edge_z_up,m_circ_edge_z_down; //!< circular edge flags JM addition for y/z |
1165 | 88 | static const int m_exchg_tag; | 88 | static const int m_exchg_tag; |
1166 | 89 | 89 | ||
1167 | 90 | // helper fnc | 90 | // helper fnc |
1168 | 91 | 91 | ||
1169 | === modified file 'ppa/src/pp_array.hpp' | |||
1170 | --- ppa/src/pp_array.hpp 2017-01-04 08:26:43 +0000 | |||
1171 | +++ ppa/src/pp_array.hpp 2018-11-27 02:58:52 +0000 | |||
1172 | @@ -64,6 +64,12 @@ | |||
1173 | 64 | //- set x-edges to non-circular | 64 | //- set x-edges to non-circular |
1174 | 65 | m_circ_edge_x_down=false; | 65 | m_circ_edge_x_down=false; |
1175 | 66 | m_circ_edge_x_up=false; | 66 | m_circ_edge_x_up=false; |
1176 | 67 | //JM - set y-edges to non-circular | ||
1177 | 68 | m_circ_edge_y_down=false; | ||
1178 | 69 | m_circ_edge_y_up=false; | ||
1179 | 70 | //JM - set z-edges to non-circular | ||
1180 | 71 | m_circ_edge_z_down=false; | ||
1181 | 72 | m_circ_edge_z_up=false; | ||
1182 | 67 | //- get own process coords | 73 | //- get own process coords |
1183 | 68 | vector<int> pcoords=m_comm.get_coords(); | 74 | vector<int> pcoords=m_comm.get_coords(); |
1184 | 69 | //- initialize ntable | 75 | //- initialize ntable |
1185 | @@ -159,6 +165,12 @@ | |||
1186 | 159 | // setup circular edges | 165 | // setup circular edges |
1187 | 160 | m_circ_edge_x_down=(circ[0] && (pcoords[0]==0)) ? true : false ; | 166 | m_circ_edge_x_down=(circ[0] && (pcoords[0]==0)) ? true : false ; |
1188 | 161 | m_circ_edge_x_up=(circ[0] && (pcoords[0]==m_comm.get_dim(0)-1)) ? true : false ; | 167 | m_circ_edge_x_up=(circ[0] && (pcoords[0]==m_comm.get_dim(0)-1)) ? true : false ; |
1189 | 168 | //JM setup circular edges | ||
1190 | 169 | m_circ_edge_y_down=(circ[1] && (pcoords[1]==0)) ? true : false ; | ||
1191 | 170 | m_circ_edge_y_up=(circ[1] && (pcoords[1]==m_comm.get_dim(1)-1)) ? true : false ; | ||
1192 | 171 | //JM setup circular edges | ||
1193 | 172 | m_circ_edge_z_down=(circ[2] && (pcoords[2]==0)) ? true : false ; | ||
1194 | 173 | m_circ_edge_z_up=(circ[2] && (pcoords[2]==m_comm.get_dim(2)-1)) ? true : false ; | ||
1195 | 162 | } | 174 | } |
1196 | 163 | // init time stamp | 175 | // init time stamp |
1197 | 164 | m_timestamp=0; | 176 | m_timestamp=0; |
1198 | @@ -325,13 +337,46 @@ | |||
1199 | 325 | // define tranfer slabs | 337 | // define tranfer slabs |
1200 | 326 | up_slab=m_nt->xz_slab(m_nt->ysize()-2); | 338 | up_slab=m_nt->xz_slab(m_nt->ysize()-2); |
1201 | 327 | down_slab=m_nt->xz_slab(1); | 339 | down_slab=m_nt->xz_slab(1); |
1204 | 328 | if(!circ_edge){ // normal boundary | 340 | |
1205 | 329 | // upstream | 341 | // upstream |
1206 | 342 | if(m_circ_edge_y_up){ // circ. bdry | ||
1207 | 343 | // cout << "circular shift, node " << m_comm.rank() << " y-dim, up slab size " << up_slab.size() << endl; | ||
1208 | 344 | // copy particles from transfer slab into buffer | ||
1209 | 345 | vector<T> buffer; | ||
1210 | 346 | for(typename NTSlab<T>::iterator iter=up_slab.begin(); | ||
1211 | 347 | iter!=up_slab.end(); | ||
1212 | 348 | iter++){ | ||
1213 | 349 | buffer.push_back(*iter); | ||
1214 | 350 | } | ||
1215 | 351 | // shift particles in buffer by circular shift value | ||
1216 | 352 | for(typename vector<T>::iterator iter=buffer.begin(); | ||
1217 | 353 | iter!=buffer.end(); | ||
1218 | 354 | iter++){ | ||
1219 | 355 | iter->setCircular(Vec3(0.0,-1.0*m_yshift,0.0)); | ||
1220 | 356 | } | ||
1221 | 357 | m_comm.shift_cont_packed(buffer,*m_nt,1,1,m_exchg_tag); | ||
1222 | 358 | } else { | ||
1223 | 330 | m_comm.shift_cont_packed(up_slab,*m_nt,1,1,m_exchg_tag); | 359 | m_comm.shift_cont_packed(up_slab,*m_nt,1,1,m_exchg_tag); |
1225 | 331 | // downstream | 360 | } |
1226 | 361 | // downstream | ||
1227 | 362 | if(m_circ_edge_y_down){// circ. bdry | ||
1228 | 363 | // cout << "circular shift , node " << m_comm.rank() << " y-dim, down slab size " << down_slab.size() << endl; | ||
1229 | 364 | // copy particles from transfer slab into buffer | ||
1230 | 365 | vector<T> buffer; | ||
1231 | 366 | for(typename NTSlab<T>::iterator iter=down_slab.begin(); | ||
1232 | 367 | iter!=down_slab.end(); | ||
1233 | 368 | iter++){ | ||
1234 | 369 | buffer.push_back(*iter); | ||
1235 | 370 | } | ||
1236 | 371 | // shift particles in buffer by circular shift value | ||
1237 | 372 | for(typename vector<T>::iterator iter=buffer.begin(); | ||
1238 | 373 | iter!=buffer.end(); | ||
1239 | 374 | iter++){ | ||
1240 | 375 | iter->setCircular(Vec3(0.0,m_yshift,0.0)); | ||
1241 | 376 | } | ||
1242 | 377 | m_comm.shift_cont_packed(buffer,*m_nt,1,-1,m_exchg_tag); | ||
1243 | 378 | } else { | ||
1244 | 332 | m_comm.shift_cont_packed(down_slab,*m_nt,1,-1,m_exchg_tag); | 379 | m_comm.shift_cont_packed(down_slab,*m_nt,1,-1,m_exchg_tag); |
1245 | 333 | } else { // circular edge -> buffer & shift received particles | ||
1246 | 334 | cout << "circular y shift not implemented" << endl; | ||
1247 | 335 | } | 380 | } |
1248 | 336 | } | 381 | } |
1249 | 337 | // z-dir | 382 | // z-dir |
1250 | @@ -346,13 +391,46 @@ | |||
1251 | 346 | // define tranfer slabs | 391 | // define tranfer slabs |
1252 | 347 | up_slab=m_nt->xy_slab(m_nt->zsize()-2); | 392 | up_slab=m_nt->xy_slab(m_nt->zsize()-2); |
1253 | 348 | down_slab=m_nt->xy_slab(1); | 393 | down_slab=m_nt->xy_slab(1); |
1256 | 349 | if(!circ_edge){ // normal boundary | 394 | |
1257 | 350 | // upstream | 395 | // upstream |
1258 | 396 | if(m_circ_edge_z_up){ // circ. bdry | ||
1259 | 397 | // cout << "circular shift, node " << m_comm.rank() << " z-dim, up slab size " << up_slab.size() << endl; | ||
1260 | 398 | // copy particles from transfer slab into buffer | ||
1261 | 399 | vector<T> buffer; | ||
1262 | 400 | for(typename NTSlab<T>::iterator iter=up_slab.begin(); | ||
1263 | 401 | iter!=up_slab.end(); | ||
1264 | 402 | iter++){ | ||
1265 | 403 | buffer.push_back(*iter); | ||
1266 | 404 | } | ||
1267 | 405 | // shift particles in buffer by circular shift value | ||
1268 | 406 | for(typename vector<T>::iterator iter=buffer.begin(); | ||
1269 | 407 | iter!=buffer.end(); | ||
1270 | 408 | iter++){ | ||
1271 | 409 | iter->setCircular(Vec3(0.0,0.0,-1.0*m_zshift)); | ||
1272 | 410 | } | ||
1273 | 411 | m_comm.shift_cont_packed(buffer,*m_nt,2,1,m_exchg_tag); | ||
1274 | 412 | } else { | ||
1275 | 351 | m_comm.shift_cont_packed(up_slab,*m_nt,2,1,m_exchg_tag); | 413 | m_comm.shift_cont_packed(up_slab,*m_nt,2,1,m_exchg_tag); |
1277 | 352 | // downstream | 414 | } |
1278 | 415 | // downstream | ||
1279 | 416 | if(m_circ_edge_z_down){// circ. bdry | ||
1280 | 417 | // cout << "circular shift , node " << m_comm.rank() << " z-dim, down slab size " << down_slab.size() << endl; | ||
1281 | 418 | // copy particles from transfer slab into buffer | ||
1282 | 419 | vector<T> buffer; | ||
1283 | 420 | for(typename NTSlab<T>::iterator iter=down_slab.begin(); | ||
1284 | 421 | iter!=down_slab.end(); | ||
1285 | 422 | iter++){ | ||
1286 | 423 | buffer.push_back(*iter); | ||
1287 | 424 | } | ||
1288 | 425 | // shift particles in buffer by circular shift value | ||
1289 | 426 | for(typename vector<T>::iterator iter=buffer.begin(); | ||
1290 | 427 | iter!=buffer.end(); | ||
1291 | 428 | iter++){ | ||
1292 | 429 | iter->setCircular(Vec3(0.0,0.0,m_zshift)); | ||
1293 | 430 | } | ||
1294 | 431 | m_comm.shift_cont_packed(buffer,*m_nt,2,-1,m_exchg_tag); | ||
1295 | 432 | } else { | ||
1296 | 353 | m_comm.shift_cont_packed(down_slab,*m_nt,2,-1,m_exchg_tag); | 433 | m_comm.shift_cont_packed(down_slab,*m_nt,2,-1,m_exchg_tag); |
1297 | 354 | } else { // circular edge -> buffer & shift received particles | ||
1298 | 355 | cout << "circular x shift not implemented" << endl; | ||
1299 | 356 | } | 434 | } |
1300 | 357 | } | 435 | } |
1301 | 358 | // update timestamp | 436 | // update timestamp |
1302 | @@ -424,12 +502,14 @@ | |||
1303 | 424 | send_data.push_back(((*iter).*rdf)()); | 502 | send_data.push_back(((*iter).*rdf)()); |
1304 | 425 | // cout << "put exchange values from particle " << iter->getID() << " into buffer" << endl; | 503 | // cout << "put exchange values from particle " << iter->getID() << " into buffer" << endl; |
1305 | 426 | } | 504 | } |
1306 | 505 | |||
1307 | 427 | // exchange | 506 | // exchange |
1308 | 428 | m_comm.shift_cont_packed(send_data,recv_data,dir,dist,m_exchg_tag); | 507 | m_comm.shift_cont_packed(send_data,recv_data,dir,dist,m_exchg_tag); |
1310 | 429 | 508 | ||
1311 | 430 | // apply received data | 509 | // apply received data |
1312 | 431 | // check if sizes are correct | 510 | // check if sizes are correct |
1313 | 432 | if(recv_data.size()==recv_slab.size()){ | 511 | if(recv_data.size()==recv_slab.size()){ |
1314 | 512 | |||
1315 | 433 | int count=0; | 513 | int count=0; |
1316 | 434 | for(typename NTSlab<T>::iterator iter=recv_slab.begin(); | 514 | for(typename NTSlab<T>::iterator iter=recv_slab.begin(); |
1317 | 435 | iter!=recv_slab.end(); | 515 | iter!=recv_slab.end(); |
1318 | @@ -438,6 +518,7 @@ | |||
1319 | 438 | // cout << "wrote exchange value to particle " << iter->getID() << endl; | 518 | // cout << "wrote exchange value to particle " << iter->getID() << endl; |
1320 | 439 | count++; | 519 | count++; |
1321 | 440 | } | 520 | } |
1322 | 521 | |||
1323 | 441 | }else{ | 522 | }else{ |
1324 | 442 | cerr << "rank = " << m_comm.rank() << ":ParallelParticleArray<T>::exchange_single ERROR: size mismatch in received data, recv_data.size()!=recv_slab.size() - (" << recv_data.size() << "!=" << recv_slab.size() << "). dir = " << dir << ", dist = " << dist << endl; | 523 | cerr << "rank = " << m_comm.rank() << ":ParallelParticleArray<T>::exchange_single ERROR: size mismatch in received data, recv_data.size()!=recv_slab.size() - (" << recv_data.size() << "!=" << recv_slab.size() << "). dir = " << dir << ", dist = " << dist << endl; |
1325 | 443 | } | 524 | } |
1326 | 444 | 525 | ||
1327 | === modified file 'tml/comm/cart_comm.hpp' | |||
1328 | --- tml/comm/cart_comm.hpp 2017-01-04 08:26:43 +0000 | |||
1329 | +++ tml/comm/cart_comm.hpp 2018-11-27 02:58:52 +0000 | |||
1330 | @@ -129,7 +129,7 @@ | |||
1331 | 129 | void TML_CartComm::shift_cont_packed(T send_data,P& recv_data,int dir,int dist,int tag) | 129 | void TML_CartComm::shift_cont_packed(T send_data,P& recv_data,int dir,int dist,int tag) |
1332 | 130 | { | 130 | { |
1333 | 131 | int source,dest; | 131 | int source,dest; |
1335 | 132 | 132 | ||
1336 | 133 | if(dir<m_ndims){ | 133 | if(dir<m_ndims){ |
1337 | 134 | MPI_Cart_shift(m_comm,dir,dist,&source,&dest); | 134 | MPI_Cart_shift(m_comm,dir,dist,&source,&dest); |
1338 | 135 | sendrecv_cont_packed(send_data,recv_data,dest,source,false,tag); | 135 | sendrecv_cont_packed(send_data,recv_data,dest,source,false,tag); |
1339 | 136 | 136 | ||
1340 | === modified file 'tml/comm/comm.hpp' | |||
1341 | --- tml/comm/comm.hpp 2017-01-04 08:26:43 +0000 | |||
1342 | +++ tml/comm/comm.hpp 2018-11-27 02:58:52 +0000 | |||
1343 | @@ -389,7 +389,7 @@ | |||
1344 | 389 | 389 | ||
1345 | 390 | //send/receive data | 390 | //send/receive data |
1346 | 391 | sendrecv_array(send_msg->buffer(),send_msg_size,recv_msg->buffer(),recv_msg_size,dest,source,tag+1024); | 391 | sendrecv_array(send_msg->buffer(),send_msg_size,recv_msg->buffer(),recv_msg_size,dest,source,tag+1024); |
1348 | 392 | 392 | ||
1349 | 393 | if(source!=MPI_PROC_NULL){ // if the source exists | 393 | if(source!=MPI_PROC_NULL){ // if the source exists |
1350 | 394 | // extract nuber of items | 394 | // extract nuber of items |
1351 | 395 | recv_nb_data=recv_msg->pop_int(); | 395 | recv_nb_data=recv_msg->pop_int(); |