BUGFIX: Illegal use of uninitialised value (backport)
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / reconstructPar / pointFieldReconstructor.H
blob310667ab76f38659c7cb293c054e31fab34b6dc2
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::pointFieldReconstructor
28 Description
29     Point field reconstructor.
31 SourceFiles
32     pointFieldReconstructor.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef pointFieldReconstructor_H
37 #define pointFieldReconstructor_H
39 #include "pointMesh.H"
40 #include "pointFields.H"
41 #include "PointPatchFieldMapperPatchRef.H"
42 #include "IOobjectList.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                      Class pointFieldReconstructor Declaration
51 \*---------------------------------------------------------------------------*/
53 class pointFieldReconstructor
55     // Private data
57         //- Reconstructed mesh reference
58         const pointMesh& mesh_;
60         //- List of processor meshes
61         const PtrList<pointMesh>& procMeshes_;
63         //- List of processor point addressing lists
64         const PtrList<labelIOList>& pointProcAddressing_;
66         //- List of processor boundary addressing lists
67         const PtrList<labelIOList>& boundaryProcAddressing_;
69         //- Point patch addressing
70         labelListListList patchPointAddressing_;
73     // Private Member Functions
75         //- Disallow default bitwise copy construct
76         pointFieldReconstructor
77         (
78             const pointFieldReconstructor&
79         );
81         //- Disallow default bitwise assignment
82         void operator=(const pointFieldReconstructor&);
85 public:
87         class pointPatchFieldReconstructor
88         :
89             public PointPatchFieldMapper
90         {
91             label size_;
92             label sizeBeforeMapping_;
95         public:
97             // Constructors
99                 //- Construct given size
100                 pointPatchFieldReconstructor
101                 (
102                     const label size,
103                     const label sizeBeforeMapping
104                 )
105                 :
106                     size_(size),
107                     sizeBeforeMapping_(sizeBeforeMapping)
108                 {}
111             // Member functions
113                 virtual label size() const
114                 {
115                     return size_;
116                 }
118                 virtual label sizeBeforeMapping() const
119                 {
120                     return sizeBeforeMapping_;
121                 }
123                 virtual bool direct() const
124                 {
125                     return true;
126                 }
128                 virtual const unallocLabelList& directAddressing() const
129                 {
130                     return unallocLabelList::null();
131                 }
132         };
135     // Constructors
137         //- Construct from components
138         pointFieldReconstructor
139         (
140             const pointMesh& mesh,
141             const PtrList<pointMesh>& procMeshes,
142             const PtrList<labelIOList>& pointProcAddressing,
143             const PtrList<labelIOList>& boundaryProcAddressing
144         );
147     // Member Functions
149         //- Reconstruct field
150         template<class Type>
151         tmp<GeometricField<Type, pointPatchField, pointMesh> >
152         reconstructField(const IOobject& fieldIoObject);
154         //- Reconstruct and write all fields
155         template<class Type>
156         void reconstructFields(const IOobjectList& objects);
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #ifdef NoRepository
167 #   include "pointFieldReconstructorReconstructFields.C"
168 #endif
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 #endif
174 // ************************************************************************* //