/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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::globalMeshData
Description
Various mesh related information for a parallel run. Upon construction,
constructs all info using parallel communication.
Requires:
- all processor patches to have correct ordering.
- all processorPatches to have their transforms set.
The shared point and edge addressing calculates addressing for points
and edges on coupled patches. In the 'old' way a distinction was made
between points/edges that are only on two processors and those that are
on multiple processors. The problem is that those on multiple processors
do not allow any transformations and require a global reduction on the
master processor.
The alternative is to have an exchange schedule
(through a 'distributionMap')
which sends all point/edge data (no distinction is made between
those on two and those on more than two coupled patches) to the local
'master'. This master then does any calculation and sends
the result back to the 'slave' points/edges. This only needs to be done
on points on coupled faces. Any transformation is done using a
predetermined set of transformations - since transformations have to be
space filling only a certain number of transformation is supported.
The exchange needs
- a field of data
- a distributionMap which does all parallel exchange and transformations
This appends remote data to the end of the field.
- a set of indices which indicate where to get untransformed data in the
field
- a set of indices which indicate where to get transformed data in the
field
Note:
- compared to 17x nTotalFaces, nTotalPoints do not compensate for
shared points since this would trigger full connectivity analysis
- most calculation is demand driven and uses parallel communication
so make sure to invoke on all processors at the same time
- old sharedEdge calculation: currently an edge is considered shared if it
uses two shared points and is used more than once. This is not correct
on processor patches but it only slightly overestimates the number of
shared edges. Doing full analysis of how many patches use the edge
would be too complicated
See also
distributionMap
globalIndexAndTransform
SourceFiles
globalMeshData.C
globalMeshDataTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef globalMeshData_H
#define globalMeshData_H
#include "processorTopology.H"
#include "labelPair.H"
#include "indirectPrimitivePatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
class polyMesh;
class distributionMap;
template class EdgeMap;
class globalIndex;
class globalIndexAndTransform;
class PackedBoolList;
/*---------------------------------------------------------------------------*\
Class globalMeshData Declaration
\*---------------------------------------------------------------------------*/
class globalMeshData
{
// Private Data
//- Reference to mesh
const polyMesh& mesh_;
// Data related to the complete mesh
//- Total number of points in the complete mesh
label nTotalPoints_;
//- Total number of faces in the complete mesh
label nTotalFaces_;
//- Total number of cells in the complete mesh
label nTotalCells_;
// Processor patch addressing (be careful if not running in parallel!)
//- Processor topology class
processorTopology processorTopology_;
//- List of processor patch labels
// (size of list = number of processor patches)
labelList processorPatches_;
//- List of indices into processorPatches_ for each patch.
// Index = -1 for non-processor patches.
// (size of list = number of patches)
labelList processorPatchIndices_;
//- processorPatchIndices_ of the neighbours processor patches
labelList processorPatchNeighbours_;
// Coupled point addressing
// This is addressing from coupled point to coupled points/faces/cells.
// This is a full schedule so includes points used by only two
// coupled patches.
//- Patch of coupled faces. Additional patch edge to mesh edges
// correspondence:
// points: meshPoints(), meshPointMap()
// edges : meshEdges(), meshEdgeMap()
mutable autoPtr coupledPatchPtr_;
mutable autoPtr coupledPatchMeshEdgesPtr_;
mutable autoPtr