initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / parallelProcessing / reconstructPar / pointFieldReconstructor.H
blob34b458913c43cb73e94c369c373ef71d80e9caf6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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_;
93         public:
95             // Constructors
97                 //- Construct given size
98                 pointPatchFieldReconstructor(const label size)
99                 :
100                     size_(size)
101                 {}
104             // Member functions
106                 label size() const
107                 {
108                     return size_;
109                 }
111                 bool direct() const
112                 {
113                     return true;
114                 }
116                 const unallocLabelList& directAddressing() const
117                 {
118                     return unallocLabelList::null();
119                 }
120         };
123     // Constructors
125         //- Construct from components
126         pointFieldReconstructor
127         (
128             const pointMesh& mesh,
129             const PtrList<pointMesh>& procMeshes,
130             const PtrList<labelIOList>& pointProcAddressing,
131             const PtrList<labelIOList>& boundaryProcAddressing
132         );
135     // Member Functions
137         //- Reconstruct field
138         template<class Type>
139         tmp<GeometricField<Type, pointPatchField, pointMesh> >
140         reconstructField(const IOobject& fieldIoObject);
142         //- Reconstruct and write all fields
143         template<class Type>
144         void reconstructFields(const IOobjectList& objects);
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 } // End namespace Foam
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 #ifdef NoRepository
155 #   include "pointFieldReconstructorReconstructFields.C"
156 #endif
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 #endif
162 // ************************************************************************* //