OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

manualDecomp.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::manualDecomp
00027 
00028 Description
00029     Decomposition given a cell-to-processor association in a file
00030 
00031 SourceFiles
00032     manualDecomp.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef manualDecomp_H
00037 #define manualDecomp_H
00038 
00039 #include "decompositionMethod.H"
00040 
00041 namespace Foam
00042 {
00043 
00044 /*---------------------------------------------------------------------------*\
00045                            Class manualDecomp Declaration
00046 \*---------------------------------------------------------------------------*/
00047 
00048 class manualDecomp
00049 :
00050     public decompositionMethod
00051 {
00052     // Private data
00053 
00054         const polyMesh* meshPtr_;
00055 
00056         fileName decompDataFile_;
00057 
00058 
00059     // Private Member Functions
00060 
00061         //- Disallow default bitwise copy construct and assignment
00062         void operator=(const manualDecomp&);
00063         manualDecomp(const manualDecomp&);
00064 
00065 
00066 public:
00067 
00068     //- Runtime type information
00069     TypeName("manual");
00070 
00071 
00072     // Constructors
00073 
00074         //- Construct given the decomposition dictionary
00075         manualDecomp(const dictionary& decompositionDict);
00076 
00077         //- Construct given the decomposition dictionary and mesh
00078         manualDecomp
00079         (
00080             const dictionary& decompositionDict,
00081             const polyMesh& mesh
00082         );
00083 
00084 
00085     // Destructor
00086 
00087         virtual ~manualDecomp()
00088         {}
00089 
00090 
00091     // Member Functions
00092 
00093         //- manual decompose does not care about proc boundaries - is all
00094         //  up to the user.
00095         virtual bool parallelAware() const
00096         {
00097             return true;
00098         }
00099 
00100         //- Return for every coordinate the wanted processor number. Use the
00101         //  mesh connectivity (if needed)
00102         virtual labelList decompose(const pointField&);
00103 
00104         //- Return for every coordinate the wanted processor number. Explicitly
00105         //  provided connectivity - does not use mesh_.
00106         //  The connectivity is equal to mesh.cellCells() except for
00107         //  - in parallel the cell numbers are global cell numbers (starting
00108         //    from 0 at processor0 and then incrementing all through the
00109         //    processors)
00110         //  - the connections are across coupled patches
00111         virtual labelList decompose
00112         (
00113             const labelListList& globalCellCells,
00114             const pointField& cc
00115         )
00116         {
00117             return decompose(cc);
00118         }
00119 };
00120 
00121 
00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00123 
00124 } // End namespace Foam
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 #endif
00129 
00130 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd