initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / conversion / ensight / part / ensightParts.H
blob83205dfbfa55153b5d40f67c739c6fcb5b9b058a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::ensightParts
28 Description
29     A collection of several ensightPart elements
31 SourceFiles
32     ensightParts.C
33     ensightPartsI.H
35 \*---------------------------------------------------------------------------*/
37 #ifndef ensightParts_H
38 #define ensightParts_H
40 #include "ensightPart.H"
41 #include "ensightPartFaces.H"
42 #include "ensightPartCells.H"
43 #include "volFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51                        Class ensightParts Declaration
52 \*---------------------------------------------------------------------------*/
54 class ensightParts
56     // Private Data
58         //- list of parts
59         PtrList<ensightPart> partsList_;
61     // Private Member Functions
63         //- Disallow default bitwise copy construct
64         ensightParts(const ensightParts&);
66         //- Disallow default bitwise assignment
67         void operator=(const ensightParts&);
70 public:
72     // Constructors
74         //- Construct from polyMesh
75         ensightParts(const polyMesh&);
77         //- Construct from IOobject
78         ensightParts(const IOobject&);
81     //- Destructor
82     ~ensightParts();
85     // Member functions
87         //- clear old information and construct anew from polyMesh
88         void recalculate(const polyMesh&);
90         //- renumber elements
91         void renumber
92         (
93             const labelList& origCellId,
94             const labelList& origFaceId
95         );
97         //- number of parts
98         label size() const
99         {
100             return partsList_.size();
101         }
103         //- write the geometry
104         void writeGeometry(ensightGeoFile&) const;
106         //- write summary information about the objects
107         bool writeSummary(Ostream&) const;
109         //- write the lists
110         void writeData(Ostream&) const;
112         //- write scalar field
113         void writeScalarField
114         (
115             ensightFile&,
116             const List<scalar>& field,
117             bool useFaceData = false
118         ) const;
120         //- write vector field components
121         void writeVectorField
122         (
123             ensightFile&,
124             const List<scalar>& field0,
125             const List<scalar>& field1,
126             const List<scalar>& field2,
127             bool useFaceData = false
128         ) const;
131         //- write generalized field components
132         template <class Type>
133         void writeField
134         (
135             ensightFile&,
136             const GeometricField<Type, fvPatchField, volMesh>&
137         ) const;
140     // Friend Operators
142         friend ensightGeoFile& operator<<
143         (
144             ensightGeoFile&,
145             const ensightParts&
146         );
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 #ifdef NoRepository
157 #   include "ensightPartsI.H"
158 #endif
160 #endif
162 // ************************************************************************* //