1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
26 Foam::domainDecomposition
29 Automatic domain decomposition class for FOAM meshes
34 \*---------------------------------------------------------------------------*/
36 #ifndef domainDecomposition_H
37 #define domainDecomposition_H
40 #include "labelList.H"
50 /*---------------------------------------------------------------------------*\
51 Class domainDecomposition Declaration
52 \*---------------------------------------------------------------------------*/
54 class domainDecomposition
60 //- Mesh decomposition control dictionary
61 IOdictionary decompositionDict_;
63 //- Number of processors in decomposition
66 //- Is the decomposition data to be distributed for each processor
69 //- Processor label for each cell
70 labelList cellToProc_;
72 //- Labels of points for each processor
73 labelListList procPointAddressing_;
75 //- Labels of faces for each processor
76 // Note: Face turning index is stored as the sign on addressing
77 // Only the processor boundary faces are affected: if the sign of the
78 // index is negative, the processor face is the reverse of the
79 // original face. In order to do this properly, all face
80 // indices will be incremented by 1 and the decremented as
81 // necessary t avoid the problem of face number zero having no
83 labelListList procFaceAddressing_;
85 //- Labels of cells for each processor
86 labelListList procCellAddressing_;
88 //- Original patch index for every processor patch
89 labelListList procBoundaryAddressing_;
91 //- Sizes for processor mesh patches
92 // Excludes inter-processor boundaries
93 labelListList procPatchSize_;
95 //- Start indices for processor patches
96 // Excludes inter-processor boundaries
97 labelListList procPatchStartIndex_;
99 //- Neighbour processor ID for inter-processor boundaries
100 labelListList procNeighbourProcessors_;
102 //- Sizes for inter-processor patches
103 labelListList procProcessorPatchSize_;
105 //- Start indices for inter-processor patches
106 labelListList procProcessorPatchStartIndex_;
108 //- List of globally shared point labels
109 labelList globallySharedPoints_;
111 //- Are there cyclic-parallel faces
112 bool cyclicParallel_;
115 // Private Member Functions
117 void distributeCells();
119 //- Mark all elements with value or -2 if occur twice
122 const labelList& zoneElems,
124 labelList& elementToZone
131 //- Construct from IOobject
132 domainDecomposition(const IOobject& io);
137 ~domainDecomposition();
142 //- Number of processor in decomposition
148 //- Is the decomposition data to be distributed for each processor
149 bool distributed() const
154 //- Decompose mesh. Optionally remove zero-sized patches.
155 void decomposeMesh(const bool filterEmptyPatches);
157 //- Write decomposition
158 bool writeDecomposition();
160 //- Cell-processor decomposition labels
161 const labelList& cellToProc() const
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 // ************************************************************************* //