ENH: decomposePar.C: add shortcircuit to avoid allocating point mappers
[OpenFOAM-2.0.x.git] / applications / utilities / parallelProcessing / decomposePar / dimFieldDecomposer.H
blobac3700d8cd8c1146e9edea3b0f22a7663f953718
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::dimFieldDecomposer
27 Description
28     Dimensioned field decomposer.
30 SourceFiles
31     dimFieldDecomposer.C
32     dimFieldDecomposerDecomposeFields.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef dimFieldDecomposer_H
37 #define dimFieldDecomposer_H
39 #include "fvMesh.H"
40 #include "fvPatchFieldMapper.H"
41 #include "surfaceFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 class IOobjectList;
50 /*---------------------------------------------------------------------------*\
51                     Class fvFieldDecomposer Declaration
52 \*---------------------------------------------------------------------------*/
54 class dimFieldDecomposer
56 private:
58     // Private data
60         //- Reference to complete mesh
61         const fvMesh& completeMesh_;
63         //- Reference to processor mesh
64         const fvMesh& procMesh_;
66         //- Reference to face addressing
67         const labelList& faceAddressing_;
69         //- Reference to cell addressing
70         const labelList& cellAddressing_;
73     // Private Member Functions
75         //- Disallow default bitwise copy construct
76         dimFieldDecomposer(const dimFieldDecomposer&);
78         //- Disallow default bitwise assignment
79         void operator=(const dimFieldDecomposer&);
82 public:
84     // Constructors
86         //- Construct from components
87         dimFieldDecomposer
88         (
89             const fvMesh& completeMesh,
90             const fvMesh& procMesh,
91             const labelList& faceAddressing,
92             const labelList& cellAddressing
93         );
96     //- Destructor
97     ~dimFieldDecomposer();
100     // Member Functions
102         //- Decompose field
103         template<class Type>
104         tmp<DimensionedField<Type, volMesh> > decomposeField
105         (
106             const DimensionedField<Type, volMesh>& field
107         ) const;
110         //- Decompose llist of fields
111         template<class GeoField>
112         void decomposeFields(const PtrList<GeoField>& fields) const;
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 } // End namespace Foam
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 #ifdef NoRepository
123 #   include "dimFieldDecomposerDecomposeFields.C"
124 #endif
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #endif
130 // ************************************************************************* //