ProcessorTopology.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::ProcessorTopology
28 
29 Description
30  Determines processor-processor connection. After instantiation contains
31  on all processors the processor-processor connection table.
32 
33  *this[proci] gives the list of neighbouring processors.
34 
35  TODO: This does not currently correctly support multiple processor
36  patches connecting two processors.
37 
38 SourceFiles
39  ProcessorTopology.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef ProcessorTopology_H
44 #define ProcessorTopology_H
45 
46 #include "labelList.H"
47 #include "lduSchedule.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class ProcessorTopology Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Container, class ProcPatch>
60 :
61  public labelListList
62 {
63 
64 private:
65 
66  // Private data
67 
68  //- Local map from neighbour proc to patchi. Different per processor!
69  // -1 or patchi for connection to procID
70  labelList procPatchMap_;
71 
72  //- Order in which the patches should be initialised/evaluated
73  // corresponding to the schedule
74  lduSchedule patchSchedule_;
75 
76 
77  // Private Member Functions
78 
79  //- Return all neighbouring processors of this processor. Set
80  // procPatchMap_.
81  labelList procNeighbours(const label nProcs, const Container&);
82 
83 public:
84 
85  // Constructors
86 
87  //- Construct from boundaryMesh
88  ProcessorTopology(const Container& patches, const label comm);
89 
90 
91  // Member Functions
92 
93  //- From neighbour processor to index in boundaryMesh. Local information
94  // (so not same over all processors)
95  const labelList& procPatchMap() const
96  {
97  return procPatchMap_;
98  }
99 
100  //- Order in which the patches should be initialised/evaluated
101  // corresponding to the schedule
102  const lduSchedule& patchSchedule() const
103  {
104  return patchSchedule_;
105  }
106 
107  //- Calculate non-blocking (i.e. unscheduled) schedule
108  static lduSchedule nonBlockingSchedule(const Container& patches);
109 
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #ifdef NoRepository
120  #include "ProcessorTopology.C"
121 #endif
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::ProcessorTopology::nonBlockingSchedule
static lduSchedule nonBlockingSchedule(const Container &patches)
Calculate non-blocking (i.e. unscheduled) schedule.
Definition: ProcessorTopology.C:228
Foam::ProcessorTopology::ProcessorTopology
ProcessorTopology(const Container &patches, const label comm)
Construct from boundaryMesh.
Definition: ProcessorTopology.C:110
labelList.H
Foam::ProcessorTopology
Determines processor-processor connection. After instantiation contains on all processors the process...
Definition: ProcessorTopology.H:58
lduSchedule.H
Foam::ProcessorTopology::patchSchedule
const lduSchedule & patchSchedule() const
Order in which the patches should be initialised/evaluated.
Definition: ProcessorTopology.H:101
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
ProcessorTopology.C
Foam::List< labelList >
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::ProcessorTopology::procPatchMap
const labelList & procPatchMap() const
From neighbour processor to index in boundaryMesh. Local information.
Definition: ProcessorTopology.H:94