ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / src / sampling / sampledSurface / writers / raw / rawSurfaceWriter.H
blobf157008373f6957cd8b0f7f63886d4f282d61324
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::rawSurfaceWriter
27 Description
29 SourceFiles
30     rawSurfaceWriter.C
32 \*---------------------------------------------------------------------------*/
34 #ifndef rawSurfaceWriter_H
35 #define rawSurfaceWriter_H
37 #include "surfaceWriter.H"
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 namespace Foam
44 /*---------------------------------------------------------------------------*\
45                            Class raw Declaration
46 \*---------------------------------------------------------------------------*/
48 template<class Type>
49 class rawSurfaceWriter
51     public surfaceWriter<Type>
53     // Private Member Functions
55         static void writeGeometry
56         (
57             const pointField& points,
58             const label pointI,
59             Ostream& os
60         );
62         static void writeGeometry
63         (
64             const pointField& points,
65             const faceList& faces,
66             const label faceI,
67             Ostream& os
68         );
70         static void writeData
71         (
72             const fileName& fieldName,
73             const pointField& points,
74             const faceList& faces,
75             const scalarField& values,
76             Ostream& os
77         );
79         static void writeData
80         (
81             const fileName& fieldName,
82             const pointField& points,
83             const faceList& faces,
84             const vectorField& values,
85             Ostream& os
86         );
88         static void writeData
89         (
90             const fileName& fieldName,
91             const pointField& points,
92             const faceList& faces,
93             const sphericalTensorField& values,
94             Ostream& os
95         );
97         static void writeData
98         (
99             const fileName& fieldName,
100             const pointField& points,
101             const faceList& faces,
102             const symmTensorField& values,
103             Ostream& os
104         );
106         static void writeData
107         (
108             const fileName& fieldName,
109             const pointField& points,
110             const faceList& faces,
111             const tensorField& values,
112             Ostream& os
113         );
116 public:
118     //- Runtime type information
119     TypeName("raw");
122     // Constructors
124         //- Construct null
125         rawSurfaceWriter();
128     // Destructor
130         virtual ~rawSurfaceWriter();
133     // Member Functions
135         // Write
137         //- Write geometry to file.
138         virtual void write
139         (
140             const fileName& outputDir,
141             const fileName& surfaceName,
142             const pointField& points,
143             const faceList& faces,
144             const bool verbose = false
145         ) const;
147         //- Writes single surface to file.
148         virtual void write
149         (
150             const fileName& outputDir,
151             const fileName& surfaceName,
152             const pointField& points,
153             const faceList& faces,
154             const fileName& fieldName,
155             const Field<Type>& values,
156             const bool verbose = false
157         ) const;
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 } // End namespace Foam
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 #ifdef NoRepository
168 #   include "rawSurfaceWriter.C"
169 #endif
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #endif
175 // ************************************************************************* //