BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / applications / utilities / parallelProcessing / decomposePar / pointFieldDecomposer.H
blobefe328833bcc010b9b0f03a56f1aeca73a054c82
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::pointFieldDecomposer
27 Description
28     Point field decomposer.
30 SourceFiles
31     pointFieldDecomposer.C
32     pointFieldDecomposerDecomposeFields.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef pointFieldDecomposer_H
37 #define pointFieldDecomposer_H
39 #include "pointMesh.H"
40 #include "pointPatchFieldMapperPatchRef.H"
41 #include "pointFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                Class pointFieldDecomposer Declaration
50 \*---------------------------------------------------------------------------*/
52 class pointFieldDecomposer
55 public:
57         //- Point patch field decomposer class
58         class patchFieldDecomposer
59         :
60             public pointPatchFieldMapperPatchRef
61         {
62             // Private data
64                 labelList directAddressing_;
66         public:
68             // Constructors
70                 //- Construct given addressing
71                 patchFieldDecomposer
72                 (
73                     const pointPatch& completeMeshPatch,
74                     const pointPatch& procMeshPatch,
75                     const labelList& directAddr
76                 );
79             // Member functions
81                 label size() const
82                 {
83                     return directAddressing_.size();
84                 }
86                 bool direct() const
87                 {
88                     return true;
89                 }
91                 const labelUList& directAddressing() const
92                 {
93                     return directAddressing_;
94                 }
95         };
98 private:
100     // Private data
102         //- Reference to complete mesh
103         const pointMesh& completeMesh_;
105         //- Reference to processor mesh
106         const pointMesh& procMesh_;
108         //- Reference to point addressing
109         const labelList& pointAddressing_;
111         //- Reference to boundary addressing
112         const labelList& boundaryAddressing_;
114         //- List of patch field decomposers
115         List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
118     // Private Member Functions
120         //- Disallow default bitwise copy construct
121         pointFieldDecomposer(const pointFieldDecomposer&);
123         //- Disallow default bitwise assignment
124         void operator=(const pointFieldDecomposer&);
127 public:
129     // Constructors
131         //- Construct from components
132         pointFieldDecomposer
133         (
134             const pointMesh& completeMesh,
135             const pointMesh& procMesh,
136             const labelList& pointAddressing,
137             const labelList& boundaryAddressing
138         );
141     //- Destructor
142     ~pointFieldDecomposer();
145     // Member Functions
147         //- Decompose point field
148         template<class Type>
149         tmp<GeometricField<Type, pointPatchField, pointMesh> >
150         decomposeField
151         (
152             const GeometricField<Type, pointPatchField, pointMesh>&
153         ) const;
155         template<class GeoField>
156         void decomposeFields(const PtrList<GeoField>& fields) const;
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #ifdef NoRepository
167 #   include "pointFieldDecomposerDecomposeFields.C"
168 #endif
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 #endif
174 // ************************************************************************* //