Bridge++
Ver. 1.2.x
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
gaugeConfig.cpp
Go to the documentation of this file.
1
14
#include "
gaugeConfig.h
"
15
16
#include "
commonParameters.h
"
17
#include "
communicator.h
"
18
#include "
bridgeIO.h
"
19
using
Bridge::vout
;
20
21
#include "
field.h
"
22
#include "
mat_SU_N.h
"
23
24
#include "
fieldIO.h
"
25
#include "
fieldIO_Text.h
"
26
#include "
fieldIO_Text_4x4x4x8.h
"
27
#include "
fieldIO_Binary.h
"
28
#include "
fieldIO_Binary_Parallel.h
"
29
#include "
fieldIO_Fortran.h
"
30
#include "
fieldIO_LIME.h
"
31
#include "
fieldIO_LIME_MPIIO.h
"
32
#include "
io_format.h
"
33
#include "
io_format_gauge.h
"
34
35
const
std::string
GaugeConfig::class_name
=
"GaugeConfig"
;
36
37
//====================================================================
38
GaugeConfig::GaugeConfig
(
const
string
& type)
39
: m_prefix(), m_postfix(), m_vl(
CommonParameters
::Vlevel()), m_fieldio()
40
{
41
if
(type ==
"Text"
) {
42
m_fieldio
=
new
FieldIO_Text
(
IO_Format::Gauge::ILDG
);
43
}
else
if
(type ==
"Text_4x4x4x8"
) {
44
m_fieldio
=
new
FieldIO_Text_4x4x4x8
(
IO_Format::Gauge::ILDG
);
45
}
else
if
(type ==
"Binary"
) {
46
m_fieldio
=
new
FieldIO_Binary
(
IO_Format::Gauge::ILDG
);
47
}
else
if
(type ==
"Fortran_JLQCD"
) {
48
m_fieldio
=
new
FieldIO_Fortran
(
IO_Format::Gauge::JLQCD
);
49
}
else
if
(type ==
"Fortran_ILDG"
) {
50
m_fieldio
=
new
FieldIO_Fortran
(
IO_Format::Gauge::ILDG
);
51
}
else
if
(type ==
"ILDG"
) {
52
m_fieldio
=
new
FieldIO_LIME
(
IO_Format::Gauge::ILDG
);
53
}
else
if
(type ==
"Binary_Parallel"
) {
54
m_fieldio
=
new
FieldIO_Binary_Parallel
(
IO_Format::Gauge::ILDG
);
55
}
else
if
(type ==
"ILDG_Parallel"
) {
56
m_fieldio
=
new
FieldIO_LIME_MPIIO
(
IO_Format::Gauge::ILDG
);
57
}
else
{
58
vout
.
crucial
(
"GaugeConfig: unsupported type \"%s\".\n"
, type.c_str());
59
abort();
60
}
61
}
62
63
64
//====================================================================
65
GaugeConfig::~GaugeConfig
()
66
{
67
if
(
m_fieldio
)
delete
m_fieldio
;
68
m_fieldio
= 0;
69
}
70
71
72
//====================================================================
73
string
GaugeConfig::config_filename
(
const
int
confnum)
74
{
75
const
size_t
filename_len = 256;
76
char
buf[filename_len];
77
78
snprintf(buf, filename_len,
"%s%06d%s"
,
m_prefix
.c_str(), confnum,
m_postfix
.c_str());
79
80
return
string(buf);
81
}
82
83
84
//====================================================================
85
void
GaugeConfig::read_file
(
Field
*u,
const
string
& filename)
86
{
87
if
(!
m_fieldio
) {
88
vout
.
crucial
(
"GaugeConfig::read_config(): FieldIO not set."
);
89
abort();
90
}
91
92
m_fieldio
->
read_file
(u, filename);
93
}
94
95
96
//====================================================================
97
void
GaugeConfig::write_file
(
Field
*u,
const
string
& filename)
98
{
99
if
(!
m_fieldio
) {
100
vout
.
crucial
(
"GaugeConfig::read_config(): FieldIO not set."
);
101
abort();
102
}
103
104
m_fieldio
->
write_file
(u, filename);
105
}
106
107
108
//====================================================================
109
void
GaugeConfig::read_config
(
Field
*U,
int
confnum)
110
{
111
return
read_file
(U,
config_filename
(confnum));
112
}
113
114
115
//====================================================================
116
void
GaugeConfig::write_config
(
Field
*U,
int
confnum)
117
{
118
return
write_file
(U,
config_filename
(confnum));
119
}
120
121
122
//====================================================================
123
//============================================================END=====
GaugeConfig::class_name
static const std::string class_name
Definition:
gaugeConfig.h:59
Bridge::vout
BridgeIO vout
Definition:
bridgeIO.cpp:207
GaugeConfig::~GaugeConfig
virtual ~GaugeConfig()
Definition:
gaugeConfig.cpp:65
fieldIO_LIME.h
FieldIO_LIME
FieldIO_LIME class for file I/O of Field data in LIME format.
Definition:
fieldIO_LIME.h:87
fieldIO.h
GaugeConfig::m_fieldio
FieldIO * m_fieldio
Definition:
gaugeConfig.h:97
fieldIO_LIME_MPIIO.h
gaugeConfig.h
Field
Container of Field-type object.
Definition:
field.h:37
FieldIO_Text
FieldIO_Text class for file I/O of Field data in plain text format.
Definition:
fieldIO_Text.h:33
GaugeConfig::GaugeConfig
GaugeConfig(const string &type)
Definition:
gaugeConfig.cpp:38
IO_Format::Gauge::ILDG
const Format * ILDG
Definition:
io_format.cpp:28
fieldIO_Text_4x4x4x8.h
fieldIO_Binary_Parallel.h
commonParameters.h
GaugeConfig::m_prefix
string m_prefix
Definition:
gaugeConfig.h:95
FieldIO_Fortran
FieldIO_Fortran class for file I/O of Field data in Fortran binary format.
Definition:
fieldIO_Fortran.h:51
FieldIO_Binary_Parallel
FieldIO_Binary_Parallel class for file I/O of Field data in binary format using MPI parallel I/O...
Definition:
fieldIO_Binary_Parallel.h:78
FieldIO_Text_4x4x4x8
FieldIO_Text class for file I/O of Field data in plain text format.
Definition:
fieldIO_Text_4x4x4x8.h:30
fieldIO_Binary.h
CommonParameters
Common parameter class: provides parameters as singleton.
Definition:
commonParameters.h:38
mat_SU_N.h
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition:
bridgeIO.cpp:26
IO_Format::Gauge::JLQCD
const Format * JLQCD
Definition:
io_format.cpp:29
GaugeConfig::write_file
void write_file(Field *u, const string &filename)
Definition:
gaugeConfig.cpp:97
GaugeConfig::m_postfix
string m_postfix
Definition:
gaugeConfig.h:95
GaugeConfig::write_config
void write_config(Field *U, int confnum)
Definition:
gaugeConfig.cpp:116
FieldIO_Binary
FieldIO_Binary class for file I/O of Field data in binary format.
Definition:
fieldIO_Binary.h:38
io_format_gauge.h
FieldIO::read_file
virtual void read_file(Field *v, std::string)=0
read data from file.
FieldIO::write_file
virtual void write_file(Field *v, std::string)=0
write data to file.
field.h
fieldIO_Text.h
bridgeIO.h
FieldIO_LIME_MPIIO
FieldIO_LIME_MPIIO class for file I/O of Field data in LIME format.
Definition:
fieldIO_LIME_MPIIO.h:88
fieldIO_Fortran.h
io_format.h
GaugeConfig::read_config
void read_config(Field *U, int confnum)
Definition:
gaugeConfig.cpp:109
GaugeConfig::read_file
void read_file(Field *u, const string &filename)
Definition:
gaugeConfig.cpp:85
GaugeConfig::config_filename
string config_filename(const int)
Definition:
gaugeConfig.cpp:73
communicator.h
work
sueda-2
code
bridge-code
bridge-1.2.2
src
IO
gaugeConfig.cpp
Generated on Fri Jan 30 2015 16:45:57 for Bridge++ by
1.8.5