/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
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 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
along with OpenFOAM. If not, see .
Class
Foam::regionSplit
Description
This class separates the mesh into distinct unconnected regions,
each of which is then given a label according to globalNumbering().
Say 6 cells, 3 processors, with single baffle on proc1.
\verbatim
baffle
|
+---+---+---+---+---+---+
| | | | | | |
+---+---+---+---+---+---+
proc0 | proc1 | proc2
\endverbatim
\verbatim
1: determine local regions (uncoupled)
+---+---+---+---+---+---+
| 0 | 0 | 0 | 1 | 0 | 0 |
+---+---+---+---+---+---+
proc0 | proc1 | proc2
\endverbatim
2: make global
\verbatim
+---+---+---+---+---+---+
| 0 | 0 | 1 | 2 | 3 | 3 |
+---+---+---+---+---+---+
proc0 | proc1 | proc2
\endverbatim
3: merge connected across procs
\verbatim
+---+---+---+---+---+---+
| 0 | 0 | 0 | 2 | 2 | 2 |
+---+---+---+---+---+---+
proc0 | proc1 | proc2
\endverbatim
4. determine locally owner regions.
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
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:
\verbatim
+---+---+---+---+---+---+
| 0 | 0 | 0 | 1 | 1 | 1 |
+---+---+---+---+---+---+
proc0 | proc1 | proc2
\endverbatim
Can optionally keep all regions local to the processor.
Note
does not walk across cyclicAMI/cyclicACMI - since these are not
\c coupled() at the patch level.
SourceFiles
regionSplit.C
\*---------------------------------------------------------------------------*/
#ifndef regionSplit_H
#define regionSplit_H
#include "globalIndex.H"
#include "labelPair.H"
#include "bitSet.H"
#include "boolList.H"
#include "MeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward Declarations
class polyMesh;
/*---------------------------------------------------------------------------*\
Class regionSplit Declaration
\*---------------------------------------------------------------------------*/
class regionSplit
:
public MeshObject,
public labelList
{
// Private Typedefs
typedef MeshObject
<
polyMesh,
TopologicalMeshObject,
regionSplit
> MeshObject_type;
// Private Data
//- Indexing into the regions
globalIndex globalNumbering_;
//- Temporary list of cells that have changed
mutable DynamicList