25 #include <dolfin/common/MPI.h> 26 #include "GenericFile.h" 50 enum class Type {x3d, xml, vtk, raw, xyz, binary, svg};
74 File(
const std::string filename, std::string encoding=
"ascii");
101 File(MPI_Comm comm,
const std::string filename,
102 std::string encoding=
"ascii");
119 File(
const std::string filename,
Type type, std::string encoding=
"ascii");
138 File(MPI_Comm comm,
const std::string filename,
Type type,
139 std::string encoding=
"ascii");
146 File(std::ostream& outstream);
159 template<
typename T>
void read(T& t)
173 void operator<<(const std::pair<const Mesh*, double> mesh);
183 void operator<<(const std::pair<const MeshFunction<int>*,
double> f);
194 (
const std::pair<const MeshFunction<std::size_t>*,
double> f);
204 void operator<< (const std::pair<const MeshFunction<double>*,
double> f);
214 void operator<<(const std::pair<const MeshFunction<bool>*,
double> f);
224 void operator<<(const std::pair<const Function*, double> u);
230 _file->_write(_mpi_comm.rank());
238 _file->_write(_mpi_comm.rank());
246 _file->_write(_mpi_comm.rank());
247 _file->write(x, time);
259 static bool exists(std::string filename);
271 void init(MPI_Comm comm,
const std::string filename, std::string encoding);
274 void init(MPI_Comm comm,
const std::string filename,
Type type,
275 std::string encoding);
282 std::unique_ptr<GenericFile> _file;
void operator>>(T &t)
Read from file.
Definition: File.h:152
void read(T &t)
Read from file.
Definition: File.h:159
double time()
Return wall time elapsed since some implementation dependent epoch.
Definition: timing.cpp:48
File(const std::string filename, std::string encoding="ascii")
Definition: File.cpp:38
~File()
Destructor.
Definition: File.cpp:67
Type
File formats.
Definition: File.h:50
static void create_parent_path(std::string filename)
Definition: File.cpp:121
void write(const X &x, double time)
Write object to file with time.
Definition: File.h:244
void init(int argc, char *argv[])
Definition: init.cpp:27
void operator<<(const X &x)
Write object to file.
Definition: File.h:228
void write(const X &x)
Write object to file.
Definition: File.h:236
static bool exists(std::string filename)
Definition: File.cpp:109