initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / sampling / sampledSurface / writers / surfaceWriter.H
blobb645c522ef84ed0d5f1284bc35721dd0c852855e
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::surfaceWriter
28 Description
30 SourceFiles
31     surfaceWriter.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef surfaceWriter_H
36 #define surfaceWriter_H
38 #include "Field.H"
39 #include "typeInfo.H"
40 #include "autoPtr.H"
41 #include "pointField.H"
42 #include "faceList.H"
43 #include "fileName.H"
45 #include "runTimeSelectionTables.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 // Forward declaration of friend functions and operators
54 template<class Type> class surfaceWriter;
55 template<class Type> class nullSurfaceWriter;
56 template<class Type> class proxySurfaceWriter;
58 /*---------------------------------------------------------------------------*\
59                         Class surfaceWriter Declaration
60 \*---------------------------------------------------------------------------*/
62 template<class Type>
63 class surfaceWriter
65     //- friendship between writer data types
66     template<class Type2> friend class surfaceWriter;
68 public:
70     //- Runtime type information
71     TypeName("surfaceWriter");
73     // Declare run-time constructor selection table
75         declareRunTimeSelectionTable
76         (
77             autoPtr,
78             surfaceWriter,
79             word,
80             (),
81             ()
82         );
85     // Selectors
87         //- Return a reference to the selected surfaceWriter
88         static autoPtr<surfaceWriter> New(const word& writeFormat);
91     // Constructors
93         //- Construct null
94         surfaceWriter();
97     // Destructor
99         virtual ~surfaceWriter();
102     // Member Functions
104         //- Return true if the surface format supports separate files
105         virtual bool separateFiles()
106         {
107             return false;
108         }
111         //- Writes single surface geometry to file.
112         virtual void write
113         (
114             const fileName& outputDir,      // <root>/<case>/surface/TIME
115             const fileName& surfaceName,    // name of surface
116             const pointField& points,
117             const faceList& faces,
118             const bool verbose = false
119         ) const
120         {}
123         //- Writes single surface to file. Either one value per vertex or
124         //  one value per face (detected by values.size()==faces.size())
125         virtual void write
126         (
127             const fileName& outputDir,      // <root>/<case>/surface/TIME
128             const fileName& surfaceName,    // name of surface
129             const pointField& points,
130             const faceList& faces,
131             const fileName& fieldName,      // name of field
132             const Field<Type>& values,
133             const bool verbose = false
134         ) const = 0;
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 #ifdef NoRepository
145 #   include "surfaceWriter.C"
146 #endif
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 #endif
152 // ************************************************************************* //