| 1 |  | /* | 
| 2 | < | * Copyright (C) 2000-2004  Object Oriented Parallel Simulation Engine (OOPSE) project | 
| 3 | < | * | 
| 4 | < | * Contact: oopse@oopse.org | 
| 5 | < | * | 
| 6 | < | * This program is free software; you can redistribute it and/or | 
| 7 | < | * modify it under the terms of the GNU Lesser General Public License | 
| 8 | < | * as published by the Free Software Foundation; either version 2.1 | 
| 9 | < | * of the License, or (at your option) any later version. | 
| 10 | < | * All we ask is that proper credit is given for our work, which includes | 
| 11 | < | * - but is not limited to - adding the above copyright notice to the beginning | 
| 12 | < | * of your source code files, and to any copyright notice that you may distribute | 
| 13 | < | * with programs based on this work. | 
| 14 | < | * | 
| 15 | < | * This program is distributed in the hope that it will be useful, | 
| 16 | < | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 17 | < | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
| 18 | < | * GNU Lesser General Public License for more details. | 
| 19 | < | * | 
| 20 | < | * You should have received a copy of the GNU Lesser General Public License | 
| 21 | < | * along with this program; if not, write to the Free Software | 
| 22 | < | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. | 
| 2 | > | * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. | 
| 3 |  | * | 
| 4 | + | * The University of Notre Dame grants you ("Licensee") a | 
| 5 | + | * non-exclusive, royalty free, license to use, modify and | 
| 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 | 
| 19 | + | *    notice, this list of conditions and the following disclaimer. | 
| 20 | + | * | 
| 21 | + | * 3. Redistributions in binary form must reproduce the above copyright | 
| 22 | + | *    notice, this list of conditions and the following disclaimer in the | 
| 23 | + | *    documentation and/or other materials provided with the | 
| 24 | + | *    distribution. | 
| 25 | + | * | 
| 26 | + | * This software is provided "AS IS," without a warranty of any | 
| 27 | + | * kind. All express or implied conditions, representations and | 
| 28 | + | * warranties, including any implied warranty of merchantability, | 
| 29 | + | * fitness for a particular purpose or non-infringement, are hereby | 
| 30 | + | * excluded.  The University of Notre Dame and its licensors shall not | 
| 31 | + | * be liable for any damages suffered by licensee as a result of | 
| 32 | + | * using, modifying or distributing the software or its | 
| 33 | + | * derivatives. In no event will the University of Notre Dame or its | 
| 34 | + | * licensors be liable for any lost revenue, profit or data, or for | 
| 35 | + | * direct, indirect, special, consequential, incidental or punitive | 
| 36 | + | * damages, however caused and regardless of the theory of liability, | 
| 37 | + | * arising out of the use of or inability to use software, even if the | 
| 38 | + | * University of Notre Dame has been advised of the possibility of | 
| 39 | + | * such damages. | 
| 40 |  | */ | 
| 41 |  |  | 
| 42 | < | /** | 
| 43 | < | * @file DataStorage.cpp | 
| 44 | < | * @author tlin | 
| 45 | < | * @date 10/26/2004 | 
| 46 | < | * @time 11:56am | 
| 47 | < | * @version 1.0 | 
| 48 | < | */ | 
| 42 | > | /** | 
| 43 | > | * @file DataStorage.cpp | 
| 44 | > | * @author tlin | 
| 45 | > | * @date 10/26/2004 | 
| 46 | > | * @time 11:56am | 
| 47 | > | * @version 1.0 | 
| 48 | > | */ | 
| 49 |  |  | 
| 50 |  | #include "brains/DataStorage.hpp" | 
| 51 |  |  | 
| 52 | + | namespace oopse { | 
| 53 |  |  | 
| 54 | < | DataStorage::DataStorage() : size_(0), storageLayout_(0){ | 
| 54 | > | DataStorage::DataStorage() : size_(0), storageLayout_(0){ | 
| 55 |  |  | 
| 56 | < | } | 
| 56 | > | } | 
| 57 |  |  | 
| 58 | < | DataStorage::DataStorage(int size, int storageLayout) : size_(size){ | 
| 58 | > | DataStorage::DataStorage(int size, int storageLayout) : size_(size){ | 
| 59 |  | setStorageLayout(storageLayout); | 
| 60 |  | resize(size); | 
| 61 | < | } | 
| 61 | > | } | 
| 62 |  |  | 
| 63 | < | int DataStorage::getSize() { | 
| 63 | > | int DataStorage::getSize() { | 
| 64 |  |  | 
| 65 |  | if (storageLayout_ & dslPosition && position.size() != size_) { | 
| 66 | < | //error | 
| 67 | < | std::cerr << "size does not match"<< std::endl; | 
| 66 | > | //error | 
| 67 | > | std::cerr << "size does not match"<< std::endl; | 
| 68 |  | } | 
| 69 |  |  | 
| 70 |  | if (storageLayout_ & dslVelocity && velocity.size() != size_) { | 
| 71 | < | //error | 
| 72 | < | std::cerr << "size does not match"<< std::endl; | 
| 71 | > | //error | 
| 72 | > | std::cerr << "size does not match"<< std::endl; | 
| 73 |  | } | 
| 74 |  |  | 
| 75 |  | if (storageLayout_ & dslAmat && aMat.size() != size_) { | 
| 76 | < | //error | 
| 77 | < | std::cerr << "size does not match"<< std::endl; | 
| 76 | > | //error | 
| 77 | > | std::cerr << "size does not match"<< std::endl; | 
| 78 |  | } | 
| 79 |  |  | 
| 80 |  | if (storageLayout_ & dslAngularMomentum && angularMomentum.size() != size_) { | 
| 81 | < | //error | 
| 82 | < | std::cerr << "size does not match"<< std::endl; | 
| 81 | > | //error | 
| 82 | > | std::cerr << "size does not match"<< std::endl; | 
| 83 |  | } | 
| 84 |  |  | 
| 85 | < | if (storageLayout_ & dslUnitVector && unitVector.size() != size_) { | 
| 86 | < | //error | 
| 87 | < | std::cerr << "size does not match"<< std::endl; | 
| 85 | > | if (storageLayout_ & dslElectroFrame && electroFrame.size() != size_) { | 
| 86 | > | //error | 
| 87 | > | std::cerr << "size does not match"<< std::endl; | 
| 88 |  | } | 
| 89 |  |  | 
| 90 |  | if (storageLayout_ & dslZAngle && zAngle.size() != size_) { | 
| 91 | < | //error | 
| 92 | < | std::cerr << "size does not match"<< std::endl; | 
| 91 | > | //error | 
| 92 | > | std::cerr << "size does not match"<< std::endl; | 
| 93 |  | } | 
| 94 |  |  | 
| 95 |  | if (storageLayout_ & dslForce && force.size() != size_) { | 
| 96 | < | //error | 
| 97 | < | std::cerr << "size does not match"<< std::endl; | 
| 96 | > | //error | 
| 97 | > | std::cerr << "size does not match"<< std::endl; | 
| 98 |  | } | 
| 99 |  |  | 
| 100 |  | if (storageLayout_ & dslTorque && torque.size() != size_) { | 
| 101 | < | //error | 
| 102 | < | std::cerr << "size does not match"<< std::endl; | 
| 101 | > | //error | 
| 102 | > | std::cerr << "size does not match"<< std::endl; | 
| 103 |  | } | 
| 104 | < |  | 
| 104 | > | if (storageLayout_ & dslParticlePot && particlePot.size() != size_) { | 
| 105 | > | //error | 
| 106 | > | std::cerr << "size does not match"<< std::endl; | 
| 107 | > | } | 
| 108 | > |  | 
| 109 |  | return size_; | 
| 110 |  |  | 
| 111 | < | } | 
| 111 | > | } | 
| 112 |  |  | 
| 113 | < | void DataStorage::resize(int newSize) { | 
| 113 | > | void DataStorage::resize(int newSize) { | 
| 114 |  |  | 
| 115 |  | if (storageLayout_ & dslPosition) { | 
| 116 | < | internalResize(position, newSize); | 
| 116 | > | internalResize(position, newSize); | 
| 117 |  | } | 
| 118 |  |  | 
| 119 |  | if (storageLayout_ & dslVelocity) { | 
| 120 | < | internalResize(velocity, newSize); | 
| 120 | > | internalResize(velocity, newSize); | 
| 121 |  | } | 
| 122 |  |  | 
| 123 |  | if (storageLayout_ & dslAmat) { | 
| 124 | < | internalResize(aMat, newSize); | 
| 124 | > | internalResize(aMat, newSize); | 
| 125 |  | } | 
| 126 |  |  | 
| 127 |  | if (storageLayout_ & dslAngularMomentum) { | 
| 128 | < | internalResize(angularMomentum, newSize); | 
| 128 | > | internalResize(angularMomentum, newSize); | 
| 129 |  | } | 
| 130 |  |  | 
| 131 | < | if (storageLayout_ & dslUnitVector) { | 
| 132 | < | internalResize(unitVector, newSize); | 
| 131 | > | if (storageLayout_ & dslElectroFrame) { | 
| 132 | > | internalResize(electroFrame, newSize); | 
| 133 |  | } | 
| 134 |  |  | 
| 135 |  | if (storageLayout_ & dslZAngle) { | 
| 136 | < | internalResize(zAngle, newSize); | 
| 136 | > | internalResize(zAngle, newSize); | 
| 137 |  | } | 
| 138 |  |  | 
| 139 |  | if (storageLayout_ & dslForce) { | 
| 140 | < | internalResize(force, newSize); | 
| 140 | > | internalResize(force, newSize); | 
| 141 |  | } | 
| 142 |  |  | 
| 143 |  | if (storageLayout_ & dslTorque) { | 
| 144 | < | internalResize(torque, newSize); | 
| 144 | > | internalResize(torque, newSize); | 
| 145 |  | } | 
| 146 |  |  | 
| 147 | + | if (storageLayout_ & dslParticlePot) { | 
| 148 | + | internalResize(particlePot, newSize); | 
| 149 | + | } | 
| 150 | + |  | 
| 151 |  | size_ = newSize; | 
| 152 | < | } | 
| 152 | > | } | 
| 153 |  |  | 
| 154 | < | void DataStorage::reserve(int size) { | 
| 154 | > | void DataStorage::reserve(int size) { | 
| 155 |  | if (storageLayout_ & dslPosition) { | 
| 156 | < | position.reserve(size); | 
| 156 | > | position.reserve(size); | 
| 157 |  | } | 
| 158 |  |  | 
| 159 |  | if (storageLayout_ & dslVelocity) { | 
| 160 | < | velocity.reserve(size); | 
| 160 | > | velocity.reserve(size); | 
| 161 |  | } | 
| 162 |  |  | 
| 163 |  | if (storageLayout_ & dslAmat) { | 
| 164 | < | aMat.reserve(size); | 
| 164 | > | aMat.reserve(size); | 
| 165 |  | } | 
| 166 |  |  | 
| 167 |  | if (storageLayout_ & dslAngularMomentum) { | 
| 168 | < | angularMomentum.reserve(size); | 
| 168 | > | angularMomentum.reserve(size); | 
| 169 |  | } | 
| 170 |  |  | 
| 171 | < | if (storageLayout_ & dslUnitVector) { | 
| 172 | < | unitVector.reserve(size); | 
| 171 | > | if (storageLayout_ & dslElectroFrame) { | 
| 172 | > | electroFrame.reserve(size); | 
| 173 |  | } | 
| 174 |  |  | 
| 175 |  | if (storageLayout_ & dslZAngle) { | 
| 176 | < | zAngle.reserve(size); | 
| 176 | > | zAngle.reserve(size); | 
| 177 |  | } | 
| 178 |  |  | 
| 179 |  | if (storageLayout_ & dslForce) { | 
| 180 | < | force.reserve(size); | 
| 180 | > | force.reserve(size); | 
| 181 |  | } | 
| 182 |  |  | 
| 183 |  | if (storageLayout_ & dslTorque) { | 
| 184 | < | torque.reserve(size); | 
| 184 | > | torque.reserve(size); | 
| 185 |  | } | 
| 186 | + |  | 
| 187 | + | if (storageLayout_ & dslParticlePot) { | 
| 188 | + | particlePot.reserve(size); | 
| 189 | + | } | 
| 190 |  |  | 
| 191 | < | } | 
| 191 | > | } | 
| 192 |  |  | 
| 193 | < | void DataStorage::copy(int source, int num, int target) { | 
| 193 | > | void DataStorage::copy(int source, int num, int target) { | 
| 194 |  | if (num + target > size_ ) { | 
| 195 | < | //error | 
| 195 | > | //error | 
| 196 |  | } | 
| 197 |  |  | 
| 198 |  | if (storageLayout_ & dslPosition) { | 
| 199 | < | interalCopy(position, source, num, target); | 
| 199 | > | internalCopy(position, source, num, target); | 
| 200 |  | } | 
| 201 |  |  | 
| 202 |  | if (storageLayout_ & dslVelocity) { | 
| 203 | < | interalCopy(velocity, source, num, target); | 
| 204 | < | } | 
| 203 | > | internalCopy(velocity, source, num, target); | 
| 204 | > | } | 
| 205 |  |  | 
| 206 |  | if (storageLayout_ & dslAmat) { | 
| 207 | < | interalCopy(aMat, source, num, target); | 
| 208 | < | } | 
| 207 | > | internalCopy(aMat, source, num, target); | 
| 208 | > | } | 
| 209 |  |  | 
| 210 |  | if (storageLayout_ & dslAngularMomentum) { | 
| 211 | < | interalCopy(angularMomentum, source, num, target); | 
| 211 | > | internalCopy(angularMomentum, source, num, target); | 
| 212 |  | } | 
| 213 |  |  | 
| 214 | < | if (storageLayout_ & dslUnitVector) { | 
| 215 | < | interalCopy(unitVector, source, num, target); | 
| 214 | > | if (storageLayout_ & dslElectroFrame) { | 
| 215 | > | internalCopy(electroFrame, source, num, target); | 
| 216 |  | } | 
| 217 |  |  | 
| 218 |  | if (storageLayout_ & dslZAngle) { | 
| 219 | < | interalCopy(zAngle, source, num, target); | 
| 219 | > | internalCopy(zAngle, source, num, target); | 
| 220 |  | } | 
| 221 |  |  | 
| 222 |  | if (storageLayout_ & dslForce) { | 
| 223 | < | interalCopy(force, source, num, target); | 
| 223 | > | internalCopy(force, source, num, target); | 
| 224 |  | } | 
| 225 |  |  | 
| 226 |  | if (storageLayout_ & dslTorque) { | 
| 227 | < | interalCopy(torque, source, num, target); | 
| 227 | > | internalCopy(torque, source, num, target); | 
| 228 |  | } | 
| 229 | + |  | 
| 230 | + | if (storageLayout_ & dslParticlePot) { | 
| 231 | + | internalCopy(particlePot, source, num, target); | 
| 232 | + | } | 
| 233 |  |  | 
| 234 |  |  | 
| 235 | < | } | 
| 203 | < |  | 
| 204 | < | int DataStorage::getStorageLayout() { | 
| 205 | < | return storageLayout_; | 
| 206 | < | } | 
| 235 | > | } | 
| 236 |  |  | 
| 237 | < | void DataStorage::setStorageLayout(int layout) { | 
| 237 | > | int DataStorage::getStorageLayout() { | 
| 238 | > | return storageLayout_; | 
| 239 | > | } | 
| 240 | > |  | 
| 241 | > | void DataStorage::setStorageLayout(int layout) { | 
| 242 |  | storageLayout_ = layout; | 
| 243 |  | resize(size_); | 
| 244 | < | } | 
| 244 | > | } | 
| 245 |  |  | 
| 246 | < | double* DataStorage::getArrayPointer(int whichArray) { | 
| 246 | > | RealType* DataStorage::getArrayPointer(int whichArray) { | 
| 247 |  |  | 
| 248 |  | switch (whichArray) { | 
| 249 | < | case dslPosition: | 
| 250 | < | return internalGetArrayPointer(torque); | 
| 251 | < | break; | 
| 249 | > | case dslPosition: | 
| 250 | > | return internalGetArrayPointer(position); | 
| 251 | > | break; | 
| 252 |  |  | 
| 253 | < | case dslVelocity: | 
| 254 | < | return internalGetArrayPointer(velocity); | 
| 255 | < | break; | 
| 253 | > | case dslVelocity: | 
| 254 | > | return internalGetArrayPointer(velocity); | 
| 255 | > | break; | 
| 256 |  |  | 
| 257 | < | case dslAmat: | 
| 258 | < | return internalGetArrayPointer(aMat); | 
| 259 | < | break; | 
| 257 | > | case dslAmat: | 
| 258 | > | return internalGetArrayPointer(aMat); | 
| 259 | > | break; | 
| 260 |  |  | 
| 261 | < | case dslAngularMomentum: | 
| 262 | < | return internalGetArrayPointer(angularMomentum); | 
| 263 | < | break; | 
| 261 | > | case dslAngularMomentum: | 
| 262 | > | return internalGetArrayPointer(angularMomentum); | 
| 263 | > | break; | 
| 264 |  |  | 
| 265 | < | case dslUnitVector: | 
| 266 | < | return internalGetArrayPointer(unitVector); | 
| 267 | < | break; | 
| 265 | > | case dslElectroFrame: | 
| 266 | > | return internalGetArrayPointer(electroFrame); | 
| 267 | > | break; | 
| 268 |  |  | 
| 269 | < | case dslZAngle: | 
| 270 | < | return internalGetArrayPointer(zAngle); | 
| 271 | < | break; | 
| 269 | > | case dslZAngle: | 
| 270 | > | return internalGetArrayPointer(zAngle); | 
| 271 | > | break; | 
| 272 |  |  | 
| 273 | < | case dslForce: | 
| 274 | < | return internalGetArrayPointer(force); | 
| 275 | < | break; | 
| 273 | > | case dslForce: | 
| 274 | > | return internalGetArrayPointer(force); | 
| 275 | > | break; | 
| 276 |  |  | 
| 277 | < | case dslTorque: | 
| 278 | < | return internalGetArrayPointer(torque); | 
| 279 | < | break; | 
| 277 | > | case dslTorque: | 
| 278 | > | return internalGetArrayPointer(torque); | 
| 279 | > | break; | 
| 280 | > |  | 
| 281 | > | case dslParticlePot: | 
| 282 | > | return internalGetArrayPointer(particlePot); | 
| 283 | > | break; | 
| 284 |  |  | 
| 285 | < | default: | 
| 286 | < | //error message | 
| 287 | < | return NULL; | 
| 285 | > | default: | 
| 286 | > | //error message | 
| 287 | > | return NULL; | 
| 288 |  |  | 
| 289 |  | } | 
| 290 | < | } | 
| 290 | > | } | 
| 291 |  |  | 
| 292 | < | double* DataStorage::internalGetArrayPointer(std::vector<Vector3d>& v) { | 
| 292 | > | RealType* DataStorage::internalGetArrayPointer(std::vector<Vector3d>& v) { | 
| 293 |  | if (v.size() == 0) { | 
| 294 | < | return NULL; | 
| 294 | > | return NULL; | 
| 295 |  | } else { | 
| 296 | < | return v[0].getArrayPointer(); | 
| 296 | > | return v[0].getArrayPointer(); | 
| 297 |  | } | 
| 298 | < | } | 
| 298 | > | } | 
| 299 |  |  | 
| 300 | < | double* DataStorage::internalGetArrayPointer(std::vector<RotMat3x3d>& v) { | 
| 300 | > | RealType* DataStorage::internalGetArrayPointer(std::vector<RotMat3x3d>& v) { | 
| 301 |  | if (v.size() == 0) { | 
| 302 | < | return NULL; | 
| 302 | > | return NULL; | 
| 303 |  | } else { | 
| 304 | < | return v[0].getArrayPointer(); | 
| 304 | > | return v[0].getArrayPointer(); | 
| 305 |  | } | 
| 306 |  |  | 
| 307 | < | } | 
| 307 | > | } | 
| 308 |  |  | 
| 309 | < | double* DataStorage::internalGetArrayPointer(std::vector<double>& v) { | 
| 309 | > | RealType* DataStorage::internalGetArrayPointer(std::vector<RealType>& v) { | 
| 310 |  | if (v.size() == 0) { | 
| 311 | < | return NULL; | 
| 311 | > | return NULL; | 
| 312 |  | } else { | 
| 313 | < | return &(v[0]); | 
| 313 | > | return &(v[0]); | 
| 314 |  | } | 
| 315 |  |  | 
| 316 | < | } | 
| 316 | > | } | 
| 317 |  |  | 
| 318 | < | template<typename T> | 
| 319 | < | void DataStorage::internalResize(std::vector<T>& v, int newSize){ | 
| 318 | > | template<typename T> | 
| 319 | > | void DataStorage::internalResize(std::vector<T>& v, int newSize){ | 
| 320 |  | int oldSize = v.size(); | 
| 321 |  |  | 
| 322 |  | if (oldSize == newSize) { | 
| 323 | < | return; | 
| 323 | > | return; | 
| 324 |  | } else if (oldSize < newSize) { | 
| 325 | < | v.insert(v.end(), newSize-oldSize, T()); | 
| 325 | > | v.insert(v.end(), newSize-oldSize, T()); | 
| 326 |  | } else { | 
| 327 | < | typename std::vector<T>::iterator i; | 
| 328 | < | i = v.begin(); | 
| 329 | < | std::advance(i, newSize); | 
| 330 | < | v.erase(i, v.end()); | 
| 327 | > | typename std::vector<T>::iterator i; | 
| 328 | > | i = v.begin(); | 
| 329 | > | std::advance(i, newSize); | 
| 330 | > | v.erase(i, v.end()); | 
| 331 |  | } | 
| 332 | < | } | 
| 332 | > | } | 
| 333 |  |  | 
| 334 | < | template<typename T> | 
| 335 | < | void DataStorage::interalCopy(std::vector<T>& v, int source,  int num, int target) { | 
| 334 | > | template<typename T> | 
| 335 | > | void DataStorage::internalCopy(std::vector<T>& v, int source,  int num, int target) { | 
| 336 |  | typename std::vector<T>::iterator first; | 
| 337 |  | typename std::vector<T>::iterator last; | 
| 338 |  | typename std::vector<T>::iterator result; | 
| 347 |  | std::advance(result, target ); | 
| 348 |  |  | 
| 349 |  | std::copy(first, last, result); | 
| 350 | + | } | 
| 351 | + |  | 
| 352 | + | int DataStorage::getBytesPerStuntDouble(int layout) { | 
| 353 | + | int bytes = 0; | 
| 354 | + | if (layout & dslPosition) { | 
| 355 | + | bytes += sizeof(Vector3d); | 
| 356 | + | } | 
| 357 | + | if (layout & dslVelocity) { | 
| 358 | + | bytes += sizeof(Vector3d); | 
| 359 | + | } | 
| 360 | + | if (layout & dslAmat) { | 
| 361 | + | bytes += sizeof(RotMat3x3d); | 
| 362 | + | } | 
| 363 | + | if (layout & dslAngularMomentum) { | 
| 364 | + | bytes += sizeof(Vector3d); | 
| 365 | + | } | 
| 366 | + | if (layout & dslElectroFrame) { | 
| 367 | + | bytes += sizeof(Mat3x3d); | 
| 368 | + | } | 
| 369 | + | if (layout & dslZAngle) { | 
| 370 | + | bytes += sizeof(RealType); | 
| 371 | + | } | 
| 372 | + | if (layout & dslForce) { | 
| 373 | + | bytes += sizeof(Vector3d); | 
| 374 | + | } | 
| 375 | + | if (layout & dslTorque) { | 
| 376 | + | bytes += sizeof(Vector3d); | 
| 377 | + | } | 
| 378 | + | if (layout & dslParticlePot) { | 
| 379 | + | bytes += sizeof(RealType); | 
| 380 | + | } | 
| 381 | + | return bytes; | 
| 382 | + | } | 
| 383 | + |  | 
| 384 |  | } |