Memosa-FVM  0.2
FluentReader.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #ifndef _FLUENTREADER_H_
6 #define _FLUENTREADER_H_
7 
8 #include "misc.h"
9 #include "StorageSite.h"
10 #include "SchemeReader.h"
11 #include "Array.h"
12 #include "Vector.h"
13 #include "CRConnectivity.h"
14 #include "Mesh.h"
15 
17 
18 typedef map<int, shared_ptr<OneToOneIndexMap> > GhostCellMapsMap;
19 
20 struct FluentZone
21 {
22  int ID;
23  int iBeg;
24  int iEnd;
25  int partnerId;
27  string zoneName;
28  string zoneType;
29  string zoneVars;
30 };
31 
32 struct FluentFaceZone : public FluentZone
33 {
36 };
37 
38 struct FluentCellZone : public FluentZone
39 {
40  vector<int> boundaryZoneIds;
41  vector<int> interiorZoneIds;
42  vector<int> interfaceZoneIds;
43 
46  shared_ptr<Array<int> > globalToLocalNodeMap;
47 };
48 
50 {
51  FluentFacePairs(const int count_, const int leftID_, const int rightID_,
52  shared_ptr<Array<int> > leftFaces_,
53  shared_ptr<Array<int> > rightFaces_) :
54  count(count_),
55  leftID(leftID_),
56  rightID(rightID_),
57  leftFaces(leftFaces_),
58  rightFaces(rightFaces_)
59  {}
60 
61  const int count;
62  const int leftID;
63  const int rightID;
64  shared_ptr<Array<int> > leftFaces;
65  shared_ptr<Array<int> > rightFaces;
66 
67 };
68 
69 
70 typedef map<int,FluentFaceZone*> FaceZonesMap;
71 typedef map<int,FluentCellZone*> CellZonesMap;
72 typedef map<int,shared_ptr<FluentFacePairs> > FacePairsMap;
73 
74 class FluentReader : public SchemeReader
75 {
76 public:
77 
79 
80 
81 
82  FluentReader(const string& fileName);
83  virtual ~FluentReader();
84 
85  void readMesh();
86  //void orderCellFacesAndNodes();
87 
88 
90 
91  int getNumCells() {return _numCells;}
92 
93  string getVars() {return _rpVars;}
94 
97 
98 protected:
104 
108 
109  shared_ptr<CRConnectivity> _faceNodes;
110  shared_ptr<CRConnectivity> _faceCells;
111  shared_ptr<CRConnectivity> _cellFaces;
112  shared_ptr<CRConnectivity> _cellNodes;
113  shared_ptr<CRConnectivity> _nodeCells;
114 
118 
121  string _rpVars;
122  map<int,int> _zoneVarStringLength;
123 
124  void read(const int pass);
125  void readNodes(const int pass, const bool isBinary,
126  const bool isDP, const int id);
127  void readCells(const int pass, const bool isBinary, const int id);
128  void readFaces(const int pass, const bool isBinary, const int id);
129  void readFacePairs(const int pass, const bool isBinary, const int id);
130 
131 
132  void readVectorData(Array<Vec3>& a,
133  const int iBeg, const int iEnd, const bool isBinary,
134  const bool isDP);
135 
136  void buildZones();
137 
138  const CRConnectivity& getCellFaces();
139  const CRConnectivity& getCellNodes();
140  const CRConnectivity& getNodeCells();
141 
142  // get the cell zone ID for a particular cell
143  int getCellZoneID(const int c) const;
144 
145  shared_ptr<OneToOneIndexMap>
146  getGhostCellMap(const FluentCellZone& cz, const Array<int>& indices);
147 
148  shared_ptr<OneToOneIndexMap>
149  getCommonNodeMap(const FluentCellZone& cz0, const FluentCellZone& cz1);
150 
151  Mesh* createMesh(const int cellZoneID, Array<int>&);
152 
153 };
154 #endif
const CRConnectivity & getCellFaces()
string zoneVars
Definition: FluentReader.h:29
FacePairsMap _facePairs
Definition: FluentReader.h:117
void readNodes(const int pass, const bool isBinary, const bool isDP, const int id)
shared_ptr< CRConnectivity > _nodeCells
Definition: FluentReader.h:113
map< int, shared_ptr< OneToOneIndexMap > > GhostCellMapsMap
Definition: FluentReader.h:16
void read(const int pass)
void readVectorData(Array< Vec3 > &a, const int iBeg, const int iEnd, const bool isBinary, const bool isDP)
int threadType
Definition: FluentReader.h:26
int getCellZoneID(const int c) const
StorageSite _nodes
Definition: FluentReader.h:107
vector< int > interfaceZoneIds
Definition: FluentReader.h:42
virtual ~FluentReader()
const CRConnectivity & getNodeCells()
map< int, FluentFaceZone * > FaceZonesMap
Definition: FluentReader.h:70
void readFacePairs(const int pass, const bool isBinary, const int id)
GhostCellMapsMap ghostCellMaps
Definition: FluentReader.h:45
FaceZonesMap _faceZones
Definition: FluentReader.h:115
CellZonesMap _cellZones
Definition: FluentReader.h:116
Definition: Mesh.h:49
vector< int > boundaryZoneIds
Definition: FluentReader.h:40
shared_ptr< Array< int > > rightFaces
Definition: FluentReader.h:65
Mesh * createMesh(const int cellZoneID, Array< int > &)
string zoneType
Definition: FluentReader.h:28
map< int, int > _zoneVarStringLength
Definition: FluentReader.h:122
shared_ptr< OneToOneIndexMap > getCommonNodeMap(const FluentCellZone &cz0, const FluentCellZone &cz1)
void readCells(const int pass, const bool isBinary, const int id)
const CRConnectivity & getCellNodes()
FaceZonesMap & getFaceZones()
Definition: FluentReader.h:95
StorageSite _faces
Definition: FluentReader.h:106
int getNumCells()
Definition: FluentReader.h:91
map< int, FluentCellZone * > CellZonesMap
Definition: FluentReader.h:71
CellZonesMap & getCellZones()
Definition: FluentReader.h:96
void readFaces(const int pass, const bool isBinary, const int id)
const int leftID
Definition: FluentReader.h:62
MeshList getMeshList()
shared_ptr< CRConnectivity > _cellNodes
Definition: FluentReader.h:112
Array< Vec3 > _coords
Definition: FluentReader.h:119
string zoneName
Definition: FluentReader.h:27
FluentReader(const string &fileName)
shared_ptr< CRConnectivity > _cellFaces
Definition: FluentReader.h:111
shared_ptr< Array< int > > globalToLocalNodeMap
Definition: FluentReader.h:46
const int count
Definition: FluentReader.h:61
shared_ptr< CRConnectivity > _faceCells
Definition: FluentReader.h:110
StorageSite _cells
Definition: FluentReader.h:105
const int rightID
Definition: FluentReader.h:63
vector< int > interiorZoneIds
Definition: FluentReader.h:41
Vector< double, 3 > Vec3
Definition: FluentReader.h:78
shared_ptr< OneToOneIndexMap > getGhostCellMap(const FluentCellZone &cz, const Array< int > &indices)
int _rpVarStringLength
Definition: FluentReader.h:120
shared_ptr< CRConnectivity > _faceNodes
Definition: FluentReader.h:109
FluentFacePairs(const int count_, const int leftID_, const int rightID_, shared_ptr< Array< int > > leftFaces_, shared_ptr< Array< int > > rightFaces_)
Definition: FluentReader.h:51
string getVars()
Definition: FluentReader.h:93
map< int, shared_ptr< FluentFacePairs > > FacePairsMap
Definition: FluentReader.h:72
string _rpVars
Definition: FluentReader.h:121
int _numBoundaryFaces
Definition: FluentReader.h:103
vector< Mesh * > MeshList
Definition: Mesh.h:439
shared_ptr< Array< int > > leftFaces
Definition: FluentReader.h:64