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

fvFieldReconstructor.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::fvFieldReconstructor
00026 
00027 Description
00028     FV volume and surface field reconstructor.
00029 
00030 SourceFiles
00031     fvFieldReconstructor.C
00032     fvFieldReconstructorReconstructFields.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef fvFieldReconstructor_H
00037 #define fvFieldReconstructor_H
00038 
00039 #include <OpenFOAM/PtrList.H>
00040 #include <finiteVolume/fvMesh.H>
00041 #include <OpenFOAM/IOobjectList.H>
00042 #include <finiteVolume/fvPatchFieldMapper.H>
00043 #include <OpenFOAM/labelIOList.H>
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 
00051 /*---------------------------------------------------------------------------*\
00052                  Class fvFieldReconstructor Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class fvFieldReconstructor
00056 {
00057     // Private data
00058 
00059         //- Reconstructed mesh reference
00060         fvMesh& mesh_;
00061 
00062         //- List of processor meshes
00063         const PtrList<fvMesh>& procMeshes_;
00064 
00065         //- List of processor face addressing lists
00066         const PtrList<labelIOList>& faceProcAddressing_;
00067 
00068         //- List of processor cell addressing lists
00069         const PtrList<labelIOList>& cellProcAddressing_;
00070 
00071         //- List of processor boundary addressing lists
00072         const PtrList<labelIOList>& boundaryProcAddressing_;
00073 
00074 
00075     // Private Member Functions
00076 
00077         //- Disallow default bitwise copy construct
00078         fvFieldReconstructor(const fvFieldReconstructor&);
00079 
00080         //- Disallow default bitwise assignment
00081         void operator=(const fvFieldReconstructor&);
00082 
00083 
00084 public:
00085 
00086         class fvPatchFieldReconstructor
00087         :
00088             public fvPatchFieldMapper
00089         {
00090             label size_;
00091 
00092         public:
00093 
00094             // Constructors
00095 
00096                 //- Construct given size
00097                 fvPatchFieldReconstructor(const label size)
00098                 :
00099                     size_(size)
00100                 {}
00101 
00102 
00103             // Member functions
00104 
00105                 label size() const
00106                 {
00107                     return size_;
00108                 }
00109 
00110                 bool direct() const
00111                 {
00112                     return true;
00113                 }
00114 
00115                 const unallocLabelList& directAddressing() const
00116                 {
00117                     return unallocLabelList::null();
00118                 }
00119         };
00120 
00121 
00122     // Constructors
00123 
00124         //- Construct from components
00125         fvFieldReconstructor
00126         (
00127             fvMesh& mesh,
00128             const PtrList<fvMesh>& procMeshes,
00129             const PtrList<labelIOList>& faceProcAddressing,
00130             const PtrList<labelIOList>& cellProcAddressing,
00131             const PtrList<labelIOList>& boundaryProcAddressing
00132         );
00133 
00134 
00135     // Member Functions
00136 
00137         //- Reconstruct volume field
00138         template<class Type>
00139         tmp<GeometricField<Type, fvPatchField, volMesh> >
00140         reconstructFvVolumeField
00141         (
00142             const IOobject& fieldIoObject
00143         );
00144 
00145         //- Reconstruct surface field
00146         template<class Type>
00147         tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00148         reconstructFvSurfaceField
00149         (
00150             const IOobject& fieldIoObject
00151         );
00152 
00153         //- Reconstruct and write all/selected volume fields
00154         template<class Type>
00155         void reconstructFvVolumeFields
00156         (
00157             const IOobjectList& objects,
00158             const HashSet<word>& selectedFields
00159         );
00160 
00161         //- Reconstruct and write all/selected volume fields
00162         template<class Type>
00163         void reconstructFvSurfaceFields
00164         (
00165             const IOobjectList& objects,
00166             const HashSet<word>& selectedFields
00167         );
00168 };
00169 
00170 
00171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00172 
00173 } // End namespace Foam
00174 
00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00176 
00177 #ifdef NoRepository
00178 #   include "fvFieldReconstructorReconstructFields.C"
00179 #endif
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 #endif
00184 
00185 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines