| 6 | 
  | 
 * redistribute this software in source and binary code form, provided | 
| 7 | 
  | 
 * that the following conditions are met: | 
| 8 | 
  | 
 * | 
| 9 | 
< | 
 * 1. Acknowledgement of the program authors must be made in any | 
| 10 | 
< | 
 *    publication of scientific results based in part on use of the | 
| 11 | 
< | 
 *    program.  An acceptable form of acknowledgement is citation of | 
| 12 | 
< | 
 *    the article in which the program was described (Matthew | 
| 13 | 
< | 
 *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher | 
| 14 | 
< | 
 *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented | 
| 15 | 
< | 
 *    Parallel Simulation Engine for Molecular Dynamics," | 
| 16 | 
< | 
 *    J. Comput. Chem. 26, pp. 252-271 (2005)) | 
| 17 | 
< | 
 * | 
| 18 | 
< | 
 * 2. Redistributions of source code must retain the above copyright | 
| 9 | 
> | 
 * 1. Redistributions of source code must retain the above copyright | 
| 10 | 
  | 
 *    notice, this list of conditions and the following disclaimer. | 
| 11 | 
  | 
 * | 
| 12 | 
< | 
 * 3. Redistributions in binary form must reproduce the above copyright | 
| 12 | 
> | 
 * 2. Redistributions in binary form must reproduce the above copyright | 
| 13 | 
  | 
 *    notice, this list of conditions and the following disclaimer in the | 
| 14 | 
  | 
 *    documentation and/or other materials provided with the | 
| 15 | 
  | 
 *    distribution. | 
| 28 | 
  | 
 * arising out of the use of or inability to use software, even if the | 
| 29 | 
  | 
 * University of Notre Dame has been advised of the possibility of | 
| 30 | 
  | 
 * such damages. | 
| 31 | 
+ | 
 * | 
| 32 | 
+ | 
 * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your | 
| 33 | 
+ | 
 * research, please cite the appropriate papers when you publish your | 
| 34 | 
+ | 
 * work.  Good starting points are: | 
| 35 | 
+ | 
 *                                                                       | 
| 36 | 
+ | 
 * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).              | 
| 37 | 
+ | 
 * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).           | 
| 38 | 
+ | 
 * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).           | 
| 39 | 
+ | 
 * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010). | 
| 40 | 
+ | 
 * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). | 
| 41 | 
  | 
 */ | 
| 42 | 
  | 
  | 
| 43 | 
  | 
/** | 
| 44 | 
  | 
 * @file DataStorage.cpp | 
| 45 | 
  | 
 * @author tlin | 
| 46 | 
  | 
 * @date 10/26/2004 | 
| 46 | 
– | 
 * @time 11:56am | 
| 47 | 
  | 
 * @version 1.0 | 
| 48 | 
  | 
 */ | 
| 49 | 
  | 
 | 
| 50 | 
  | 
#include "brains/DataStorage.hpp" | 
| 51 | 
+ | 
using namespace std; | 
| 52 | 
+ | 
namespace OpenMD { | 
| 53 | 
  | 
 | 
| 52 | 
– | 
namespace oopse { | 
| 53 | 
– | 
 | 
| 54 | 
  | 
  DataStorage::DataStorage() : size_(0), storageLayout_(0){ | 
| 55 | 
  | 
 | 
| 56 | 
  | 
  } | 
| 64 | 
  | 
 | 
| 65 | 
  | 
    if (storageLayout_ & dslPosition && position.size() != size_) { | 
| 66 | 
  | 
      //error | 
| 67 | 
< | 
      std::cerr << "size does not match"<< std::endl; | 
| 67 | 
> | 
      cerr << "size does not match"<< endl; | 
| 68 | 
  | 
    } | 
| 69 | 
  | 
 | 
| 70 | 
  | 
    if (storageLayout_ & dslVelocity && velocity.size() != size_) { | 
| 71 | 
  | 
      //error | 
| 72 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 72 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 73 | 
  | 
    } | 
| 74 | 
  | 
 | 
| 75 | 
+ | 
    if (storageLayout_ & dslForce && force.size() != size_) { | 
| 76 | 
+ | 
      //error | 
| 77 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 78 | 
+ | 
    } | 
| 79 | 
+ | 
 | 
| 80 | 
  | 
    if (storageLayout_ & dslAmat && aMat.size() != size_) { | 
| 81 | 
  | 
      //error | 
| 82 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 82 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 83 | 
  | 
    } | 
| 84 | 
  | 
 | 
| 85 | 
  | 
    if (storageLayout_ & dslAngularMomentum && angularMomentum.size() != size_) { | 
| 86 | 
  | 
      //error | 
| 87 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 87 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 88 | 
  | 
    } | 
| 89 | 
  | 
 | 
| 90 | 
< | 
    if (storageLayout_ & dslElectroFrame && electroFrame.size() != size_) { | 
| 90 | 
> | 
    if (storageLayout_ & dslTorque && torque.size() != size_) { | 
| 91 | 
  | 
      //error | 
| 92 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 92 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 93 | 
  | 
    } | 
| 94 | 
  | 
 | 
| 95 | 
< | 
    if (storageLayout_ & dslZAngle && zAngle.size() != size_) { | 
| 95 | 
> | 
    if (storageLayout_ & dslParticlePot && particlePot.size() != size_) { | 
| 96 | 
  | 
      //error | 
| 97 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 97 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 98 | 
  | 
    } | 
| 99 | 
  | 
 | 
| 100 | 
< | 
    if (storageLayout_ & dslForce && force.size() != size_) { | 
| 100 | 
> | 
    if (storageLayout_ & dslDensity && density.size() != size_) { | 
| 101 | 
  | 
      //error | 
| 102 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 102 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 103 | 
  | 
    } | 
| 104 | 
  | 
 | 
| 105 | 
< | 
    if (storageLayout_ & dslTorque && torque.size() != size_) { | 
| 105 | 
> | 
    if (storageLayout_ & dslFunctional && functional.size() != size_) { | 
| 106 | 
  | 
      //error | 
| 107 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 107 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 108 | 
  | 
    } | 
| 109 | 
< | 
    if (storageLayout_ & dslParticlePot && particlePot.size() != size_) { | 
| 109 | 
> | 
 | 
| 110 | 
> | 
    if (storageLayout_ & dslFunctionalDerivative && functionalDerivative.size() != size_) { | 
| 111 | 
  | 
      //error | 
| 112 | 
< | 
      std::cerr << "size does not match"<< std::endl;         | 
| 112 | 
> | 
      cerr << "size does not match"<< endl;         | 
| 113 | 
  | 
    } | 
| 114 | 
+ | 
 | 
| 115 | 
+ | 
    if (storageLayout_ & dslDipole && dipole.size() != size_) { | 
| 116 | 
+ | 
      //error | 
| 117 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 118 | 
+ | 
    } | 
| 119 | 
+ | 
 | 
| 120 | 
+ | 
    if (storageLayout_ & dslQuadrupole && quadrupole.size() != size_) { | 
| 121 | 
+ | 
      //error | 
| 122 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 123 | 
+ | 
    } | 
| 124 | 
+ | 
 | 
| 125 | 
+ | 
    if (storageLayout_ & dslElectricField && electricField.size() != size_) { | 
| 126 | 
+ | 
      //error | 
| 127 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 128 | 
+ | 
    } | 
| 129 | 
+ | 
 | 
| 130 | 
+ | 
    if (storageLayout_ & dslSkippedCharge && skippedCharge.size() != size_) { | 
| 131 | 
+ | 
      //error | 
| 132 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 133 | 
+ | 
    } | 
| 134 | 
+ | 
 | 
| 135 | 
+ | 
    if (storageLayout_ & dslFlucQPosition && flucQPos.size() != size_) { | 
| 136 | 
+ | 
      //error | 
| 137 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 138 | 
+ | 
    } | 
| 139 | 
+ | 
 | 
| 140 | 
+ | 
    if (storageLayout_ & dslFlucQVelocity && flucQVel.size() != size_) { | 
| 141 | 
+ | 
      //error | 
| 142 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 143 | 
+ | 
    } | 
| 144 | 
+ | 
 | 
| 145 | 
+ | 
    if (storageLayout_ & dslFlucQForce && flucQFrc.size() != size_) { | 
| 146 | 
+ | 
      //error | 
| 147 | 
+ | 
      cerr << "size does not match"<< endl;         | 
| 148 | 
+ | 
    } | 
| 149 | 
  | 
     | 
| 150 | 
  | 
    return size_; | 
| 151 | 
  | 
 | 
| 161 | 
  | 
      internalResize(velocity, newSize); | 
| 162 | 
  | 
    } | 
| 163 | 
  | 
 | 
| 164 | 
+ | 
    if (storageLayout_ & dslForce) { | 
| 165 | 
+ | 
      internalResize(force, newSize); | 
| 166 | 
+ | 
    } | 
| 167 | 
+ | 
 | 
| 168 | 
  | 
    if (storageLayout_ & dslAmat) { | 
| 169 | 
  | 
      internalResize(aMat, newSize); | 
| 170 | 
  | 
    } | 
| 172 | 
  | 
    if (storageLayout_ & dslAngularMomentum) { | 
| 173 | 
  | 
      internalResize(angularMomentum, newSize); | 
| 174 | 
  | 
    } | 
| 175 | 
+ | 
     | 
| 176 | 
+ | 
    if (storageLayout_ & dslTorque) { | 
| 177 | 
+ | 
      internalResize(torque, newSize); | 
| 178 | 
+ | 
    } | 
| 179 | 
  | 
 | 
| 180 | 
< | 
    if (storageLayout_ & dslElectroFrame) { | 
| 181 | 
< | 
      internalResize(electroFrame, newSize); | 
| 180 | 
> | 
    if (storageLayout_ & dslParticlePot) { | 
| 181 | 
> | 
      internalResize(particlePot, newSize); | 
| 182 | 
  | 
    } | 
| 183 | 
< | 
     | 
| 184 | 
< | 
    if (storageLayout_ & dslZAngle) { | 
| 185 | 
< | 
      internalResize(zAngle, newSize); | 
| 183 | 
> | 
 | 
| 184 | 
> | 
    if (storageLayout_ & dslDensity) { | 
| 185 | 
> | 
      internalResize(density, newSize); | 
| 186 | 
  | 
    } | 
| 187 | 
  | 
 | 
| 188 | 
< | 
    if (storageLayout_ & dslForce) { | 
| 189 | 
< | 
      internalResize(force, newSize); | 
| 188 | 
> | 
    if (storageLayout_ & dslFunctional) { | 
| 189 | 
> | 
      internalResize(functional, newSize); | 
| 190 | 
  | 
    } | 
| 191 | 
  | 
 | 
| 192 | 
< | 
    if (storageLayout_ & dslTorque) { | 
| 193 | 
< | 
      internalResize(torque, newSize); | 
| 192 | 
> | 
    if (storageLayout_ & dslFunctionalDerivative) { | 
| 193 | 
> | 
      internalResize(functionalDerivative, newSize); | 
| 194 | 
  | 
    } | 
| 195 | 
  | 
 | 
| 196 | 
< | 
    if (storageLayout_ & dslParticlePot) { | 
| 197 | 
< | 
      internalResize(particlePot, newSize); | 
| 196 | 
> | 
    if (storageLayout_ & dslDipole) { | 
| 197 | 
> | 
      internalResize(dipole, newSize); | 
| 198 | 
  | 
    } | 
| 199 | 
  | 
 | 
| 200 | 
+ | 
    if (storageLayout_ & dslQuadrupole) { | 
| 201 | 
+ | 
      internalResize(quadrupole, newSize); | 
| 202 | 
+ | 
    } | 
| 203 | 
+ | 
 | 
| 204 | 
+ | 
    if (storageLayout_ & dslElectricField) { | 
| 205 | 
+ | 
      internalResize(electricField, newSize); | 
| 206 | 
+ | 
    } | 
| 207 | 
+ | 
 | 
| 208 | 
+ | 
    if (storageLayout_ & dslSkippedCharge) { | 
| 209 | 
+ | 
      internalResize(skippedCharge, newSize); | 
| 210 | 
+ | 
    } | 
| 211 | 
+ | 
 | 
| 212 | 
+ | 
    if (storageLayout_ & dslFlucQPosition) { | 
| 213 | 
+ | 
      internalResize(flucQPos, newSize); | 
| 214 | 
+ | 
    } | 
| 215 | 
+ | 
 | 
| 216 | 
+ | 
    if (storageLayout_ & dslFlucQVelocity) { | 
| 217 | 
+ | 
      internalResize(flucQVel, newSize); | 
| 218 | 
+ | 
    } | 
| 219 | 
+ | 
 | 
| 220 | 
+ | 
    if (storageLayout_ & dslFlucQForce) { | 
| 221 | 
+ | 
      internalResize(flucQFrc, newSize); | 
| 222 | 
+ | 
    } | 
| 223 | 
+ | 
 | 
| 224 | 
  | 
    size_ = newSize; | 
| 225 | 
  | 
  } | 
| 226 | 
  | 
 | 
| 233 | 
  | 
      velocity.reserve(size); | 
| 234 | 
  | 
    }  | 
| 235 | 
  | 
 | 
| 236 | 
+ | 
    if (storageLayout_ & dslForce) { | 
| 237 | 
+ | 
      force.reserve(size); | 
| 238 | 
+ | 
    }  | 
| 239 | 
+ | 
 | 
| 240 | 
  | 
    if (storageLayout_ & dslAmat) { | 
| 241 | 
  | 
      aMat.reserve(size); | 
| 242 | 
  | 
    }  | 
| 245 | 
  | 
      angularMomentum.reserve(size); | 
| 246 | 
  | 
    }  | 
| 247 | 
  | 
 | 
| 171 | 
– | 
    if (storageLayout_ & dslElectroFrame) { | 
| 172 | 
– | 
      electroFrame.reserve(size); | 
| 173 | 
– | 
    } | 
| 174 | 
– | 
     | 
| 175 | 
– | 
    if (storageLayout_ & dslZAngle) { | 
| 176 | 
– | 
      zAngle.reserve(size); | 
| 177 | 
– | 
    } | 
| 178 | 
– | 
 | 
| 179 | 
– | 
    if (storageLayout_ & dslForce) { | 
| 180 | 
– | 
      force.reserve(size); | 
| 181 | 
– | 
    }  | 
| 182 | 
– | 
 | 
| 248 | 
  | 
    if (storageLayout_ & dslTorque) { | 
| 249 | 
  | 
      torque.reserve(size); | 
| 250 | 
  | 
    } | 
| 251 | 
  | 
     | 
| 252 | 
  | 
    if (storageLayout_ & dslParticlePot) { | 
| 253 | 
  | 
      particlePot.reserve(size); | 
| 254 | 
+ | 
    } | 
| 255 | 
+ | 
 | 
| 256 | 
+ | 
    if (storageLayout_ & dslDensity) { | 
| 257 | 
+ | 
      density.reserve(size); | 
| 258 | 
+ | 
    } | 
| 259 | 
+ | 
 | 
| 260 | 
+ | 
    if (storageLayout_ & dslFunctional) { | 
| 261 | 
+ | 
      functional.reserve(size); | 
| 262 | 
+ | 
    } | 
| 263 | 
+ | 
 | 
| 264 | 
+ | 
    if (storageLayout_ & dslFunctionalDerivative) { | 
| 265 | 
+ | 
      functionalDerivative.reserve(size); | 
| 266 | 
+ | 
    } | 
| 267 | 
+ | 
 | 
| 268 | 
+ | 
    if (storageLayout_ & dslDipole) { | 
| 269 | 
+ | 
      dipole.reserve(size); | 
| 270 | 
+ | 
    } | 
| 271 | 
+ | 
 | 
| 272 | 
+ | 
    if (storageLayout_ & dslQuadrupole) { | 
| 273 | 
+ | 
      quadrupole.reserve(size); | 
| 274 | 
  | 
    } | 
| 275 | 
  | 
 | 
| 276 | 
+ | 
    if (storageLayout_ & dslElectricField) { | 
| 277 | 
+ | 
      electricField.reserve(size); | 
| 278 | 
+ | 
    } | 
| 279 | 
+ | 
 | 
| 280 | 
+ | 
    if (storageLayout_ & dslSkippedCharge) { | 
| 281 | 
+ | 
      skippedCharge.reserve(size); | 
| 282 | 
+ | 
    } | 
| 283 | 
+ | 
 | 
| 284 | 
+ | 
    if (storageLayout_ & dslFlucQPosition) { | 
| 285 | 
+ | 
      flucQPos.reserve(size); | 
| 286 | 
+ | 
    } | 
| 287 | 
+ | 
 | 
| 288 | 
+ | 
    if (storageLayout_ & dslFlucQVelocity) { | 
| 289 | 
+ | 
      flucQVel.reserve(size); | 
| 290 | 
+ | 
    } | 
| 291 | 
+ | 
 | 
| 292 | 
+ | 
    if (storageLayout_ & dslFlucQForce) { | 
| 293 | 
+ | 
      flucQFrc.reserve(size); | 
| 294 | 
+ | 
    } | 
| 295 | 
  | 
  } | 
| 296 | 
  | 
 | 
| 297 | 
  | 
  void DataStorage::copy(int source, int num, int target) { | 
| 307 | 
  | 
      internalCopy(velocity, source, num, target); | 
| 308 | 
  | 
    }  | 
| 309 | 
  | 
 | 
| 310 | 
+ | 
    if (storageLayout_ & dslForce) { | 
| 311 | 
+ | 
      internalCopy(force, source, num, target); | 
| 312 | 
+ | 
    }  | 
| 313 | 
+ | 
 | 
| 314 | 
  | 
    if (storageLayout_ & dslAmat) { | 
| 315 | 
  | 
      internalCopy(aMat, source, num, target); | 
| 316 | 
  | 
    }  | 
| 319 | 
  | 
      internalCopy(angularMomentum, source, num, target); | 
| 320 | 
  | 
    }  | 
| 321 | 
  | 
 | 
| 214 | 
– | 
    if (storageLayout_ & dslElectroFrame) { | 
| 215 | 
– | 
      internalCopy(electroFrame, source, num, target); | 
| 216 | 
– | 
    } | 
| 217 | 
– | 
     | 
| 218 | 
– | 
    if (storageLayout_ & dslZAngle) { | 
| 219 | 
– | 
      internalCopy(zAngle, source, num, target); | 
| 220 | 
– | 
    } | 
| 221 | 
– | 
 | 
| 222 | 
– | 
    if (storageLayout_ & dslForce) { | 
| 223 | 
– | 
      internalCopy(force, source, num, target); | 
| 224 | 
– | 
    }  | 
| 225 | 
– | 
 | 
| 322 | 
  | 
    if (storageLayout_ & dslTorque) { | 
| 323 | 
  | 
      internalCopy(torque, source, num, target);  | 
| 324 | 
  | 
    } | 
| 326 | 
  | 
    if (storageLayout_ & dslParticlePot) { | 
| 327 | 
  | 
      internalCopy(particlePot, source, num, target);  | 
| 328 | 
  | 
    } | 
| 233 | 
– | 
     | 
| 329 | 
  | 
 | 
| 330 | 
+ | 
    if (storageLayout_ & dslDensity) { | 
| 331 | 
+ | 
      internalCopy(density, source, num, target); | 
| 332 | 
+ | 
    } | 
| 333 | 
+ | 
 | 
| 334 | 
+ | 
    if (storageLayout_ & dslFunctional) { | 
| 335 | 
+ | 
      internalCopy(functional, source, num, target); | 
| 336 | 
+ | 
    } | 
| 337 | 
+ | 
 | 
| 338 | 
+ | 
    if (storageLayout_ & dslFunctionalDerivative) { | 
| 339 | 
+ | 
      internalCopy(functionalDerivative, source, num, target); | 
| 340 | 
+ | 
    } | 
| 341 | 
+ | 
 | 
| 342 | 
+ | 
    if (storageLayout_ & dslDipole) { | 
| 343 | 
+ | 
      internalCopy(dipole, source, num, target); | 
| 344 | 
+ | 
    } | 
| 345 | 
+ | 
 | 
| 346 | 
+ | 
    if (storageLayout_ & dslQuadrupole) { | 
| 347 | 
+ | 
      internalCopy(quadrupole, source, num, target); | 
| 348 | 
+ | 
    } | 
| 349 | 
+ | 
 | 
| 350 | 
+ | 
    if (storageLayout_ & dslElectricField) { | 
| 351 | 
+ | 
      internalCopy(electricField, source, num, target); | 
| 352 | 
+ | 
    } | 
| 353 | 
+ | 
 | 
| 354 | 
+ | 
    if (storageLayout_ & dslSkippedCharge) { | 
| 355 | 
+ | 
      internalCopy(skippedCharge, source, num, target); | 
| 356 | 
+ | 
    } | 
| 357 | 
+ | 
 | 
| 358 | 
+ | 
    if (storageLayout_ & dslFlucQPosition) { | 
| 359 | 
+ | 
      internalCopy(flucQPos, source, num, target); | 
| 360 | 
+ | 
    } | 
| 361 | 
+ | 
 | 
| 362 | 
+ | 
    if (storageLayout_ & dslFlucQVelocity) { | 
| 363 | 
+ | 
      internalCopy(flucQVel, source, num, target); | 
| 364 | 
+ | 
    } | 
| 365 | 
+ | 
    if (storageLayout_ & dslFlucQForce) { | 
| 366 | 
+ | 
      internalCopy(flucQFrc, source, num, target); | 
| 367 | 
+ | 
    } | 
| 368 | 
  | 
  } | 
| 369 | 
  | 
 | 
| 370 | 
  | 
  int DataStorage::getStorageLayout() { | 
| 381 | 
  | 
    switch (whichArray) { | 
| 382 | 
  | 
    case dslPosition: | 
| 383 | 
  | 
      return internalGetArrayPointer(position); | 
| 251 | 
– | 
      break; | 
| 384 | 
  | 
             | 
| 385 | 
  | 
    case dslVelocity: | 
| 386 | 
  | 
      return internalGetArrayPointer(velocity); | 
| 255 | 
– | 
      break; | 
| 387 | 
  | 
             | 
| 388 | 
+ | 
    case dslForce: | 
| 389 | 
+ | 
      return internalGetArrayPointer(force); | 
| 390 | 
+ | 
 | 
| 391 | 
  | 
    case dslAmat: | 
| 392 | 
  | 
      return internalGetArrayPointer(aMat); | 
| 259 | 
– | 
      break;             | 
| 393 | 
  | 
             | 
| 394 | 
  | 
    case dslAngularMomentum: | 
| 395 | 
  | 
      return internalGetArrayPointer(angularMomentum); | 
| 263 | 
– | 
      break; | 
| 396 | 
  | 
             | 
| 265 | 
– | 
    case dslElectroFrame: | 
| 266 | 
– | 
      return internalGetArrayPointer(electroFrame); | 
| 267 | 
– | 
      break; | 
| 268 | 
– | 
             | 
| 269 | 
– | 
    case dslZAngle: | 
| 270 | 
– | 
      return internalGetArrayPointer(zAngle); | 
| 271 | 
– | 
      break; | 
| 272 | 
– | 
 | 
| 273 | 
– | 
    case dslForce: | 
| 274 | 
– | 
      return internalGetArrayPointer(force); | 
| 275 | 
– | 
      break;             | 
| 276 | 
– | 
 | 
| 397 | 
  | 
    case dslTorque: | 
| 398 | 
  | 
      return internalGetArrayPointer(torque); | 
| 279 | 
– | 
      break; | 
| 399 | 
  | 
 | 
| 400 | 
  | 
    case dslParticlePot: | 
| 401 | 
  | 
      return internalGetArrayPointer(particlePot); | 
| 402 | 
< | 
      break; | 
| 403 | 
< | 
             | 
| 402 | 
> | 
 | 
| 403 | 
> | 
    case dslDensity: | 
| 404 | 
> | 
      return internalGetArrayPointer(density); | 
| 405 | 
> | 
 | 
| 406 | 
> | 
    case dslFunctional: | 
| 407 | 
> | 
      return internalGetArrayPointer(functional); | 
| 408 | 
> | 
 | 
| 409 | 
> | 
    case dslFunctionalDerivative: | 
| 410 | 
> | 
      return internalGetArrayPointer(functionalDerivative); | 
| 411 | 
> | 
 | 
| 412 | 
> | 
    case dslDipole: | 
| 413 | 
> | 
      return internalGetArrayPointer(dipole); | 
| 414 | 
> | 
 | 
| 415 | 
> | 
    case dslQuadrupole: | 
| 416 | 
> | 
      return internalGetArrayPointer(quadrupole); | 
| 417 | 
> | 
 | 
| 418 | 
> | 
    case dslElectricField: | 
| 419 | 
> | 
      return internalGetArrayPointer(electricField); | 
| 420 | 
> | 
 | 
| 421 | 
> | 
    case dslSkippedCharge: | 
| 422 | 
> | 
      return internalGetArrayPointer(skippedCharge); | 
| 423 | 
> | 
 | 
| 424 | 
> | 
    case dslFlucQPosition: | 
| 425 | 
> | 
      return internalGetArrayPointer(flucQPos); | 
| 426 | 
> | 
 | 
| 427 | 
> | 
    case dslFlucQVelocity: | 
| 428 | 
> | 
      return internalGetArrayPointer(flucQVel); | 
| 429 | 
> | 
            | 
| 430 | 
> | 
    case dslFlucQForce: | 
| 431 | 
> | 
      return internalGetArrayPointer(flucQFrc); | 
| 432 | 
> | 
            | 
| 433 | 
  | 
    default: | 
| 434 | 
  | 
      //error message | 
| 435 | 
  | 
      return NULL; | 
| 288 | 
– | 
 | 
| 436 | 
  | 
    } | 
| 437 | 
  | 
  }     | 
| 438 | 
  | 
 | 
| 439 | 
  | 
  RealType* DataStorage::internalGetArrayPointer(std::vector<Vector3d>& v) { | 
| 440 | 
< | 
    if (v.size() == 0) { | 
| 440 | 
> | 
    if (v.empty()) { | 
| 441 | 
  | 
      return NULL; | 
| 442 | 
  | 
    } else { | 
| 443 | 
  | 
      return v[0].getArrayPointer(); | 
| 444 | 
  | 
    } | 
| 445 | 
  | 
  } | 
| 446 | 
  | 
 | 
| 447 | 
< | 
  RealType* DataStorage::internalGetArrayPointer(std::vector<RotMat3x3d>& v) { | 
| 448 | 
< | 
    if (v.size() == 0) { | 
| 447 | 
> | 
  RealType* DataStorage::internalGetArrayPointer(std::vector<Mat3x3d>& v) { | 
| 448 | 
> | 
    if (v.empty()) { | 
| 449 | 
  | 
      return NULL; | 
| 450 | 
  | 
    } else { | 
| 451 | 
  | 
      return v[0].getArrayPointer(); | 
| 454 | 
  | 
  } | 
| 455 | 
  | 
 | 
| 456 | 
  | 
  RealType* DataStorage::internalGetArrayPointer(std::vector<RealType>& v) { | 
| 457 | 
< | 
    if (v.size() == 0) { | 
| 457 | 
> | 
    if (v.empty()) { | 
| 458 | 
  | 
      return NULL; | 
| 459 | 
  | 
    } else { | 
| 460 | 
  | 
      return &(v[0]); | 
| 504 | 
  | 
    if (layout & dslVelocity) { | 
| 505 | 
  | 
      bytes += sizeof(Vector3d); | 
| 506 | 
  | 
    } | 
| 507 | 
+ | 
    if (layout & dslForce) { | 
| 508 | 
+ | 
      bytes += sizeof(Vector3d); | 
| 509 | 
+ | 
    } | 
| 510 | 
  | 
    if (layout & dslAmat) { | 
| 511 | 
  | 
      bytes += sizeof(RotMat3x3d);     | 
| 512 | 
  | 
    } | 
| 513 | 
  | 
    if (layout & dslAngularMomentum) { | 
| 514 | 
  | 
      bytes += sizeof(Vector3d); | 
| 515 | 
  | 
    } | 
| 516 | 
< | 
    if (layout & dslElectroFrame) { | 
| 517 | 
< | 
      bytes += sizeof(Mat3x3d); | 
| 516 | 
> | 
    if (layout & dslTorque) { | 
| 517 | 
> | 
      bytes += sizeof(Vector3d); | 
| 518 | 
  | 
    } | 
| 519 | 
< | 
    if (layout & dslZAngle) { | 
| 519 | 
> | 
    if (layout & dslParticlePot) { | 
| 520 | 
  | 
      bytes += sizeof(RealType); | 
| 521 | 
  | 
    } | 
| 522 | 
< | 
    if (layout & dslForce) { | 
| 522 | 
> | 
    if (layout & dslDensity) { | 
| 523 | 
> | 
      bytes += sizeof(RealType); | 
| 524 | 
> | 
    } | 
| 525 | 
> | 
    if (layout & dslFunctional) { | 
| 526 | 
> | 
      bytes += sizeof(RealType); | 
| 527 | 
> | 
    } | 
| 528 | 
> | 
    if (layout & dslFunctionalDerivative) { | 
| 529 | 
> | 
      bytes += sizeof(RealType); | 
| 530 | 
> | 
    } | 
| 531 | 
> | 
    if (layout & dslDipole) { | 
| 532 | 
  | 
      bytes += sizeof(Vector3d); | 
| 533 | 
  | 
    } | 
| 534 | 
< | 
    if (layout & dslTorque) { | 
| 534 | 
> | 
    if (layout & dslQuadrupole) { | 
| 535 | 
> | 
      bytes += sizeof(Mat3x3d); | 
| 536 | 
> | 
    } | 
| 537 | 
> | 
    if (layout & dslElectricField) { | 
| 538 | 
  | 
      bytes += sizeof(Vector3d); | 
| 539 | 
  | 
    } | 
| 540 | 
< | 
    if (layout & dslParticlePot) { | 
| 540 | 
> | 
    if (layout & dslSkippedCharge) { | 
| 541 | 
  | 
      bytes += sizeof(RealType); | 
| 542 | 
  | 
    } | 
| 543 | 
+ | 
    if (layout & dslFlucQPosition) { | 
| 544 | 
+ | 
      bytes += sizeof(RealType); | 
| 545 | 
+ | 
    } | 
| 546 | 
+ | 
    if (layout & dslFlucQVelocity) { | 
| 547 | 
+ | 
      bytes += sizeof(RealType); | 
| 548 | 
+ | 
    } | 
| 549 | 
+ | 
    if (layout & dslFlucQForce) { | 
| 550 | 
+ | 
      bytes += sizeof(RealType); | 
| 551 | 
+ | 
    } | 
| 552 | 
+ | 
 | 
| 553 | 
  | 
    return bytes; | 
| 554 | 
  | 
  } | 
| 555 | 
  | 
 |