ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/DataStorage.cpp
(Generate patch)

Comparing:
trunk/src/brains/DataStorage.cpp (file contents), Revision 1104 by gezelter, Fri Dec 29 21:43:18 2006 UTC vs.
branches/development/src/brains/DataStorage.cpp (file contents), Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 6 | Line 6
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.
# Line 37 | Line 28
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, 24107 (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   /**
# Line 49 | Line 50
50  
51   #include "brains/DataStorage.hpp"
52  
53 < namespace oopse {
53 > namespace OpenMD {
54  
55    DataStorage::DataStorage() : size_(0), storageLayout_(0){
56  
# Line 102 | Line 103 | namespace oopse {
103        std::cerr << "size does not match"<< std::endl;        
104      }
105  
106 +    if (storageLayout_ & dslParticlePot && particlePot.size() != size_) {
107 +      //error
108 +      std::cerr << "size does not match"<< std::endl;        
109 +    }
110 +
111 +    if (storageLayout_ & dslDensity && density.size() != size_) {
112 +      //error
113 +      std::cerr << "size does not match"<< std::endl;        
114 +    }
115 +
116 +    if (storageLayout_ & dslFunctional && functional.size() != size_) {
117 +      //error
118 +      std::cerr << "size does not match"<< std::endl;        
119 +    }
120 +
121 +    if (storageLayout_ & dslFunctionalDerivative && functionalDerivative.size() != size_) {
122 +      //error
123 +      std::cerr << "size does not match"<< std::endl;        
124 +    }
125 +
126 +    if (storageLayout_ & dslElectricField && electricField.size() != size_) {
127 +      //error
128 +      std::cerr << "size does not match"<< std::endl;        
129 +    }
130 +
131 +    if (storageLayout_ & dslSkippedCharge && skippedCharge.size() != size_) {
132 +      //error
133 +      std::cerr << "size does not match"<< std::endl;        
134 +    }
135 +    
136      return size_;
137  
138    }
# Line 140 | Line 171 | namespace oopse {
171        internalResize(torque, newSize);
172      }
173  
174 +    if (storageLayout_ & dslParticlePot) {
175 +      internalResize(particlePot, newSize);
176 +    }
177 +
178 +    if (storageLayout_ & dslDensity) {
179 +      internalResize(density, newSize);
180 +    }
181 +
182 +    if (storageLayout_ & dslFunctional) {
183 +      internalResize(functional, newSize);
184 +    }
185 +
186 +    if (storageLayout_ & dslFunctionalDerivative) {
187 +      internalResize(functionalDerivative, newSize);
188 +    }
189 +
190 +    if (storageLayout_ & dslElectricField) {
191 +      internalResize(electricField, newSize);
192 +    }
193 +
194 +    if (storageLayout_ & dslSkippedCharge) {
195 +      internalResize(skippedCharge, newSize);
196 +    }
197 +
198      size_ = newSize;
199    }
200  
# Line 174 | Line 229 | namespace oopse {
229  
230      if (storageLayout_ & dslTorque) {
231        torque.reserve(size);
232 +    }
233 +    
234 +    if (storageLayout_ & dslParticlePot) {
235 +      particlePot.reserve(size);
236 +    }
237 +
238 +    if (storageLayout_ & dslDensity) {
239 +      density.reserve(size);
240 +    }
241 +
242 +    if (storageLayout_ & dslFunctional) {
243 +      functional.reserve(size);
244      }
245  
246 +    if (storageLayout_ & dslFunctionalDerivative) {
247 +      functionalDerivative.reserve(size);
248 +    }
249 +
250 +    if (storageLayout_ & dslElectricField) {
251 +      electricField.reserve(size);
252 +    }
253 +
254 +    if (storageLayout_ & dslSkippedCharge) {
255 +      skippedCharge.reserve(size);
256 +    }
257 +
258    }
259  
260    void DataStorage::copy(int source, int num, int target) {
# Line 214 | Line 293 | namespace oopse {
293      if (storageLayout_ & dslTorque) {
294        internalCopy(torque, source, num, target);
295      }
217    
296  
297 +    if (storageLayout_ & dslParticlePot) {
298 +      internalCopy(particlePot, source, num, target);
299 +    }
300 +
301 +    if (storageLayout_ & dslDensity) {
302 +      internalCopy(density, source, num, target);
303 +    }
304 +
305 +    if (storageLayout_ & dslFunctional) {
306 +      internalCopy(functional, source, num, target);
307 +    }
308 +
309 +    if (storageLayout_ & dslFunctionalDerivative) {
310 +      internalCopy(functionalDerivative, source, num, target);
311 +    }
312 +
313 +    if (storageLayout_ & dslElectricField) {
314 +      internalCopy(electricField, source, num, target);
315 +    }
316 +
317 +    if (storageLayout_ & dslSkippedCharge) {
318 +      internalCopy(skippedCharge, source, num, target);
319 +    }
320    }
321  
322    int DataStorage::getStorageLayout() {
# Line 261 | Line 362 | namespace oopse {
362      case dslTorque:
363        return internalGetArrayPointer(torque);
364        break;
365 <            
365 >
366 >    case dslParticlePot:
367 >      return internalGetArrayPointer(particlePot);
368 >      break;
369 >
370 >    case dslDensity:
371 >      return internalGetArrayPointer(density);
372 >      break;
373 >
374 >    case dslFunctional:
375 >      return internalGetArrayPointer(functional);
376 >      break;
377 >
378 >    case dslFunctionalDerivative:
379 >      return internalGetArrayPointer(functionalDerivative);
380 >      break;
381 >
382 >    case dslElectricField:
383 >      return internalGetArrayPointer(electricField);
384 >      break;
385 >
386 >    case dslSkippedCharge:
387 >      return internalGetArrayPointer(skippedCharge);
388 >      break;
389 >          
390      default:
391        //error message
392        return NULL;
# Line 338 | Line 463 | namespace oopse {
463        bytes += sizeof(Vector3d);
464      }
465      if (layout & dslAmat) {
466 <      bytes += sizeof(Mat3x3d);    
466 >      bytes += sizeof(RotMat3x3d);    
467      }
468      if (layout & dslAngularMomentum) {
469        bytes += sizeof(Vector3d);
# Line 347 | Line 472 | namespace oopse {
472        bytes += sizeof(Mat3x3d);
473      }
474      if (layout & dslZAngle) {
475 <      bytes += sizeof(Vector3d);
475 >      bytes += sizeof(RealType);
476      }
477      if (layout & dslForce) {
478        bytes += sizeof(Vector3d);
# Line 355 | Line 480 | namespace oopse {
480      if (layout & dslTorque) {
481        bytes += sizeof(Vector3d);
482      }
483 +    if (layout & dslParticlePot) {
484 +      bytes += sizeof(RealType);
485 +    }
486 +    if (layout & dslDensity) {
487 +      bytes += sizeof(RealType);
488 +    }
489 +    if (layout & dslFunctional) {
490 +      bytes += sizeof(RealType);
491 +    }
492 +    if (layout & dslFunctionalDerivative) {
493 +      bytes += sizeof(RealType);
494 +    }
495 +    if (layout & dslElectricField) {
496 +      bytes += sizeof(Vector3d);
497 +    }
498 +    if (layout & dslSkippedCharge) {
499 +      bytes += sizeof(RealType);
500 +    }
501 +
502      return bytes;
503    }
504  

Comparing:
trunk/src/brains/DataStorage.cpp (property svn:keywords), Revision 1104 by gezelter, Fri Dec 29 21:43:18 2006 UTC vs.
branches/development/src/brains/DataStorage.cpp (property svn:keywords), Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines