27 int nin_field = v->
nin();
28 int nex_field = v->
nex();
32 int NinG = 2 * Nc * Nc;
37 int LvolF = NxF * NyF * NzF * NtF;
38 Field v_in(NinG, LvolF, Ndim);
43 assert(nin_file == nin_field);
44 assert(nex_file == nex_field);
48 vout.
detailed(
m_vl,
"%s: file format: nin=%d, nex=%d, Lvol=%d\n", __func__, nin_file, nex_file, Lvol);
49 vout.
detailed(
m_vl,
"%s: field format: nin=%d, nex=%d, Lvol=%d\n", __func__, nin_field, nex_field, v->
nvol());
53 Field vtmp(nin_field, LvolF, nex_field);
60 std::fstream config(filename.c_str(), std::ios::in);
61 if (!config.is_open()) {
62 vout.
crucial(
m_vl,
"%s: file open error: %s may not exist.\n", __func__, filename.c_str());
68 for (
int isite = 0; isite < LvolF; ++isite) {
69 for (
int j = 0; j < nex_file; ++j) {
70 for (
int i = 0; i < nin_file; ++i) {
90 vtmp.
set(i, isite, j, val);
111 int count = NinG * LvolF * Ndim;
127 for (
int j = 0; j < Ndim; ++j) {
128 for (
int t = 0; t < Nt; ++t) {
129 int t2 = (t + ipet * Nt) % NtF;
130 for (
int z = 0; z < Nz; ++z) {
131 int z2 = (z + ipez * Nz) % NzF;
132 for (
int y = 0; y < Ny; ++y) {
133 int y2 = (y + ipey * Ny) % NyF;
134 for (
int x = 0; x < Nx; ++x) {
135 int x2 = (x + ipex * Nx) % NxF;
136 int lsite = idx.site(x, y, z, t);
137 int gsite = indexF.
site(x2, y2, z2, t2);
139 for (
int i = 0; i < NinG; ++i) {
140 v->
set(i, lsite, j, vtmp.
cmp(i, gsite, j));
void detailed(const char *format,...)
void set(const int jin, const int site, const int jex, double v)
int site(const int &x, const int &y, const int &z, const int &t) const
double * ptr(const int jin, const int site, const int jex)
Container of Field-type object.
void write_file(Field *v, string filename)
double cmp(const int jin, const int site, const int jex) const
static int ipe(const int dir)
logical coordinate of current proc.
void read_file(Field *v, string filename)
void crucial(const char *format,...)
static const std::string class_name
static int sync()
synchronize within small world.
static int broadcast(int count, double *data, int sender)
broadcast array of double from sender.
static bool is_primary()
check if the present node is primary in small communicator.
Bridge::VerboseLevel m_vl