regionSplit.H 8.66 KB
 OpenFOAM-admin committed Apr 15, 2008 1 2 3 4 ``````/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | `````` OpenFOAM bot committed Oct 31, 2019 5 `````` \\ / A nd | www.openfoam.com `````` OpenFOAM bot committed Feb 06, 2019 6 7 `````` \\/ M anipulation | ------------------------------------------------------------------------------- `````` OpenFOAM bot committed Oct 31, 2019 8 `````` Copyright (C) 2011-2013 OpenFOAM Foundation `````` Mark Olesen committed Dec 08, 2020 9 `````` Copyright (C) 2018-2020 OpenCFD Ltd. `````` OpenFOAM-admin committed Apr 15, 2008 10 11 12 13 ``````------------------------------------------------------------------------------- License This file is part of OpenFOAM. `````` Mark Olesen committed Mar 29, 2010 14 15 16 17 `````` OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. `````` OpenFOAM-admin committed Apr 15, 2008 18 19 20 21 22 23 24 `````` OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License `````` Mark Olesen committed Mar 29, 2010 25 `````` along with OpenFOAM. If not, see . `````` OpenFOAM-admin committed Apr 15, 2008 26 27 28 29 30 31 `````` Class Foam::regionSplit Description This class separates the mesh into distinct unconnected regions, `````` mattijs committed Jan 24, 2012 32 33 34 35 36 `````` each of which is then given a label according to globalNumbering(). Say 6 cells, 3 processors, with single baffle on proc1. `````` Mark Olesen committed Apr 05, 2018 37 `````` \verbatim `````` mattijs committed Jan 24, 2012 38 39 40 41 42 43 44 `````` baffle | +---+---+---+---+---+---+ | | | | | | | +---+---+---+---+---+---+ proc0 | proc1 | proc2 `````` Mark Olesen committed Apr 05, 2018 45 `````` \endverbatim `````` mattijs committed Jan 24, 2012 46 47 `````` `````` Mark Olesen committed Apr 05, 2018 48 49 `````` \verbatim `````` mattijs committed Jan 24, 2012 50 51 52 53 54 55 56 `````` 1: determine local regions (uncoupled) +---+---+---+---+---+---+ | 0 | 0 | 0 | 1 | 0 | 0 | +---+---+---+---+---+---+ proc0 | proc1 | proc2 `````` Mark Olesen committed Apr 05, 2018 57 `````` \endverbatim `````` mattijs committed Jan 24, 2012 58 59 60 61 `````` 2: make global `````` Mark Olesen committed Apr 05, 2018 62 63 `````` \verbatim `````` mattijs committed Jan 24, 2012 64 65 66 67 68 `````` +---+---+---+---+---+---+ | 0 | 0 | 1 | 2 | 3 | 3 | +---+---+---+---+---+---+ proc0 | proc1 | proc2 `````` Mark Olesen committed Apr 05, 2018 69 `````` \endverbatim `````` mattijs committed Jan 24, 2012 70 71 72 73 `````` 3: merge connected across procs `````` Mark Olesen committed Apr 05, 2018 74 75 `````` \verbatim `````` mattijs committed Jan 24, 2012 76 77 78 79 80 `````` +---+---+---+---+---+---+ | 0 | 0 | 0 | 2 | 2 | 2 | +---+---+---+---+---+---+ proc0 | proc1 | proc2 `````` Mark Olesen committed Apr 05, 2018 81 `````` \endverbatim `````` mattijs committed Jan 24, 2012 82 83 `````` `````` Mark Olesen committed Apr 05, 2018 84 `````` 4. determine locally owner regions. `````` mattijs committed Jan 24, 2012 85 `````` `````` Mark Olesen committed Apr 05, 2018 86 87 88 89 90 91 92 93 94 95 `````` Determine compact numbering for the local regions and send these to all processors that need them: - proc0 uses regions: - 0 which is local to it. - proc1 uses regions - 0 which originates from proc0 - 2 which is local to it - proc2 uses regions - 2 which originates from proc1 `````` mattijs committed Jan 24, 2012 96 97 98 99 `````` So proc1 needs to get the compact number for region 0 from proc0 and proc2 needs to get the compact number for region 2 from proc1: `````` Mark Olesen committed Apr 05, 2018 100 101 `````` \verbatim `````` mattijs committed Jan 24, 2012 102 103 104 105 106 `````` +---+---+---+---+---+---+ | 0 | 0 | 0 | 1 | 1 | 1 | +---+---+---+---+---+---+ proc0 | proc1 | proc2 `````` Mark Olesen committed Apr 05, 2018 107 108 `````` \endverbatim `````` mattijs committed Sep 26, 2013 109 110 `````` Can optionally keep all regions local to the processor. `````` Mark Olesen committed Apr 27, 2018 111 112 113 ``````Note does not walk across cyclicAMI/cyclicACMI - since these are not \c coupled() at the patch level. `````` mattijs committed Sep 26, 2013 114 `````` `````` OpenFOAM-admin committed Apr 15, 2008 115 116 117 118 119 120 121 122 ``````SourceFiles regionSplit.C \*---------------------------------------------------------------------------*/ #ifndef regionSplit_H #define regionSplit_H `````` mattijs committed Jan 24, 2012 123 124 ``````#include "globalIndex.H" #include "labelPair.H" `````` Mark Olesen committed Dec 08, 2020 125 ``````#include "bitSet.H" `````` mattijs committed Jan 24, 2012 126 ``````#include "boolList.H" `````` mattijs committed Oct 05, 2012 127 ``````#include "MeshObject.H" `````` OpenFOAM-admin committed Apr 15, 2008 128 129 130 131 132 133 `````` // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { `````` Mark Olesen committed Dec 08, 2020 134 ``````// Forward Declarations `````` mattijs committed Jan 24, 2012 135 136 ``````class polyMesh; `````` OpenFOAM-admin committed Apr 15, 2008 137 ``````/*---------------------------------------------------------------------------*\ `````` andy committed Mar 13, 2013 138 `````` Class regionSplit Declaration `````` OpenFOAM-admin committed Apr 15, 2008 139 140 141 142 ``````\*---------------------------------------------------------------------------*/ class regionSplit : `````` 143 `````` public MeshObject, `````` OpenFOAM-admin committed Apr 15, 2008 144 145 `````` public labelList { `````` Mark Olesen committed Dec 08, 2020 146 `````` // Private Data `````` OpenFOAM-admin committed Apr 15, 2008 147 `````` `````` Mark Olesen committed Dec 08, 2020 148 149 `````` //- Indexing into the regions globalIndex globalNumbering_; `````` Mark Olesen committed Apr 27, 2018 150 151 152 153 154 155 `````` //- Temporary list of cells that have changed mutable DynamicList