#include <mdp_field.h>
Public Member Functions | |
mdp_field () | |
declare empty field (zero size) | |
mdp_field (mdp_lattice &a, int n=1) | |
declares a field on lattice a and allocates a vector of n T at each site | |
mdp_field (mdp_field &field) | |
bool | allocated () |
checks if a field is allocated of has zero-size | |
void | allocate_field (mdp_lattice &a, int n=0) |
Allows dynamical allocation of a field that is not allocated. | |
void | fill_header () |
void | deallocate_memory () |
void | reset_field () |
do not use, may cause memory leaks | |
void | deallocate_field () |
dynamically deallocate field | |
T & | operator() (mdp_site x, int i=0) |
returns component i of the vector of objects T stored at site x | |
T & | operator() (int idx, int i=0) |
T * | operator[] (mdp_site x) |
retruns the address of the vector of objects T stored at site x | |
T & | operator[] (long i) |
T * | address (mdp_site x, int i=0) const |
void | shift (int i, int mu) |
void | operator= (const mdp_field &a) |
void | operator= (const T a) |
void | operator+= (const mdp_field &a) |
void | operator-= (const mdp_field &a) |
template<class T2> | |
void | operator *= (const T2 a) |
template<class T2> | |
void | operator/= (const T2 a) |
mdp_lattice & | lattice () const |
returns by reference the lattice this field is defined on | |
long | field_size () |
returns the total memory in bytes occupied by the field | |
long | file_size () |
returns the total space in bytes required to store the field | |
int | where_global (long i) |
only used by mdp_field::load() and mdp_field::save() | |
void | switch_endianess_4bytes () |
long | global_size () |
lattice size in units of sizeof(T) | |
long | physical_size () |
long | size_per_site () |
long | physical_local_start (int i=2) |
long | physical_local_stop (int i=2) |
T * | physical_address (long i=0) |
void | update (int np=2, int d=-1, int size=1) |
bool | load (string filename, int processIO=0, long max_buffer_size=1024, bool load_header=true, long skip_bytes=0, bool(*user_read)(FILE *, void *, long, long, long, const mdp_lattice &)=0, bool try_switch_endianess=false) |
Best way to load a field. | |
bool | save (string filename, int processIO=0, long max_buffer_size=1024, bool load_header=true, long skip_bytes=0, bool(*user_write)(FILE *, void *, long, long, long, const mdp_lattice &)=0) |
Best way to save a field. | |
Public Attributes | |
mdp_field_file_header | header |
the field file header, contains data only if field was read from file | |
Protected Attributes | |
T * | m |
long | Tsize |
long | size |
int | field_components |
Example:
int box[]={10,10,10}; mdp_lattice lattice(3,box); mdp_field<float> psi(lattice,10); mdp_site x(lattice); forallsites(x) for(int i=0; i<10; i++) psi(x,i)=0.0; psi.update(); // synchronization psi.save("myfield"); psi.load("myfield");
|
shifts the entire fields in direction mu of i steps (i can be positive or negative) note that if i=1, field(x-mu) is assigned to field(x) function requires communication |
|
the most important communication function in MDP. it must be called after each field variables are modified. it restores the syncronization between parallel processes. |