OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::DataStorage Class Reference

#include <DataStorage.hpp>

Public Types

enum  {
  dslPosition = 1 , dslVelocity = 2 , dslForce = 4 , dslAmat = 8 ,
  dslAngularMomentum = 16 , dslTorque = 32 , dslParticlePot = 64 , dslDensity = 128 ,
  dslFunctional = 256 , dslFunctionalDerivative = 512 , dslDipole = 1024 , dslQuadrupole = 2048 ,
  dslElectricField = 4096 , dslSkippedCharge = 8192 , dslFlucQPosition = 16384 , dslFlucQVelocity = 32768 ,
  dslFlucQForce = 65536 , dslSitePotential = 131072
}
 

Public Member Functions

 DataStorage (std::size_t size, int storageLayout=0)
 
std::size_t getSize ()
 return the size of this DataStorage.
 
void resize (std::size_t newSize)
 Changes the size of this DataStorage.
 
void reserve (std::size_t size)
 Reallocates memory manually.
 
void copy (int source, std::size_t num, std::size_t target)
 Copies data inside DataStorage class.
 
int getStorageLayout ()
 Returns the storage layout

 
void setStorageLayout (int layout)
 Sets the storage layout

 
RealType * getArrayPointer (int whichArray)
 Returns the pointer of internal array.
 

Static Public Member Functions

static std::size_t getBytesPerStuntDouble (int layout)
 electrostatic site potentials
 

Public Attributes

vector< Vector3dposition
 
vector< Vector3dvelocity
 position array
 
vector< Vector3dforce
 velocity array
 
vector< RotMat3x3daMat
 force array
 
vector< Vector3dangularMomentum
 rotation matrix array
 
vector< Vector3dtorque
 angular momentum array (body-fixed)
 
vector< RealType > particlePot
 torque array
 
vector< RealType > density
 particle potential arrray
 
vector< RealType > functional
 electron density
 
vector< RealType > functionalDerivative
 density functional
 
vector< Vector3ddipole
 derivative of functional
 
vector< Mat3x3dquadrupole
 space-frame dipole vector
 
vector< Vector3delectricField
 space-frame quadrupole tensor
 
vector< RealType > skippedCharge
 local electric field
 
vector< RealType > flucQPos
 charge skipped during normal pairwise calculation
 
vector< RealType > flucQVel
 fluctuating charges
 
vector< RealType > flucQFrc
 fluctuating charge velocities
 
vector< RealType > sitePotential
 fluctuating charge forces
 

Detailed Description

Warning
do not try to insert element into (or ease element from) private member data of DataStorage directly.
Todo
DataStorage may need refactoring. Every vector can inherit from the same base class which will make it easy to maintain

Definition at line 69 of file DataStorage.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 71 of file DataStorage.hpp.

Constructor & Destructor Documentation

◆ DataStorage() [1/2]

OpenMD::DataStorage::DataStorage ( )

Definition at line 56 of file DataStorage.cpp.

◆ DataStorage() [2/2]

OpenMD::DataStorage::DataStorage ( std::size_t size,
int storageLayout = 0 )

Definition at line 58 of file DataStorage.cpp.

Member Function Documentation

◆ copy()

void OpenMD::DataStorage::copy ( int source,
std::size_t num,
std::size_t target )

Copies data inside DataStorage class.

Copy function actually calls copy for every vector in DataStorage class. One Precondition of copy is that target is not within the range [source, soruce + num]

Parameters
source
numnumber of element to be moved
target

Definition at line 255 of file DataStorage.cpp.

◆ getArrayPointer()

RealType * OpenMD::DataStorage::getArrayPointer ( int whichArray)

Returns the pointer of internal array.

Definition at line 335 of file DataStorage.cpp.

◆ getBytesPerStuntDouble()

std::size_t OpenMD::DataStorage::getBytesPerStuntDouble ( int layout)
static

electrostatic site potentials

Definition at line 456 of file DataStorage.cpp.

◆ getSize()

std::size_t OpenMD::DataStorage::getSize ( )

return the size of this DataStorage.

Definition at line 63 of file DataStorage.cpp.

◆ getStorageLayout()

int OpenMD::DataStorage::getStorageLayout ( )

Returns the storage layout

Definition at line 328 of file DataStorage.cpp.

◆ reserve()

void OpenMD::DataStorage::reserve ( std::size_t size)

Reallocates memory manually.

The main reason for using reserve() is efficiency if you know the capacity to which your vector must eventually grow, then it is usually more efficient to allocate that memory all at once.

Definition at line 215 of file DataStorage.cpp.

◆ resize()

void OpenMD::DataStorage::resize ( std::size_t newSize)

Changes the size of this DataStorage.

Parameters
newSizenew size of this DataStorage

Definition at line 159 of file DataStorage.cpp.

Referenced by OpenMD::ForceMatrixDecomposition::distributeInitialData().

◆ setStorageLayout()

void OpenMD::DataStorage::setStorageLayout ( int layout)

Sets the storage layout

Definition at line 330 of file DataStorage.cpp.

Referenced by OpenMD::ForceMatrixDecomposition::distributeInitialData().

Member Data Documentation

◆ aMat

vector<RotMat3x3d> OpenMD::DataStorage::aMat

force array

Definition at line 132 of file DataStorage.hpp.

◆ angularMomentum

vector<Vector3d> OpenMD::DataStorage::angularMomentum

rotation matrix array

Definition at line 133 of file DataStorage.hpp.

◆ density

vector<RealType> OpenMD::DataStorage::density

particle potential arrray

Definition at line 136 of file DataStorage.hpp.

◆ dipole

vector<Vector3d> OpenMD::DataStorage::dipole

derivative of functional

Definition at line 139 of file DataStorage.hpp.

◆ electricField

vector<Vector3d> OpenMD::DataStorage::electricField

space-frame quadrupole tensor

Definition at line 141 of file DataStorage.hpp.

◆ flucQFrc

vector<RealType> OpenMD::DataStorage::flucQFrc

fluctuating charge velocities

Definition at line 146 of file DataStorage.hpp.

◆ flucQPos

vector<RealType> OpenMD::DataStorage::flucQPos

charge skipped during normal pairwise calculation

Definition at line 144 of file DataStorage.hpp.

◆ flucQVel

vector<RealType> OpenMD::DataStorage::flucQVel

fluctuating charges

Definition at line 145 of file DataStorage.hpp.

◆ force

vector<Vector3d> OpenMD::DataStorage::force

velocity array

Definition at line 131 of file DataStorage.hpp.

◆ functional

vector<RealType> OpenMD::DataStorage::functional

electron density

Definition at line 137 of file DataStorage.hpp.

◆ functionalDerivative

vector<RealType> OpenMD::DataStorage::functionalDerivative

density functional

Definition at line 138 of file DataStorage.hpp.

◆ particlePot

vector<RealType> OpenMD::DataStorage::particlePot

torque array

Definition at line 135 of file DataStorage.hpp.

◆ position

vector<Vector3d> OpenMD::DataStorage::position

Definition at line 129 of file DataStorage.hpp.

◆ quadrupole

vector<Mat3x3d> OpenMD::DataStorage::quadrupole

space-frame dipole vector

Definition at line 140 of file DataStorage.hpp.

◆ sitePotential

vector<RealType> OpenMD::DataStorage::sitePotential

fluctuating charge forces

Definition at line 147 of file DataStorage.hpp.

◆ skippedCharge

vector<RealType> OpenMD::DataStorage::skippedCharge

local electric field

Definition at line 143 of file DataStorage.hpp.

◆ torque

vector<Vector3d> OpenMD::DataStorage::torque

angular momentum array (body-fixed)

Definition at line 134 of file DataStorage.hpp.

◆ velocity

vector<Vector3d> OpenMD::DataStorage::velocity

position array

Definition at line 130 of file DataStorage.hpp.


The documentation for this class was generated from the following files: