BUGFIX: Illegal use of uninitialised value (backport)
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / reconstructPar / faFieldReconstructor.H
blob90d76ce6933d286758e5ba282c5f0292ee715fb5
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     faFieldReconstructor
28 Description
29     FA area and edge field reconstructor.
31 Author
32     Zeljko Tukovic, FSB Zagreb.  All rights reserved
34 SourceFiles
35     faFieldReconstructor.C
36     faFieldReconstructorReconstructFields.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef faFieldReconstructor_H
41 #define faFieldReconstructor_H
43 #include "PtrList.H"
44 #include "faMesh.H"
45 #include "IOobjectList.H"
46 #include "faPatchFieldMapper.H"
47 #include "labelIOList.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
55 /*---------------------------------------------------------------------------*\
56                      Class faFieldReconstructor Declaration
57 \*---------------------------------------------------------------------------*/
59 class faFieldReconstructor
61     // Private data
63         //- Reconstructed mesh reference
64         faMesh& mesh_;
66         //- List of processor meshes
67         const PtrList<faMesh>& procMeshes_;
69         //- List of processor edge addressing lists
70         const PtrList<labelIOList>& edgeProcAddressing_;
72         //- List of processor face addressing lists
73         const PtrList<labelIOList>& faceProcAddressing_;
75         //- List of processor boundary addressing lists
76         const PtrList<labelIOList>& boundaryProcAddressing_;
79     // Private Member Functions
81         //- Disallow default bitwise copy construct
82         faFieldReconstructor(const faFieldReconstructor&);
84         //- Disallow default bitwise assignment
85         void operator=(const faFieldReconstructor&);
88 public:
90         class faPatchFieldReconstructor
91         :
92             public faPatchFieldMapper
93         {
94             label size_;
95             label sizeBeforeMapping_;
97         public:
99             // Constructors
101                 //- Construct given size
102                 faPatchFieldReconstructor
103                 (
104                     const label size,
105                     const label sizeBeforeMapping
106                 )
107                 :
108                     size_(size),
109                     sizeBeforeMapping_(sizeBeforeMapping)
110                 {}
113             // Member functions
115                 virtual label size() const
116                 {
117                     return size_;
118                 }
120                 virtual label sizeBeforeMapping() const
121                 {
122                     return sizeBeforeMapping_;
123                 }
125                 virtual bool direct() const
126                 {
127                     return true;
128                 }
130                 virtual const unallocLabelList& directAddressing() const
131                 {
132                     return unallocLabelList::null();
133                 }
134         };
137     // Constructors
139         //- Construct from components
140         faFieldReconstructor
141         (
142             faMesh& mesh,
143             const PtrList<faMesh>& procMeshes,
144             const PtrList<labelIOList>& edgeProcAddressing,
145             const PtrList<labelIOList>& faceProcAddressing,
146             const PtrList<labelIOList>& boundaryProcAddressing
147         );
150     // Member Functions
152         //- Reconstruct area field
153         template<class Type>
154         tmp<GeometricField<Type, faPatchField, areaMesh> >
155         reconstructFaAreaField
156         (
157             const IOobject& fieldIoObject
158         );
160         //- Reconstruct edge field
161         template<class Type>
162         tmp<GeometricField<Type, faePatchField, edgeMesh> >
163         reconstructFaEdgeField
164         (
165             const IOobject& fieldIoObject
166         );
168         //- Reconstruct and write all area fields
169         template<class Type>
170         void reconstructFaAreaFields
171         (
172             const IOobjectList& objects
173         );
175         //- Reconstruct and write all area fields
176         template<class Type>
177         void reconstructFaEdgeFields
178         (
179             const IOobjectList& objects
180         );
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 } // End namespace Foam
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 #ifdef NoRepository
191 #   include "faFieldReconstructorReconstructFields.C"
192 #endif
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #endif
198 // ************************************************************************* //