ensightPartCells.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::ensightPartCells
26 
27 Description
28  An implementation of ensightPart to hold volume mesh cells.
29 
30 SourceFiles
31  ensightPartCells.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef ensightPartCells_H
36 #define ensightPartCells_H
37 
38 #include "ensightPart.H"
39 #include "typeInfo.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class ensightPartCells Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class ensightPartCells
51 :
52  public ensightPart
53 {
54  // Private Member Functions
55 
56  //- Disallow default bitwise assignment
57  void operator=(const ensightPartCells&);
58 
59  //- Classify the cell types, set elemLists.
60  void classify
61  (
62  const polyMesh&,
63  const labelUList& idLabels = labelUList::null()
64  );
65 
66  //- Track points used
67  virtual localPoints calcLocalPoints() const;
68 
69  //- Track the points used
70  // virtual void makeLocalPointMap();
71 
72  //- Element connectivity
73  virtual void writeConnectivity
74  (
76  const word& key,
77  const labelUList& idList,
78  const labelUList& pointMap
79  ) const;
80 
81 
82 protected:
83 
84  //- Addressable ensight element types
85  enum elemType
86  {
92  };
93 
94 
95  // Static data members
96 
97  static const List<word> elemTypes_;
98 
99 
100  // Protected data
101 
102  //- Mesh referenced
103  const polyMesh& mesh_;
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("ensightCells");
110 
111  // Constructors
112 
113  //- Construct empty part with number and description
114  ensightPartCells(label partNumber, const string& partDescription);
115 
116  //- Construct from polyMesh without zones
117  ensightPartCells(label partNumber, const polyMesh&);
118 
119  //- Construct from polyMesh and list of (non-zoned) cells
121  (
122  label partNumber,
123  const polyMesh&,
124  const labelUList&
125  );
126 
127  //- Construct from polyMesh and cellZone
129  (
130  label partNumber,
131  const polyMesh&,
132  const cellZone&
133  );
134 
135  //- Construct as copy
137 
138  //- Reconstruct part characteristics (eg, element types) from Istream
139  // A part reconstructed in this manner can be used when writing fields,
140  // but cannot be used to write a new geometry
141  // \sa Foam::ensightPart::reconstruct
143 
144  //- Reconstruct part characteristics on freestore from Istream
146  {
148  }
149 
150 
151  //- Destructor
152  virtual ~ensightPartCells();
153 
154 
155  // Member Functions
156 
157  //- Write geometry
158  virtual void writeGeometry(ensightGeoFile&) const;
159 
160  //- Static listing of the element types
161  virtual const List<word>& elementTypes() const
162  {
163  return elemTypes_;
164  }
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
static autoPtr< ensightPartCells > New(Istream &is)
Reconstruct part characteristics on freestore from Istream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Specialized Ensight output with extra geometry file header.
Track the points used by the part and map global to local indices.
Definition: ensightPart.H:105
An implementation of ensightPart to hold volume mesh cells.
virtual void writeGeometry(ensightGeoFile &) const
Write geometry.
TypeName("ensightCells")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
elemType
Addressable ensight element types.
Base class for ensightPartCells and ensightPartFaces.
Definition: ensightPart.H:65
virtual const List< word > & elementTypes() const
Static listing of the element types.
static const UList< T > & null()
Return a null UList.
Definition: UListI.H:51
A subset of mesh cells.
Definition: cellZone.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
static const List< word > elemTypes_
ensightPartCells(label partNumber, const string &partDescription)
Construct empty part with number and description.
virtual ~ensightPartCells()
Destructor.
const polyMesh & mesh_
Mesh referenced.
Namespace for OpenFOAM.