COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
smurf.h
Go to the documentation of this file.
1 #ifndef smurf_h
2 #define smurf_h
3 
4 #include <fstream>
5 #include <vector>
6 
7 // based on PREPLOT V11.2-0 06/05/2007
8 // Copyright (C) Tecplot, Inc. 1987-2008
9 
10 
11 namespace SmURF {
12 
13 
16 enum ZonePack { BLOCK, POINT };
18 
19 struct TecZone {
20  std::string title;
21  double time;
25  unsigned i, j, k;
26 };
27 
28 
30 {
31  public:
32  MeshWriter(const std::string& fname, const DataType _datatype=DOUBLE, const bool _reverse=false, const unsigned _version=107, const double _solutiontime=0.);
33  ~MeshWriter();
34  void writeMainHeader(const std::string& htitle, const std::vector< std::string >& hvnames);
35  void writeZoneHeader(const ZoneType& type, const ZonePack& pack, const std::string& title, const unsigned I=1, const unsigned J=1, const unsigned K=1, const int &strand_id=int(-2));
36  void writeZoneData (const ZoneType& type, const ZonePack& pack, const std::vector< std::vector< unsigned > >& ve, const std::vector< std::vector< double > >& vv=std::vector< std::vector< double > >(), const int sharefrom=0);
37  private:
38  FILE* m_file; // file pointer
39  const DataType m_datatype; // data type (for all variables)
40  const bool m_reverse; // byte reversal
41  const unsigned m_version; // file version
42  const double m_solutiontime; // solution time
43  unsigned m_nvars; // number of variables
44  bool m_eohmarker; // end-of-header marker
45 };
46 
47 
49 {
50  public:
51  MeshReader(const std::string& fname);
52  ~MeshReader();
53  void readMainHeader(std::string& htitle, std::vector< std::string >& hvnames);
54  std::vector< TecZone > readZoneHeaders();
55  void readZoneData(const TecZone& z, std::vector< std::vector< unsigned > >& ve, std::vector< std::vector< double > >& vv);
56  private:
57  std::ifstream m_file; // file stream
58  unsigned m_version; // file version
59  unsigned m_nvars; // number of variables
60 };
61 
62 
63 }
64 
65 #endif
66 
FILE * m_file
Definition: smurf.h:38
CGAL::Exact_predicates_inexact_constructions_kernel K
ZonePack pack
Definition: smurf.h:24
void writeZoneData(const ZoneType &type, const ZonePack &pack, const std::vector< std::vector< unsigned > > &ve, const std::vector< std::vector< double > > &vv=std::vector< std::vector< double > >(), const int sharefrom=0)
Definition: smurf.cpp:164
ZoneColor color
Definition: smurf.h:22
void writeMainHeader(const std::string &htitle, const std::vector< std::string > &hvnames)
Definition: smurf.cpp:92
ZoneType
Definition: smurf.h:15
unsigned m_nvars
Definition: smurf.h:43
ZoneColor
Definition: smurf.h:14
unsigned j
Definition: smurf.h:25
std::string title
Definition: smurf.h:20
ZonePack
Definition: smurf.h:16
unsigned k
Definition: smurf.h:25
void writeZoneHeader(const ZoneType &type, const ZonePack &pack, const std::string &title, const unsigned I=1, const unsigned J=1, const unsigned K=1, const int &strand_id=int(-2))
Definition: smurf.cpp:113
MeshReader(const std::string &fname)
Definition: smurf.cpp:243
unsigned i
Definition: smurf.h:25
Definition: smurf.cpp:12
bool m_eohmarker
Definition: smurf.h:44
unsigned m_version
Definition: smurf.h:58
std::ifstream m_file
Definition: smurf.h:57
DataType
Definition: smurf.h:17
void readMainHeader(std::string &htitle, std::vector< std::string > &hvnames)
Definition: smurf.cpp:259
const bool m_reverse
Definition: smurf.h:40
double time
Definition: smurf.h:21
ZoneType type
Definition: smurf.h:23
std::vector< TecZone > readZoneHeaders()
Definition: smurf.cpp:284
const DataType m_datatype
Definition: smurf.h:39
const double m_solutiontime
Definition: smurf.h:42
void readZoneData(const TecZone &z, std::vector< std::vector< unsigned > > &ve, std::vector< std::vector< double > > &vv)
Definition: smurf.cpp:332
const unsigned m_version
Definition: smurf.h:41
unsigned m_nvars
Definition: smurf.h:59
MeshWriter(const std::string &fname, const DataType _datatype=DOUBLE, const bool _reverse=false, const unsigned _version=107, const double _solutiontime=0.)
Definition: smurf.cpp:69
Send comments to:
COOLFluiD Web Admin