26 const int nin_field = v->
nin();
27 const int nex_field = v->
nex();
32 if ((nin_file == 0) || (nex_file == 0)) {
39 vout.
detailed(
m_vl,
"%s: file format: nin=%d, nex=%d, Lvol=%ld\n", __func__, nin_file, nex_file, Lvol);
40 vout.
detailed(
m_vl,
"%s: field format: nin=%d, nex=%d, Lvol=%ld\n", __func__, nin_field, nex_field, v->
nvol());
48 vtmp.
reset(nin_field, Lvol, nex_field);
50 std::fstream config(filename.c_str(), std::ios::in);
51 if (!config.is_open()) {
52 vout.
crucial(
m_vl,
"Error at %s: file open error: %s may not exist.\n", __func__, filename.c_str());
58 for (
int j = 0; j < nex_file; ++j) {
59 for (
long_t isite = 0; isite < Lvol; ++isite) {
60 for (
int i = 0; i < nin_file; ++i) {
80 vtmp.
set(s, isite, t, val);
90 vout.
crucial(
m_vl,
"Warning at %s: file size larger than expected.\n", __func__);
111 const int nin_field = v->
nin();
112 const int nex_field = v->
nex();
117 if ((nin_file == 0) || (nex_file == 0)) {
118 nin_file = nin_field;
119 nex_file = nex_field;
124 vout.
detailed(
m_vl,
"%s: file format: nin=%d, nex=%d, Lvol=%ld\n", __func__, nin_file, nex_file, Lvol);
125 vout.
detailed(
m_vl,
"%s: field format: nin=%d, nex=%d, Lvol=%ld\n", __func__, nin_field, nex_field, v->
nvol());
130 vtmp.
reset(nin_field, Lvol, nex_field);
138 std::fstream config(filename.c_str(), std::ios::out);
139 if (!config.is_open()) {
140 vout.
crucial(
m_vl,
"Error at %s: file open error: %s\n", __func__, filename.c_str());
144 config.setf(std::ios_base::scientific, std::ios_base::floatfield);
145 config.precision(14);
149 for (
int j = 0; j < nex_file; ++j) {
150 for (
long_t isite = 0; isite < Lvol; ++isite) {
151 for (
int i = 0; i < nin_file; ++i) {
154 val = vtmp.
cmp(s, isite, t);
155 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 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
const IO_Format::Format * m_format
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
long long_t
definition of long for Bridge++
void crucial(const char *format,...)
void write_file(Field *v, const std::string filename)
write data to file.
void read_file(Field *v, const std::string filename)
read data from file.
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