OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

surfaceWriter.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::surfaceWriter
00027 
00028 Description
00029 
00030 SourceFiles
00031     surfaceWriter.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef surfaceWriter_H
00036 #define surfaceWriter_H
00037 
00038 #include "Field.H"
00039 #include "typeInfo.H"
00040 #include "autoPtr.H"
00041 #include "pointField.H"
00042 #include "faceList.H"
00043 #include "fileName.H"
00044 
00045 #include "runTimeSelectionTables.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 // Forward declaration of friend functions and operators
00053 
00054 template<class Type> class surfaceWriter;
00055 template<class Type> class nullSurfaceWriter;
00056 template<class Type> class proxySurfaceWriter;
00057 
00058 /*---------------------------------------------------------------------------*\
00059                         Class surfaceWriter Declaration
00060 \*---------------------------------------------------------------------------*/
00061 
00062 template<class Type>
00063 class surfaceWriter
00064 {
00065     //- friendship between writer data types
00066     template<class Type2> friend class surfaceWriter;
00067 
00068 public:
00069 
00070     //- Runtime type information
00071     TypeName("surfaceWriter");
00072 
00073     // Declare run-time constructor selection table
00074 
00075         declareRunTimeSelectionTable
00076         (
00077             autoPtr,
00078             surfaceWriter,
00079             word,
00080             (),
00081             ()
00082         );
00083 
00084 
00085     // Selectors
00086 
00087         //- Return a reference to the selected surfaceWriter
00088         static autoPtr<surfaceWriter> New(const word& writeFormat);
00089 
00090 
00091     // Constructors
00092 
00093         //- Construct null
00094         surfaceWriter();
00095 
00096 
00097     // Destructor
00098 
00099         virtual ~surfaceWriter();
00100 
00101 
00102     // Member Functions
00103 
00104         //- Return true if the surface format supports separate files
00105         virtual bool separateFiles()
00106         {
00107             return false;
00108         }
00109 
00110 
00111         //- Writes single surface geometry to file.
00112         virtual void write
00113         (
00114             const fileName& outputDir,      // <root>/<case>/surface/TIME
00115             const fileName& surfaceName,    // name of surface
00116             const pointField& points,
00117             const faceList& faces,
00118             const bool verbose = false
00119         ) const
00120         {}
00121 
00122 
00123         //- Writes single surface to file. Either one value per vertex or
00124         //  one value per face (detected by values.size()==faces.size())
00125         virtual void write
00126         (
00127             const fileName& outputDir,      // <root>/<case>/surface/TIME
00128             const fileName& surfaceName,    // name of surface
00129             const pointField& points,
00130             const faceList& faces,
00131             const fileName& fieldName,      // name of field
00132             const Field<Type>& values,
00133             const bool verbose = false
00134         ) const = 0;
00135 };
00136 
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 } // End namespace Foam
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 #ifdef NoRepository
00145 #   include "surfaceWriter.C"
00146 #endif
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 #endif
00151 
00152 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd