BUGFIX: Illegal use of uninitialised value (backport)
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / reconstructParMesh / fvFieldReconstructor.H
blob542644ce1b6442af86aa9910e27030511bf6188b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::fvFieldReconstructor
28 Description
29     FV volume and surface field reconstructor.
31 SourceFiles
32     fvFieldReconstructor.C
33     fvFieldReconstructorReconstructFields.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef fvFieldReconstructor_H
38 #define fvFieldReconstructor_H
40 #include "PtrList.H"
41 #include "fvMesh.H"
42 #include "IOobjectList.H"
43 #include "fvPatchFieldMapper.H"
44 #include "labelIOList.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
52 /*---------------------------------------------------------------------------*\
53                  Class fvFieldReconstructor Declaration
54 \*---------------------------------------------------------------------------*/
56 class fvFieldReconstructor
58     // Private data
60         //- Reconstructed mesh reference
61         fvMesh& mesh_;
63         //- List of processor meshes
64         const PtrList<fvMesh>& procMeshes_;
66         //- List of processor face addressing lists
67         const PtrList<labelIOList>& faceProcAddressing_;
69         //- List of processor cell addressing lists
70         const PtrList<labelIOList>& cellProcAddressing_;
72         //- List of processor boundary addressing lists
73         const PtrList<labelIOList>& boundaryProcAddressing_;
76     // Private Member Functions
78         //- Disallow default bitwise copy construct
79         fvFieldReconstructor(const fvFieldReconstructor&);
81         //- Disallow default bitwise assignment
82         void operator=(const fvFieldReconstructor&);
85 public:
87         class fvPatchFieldReconstructor
88         :
89             public fvPatchFieldMapper
90         {
91             label size_;
92             label sizeBeforeMapping_;
94         public:
96             // Constructors
98                 //- Construct given size
99                 fvPatchFieldReconstructor
100                 (
101                     const label size,
102                     const label sizeBeforeMapping
103                 )
104                 :
105                     size_(size),
106                     sizeBeforeMapping_(sizeBeforeMapping)
107                 {}
110             // Member functions
112                 virtual label size() const
113                 {
114                     return size_;
115                 }
117                 virtual label sizeBeforeMapping() const
118                 {
119                     return sizeBeforeMapping_;
120                 }
122                 virtual bool direct() const
123                 {
124                     return true;
125                 }
127                 virtual const unallocLabelList& directAddressing() const
128                 {
129                     return unallocLabelList::null();
130                 }
131         };
134     // Constructors
136         //- Construct from components
137         fvFieldReconstructor
138         (
139             fvMesh& mesh,
140             const PtrList<fvMesh>& procMeshes,
141             const PtrList<labelIOList>& faceProcAddressing,
142             const PtrList<labelIOList>& cellProcAddressing,
143             const PtrList<labelIOList>& boundaryProcAddressing
144         );
147     // Member Functions
149         //- Reconstruct volume field
150         template<class Type>
151         tmp<GeometricField<Type, fvPatchField, volMesh> >
152         reconstructFvVolumeField
153         (
154             const IOobject& fieldIoObject
155         );
157         //- Reconstruct surface field
158         template<class Type>
159         tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
160         reconstructFvSurfaceField
161         (
162             const IOobject& fieldIoObject
163         );
165         //- Reconstruct and write all/selected volume fields
166         template<class Type>
167         void reconstructFvVolumeFields
168         (
169             const IOobjectList& objects,
170             const HashSet<word>& selectedFields
171         );
173         //- Reconstruct and write all/selected volume fields
174         template<class Type>
175         void reconstructFvSurfaceFields
176         (
177             const IOobjectList& objects,
178             const HashSet<word>& selectedFields
179         );
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 #ifdef NoRepository
190 #   include "fvFieldReconstructorReconstructFields.C"
191 #endif
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 #endif
197 // ************************************************************************* //