ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / src / sampling / sampledSurface / writers / surfaceWriter.H
blob2c6a2b4faba4918cfd0935df5d7cae41fbb518da
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.
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.
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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::surfaceWriter
27 Description
29 SourceFiles
30     surfaceWriter.C
32 \*---------------------------------------------------------------------------*/
34 #ifndef surfaceWriter_H
35 #define surfaceWriter_H
37 #include "Field.H"
38 #include "typeInfo.H"
39 #include "autoPtr.H"
40 #include "pointField.H"
41 #include "faceList.H"
42 #include "fileName.H"
44 #include "runTimeSelectionTables.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 // Forward declaration of friend functions and operators
53 template<class Type> class surfaceWriter;
54 template<class Type> class nullSurfaceWriter;
55 template<class Type> class proxySurfaceWriter;
57 /*---------------------------------------------------------------------------*\
58                         Class surfaceWriter Declaration
59 \*---------------------------------------------------------------------------*/
61 template<class Type>
62 class surfaceWriter
64     //- friendship between writer data types
65     template<class Type2> friend class surfaceWriter;
67 public:
69     //- Runtime type information
70     TypeName("surfaceWriter");
72     // Declare run-time constructor selection table
74         declareRunTimeSelectionTable
75         (
76             autoPtr,
77             surfaceWriter,
78             word,
79             (),
80             ()
81         );
84     // Selectors
86         //- Return a reference to the selected surfaceWriter
87         static autoPtr<surfaceWriter> New(const word& writeFormat);
90     // Constructors
92         //- Construct null
93         surfaceWriter();
96     // Destructor
98         virtual ~surfaceWriter();
101     // Member Functions
103         //- Return true if the surface format supports separate files
104         virtual bool separateFiles()
105         {
106             return false;
107         }
110         //- Writes single surface geometry to file.
111         virtual void write
112         (
113             const fileName& outputDir,      // <root>/<case>/surface/TIME
114             const fileName& surfaceName,    // name of surface
115             const pointField& points,
116             const faceList& faces,
117             const bool verbose = false
118         ) const
119         {}
122         //- Writes single surface to file. Either one value per vertex or
123         //  one value per face (detected by values.size()==faces.size())
124         virtual void write
125         (
126             const fileName& outputDir,      // <root>/<case>/surface/TIME
127             const fileName& surfaceName,    // name of surface
128             const pointField& points,
129             const faceList& faces,
130             const fileName& fieldName,      // name of field
131             const Field<Type>& values,
132             const bool verbose = false
133         ) const = 0;
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 #ifdef NoRepository
144 #   include "surfaceWriter.C"
145 #endif
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 #endif
151 // ************************************************************************* //