FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

MeshObject.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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::MeshObject
00026 
00027 Description
00028     Templated abstract base-class for dynamic mesh objects used to automate
00029     their allocation to the mesh database and the mesh-modifier event-loop.
00030 
00031 SourceFiles
00032     MeshObject.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef MeshObject_H
00037 #define MeshObject_H
00038 
00039 #include <OpenFOAM/regIOobject.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class MeshObject Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 
00051 template<class Mesh, class Type>
00052 class MeshObject
00053 :
00054     public regIOobject
00055 {
00056 
00057 protected:
00058 
00059         // Reference to Mesh
00060         const Mesh& mesh_;
00061 
00062 
00063 public:
00064 
00065     // Constructors
00066 
00067         explicit MeshObject(const Mesh& mesh);
00068 
00069         static const Type& New(const Mesh& mesh);
00070 
00071         template<class Data1>
00072         static const Type& New
00073         (
00074             const Mesh& mesh,
00075             const Data1& d
00076         );
00077 
00078         template<class Data1, class Data2>
00079         static const Type& New
00080         (
00081             const Mesh& mesh,
00082             const Data1&,
00083             const Data2&
00084         );
00085 
00086         template<class Data1, class Data2, class Data3>
00087         static const Type& New
00088         (
00089             const Mesh& mesh,
00090             const Data1&,
00091             const Data2&,
00092             const Data3&
00093         );
00094 
00095         template<class Data1, class Data2, class Data3, class Data4>
00096         static const Type& New
00097         (
00098             const Mesh& mesh,
00099             const Data1&,
00100             const Data2&,
00101             const Data3&,
00102             const Data4&
00103         );
00104 
00105 
00106     // Destructors
00107 
00108         virtual ~MeshObject();
00109 
00110         static bool Delete(const Mesh& mesh);
00111 
00112 
00113     // Member Functions
00114 
00115         const Mesh& mesh() const
00116         {
00117             return mesh_;
00118         }
00119 
00120         virtual bool writeData(Foam::Ostream&) const
00121         {
00122             return true;
00123         }
00124 };
00125 
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 } // End namespace Foam
00130 
00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00132 
00133 #ifdef NoRepository
00134 #   include <OpenFOAM/MeshObject.C>
00135 #endif
00136 
00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00138 
00139 #endif
00140 
00141 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines