Enables working with files in the XML Format. More...
Inherits XMLParser.
Public Types | |
enum | AccessType |
Enumerated values for file access type. | |
Public Member Functions | |
IOField () | |
Default constructor. | |
IOField (const string &file, AccessType access, bool compact=true) | |
Constructor using file name. More... | |
IOField (const string &mesh_file, const string &file, Mesh &ms, AccessType access, bool compact=true) | |
Constructor using file name, mesh file and mesh. More... | |
IOField (const string &file, Mesh &ms, AccessType access, bool compact=true) | |
Constructor using file name and mesh. More... | |
~IOField () | |
Destructor. | |
void | setMeshFile (const string &file) |
Set mesh file. More... | |
void | open () |
Open file. More... | |
void | open (const string &file, AccessType access) |
Open file. More... | |
void | close () |
Close file. | |
void | put (Mesh &ms) |
Store mesh in file. | |
void | put (const Vect< real_t > &v) |
Store Vect instance v in file. More... | |
real_t | get (Vect< real_t > &v) |
Get Vect v instance from file. More... | |
int | get (Vect< real_t > &v, real_t t) |
Get Vect v instance from file corresponding to a specific time value. More... | |
void | saveGMSH (string output_file, string mesh_file) |
Save field vectors in a file using GMSH format. More... | |
Detailed Description
Enables working with files in the XML Format.
This class has methods to store vectors in files and read from files.
Constructor & Destructor Documentation
IOField | ( | const string & | file, |
AccessType | access, | ||
bool | compact = true |
||
) |
Constructor using file name.
- Parameters
-
[in] file File name. [in] access Access code. This number is to be chosen among two enumerated values: -
IOField::IN
to read the file -
IOField::OUT
to write on it
[in] compact Flag to choose a compact storage or not [Default: true
] -
IOField | ( | const string & | mesh_file, |
const string & | file, | ||
Mesh & | ms, | ||
AccessType | access, | ||
bool | compact = true |
||
) |
Constructor using file name, mesh file and mesh.
- Parameters
-
[in] mesh_file File containing mesh [in] file File that contains field stored or to store [in] ms Mesh instance [in] access Access code. This number is to be chosen among two enumerated values: -
IOField::IN
to read the file -
IOField::OUT
to write on it
[in] compact Flag to choose a compact storage or not [Default: true
] -
IOField | ( | const string & | file, |
Mesh & | ms, | ||
AccessType | access, | ||
bool | compact = true |
||
) |
Constructor using file name and mesh.
- Parameters
-
[in] file File that contains field stored or to store [in] ms Mesh instance [in] access Access code. This number is to be chosen among two enumerated values: -
IOField::IN
to read the file -
IOField::OUT
to write on it
[in] compact Flag to choose a compact storage or not [Default: true
] -
Member Function Documentation
void setMeshFile | ( | const string & | file | ) |
Set mesh file.
- Parameters
-
[in] file Mesh file
void open | ( | ) |
Open file.
Case where file name has been previously given (in the constructor).
void open | ( | const string & | file, |
AccessType | access | ||
) |
Open file.
- Parameters
-
[in] file File name. [in] access Access code. This number is to be chosen among two enumerated values: -
IOField::IN
to read the file -
IOField::OUT
to write on it
-
Get Vect v
instance from file.
First time step is read from the XML
file.
Get Vect v
instance from file corresponding to a specific time value.
The sought vector corresponding to the time value is read from the XML
file.
- Parameters
-
[in,out] v Vector instance [in] t Time value
void saveGMSH | ( | string | output_file, |
string | mesh_file | ||
) |
Save field vectors in a file using GMSH format.
This member function enables avoiding the use of cfield
. It must be used once all field vectors have been stored in output file. It closes this file and copies its contents to a GMSH file.
- Parameters
-
[in] output_file Output file name where to store using GMSH format [in] mesh_file File containing mesh data