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

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