Bridge++
Ver. 1.3.x
Main Page
Namespaces
Classes
Files
File List
File Members
gaugeConfig.cpp
Go to the documentation of this file.
1
14
#include "
gaugeConfig.h
"
15
16
const
std::string
GaugeConfig::class_name
=
"GaugeConfig"
;
17
18
//====================================================================
19
GaugeConfig::GaugeConfig
(
const
string
& type)
20
: m_vl(
CommonParameters
::Vlevel()), m_fieldio()
21
{
22
if
(type ==
"Text"
) {
23
m_fieldio
=
new
FieldIO_Text
(
IO_Format::Gauge::ILDG
);
24
}
else
if
(type ==
"Text_4x4x4x8"
) {
25
m_fieldio
=
new
FieldIO_Text_4x4x4x8
(
IO_Format::Gauge::ILDG
);
26
}
else
if
(type ==
"Binary"
) {
27
m_fieldio
=
new
FieldIO_Binary
(
IO_Format::Gauge::ILDG
);
28
}
else
if
(type ==
"Fortran_JLQCD"
) {
29
m_fieldio
=
new
FieldIO_Fortran
(
IO_Format::Gauge::JLQCD
);
30
}
else
if
(type ==
"Fortran_ILDG"
) {
31
m_fieldio
=
new
FieldIO_Fortran
(
IO_Format::Gauge::ILDG
);
32
}
else
if
(type ==
"ILDG"
) {
33
m_fieldio
=
new
FieldIO_LIME
(
IO_Format::Gauge::ILDG
);
34
}
else
if
(type ==
"Binary_Parallel"
) {
35
m_fieldio
=
new
FieldIO_Binary_Parallel
(
IO_Format::Gauge::ILDG
);
36
}
else
if
(type ==
"Binary_Distributed"
) {
37
m_fieldio
=
new
FieldIO_Binary_Distributed
(
IO_Format::Gauge::ILDG
);
38
}
else
if
(type ==
"ILDG_Parallel"
) {
39
m_fieldio
=
new
FieldIO_LIME_MPIIO
(
IO_Format::Gauge::ILDG
);
40
}
else
{
41
vout
.
crucial
(
"%s: unsupported type \"%s\".\n"
,
class_name
.c_str(), type.c_str());
42
exit(EXIT_FAILURE);
43
}
44
}
45
46
47
//====================================================================
48
GaugeConfig::~GaugeConfig
()
49
{
50
if
(
m_fieldio
)
delete
m_fieldio
;
51
m_fieldio
= 0;
52
}
53
54
55
//====================================================================
56
void
GaugeConfig::read_file
(
Field
*U,
const
string
& filename)
57
{
58
if
(!
m_fieldio
) {
59
vout
.
crucial
(
"%s::read_file(): FieldIO not set.\n"
,
class_name
.c_str());
60
exit(EXIT_FAILURE);
61
}
62
63
m_fieldio
->
read_file
(U, filename);
64
}
65
66
67
//====================================================================
68
void
GaugeConfig::read_file
(
unique_ptr<Field_G>
& U,
const
string
& filename)
69
{
70
if
(!
m_fieldio
) {
71
vout
.
crucial
(
"%s::read_file(): FieldIO not set.\n"
,
class_name
.c_str());
72
exit(EXIT_FAILURE);
73
}
74
75
m_fieldio
->
read_file
((
Field
*)U.
get
(), filename);
76
}
77
78
79
//====================================================================
80
void
GaugeConfig::write_file
(
Field
*U,
const
string
& filename)
81
{
82
if
(!
m_fieldio
) {
83
vout
.
crucial
(
"%s::write_file(): FieldIO not set.\n"
,
class_name
.c_str());
84
exit(EXIT_FAILURE);
85
}
86
87
string
filename_header = filename.substr(0, 9);
88
89
if
(filename_header !=
"NO_OUTPUT"
) {
90
m_fieldio
->
write_file
(U, filename);
91
}
92
}
93
94
95
//====================================================================
96
void
GaugeConfig::write_file
(
unique_ptr<Field_G>
& U,
const
string
& filename)
97
{
98
if
(!
m_fieldio
) {
99
vout
.
crucial
(
"%s::write_file(): FieldIO not set.\n"
,
class_name
.c_str());
100
exit(EXIT_FAILURE);
101
}
102
103
string
filename_header = filename.substr(0, 9);
104
105
if
(filename_header !=
"NO_OUTPUT"
) {
106
m_fieldio
->
write_file
((
Field
*)U.
get
(), filename);
107
}
108
}
109
110
111
//====================================================================
112
//============================================================END=====
GaugeConfig::class_name
static const std::string class_name
Definition:
gaugeConfig.h:64
Bridge::vout
BridgeIO vout
Definition:
bridgeIO.cpp:278
GaugeConfig::~GaugeConfig
virtual ~GaugeConfig()
Definition:
gaugeConfig.cpp:48
FieldIO_LIME
FieldIO_LIME class for file I/O of Field data in LIME format.
Definition:
fieldIO_LIME.h:89
GaugeConfig::m_fieldio
FieldIO * m_fieldio
Definition:
gaugeConfig.h:85
gaugeConfig.h
Field
Container of Field-type object.
Definition:
field.h:39
FieldIO_Text
FieldIO_Text class for file I/O of Field data in plain text format.
Definition:
fieldIO_Text.h:32
GaugeConfig::GaugeConfig
GaugeConfig(const string &type)
Definition:
gaugeConfig.cpp:19
IO_Format::Gauge::ILDG
const Format * ILDG
Definition:
io_format.cpp:28
GaugeConfig::read_file
void read_file(Field *U, const string &filename)
Definition:
gaugeConfig.cpp:56
FieldIO_Fortran
FieldIO_Fortran class for file I/O of Field data in Fortran binary format.
Definition:
fieldIO_Fortran.h:46
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:83
FieldIO_Text_4x4x4x8
FieldIO_Text class for file I/O of Field data in plain text format.
Definition:
fieldIO_Text_4x4x4x8.h:29
Bridge::unique_ptr::get
pointer get() const
Definition:
unique_pointer.h:70
CommonParameters
Common parameter class: provides parameters as singleton.
Definition:
commonParameters.h:40
GaugeConfig::write_file
void write_file(Field *U, const string &filename)
Definition:
gaugeConfig.cpp:80
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition:
bridgeIO.cpp:48
IO_Format::Gauge::JLQCD
const Format * JLQCD
Definition:
io_format.cpp:29
FieldIO_Binary
FieldIO_Binary class for file I/O of Field data in binary format.
Definition:
fieldIO_Binary.h:37
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.
FieldIO_Binary_Distributed
FieldIO_Binary_Distributed class for file I/O of Field data in binary format.
Definition:
fieldIO_Binary_Distributed.h:39
FieldIO_LIME_MPIIO
FieldIO_LIME_MPIIO class for file I/O of Field data in LIME format.
Definition:
fieldIO_LIME_MPIIO.h:85
Bridge::unique_ptr
Definition:
unique_pointer.h:24
work
sueda3
svn
bridge
branches
release
version1.3
src
IO
gaugeConfig.cpp
Generated on Mon Nov 2 2015 22:38:55 for Bridge++ by
1.8.10