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

ProcessorTopology.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::ProcessorTopology
00027 
00028 Description
00029     Determines processor-processor connection. After instantiation contains
00030     on all processors the processor-processor connection table.
00031 
00032     *this[procI] gives the list of neighbouring processors.
00033 
00034 SourceFiles
00035     ProcessorTopology.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef ProcessorTopology_H
00040 #define ProcessorTopology_H
00041 
00042 #include "labelList.H"
00043 #include "lduSchedule.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                        Class ProcessorTopology Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 template<class Patch, class ProcPatch>
00055 class ProcessorTopology
00056 :
00057     public labelListList
00058 {
00059 
00060 private:
00061 
00062     // Private data
00063 
00064         //- Local map from neighbour proc to patchI. Different per processor!
00065         //  -1 or patchI for connection to procID
00066         labelList procPatchMap_;
00067 
00068         //- Order in which the patches should be initialised/evaluated
00069         //  corresponding to the schedule
00070         lduSchedule patchSchedule_;
00071 
00072 
00073     // Private Member Functions
00074 
00075         //- Return all neighbouring processors of this processor. Set
00076         //  procPatchMap_.
00077         labelList procNeighbours(const PtrList<Patch>&);
00078 
00079 public:
00080 
00081     // Constructors
00082 
00083         //- Construct from boundaryMesh
00084         ProcessorTopology(const PtrList<Patch>& patches);
00085 
00086 
00087     // Member Functions
00088 
00089         //- from neighbour processor to index in boundaryMesh. Local information
00090         //  (so not same over all processors)
00091         const labelList& procPatchMap() const
00092         {
00093             return procPatchMap_;
00094         }
00095 
00096         //- Order in which the patches should be initialised/evaluated
00097         //  corresponding to the schedule
00098         const lduSchedule& patchSchedule() const
00099         {
00100             return patchSchedule_;
00101         }
00102 };
00103 
00104 
00105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00106 
00107 } // End namespace Foam
00108 
00109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00110 
00111 #ifdef NoRepository
00112 #   include "ProcessorTopology.C"
00113 #endif
00114 
00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00116 
00117 #endif
00118 
00119 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd