FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::manualDecomp
00026 
00027 Description
00028     Decomposition given a cell-to-processor association in a file
00029 
00030 SourceFiles
00031     manualDecomp.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef manualDecomp_H
00036 #define manualDecomp_H
00037 
00038 #include <decompositionMethods/decompositionMethod.H>
00039 
00040 namespace Foam
00041 {
00042 
00043 /*---------------------------------------------------------------------------*\
00044                            Class manualDecomp Declaration
00045 \*---------------------------------------------------------------------------*/
00046 
00047 class manualDecomp
00048 :
00049     public decompositionMethod
00050 {
00051     // Private data
00052 
00053         const polyMesh* meshPtr_;
00054 
00055         fileName decompDataFile_;
00056 
00057 
00058     // Private Member Functions
00059 
00060         //- Disallow default bitwise copy construct and assignment
00061         void operator=(const manualDecomp&);
00062         manualDecomp(const manualDecomp&);
00063 
00064 
00065 public:
00066 
00067     //- Runtime type information
00068     TypeName("manual");
00069 
00070 
00071     // Constructors
00072 
00073         //- Construct given the decomposition dictionary
00074         manualDecomp(const dictionary& decompositionDict);
00075 
00076         //- Construct given the decomposition dictionary and mesh
00077         manualDecomp
00078         (
00079             const dictionary& decompositionDict,
00080             const polyMesh& mesh
00081         );
00082 
00083 
00084     // Destructor
00085 
00086         virtual ~manualDecomp()
00087         {}
00088 
00089 
00090     // Member Functions
00091 
00092         //- manual decompose does not care about proc boundaries - is all
00093         //  up to the user.
00094         virtual bool parallelAware() const
00095         {
00096             return true;
00097         }
00098 
00099         //- Return for every coordinate the wanted processor number. Use the
00100         //  mesh connectivity (if needed)
00101         virtual labelList decompose
00102         (
00103             const pointField& points,
00104             const scalarField& pointWeights
00105         );
00106 
00107         //- Return for every coordinate the wanted processor number. Explicitly
00108         //  provided connectivity - does not use mesh_.
00109         //  The connectivity is equal to mesh.cellCells() except for
00110         //  - in parallel the cell numbers are global cell numbers (starting
00111         //    from 0 at processor0 and then incrementing all through the
00112         //    processors)
00113         //  - the connections are across coupled patches
00114         virtual labelList decompose
00115         (
00116             const labelListList& globalCellCells,
00117             const pointField& cc,
00118             const scalarField& cWeights
00119         )
00120         {
00121             return decompose(cc, cWeights);
00122         }
00123 };
00124 
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 } // End namespace Foam
00129 
00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00131 
00132 #endif
00133 
00134 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines