JDFTx  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FieldData< T > Struct Template Reference

ManagedMemory wrapper with gridInfo and pending scale factor for ScalarField* classes. More...

#include <ScalarField.h>

Inheritance diagram for FieldData< T >:
ManagedMemory< T >

Classes

struct  PrivateTag
 Used to prevent direct use of ScalarField constructors, and force the shared_ptr usage. More...
 

Public Member Functions

 FieldData (const GridInfo &gInfo, string category, int nElem, bool onGpu=false)
 
void copyData (const FieldData< T > &other)
 Copy data and scale (used by clone())
 
void absorbScale () const
 Absorb scale factor into data.
 
T * data (bool shouldAbsorbScale=true)
 get a pointer to the actual data (after absorbing the scale factor, unless otherwise specified)
 
const T * data (bool shouldAbsorbScale=true) const
 get a const pointer to the actual data (after absorbing the scale factor, unless otherwise specified)
 
T * dataGpu (bool shouldAbsorbScale=true)
 get a pointer to the actual data (after absorbing the scale factor, unless otherwise specified)
 
const T * dataGpu (bool shouldAbsorbScale=true) const
 get a const pointer to the actual data (after absorbing the scale factor, unless otherwise specified)
 
T * dataPref (bool shouldAbsorbScale=true)
 
const T * dataPref (bool shouldAbsorbScale=true) const
 
void zero ()
 initialize to zero
 
bool isOnGpu () const
 Check where the data is (for #ifdef simplicity exposed even when no GPU_ENABLED)
 
void sendData (const MPIUtil *mpiUtil, int dest, int tag, MPIUtil::Request *request=0) const
 
void recvData (const MPIUtil *mpiUtil, int dest, int tag, MPIUtil::Request *request=0)
 
void bcastData (const MPIUtil *mpiUtil, int root=0, MPIUtil::Request *request=0)
 
void allReduceData (const MPIUtil *mpiUtil, MPIUtil::ReduceOp op, bool safeMode=false, MPIUtil::Request *request=0)
 
void reduceData (const MPIUtil *mpiUtil, MPIUtil::ReduceOp op, int root=0, MPIUtil::Request *request=0)
 

Public Attributes

const int nElem
 number of elements
 
double scale
 overall scale factor of the data array
 
const GridInfogInfo
 simulation grid info
 

Detailed Description

template<typename T>
struct FieldData< T >

ManagedMemory wrapper with gridInfo and pending scale factor for ScalarField* classes.


The documentation for this struct was generated from the following file: