/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 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::InteractionLists
Description
Builds direct interaction list, specifying which local (real)
cells are potentially in range of each other.
Builds referred interaction list, specifying which cells are
required to provide interactions across coupled patches (cyclic or
processor). Generates referred cells, and refers particles to the
correct processor, applying the appropriate transform.
Simultaneous communication and computation is possible using:
\verbatim
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
label startOfRequests = Pstream::nRequests();
il_.sendReferredData(cellOccupancy_, pBufs);
// Do other things
il_.receiveReferredData(pBufs, startOfRequests);
\endverbatim
Requiring data:
\verbatim
List> cellOccupancy_;
\endverbatim
SourceFiles
InteractionListsI.H
InteractionLists.C
InteractionListsIO.C
\*---------------------------------------------------------------------------*/
#ifndef InteractionLists_H
#define InteractionLists_H
#include "polyMesh.H"
#include "referredWallFace.H"
//#include "distributionMap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class globalIndexAndTransform;
class distributionMap;
/*---------------------------------------------------------------------------*\
Class InteractionLists Declaration
\*---------------------------------------------------------------------------*/
template
class InteractionLists
{
// Private Data
//- Reference to mesh
const polyMesh& mesh_;
//- Dummy cloud to give to particles
lagrangian::Cloud cloud_;
//- Switch controlling whether or not the cloud gets populated
// with the referred particles, hence gets written out
const Switch writeCloud_;
//- distributionMap to exchange referred particles into referred cells
autoPtr cellMapPtr_;
//- distributionMap to exchange wall face data
autoPtr wallFaceMapPtr_;
//- Maximum distance over which interactions will be detected
scalar maxDistance_;
//- Direct interaction list
labelListList dil_;
//- Wall faces on this processor that are in interaction range
// of each each cell (direct wall face interaction list)
labelListList dwfil_;
//- Referred interaction list - which real cells are to be
// supplied with particle interactions from the referred
// particle container with the same index.
labelListList ril_;
//- Inverse addressing for referred cells, specifies which
// referred cells (indices of entries in the ril_ and
// referredParticles_ lists) interact with the real cell
// indexed in this container.
labelListList rilInverse_;
//- Which real cells on this on this processor are in
// interaction range of each referred wall face (referred
// wall face interaction list)
labelListList rwfil_;
//- Inverse addressing for referred wall faces, specifies
// which referred wall faces interact with the real cells
// indexed in this container.
labelListList rwfilInverse_;
//- Which cells are to be sent via the cellMap, and an index
// specifying how they should be transformed.
List cellIndexAndTransformToDistribute_;
//- Which wallFaces are to be sent via the wallFaceMap, and an index
// specifying how they should be transformed.
List wallFaceIndexAndTransformToDistribute_;
//- Referred wall faces
List referredWallFaces_;
//- Velocity field name, default to "U"
const word UName_;
//- Referred wall face velocity field values;
List referredWallData_;
//- Referred particle container
List> referredParticles_;
// Private Member Functions
//- Construct all interaction lists
void buildInteractionLists();
//- Find the other processors which have interaction range
// extended bound boxes in range
void findExtendedProcBbsInRange
(
const treeBoundBox& procBb,
const List& allExtendedProcBbs,
const globalIndexAndTransform& globalTransforms,
List& extendedProcBbsInRange,
List