initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / parallelProcessing / decomposePar / pointFieldDecomposer.H
blob52617a7aacfe9e4f8ce546e7a160785969718cb8
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::pointFieldDecomposer
28 Description
29     Point field decomposer.
31 SourceFiles
32     pointFieldDecomposer.C
33     pointFieldDecomposerDecomposeFields.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef pointFieldDecomposer_H
38 #define pointFieldDecomposer_H
40 #include "pointMesh.H"
41 #include "pointPatchFieldMapperPatchRef.H"
42 #include "pointFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                Class pointFieldDecomposer Declaration
51 \*---------------------------------------------------------------------------*/
53 class pointFieldDecomposer
56 public:
58         //- Point patch field decomposer class
59         class patchFieldDecomposer
60         :
61             public pointPatchFieldMapperPatchRef
62         {
63             // Private data
65                 labelList directAddressing_;
67         public:
69             // Constructors
71                 //- Construct given addressing
72                 patchFieldDecomposer
73                 (
74                     const pointPatch& completeMeshPatch,
75                     const pointPatch& procMeshPatch,
76                     const labelList& directAddr
77                 );
80             // Member functions
82                 label size() const
83                 {
84                     return directAddressing_.size();
85                 }
87                 bool direct() const
88                 {
89                     return true;
90                 }
92                 const unallocLabelList& directAddressing() const
93                 {
94                     return directAddressing_;
95                 }
96         };
99 private:
101     // Private data
103         //- Reference to complete mesh
104         const pointMesh& completeMesh_;
106         //- Reference to processor mesh
107         const pointMesh& procMesh_;
109         //- Reference to point addressing
110         const labelList& pointAddressing_;
112         //- Reference to boundary addressing
113         const labelList& boundaryAddressing_;
115         //- List of patch field decomposers
116         List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
119     // Private Member Functions
121         //- Disallow default bitwise copy construct
122         pointFieldDecomposer(const pointFieldDecomposer&);
124         //- Disallow default bitwise assignment
125         void operator=(const pointFieldDecomposer&);
128 public:
130     // Constructors
132         //- Construct from components
133         pointFieldDecomposer
134         (
135             const pointMesh& completeMesh,
136             const pointMesh& procMesh,
137             const labelList& pointAddressing,
138             const labelList& boundaryAddressing
139         );
142     // Destructor
144         ~pointFieldDecomposer();
147     // Member Functions
149         //- Decompose point field
150         template<class Type>
151         tmp<GeometricField<Type, pointPatchField, pointMesh> >
152         decomposeField
153         (
154             const GeometricField<Type, pointPatchField, pointMesh>&
155         ) const;
157         template<class GeoField>
158         void decomposeFields(const PtrList<GeoField>& fields) const;
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 #ifdef NoRepository
169 #   include "pointFieldDecomposerDecomposeFields.C"
170 #endif
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #endif
176 // ************************************************************************* //