FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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  ensightPartsI.H
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 <finiteVolume/volFields.H>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class ensightParts Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55  // Private Data
56 
57  //- list of parts
58  PtrList<ensightPart> partsList_;
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 labelList& origCellId,
93  const labelList& 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 scalar field
112  void writeScalarField
113  (
114  ensightFile&,
115  const List<scalar>& field,
116  bool useFaceData = false
117  ) const;
118 
119  //- write vector field components
120  void writeVectorField
121  (
122  ensightFile&,
123  const List<scalar>& field0,
124  const List<scalar>& field1,
125  const List<scalar>& field2,
126  bool useFaceData = false
127  ) const;
128 
129 
130  //- write generalized field components
131  template <class Type>
132  void writeField
133  (
134  ensightFile&,
136  ) const;
137 
138 
139  // Friend Operators
140 
141  friend ensightGeoFile& operator<<
142  (
144  const ensightParts&
145  );
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #ifdef NoRepository
156 # include "ensightPartsI.H"
157 #endif
158 
159 #endif
160 
161 // ************************ vim: set sw=4 sts=4 et: ************************ //