initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / decompositionMethods / decompositionMethods / manualDecomp / manualDecomp.H
blobed5ad4e8c02838178cb66143f4ac5f86c4544aab
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::manualDecomp
28 Description
29     Decomposition given a cell-to-processor association in a file
31 SourceFiles
32     manualDecomp.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef manualDecomp_H
37 #define manualDecomp_H
39 #include "decompositionMethod.H"
41 namespace Foam
44 /*---------------------------------------------------------------------------*\
45                            Class manualDecomp Declaration
46 \*---------------------------------------------------------------------------*/
48 class manualDecomp
50     public decompositionMethod
52     // Private data
54         const polyMesh* meshPtr_;
56         fileName decompDataFile_;
59     // Private Member Functions
61         //- Disallow default bitwise copy construct and assignment
62         void operator=(const manualDecomp&);
63         manualDecomp(const manualDecomp&);
66 public:
68     //- Runtime type information
69     TypeName("manual");
72     // Constructors
74         //- Construct given the decomposition dictionary
75         manualDecomp(const dictionary& decompositionDict);
77         //- Construct given the decomposition dictionary and mesh
78         manualDecomp
79         (
80             const dictionary& decompositionDict,
81             const polyMesh& mesh
82         );
85     // Destructor
87         virtual ~manualDecomp()
88         {}
91     // Member Functions
93         //- manual decompose does not care about proc boundaries - is all
94         //  up to the user.
95         virtual bool parallelAware() const
96         {
97             return true;
98         }
100         //- Return for every coordinate the wanted processor number. Use the
101         //  mesh connectivity (if needed)
102         virtual labelList decompose(const pointField&);
104         //- Return for every coordinate the wanted processor number. Explicitly
105         //  provided connectivity - does not use mesh_.
106         //  The connectivity is equal to mesh.cellCells() except for
107         //  - in parallel the cell numbers are global cell numbers (starting
108         //    from 0 at processor0 and then incrementing all through the
109         //    processors)
110         //  - the connections are across coupled patches
111         virtual labelList decompose
112         (
113             const labelListList& globalCellCells,
114             const pointField& cc
115         )
116         {
117             return decompose(cc);
118         }
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #endif
130 // ************************************************************************* //