JDFTx  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ScalarFieldArray.h File Reference

Variable length arrays of ScalarField and ScalarFieldTildeArray, and their operators. More...

#include <core/VectorField.h>
#include <cstdio>

Macros

#define TptrCollection   std::vector<std::shared_ptr<T> >
 shorthand for templates below (undef'd at end of file)
 

Typedefs

typedef std::vector< ScalarFieldScalarFieldArray
 dynamic size collection of real space scalar fields
 
typedef std::vector
< ScalarFieldTilde
ScalarFieldTildeArray
 dynamic size collection of reciprocal space scalar fields
 

Functions

template<typename T >
std::vector< typename
T::DataType * > 
dataPref (TptrCollection &x)
 Extract a std::vector of data pointers from a ScalarFieldArray.
 
template<typename T >
std::vector< const typename
T::DataType * > 
constDataPref (const TptrCollection &x)
 Extract a std::vector of const data pointers from a const ScalarFieldArray.
 
template<typename T >
TptrCollection clone (const TptrCollection &x)
 Create a copy of the data (note operator= references same data since Tptr's are pointers!)
 
template<typename T >
TptrCollectionoperator*= (TptrCollection &x, double alpha)
 Scale.
 
template<class T >
TptrCollection operator* (const TptrCollection &in, double scaleFac)
 
template<class T >
TptrCollection operator* (double scaleFac, const TptrCollection &in)
 
template<class T >
TptrCollection operator* (TptrCollection &&in, double scaleFac)
 Add (destructible input)
 
template<class T >
TptrCollection operator* (double scaleFac, TptrCollection &&in)
 Add (destructible input)
 
template<typename T >
void axpy (double alpha, const TptrCollection &x, TptrCollection &y)
 y += alpha x
 
ScalarFieldArray operator* (const ScalarFieldArray &x, const ScalarFieldArray &y)
 elementise multiply
 
ScalarFieldArray operator* (ScalarFieldArray &&x, const ScalarFieldArray &y)
 
ScalarFieldArray operator* (const ScalarFieldArray &x, ScalarFieldArray &&y)
 
ScalarFieldArrayoperator*= (ScalarFieldArray &y, const ScalarField &x)
 
ScalarFieldArray operator* (const ScalarField &x, ScalarFieldArray &&y)
 
ScalarFieldArray operator* (ScalarFieldArray &&y, const ScalarField &x)
 
ScalarFieldArray operator* (const ScalarField &x, const ScalarFieldArray &y)
 
ScalarFieldArray operator* (const ScalarFieldArray &y, const ScalarField &x)
 
template<class T >
TptrCollectionoperator+= (TptrCollection &in, const TptrCollection &other)
 Increment.
 
template<class T >
TptrCollectionoperator-= (TptrCollection &in, const TptrCollection &other)
 Decrement.
 
template<class T >
TptrCollection operator+ (const TptrCollection &in1, const TptrCollection &in2)
 
template<class T >
TptrCollection operator+ (const TptrCollection &in1, TptrCollection &&in2)
 Add (destructible input)
 
template<class T >
TptrCollection operator+ (TptrCollection &&in1, const TptrCollection &in2)
 Add (destructible input)
 
template<class T >
TptrCollection operator+ (TptrCollection &&in1, TptrCollection &&in2)
 Add (destructible inputs)
 
template<class T >
TptrCollection operator- (const TptrCollection &in1, const TptrCollection &in2)
 
template<class T >
TptrCollection operator- (const TptrCollection &in1, TptrCollection &&in2)
 Add (destructible inputs)
 
template<class T >
TptrCollection operator- (TptrCollection &&in1, const TptrCollection &in2)
 Add (destructible inputs)
 
template<class T >
TptrCollection operator- (TptrCollection &&in1, TptrCollection &&in2)
 Add (destructible inputs)
 
template<typename T >
double dot (const TptrCollection &x, const TptrCollection &y)
 Inner product.
 
ScalarFieldTildeArray lGradient (const ScalarFieldTilde &, int l)
 spherical tensor gradient of order l (2l+1 outputs, multiplied by Ylm(Ghat) (iG)^l)
 
ScalarFieldTilde lDivergence (const ScalarFieldTildeArray &, int l)
 spherical tensor divergence of order l (2l+1 inputs, multiplied by Ylm(Ghat) (iG)^l, and summed)
 
template<typename T >
void initZero (TptrCollection &x)
 Initialize (non-null) data to zero.
 
template<typename T >
void nullToZero (TptrCollection &x, const GridInfo &gInfo, int N=0)
 
template<typename T >
void initRandomFlat (TptrCollection &x)
 Initialize to random numbers (uniform on 0 to 1)
 
template<typename T >
void randomize (TptrCollection &x)
 Initialize to normal random numbers:
 
template<typename T >
void loadFromFile (TptrCollection &x, const char *filename)
 Load an array of scalar fields from a file.
 
template<typename T >
void saveToFile (const TptrCollection &x, const char *filename)
 Save an array of scalar fields to a file.
 
ScalarFieldArray I (ScalarFieldTildeArray &&X)
 
ScalarFieldArray I (const ScalarFieldTildeArray &X)
 Reciprocal to real space.
 
ScalarFieldTildeArray J (const ScalarFieldArray &X)
 
ScalarFieldTildeArray Idag (const ScalarFieldArray &X)
 
ScalarFieldArray Jdag (ScalarFieldTildeArray &&X)
 
ScalarFieldArray Jdag (const ScalarFieldTildeArray &X)
 Hermitian conjugate of J.
 

Detailed Description

Variable length arrays of ScalarField and ScalarFieldTildeArray, and their operators.