ensightParts.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 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::ensightParts
26 
27 Description
28  A collection of several ensightPart elements
29 
30 SourceFiles
31  ensightParts.C
32  ensightPartsTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef ensightParts_H
37 #define ensightParts_H
38 
39 #include "ensightPart.H"
40 #include "ensightPartFaces.H"
41 #include "ensightPartCells.H"
42 #include "volFields.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of friend functions and operators
50 
51 class ensightParts;
52 
53 ensightGeoFile& operator<<(ensightGeoFile&, const ensightParts&);
54 
55 
56 /*---------------------------------------------------------------------------*\
57  Class ensightParts Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class ensightParts
61 {
62  // Private Data
63 
64  //- List of parts
65  PtrList<ensightPart> partsList_;
66 
67 
68 public:
69 
70  // Constructors
71 
72  //- Construct from polyMesh
73  ensightParts(const polyMesh&);
74 
75  //- Construct from IOobject
76  ensightParts(const IOobject&);
77 
78  //- Disallow default bitwise copy construction
79  ensightParts(const ensightParts&) = delete;
80 
81 
82  //- Destructor
83  ~ensightParts();
84 
85 
86  // Member Functions
87 
88  //- Clear old information and construct anew from polyMesh
89  void recalculate(const polyMesh&);
90 
91  //- Renumber elements
92  void renumber
93  (
94  const labelUList& origCellId,
95  const labelUList& origFaceId
96  );
97 
98  //- Number of parts
99  label size() const
100  {
101  return partsList_.size();
102  }
103 
104  //- Write the geometry
105  void writeGeometry(ensightGeoFile&) const;
106 
107  //- Write summary information about the objects
108  bool writeSummary(Ostream&) const;
109 
110  //- Write the lists
111  void writeData(Ostream&) const;
112 
113  //- Write (volume) scalar field
114  // optionally write data for face parts
115  // optionally write data per node
116  void writeScalarField
117  (
118  ensightFile&,
119  const List<scalar>& field,
120  const bool useFaceData = false,
121  const bool perNode = false
122  ) const;
123 
124  //- Write (volume) vector field components
125  // optionally write data for face parts
126  // optionally write data per node
127  void writeVectorField
128  (
129  ensightFile&,
130  const List<scalar>& field0,
131  const List<scalar>& field1,
132  const List<scalar>& field2,
133  const bool useFaceData = false,
134  const bool perNode = false
135  ) const;
136 
137 
138  //- Write generalised volume field components
139  template<class Type>
140  void writeField
141  (
142  ensightFile&,
144  ) const;
145 
146 
147 
148  // Member Operators
149 
150  //- Disallow default bitwise assignment
151  void operator=(const ensightParts&) = delete;
152 
153 
154  // Friend Operators
155 
156  //- Write geometry
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #ifdef NoRepository
168  #include "ensightPartsTemplates.C"
169 #endif
170 
171 #endif
172 
173 // ************************************************************************* //
void writeGeometry(ensightGeoFile &) const
Write the geometry.
Definition: ensightParts.C:184
void writeField(ensightFile &, const GeometricField< Type, fvPatchField, volMesh > &) const
Write generalised volume field components.
Ensight output with specialised write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:47
void writeScalarField(ensightFile &, const List< scalar > &field, const bool useFaceData=false, const bool perNode=false) const
Write (volume) scalar field.
Definition: ensightParts.C:229
void recalculate(const polyMesh &)
Clear old information and construct anew from polyMesh.
Definition: ensightParts.C:56
A collection of several ensightPart elements.
Definition: ensightParts.H:59
void writeVectorField(ensightFile &, const List< scalar > &field0, const List< scalar > &field1, const List< scalar > &field2, const bool useFaceData=false, const bool perNode=false) const
Write (volume) vector field components.
Definition: ensightParts.C:252
Template to write generalised field components.
Specialised Ensight output with extra geometry file header.
friend ensightGeoFile & operator<<(ensightGeoFile &, const ensightParts &)
Write geometry.
Generic GeometricField class.
void writeData(Ostream &) const
Write the lists.
Definition: ensightParts.C:208
~ensightParts()
Destructor.
Definition: ensightParts.C:50
label size() const
Number of parts.
Definition: ensightParts.H:98
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
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
ensightParts(const polyMesh &)
Construct from polyMesh.
Definition: ensightParts.C:31
bool writeSummary(Ostream &) const
Write summary information about the objects.
Definition: ensightParts.C:197
label size() const
Return the number of elements in the UPtrList.
Definition: UPtrListI.H:29
void operator=(const ensightParts &)=delete
Disallow default bitwise assignment.
void renumber(const labelUList &origCellId, const labelUList &origFaceId)
Renumber elements.
Definition: ensightParts.C:165
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Ostream & operator<<(Ostream &, const ensightPart &)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
rDeltaTY field()
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:98
Namespace for OpenFOAM.