RBGen  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RBGen_BurkardtFileIOHandler.h
1 
2 
3 #ifndef BURKARDT_FILE_IO_HANDLER_H
4 #define BURKARDT_FILE_IO_HANDLER_H
5 
6 
7 #include "RBGen_FileIOHandler.hpp"
8 
9 // Forward declaration of Epetra_MultiVector class
10 class Epetra_MultiVector;
11 
12 namespace RBGen {
13 
15  class BurkardtFileIOHandler : public virtual FileIOHandler< Epetra_MultiVector > {
16 
17  public:
19 
20 
23 
25  virtual ~BurkardtFileIOHandler() {};
26 
28 
30 
31 
33 
34  void Reset() { num_nodes = 0; isInit = false; };
35 
37 
39 
40 
42  Teuchos::RCP<Epetra_MultiVector> Read( const std::vector<std::string>& filenames );
43 
45 
47 
48 
50  void Write( const Teuchos::RCP<const Epetra_MultiVector>& MV, const std::string& filename );
51 
53 
55 
57  bool isInitialized() const { return isInit; };
58 
60 
61  private:
62  // Number of nodes.
63  int num_nodes;
64 
65  // Whether or not we know the file format.
66  bool isInit;
67 
68  // File input / output paths
69  std::string in_path, out_path;
70 
71  // Method for getting the number of nodes in the data from a format file.
72  int data_size( const std::string filename );
73 
74  // Method for reading in a triplet of data from an input file.
75  int read_vec( const std::string filename, int n_equations, double *x, double *y );
76 
77  // Method for writing out a triplet of data into an output file.
78  int write_vec( const std::string filename, int n_equations, double *x, double *y );
79  };
80 
81 } // namespace RBGen
82 
83 #endif // BURKARDT_FILE_IO_HANDLER_H
84 
bool isInitialized() const
Return initialized status of the handler.
virtual ~BurkardtFileIOHandler()
Destructor.
FileIOHandler for reading an Epetra_MultiVector from Burkardt data files.
Teuchos::RCP< Epetra_MultiVector > Read(const std::vector< std::string > &filenames)
Method for reading multiple files and putting them into an Epetra_MultiVector.
Abstract base class for reading datasets from files.
void Initialize(const Teuchos::RCP< Teuchos::ParameterList > &params)
Initialize file reader using.
void Write(const Teuchos::RCP< const Epetra_MultiVector > &MV, const std::string &filename)
Method for writing one Epetra_MultiVector into a file.