28 int nin_field = v->
nin();
29 int nex_field = v->
nex();
34 if ((nin_file == 0) || (nex_file == 0)) {
41 vout.
detailed(
m_vl,
"%s: file format: nin=%d, nex=%d, Lvol=%d\n", __func__, nin_file, nex_file, Lvol);
42 vout.
detailed(
m_vl,
"%s: field format: nin=%d, nex=%d, Lvol=%d\n", __func__, nin_field, nex_field, v->
nvol());
50 vtmp.
reset(nin_field, Lvol, nex_field);
52 std::fstream config(filename.c_str(), std::ios::in);
53 if (!config.is_open()) {
54 vout.
crucial(
m_vl,
"%s: file open error: %s may not exist.\n", __func__, filename.c_str());
60 for (
int j = 0; j < nex_file; ++j) {
61 for (
int isite = 0; isite < Lvol; ++isite) {
62 for (
int i = 0; i < nin_file; ++i) {
82 vtmp.
set(s, isite, t, val);
113 int nin_field = v->
nin();
114 int nex_field = v->
nex();
119 if ((nin_file == 0) || (nex_file == 0)) {
120 nin_file = nin_field;
121 nex_file = nex_field;
126 vout.
detailed(
m_vl,
"%s: file format: nin=%d, nex=%d, Lvol=%d\n", __func__, nin_file, nex_file, Lvol);
127 vout.
detailed(
m_vl,
"%s: field format: nin=%d, nex=%d, Lvol=%d\n", __func__, nin_field, nex_field, v->
nvol());
132 vtmp.
reset(nin_field, Lvol, nex_field);
140 std::fstream config(filename.c_str(), std::ios::out);
141 if (!config.is_open()) {
142 vout.
crucial(
m_vl,
"%s: file open error: %s\n", __func__, filename.c_str());
146 config.setf(std::ios_base::scientific, std::ios_base::floatfield);
147 config.precision(14);
151 for (
int j = 0; j < nex_file; ++j) {
152 for (
int isite = 0; isite < Lvol; ++isite) {
153 for (
int i = 0; i < nin_file; ++i) {
156 val = vtmp.
cmp(s, isite, t);
157 config << val << std::endl;
void detailed(const char *format,...)
void set(const int jin, const int site, const int jex, double v)
static const std::string class_name
void read_file(Field *v, string filename)
void deliver(Field *vlocal, Field *vglobal)
distribute data on primary node over parallel nodes.
Container of Field-type object.
double cmp(const int jin, const int site, const int jex) const
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
const IO_Format::Format * m_format
void crucial(const char *format,...)
void write_file(Field *v, string filename)
static bool is_primary()
check if the present node is primary in small communicator.
void gather(Field *vglobal, Field *vlocal)
gather data on parallel nodes to primary node.
Bridge::VerboseLevel m_vl