2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008,2009 Oliver Gloth +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #ifndef simplefoamwriter_H
24 #define simplefoamwriter_H
26 class SimpleFoamWriter
;
28 #include "iooperation.h"
31 * Writer for OpenFOAM grids
33 class SimpleFoamWriter
: public IOOperation
36 protected: // data types
39 QVector
<vtkIdType
> node
;
40 vtkIdType owner
, neighbour
;
42 int operator[](int i
) { while(i
<0) i
+=node
.size(); while(i
>=node
.size()) i
-=node
.size(); return node
[i
]; };
43 bool operator<(const face_t
&F
) const;
44 vec3_t
normal(vtkUnstructuredGrid
*grid
);
46 face_t(int N
, int o
, int n
, int b
=0) { node
.resize(N
); owner
= o
; neighbour
= n
; bc
= b
; };
49 protected: // attributes
52 QVector
<face_t
> faces
;
60 vtkIdType
getNeigh(int i_cells
, int i_neigh
);
61 void addFace(face_t F
);
66 void writeNeighbour();
69 virtual void operate();
74 virtual ~SimpleFoamWriter() {};