1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::domainDecomposition
28 Automatic domain decomposition class for FOAM meshes
33 \*---------------------------------------------------------------------------*/
35 #ifndef domainDecomposition_H
36 #define domainDecomposition_H
39 #include "labelList.H"
49 /*---------------------------------------------------------------------------*\
50 Class domainDecomposition Declaration
51 \*---------------------------------------------------------------------------*/
53 class domainDecomposition
59 //- Mesh decomposition control dictionary
60 IOdictionary decompositionDict_;
62 //- Number of processors in decomposition
65 //- Is the decomposition data to be distributed for each processor
68 //- Processor label for each cell
69 labelList cellToProc_;
71 //- Labels of points for each processor
72 labelListList procPointAddressing_;
74 //- Labels of faces for each processor
75 // Note: Face turning index is stored as the sign on addressing
76 // Only the processor boundary faces are affected: if the sign of the
77 // index is negative, the processor face is the reverse of the
78 // original face. In order to do this properly, all face
79 // indices will be incremented by 1 and the decremented as
80 // necessary t avoid the problem of face number zero having no
81 // sign. HJ, 5/Dec/2001
82 labelListList procFaceAddressing_;
84 //- Number of internal faces for each processor
85 labelList nInternalProcFaces_;
87 //- Number of live faces for each processor
88 labelList nLiveProcFaces_;
90 //- Labels of cells for each processor
91 labelListList procCellAddressing_;
93 //- Original patch index for every processor patch
94 labelListList procBoundaryAddressing_;
96 //- Sizes for processor mesh patches
97 // Excludes inter-processor boundaries
98 labelListList procPatchSize_;
100 //- Start indices for processor patches
101 // Excludes inter-processor boundaries
102 labelListList procPatchStartIndex_;
104 //- Neighbour processor ID for inter-processor boundaries
105 labelListList procNeighbourProcessors_;
107 //- Sizes for inter-processor patches
108 labelListList procProcessorPatchSize_;
110 //- Start indices for inter-processor patches
111 labelListList procProcessorPatchStartIndex_;
113 //- List of globally shared point labels
114 labelList globallySharedPoints_;
116 //- Are there cyclic-parallel faces
117 bool cyclicParallel_;
120 // Private Member Functions
122 void distributeCells();
129 //- Construct from IOobject
130 domainDecomposition(const IOobject& io);
135 ~domainDecomposition();
140 //- Number of processor in decomposition
146 //- Is the decomposition data to be distributed for each processor
147 bool distributed() const
152 //- Decompose mesh. Optionally remove zero-sized patches.
153 void decomposeMesh(const bool filterEmptyPatches);
155 //- Write decomposition
156 bool writeDecomposition();
158 //- Cell-processor decomposition labels
159 const labelList& cellToProc() const
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 // ************************************************************************* //