ensightParts.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::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 /*---------------------------------------------------------------------------*\
50  Class ensightParts Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class ensightParts
54 {
55  // Private Data
56 
57  //- List of parts
59 
60  // Private Member Functions
61 
62  //- Disallow default bitwise copy construct
63  ensightParts(const ensightParts&);
64 
65  //- Disallow default bitwise assignment
66  void operator=(const ensightParts&);
67 
68 
69 public:
70 
71  // Constructors
72 
73  //- Construct from polyMesh
74  ensightParts(const polyMesh&);
75 
76  //- Construct from IOobject
77  ensightParts(const IOobject&);
78 
79 
80  //- Destructor
81  ~ensightParts();
82 
83 
84  // Member functions
85 
86  //- Clear old information and construct anew from polyMesh
87  void recalculate(const polyMesh&);
88 
89  //- Renumber elements
90  void renumber
91  (
92  const labelUList& origCellId,
93  const labelUList& origFaceId
94  );
95 
96  //- Number of parts
97  label size() const
98  {
99  return partsList_.size();
100  }
101 
102  //- Write the geometry
103  void writeGeometry(ensightGeoFile&) const;
104 
105  //- Write summary information about the objects
106  bool writeSummary(Ostream&) const;
107 
108  //- Write the lists
109  void writeData(Ostream&) const;
110 
111  //- Write (volume) scalar field
112  // optionally write data for face parts
113  // optionally write data per node
114  void writeScalarField
115  (
116  ensightFile&,
117  const List<scalar>& field,
118  const bool useFaceData = false,
119  const bool perNode = false
120  ) const;
121 
122  //- Write (volume) vector field components
123  // optionally write data for face parts
124  // optionally write data per node
125  void writeVectorField
126  (
127  ensightFile&,
128  const List<scalar>& field0,
129  const List<scalar>& field1,
130  const List<scalar>& field2,
131  const bool useFaceData = false,
132  const bool perNode = false
133  ) const;
134 
135 
136  //- Write generalized volume field components
137  template<class Type>
138  void writeField
139  (
140  ensightFile&,
142  ) const;
143 
144 
145  // Friend Operators
146 
147  //- Write geometry
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
159 # include "ensightPartsTemplates.C"
160 #endif
161 
162 #endif
163 
164 // ************************************************************************* //
volFields.H
Foam::ensightParts
A collection of several ensightPart elements.
Definition: ensightParts.H:52
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::ensightParts::writeData
void writeData(Ostream &) const
Write the lists.
Definition: ensightParts.C:207
Foam::ensightParts::ensightParts
ensightParts(const ensightParts &)
Disallow default bitwise copy construct.
ensightPartFaces.H
Foam::ensightParts::writeGeometry
void writeGeometry(ensightGeoFile &) const
Write the geometry.
Definition: ensightParts.C:183
Foam::ensightParts::operator=
void operator=(const ensightParts &)
Disallow default bitwise assignment.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::ensightParts::writeVectorField
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:251
Foam::ensightParts::~ensightParts
~ensightParts()
Destructor.
Definition: ensightParts.C:49
Foam::ensightParts::partsList_
PtrList< ensightPart > partsList_
List of parts.
Definition: ensightParts.H:57
Foam::ensightGeoFile
Specialized Ensight output with extra geometry file header.
Definition: ensightGeoFile.H:45
Foam::ensightParts::writeSummary
bool writeSummary(Ostream &) const
Write summary information about the objects.
Definition: ensightParts.C:196
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:59
Foam::ensightParts::writeScalarField
void writeScalarField(ensightFile &, const List< scalar > &field, const bool useFaceData=false, const bool perNode=false) const
Write (volume) scalar field.
Definition: ensightParts.C:228
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::ensightFile
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:47
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::ensightParts::renumber
void renumber(const labelUList &origCellId, const labelUList &origFaceId)
Renumber elements.
Definition: ensightParts.C:164
ensightPartsTemplates.C
Template to write generalized field components.
Foam::ensightParts::recalculate
void recalculate(const polyMesh &)
Clear old information and construct anew from polyMesh.
Definition: ensightParts.C:55
Foam::ensightParts::writeField
void writeField(ensightFile &, const GeometricField< Type, fvPatchField, volMesh > &) const
Write generalized volume field components.
Definition: ensightPartsTemplates.C:35
Foam::List< scalar >
Foam::UList
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
ensightPartCells.H
Foam::ensightParts::operator<<
friend ensightGeoFile & operator<<(ensightGeoFile &, const ensightParts &)
Write geometry.
ensightPart.H
Foam::ensightParts::size
label size() const
Number of parts.
Definition: ensightParts.H:96
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52