Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / src / sampling / sampledSurface / writers / dx / dxSurfaceWriter.H
blob3b4f2fd6d1ba2551afe7add4cf09c3bf4fd9a34d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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::dxSurfaceWriter
27 Description
28     A surfaceWriter for OpenDX format.
30 SourceFiles
31     dxSurfaceWriter.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef dxSurfaceWriter_H
36 #define dxSurfaceWriter_H
38 #include "surfaceWriter.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                        Class dxSurfaceWriter Declaration
47 \*---------------------------------------------------------------------------*/
49 class dxSurfaceWriter
51     public surfaceWriter
54     // Private Member Functions
56         static void writeGeometry(Ostream&, const pointField&, const faceList&);
57         static void writeTrailer(Ostream&, const bool isNodeValues);
59         template<class Type>
60         static void writeData(Ostream&, const Field<Type>&);
62         //- Templated write operation
63         template<class Type>
64         void writeTemplate
65         (
66             const fileName& outputDir,
67             const fileName& surfaceName,
68             const pointField& points,
69             const faceList& faces,
70             const word& fieldName,
71             const Field<Type>& values,
72             const bool isNodeValues,
73             const bool verbose
74         ) const;
77 public:
79     //- Runtime type information
80     TypeName("dx");
83     // Constructors
85         //- Construct null
86         dxSurfaceWriter();
89     //- Destructor
90     virtual ~dxSurfaceWriter();
93     // Member Functions
95         //- Write scalarField for a single surface to file.
96         //  One value per face or vertex (isNodeValues = true)
97         virtual void write
98         (
99             const fileName& outputDir,      // <case>/surface/TIME
100             const fileName& surfaceName,    // name of surface
101             const pointField& points,
102             const faceList& faces,
103             const word& fieldName,          // name of field
104             const Field<scalar>& values,
105             const bool isNodeValues,
106             const bool verbose = false
107         ) const;
109         //- Write vectorField for a single surface to file.
110         //  One value per face or vertex (isNodeValues = true)
111         virtual void write
112         (
113             const fileName& outputDir,      // <case>/surface/TIME
114             const fileName& surfaceName,    // name of surface
115             const pointField& points,
116             const faceList& faces,
117             const word& fieldName,          // name of field
118             const Field<vector>& values,
119             const bool isNodeValues,
120             const bool verbose = false
121         ) const;
123         //- Write sphericalTensorField for a single surface to file.
124         //  One value per face or vertex (isNodeValues = true)
125         virtual void write
126         (
127             const fileName& outputDir,      // <case>/surface/TIME
128             const fileName& surfaceName,    // name of surface
129             const pointField& points,
130             const faceList& faces,
131             const word& fieldName,          // name of field
132             const Field<sphericalTensor>& values,
133             const bool isNodeValues,
134             const bool verbose = false
135         ) const;
137         //- Write symmTensorField for a single surface to file.
138         //  One value per face or vertex (isNodeValues = true)
139         virtual void write
140         (
141             const fileName& outputDir,      // <case>/surface/TIME
142             const fileName& surfaceName,    // name of surface
143             const pointField& points,
144             const faceList& faces,
145             const word& fieldName,          // name of field
146             const Field<symmTensor>& values,
147             const bool isNodeValues,
148             const bool verbose = false
149         ) const;
151         //- Write tensorField for a single surface to file.
152         //  One value per face or vertex (isNodeValues = true)
153         virtual void write
154         (
155             const fileName& outputDir,      // <case>/surface/TIME
156             const fileName& surfaceName,    // name of surface
157             const pointField& points,
158             const faceList& faces,
159             const word& fieldName,          // name of field
160             const Field<tensor>& values,
161             const bool isNodeValues,
162             const bool verbose = false
163         ) const;
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #endif
176 // ************************************************************************* //