EpetraExt
Development
|
class XMLWriter: A class for writing Trilinos objects to XML files. More...
#include <EpetraExt_XMLWriter.h>
XMLWriter (const Epetra_Comm &Comm, const std::string &FileName) | |
ctor More... | |
~XMLWriter () | |
dtor More... | |
void | Create (const std::string &Label) |
Creates the file, giving Label to the whole object. More... | |
void | Close () |
Closes the file. No Write operations can follow. More... | |
void | Write (const std::string &Label, const Epetra_Map &Map) |
Writes an Epetra_Map using label Label . More... | |
void | Write (const std::string &Label, const Epetra_RowMatrix &Matrix) |
Writes an Epetra_RowMatrix using label Label . More... | |
void | Write (const std::string &Label, const Epetra_MultiVector &MultiVector) |
Writes an Epetra_MultiVector using label Label . More... | |
void | Write (const std::string &Label, const std::vector< std::string > &Content) |
Writes the std::vector of std::string's using label Label . More... | |
void | Write (const std::string &Label, const std::string &Text) |
Writes input std::string using label Label . More... | |
void | Write (const std::string &Label, Teuchos::ParameterList &List) |
Writes a Teuchos::ParameterList using label Label . More... | |
class XMLWriter: A class for writing Trilinos objects to XML files.
Class EpetraExt::XMLWriter writes several Trilinos objects in an XML-compatible format. The list of supported objects contains:
All objects can be read and written, with the std::exception of Epetra_RowMatrix objects, that can only be written to files.
An example of usage is reported in file epetraext/example/inout/XML_IO.cpp.
Writing objects goes as follows. Let Map
, Matrix
, LHS
and RHS
an Epetra_Map, Epetra_CrsMatrix, and two Epetra_MultiVector's, respectively. First, we define an XMLWriter object
and we open the file using MyProblem
label:
Writing objects simply goes as
A Teuchos::ParameterList
(List), a std::string
, and a std::vector<std::string>
can be written as
Finally, we close the file
Note that only processor 0 writes the Teuchos::ParameterList, std::string
, and std::vector<std::string>
.
The written file is as follows:
This class requires Teuchos to be configured with the option –enable-teuchos-expat
.
Definition at line 168 of file EpetraExt_XMLWriter.h.
EpetraExt::XMLWriter::XMLWriter | ( | const Epetra_Comm & | Comm, |
const std::string & | FileName | ||
) |
ctor
Definition at line 64 of file EpetraExt_XMLWriter.cpp.
|
inline |
dtor
Definition at line 176 of file EpetraExt_XMLWriter.h.
void EpetraExt::XMLWriter::Create | ( | const std::string & | Label | ) |
Creates the file, giving Label
to the whole object.
Definition at line 72 of file EpetraExt_XMLWriter.cpp.
void EpetraExt::XMLWriter::Close | ( | ) |
Closes the file. No Write operations can follow.
Definition at line 85 of file EpetraExt_XMLWriter.cpp.
void EpetraExt::XMLWriter::Write | ( | const std::string & | Label, |
const Epetra_Map & | Map | ||
) |
Writes an Epetra_Map using label Label
.
Definition at line 223 of file EpetraExt_XMLWriter.cpp.
void EpetraExt::XMLWriter::Write | ( | const std::string & | Label, |
const Epetra_RowMatrix & | Matrix | ||
) |
Writes an Epetra_RowMatrix using label Label
.
Definition at line 120 of file EpetraExt_XMLWriter.cpp.
void EpetraExt::XMLWriter::Write | ( | const std::string & | Label, |
const Epetra_MultiVector & | MultiVector | ||
) |
Writes an Epetra_MultiVector using label Label
.
Definition at line 176 of file EpetraExt_XMLWriter.cpp.
void EpetraExt::XMLWriter::Write | ( | const std::string & | Label, |
const std::vector< std::string > & | Content | ||
) |
Writes the std::vector of std::string's using label Label
.
Definition at line 99 of file EpetraExt_XMLWriter.cpp.
|
inline |
Writes input std::string using label Label
.
Definition at line 200 of file EpetraExt_XMLWriter.h.
void EpetraExt::XMLWriter::Write | ( | const std::string & | Label, |
Teuchos::ParameterList & | List | ||
) |
Writes a Teuchos::ParameterList using label Label
.
Definition at line 306 of file EpetraExt_XMLWriter.cpp.