DOLFIN
DOLFIN C++ interface
RAWFile.h
1 // Copyright (C) 2005-2007 Garth N. Wells
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // Modified by Nuno Lopes 2008.
19 //
20 // First added: 2008-05-29
21 
22 
23 #ifndef __RAW_FILE_H
24 #define __RAW_FILE_H
25 
26 #include <fstream>
27 #include "GenericFile.h"
28 
29 namespace dolfin
30 {
31 
33 
34  class RAWFile : public GenericFile
35  {
36  public:
37 
39  explicit RAWFile(const std::string filename);
40 
42  ~RAWFile();
43 
47  void write(const MeshFunction<int>& meshfunction);
48 
52  void write(const MeshFunction<double>& meshfunction);
53 
57  void write(const Function& u);
58 
59  private:
60 
61  void ResultsWrite(const Function& u) const;
62  void rawNameUpdate(const int counter);
63 
64  template<typename T>
65  void MeshFunctionWrite(T& meshfunction);
66 
67  // raw filename
68  std::string raw_filename;
69 
70  };
71 
72 }
73 
74 #endif
Definition: adapt.h:41
Definition: adapt.h:29
Base class for file I/O objects.
Definition: GenericFile.h:44
Output of data in raw binary format.
Definition: RAWFile.h:34
Definition: Function.h:65
RAWFile(const std::string filename)
Constructor.
Definition: RAWFile.cpp:42
~RAWFile()
Destructor.
Definition: RAWFile.cpp:47
void write(const MeshFunction< int > &meshfunction)
Definition: RAWFile.cpp:52