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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2016-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::ensightPartCells
29 
30 Description
31  An implementation of ensightPart to hold volume mesh cells.
32 
33 SourceFiles
34  ensightPartCells.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef ensightPartCells_H
39 #define ensightPartCells_H
40 
41 #include "ensightPart.H"
42 #include "ensightCells.H"
43 #include "typeInfo.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class ensightPartCells Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class ensightPartCells
55 :
56  public ensightCells,
57  public ensightPart
58 {
59  // Private Data
60 
61  //- The referenced mesh
62  const polyMesh& mesh_;
63 
64 
65  // Private Member Functions
66 
67  //- Track points used
68  localPoints calcLocalPoints() const;
69 
70  //- Element connectivity
71  void writeConnectivity
72  (
74  const word& key,
75  const labelUList& idList,
76  const labelUList& pointMap
77  ) const;
78 
79 
80  //- No copy construct
81  ensightPartCells(const ensightPartCells&) = delete;
82 
83  //- No copy assignment
84  void operator=(const ensightPartCells&) = delete;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("ensightCells");
91 
92 
93  // Constructors
94 
95  //- Construct from entire polyMesh without zones.
96  //- Part receives the specified name (default: "cells").
98  (
99  label partIndex,
100  const polyMesh& mesh,
101  const string& partName = "cells"
102  );
103 
104  //- Construct a part from polyMesh and list of cells.
105  //- Part receives the specified name (default: "cells").
107  (
108  label partIndex,
109  const polyMesh& mesh,
110  const labelUList& cellIds,
111  const string& partName = "cells"
112  );
113 
114  //- Construct a part from polyMesh and selection of cells.
115  //- Part receives the specified name (default: "cells").
117  (
118  label partIndex,
119  const polyMesh& mesh,
120  const bitSet& selection,
121  const string& partName = "cells"
122  );
123 
124  //- Construct from polyMesh and cellZone.
125  //- Part receives the name of the zone unless otherwise specified.
127  (
128  label partIndex,
129  const polyMesh& mesh,
130  const cellZone& zn,
131  const string& partName = ""
132  );
133 
134 
135  //- Destructor
136  virtual ~ensightPartCells() = default;
137 
138 
139  // Member Functions
140 
141  // Access
142 
143  //- Part index (0-based)
144  virtual label index() const
145  {
146  return ensightCells::index();
147  }
148 
149  //- Number of elements in this part
150  virtual label size() const
151  {
152  return ensightCells::size();
153  }
154 
155 
156  // Output
157 
158  //- Write summary information about the object
159  virtual void writeSummary(Ostream& os) const;
160 
161  //- Print various types of debugging information
162  virtual void dumpInfo(Ostream& os) const;
163 
164  //- Write geometry
165  virtual void write(ensightGeoFile& os) const;
166 
167  //- Helper: write geometry with given pointField
168  virtual void write(ensightGeoFile& os, const pointField& points) const;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Foam::ensightPart::localPoints
Track the points used by the part and map global to local indices.
Definition: ensightPart.H:78
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:64
typeInfo.H
Foam::ensightCells::cellIds
const labelUList & cellIds() const
Return the cell ids of all elements.
Definition: ensightCellsI.H:89
Foam::ensightPartCells::index
virtual label index() const
Part index (0-based)
Definition: ensightPartCells.H:143
Foam::ensightPartCells
An implementation of ensightPart to hold volume mesh cells.
Definition: ensightPartCells.H:53
Foam::ensightCells::index
label index() const
The index in a list.
Definition: ensightCellsI.H:38
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::cellZone
A subset of mesh cells.
Definition: cellZone.H:62
Foam::ensightGeoFile
Specialized Ensight output with extra geometry file header.
Definition: ensightGeoFile.H:48
Foam::ensightPartCells::size
virtual label size() const
Number of elements in this part.
Definition: ensightPartCells.H:149
Foam::label
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:62
Foam::Field< vector >
Foam::ensightPartCells::TypeName
TypeName("ensightCells")
Runtime type information.
Foam::ensightPartCells::writeSummary
virtual void writeSummary(Ostream &os) const
Write summary information about the object.
Definition: ensightPartCells.C:310
Foam::ensightCells::key
static const char * key(const enum elemType)
Return the ensight element name for the specified type.
Definition: ensightCellsI.H:32
Foam::ensightCells
Sorting/classification of cells (3D) into corresponding ensight element types.
Definition: ensightCells.H:53
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ensightPartCells::~ensightPartCells
virtual ~ensightPartCells()=default
Destructor.
Foam::ensightPart
Base class for ensightPartCells and ensightPartFaces.
Definition: ensightPart.H:56
Foam::ensightPartCells::dumpInfo
virtual void dumpInfo(Ostream &os) const
Print various types of debugging information.
Definition: ensightPartCells.C:322
Foam::UList< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::ensightPartCells::write
virtual void write(ensightGeoFile &os) const
Write geometry.
Definition: ensightPartCells.C:304
ensightPart.H
Foam::ensightCells::size
label size() const
The processor local size of all elements.
Definition: ensightCellsI.H:50
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
ensightCells.H