processorTopology: Un-templated
The template parameters were only ever polyBoundaryMesh and processorPolyPatch. Un-templating makes mainteance and bug-fixing quicker as it means minor modifications no longer cause a full rebuild of OpenFOAM.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -54,6 +54,7 @@ Description
|
|||||||
#include "wedgePolyPatch.H"
|
#include "wedgePolyPatch.H"
|
||||||
#include "planeExtrusion.H"
|
#include "planeExtrusion.H"
|
||||||
#include "emptyPolyPatch.H"
|
#include "emptyPolyPatch.H"
|
||||||
|
#include "processorPolyPatch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,6 +51,7 @@ Description
|
|||||||
#include "searchableSurface.H"
|
#include "searchableSurface.H"
|
||||||
#include "fvMeshTools.H"
|
#include "fvMeshTools.H"
|
||||||
#include "systemDict.H"
|
#include "systemDict.H"
|
||||||
|
#include "processorPolyPatch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ License
|
|||||||
|
|
||||||
#include "mapMeshes.H"
|
#include "mapMeshes.H"
|
||||||
#include "surfaceMesh.H"
|
#include "surfaceMesh.H"
|
||||||
|
#include "processorFvPatch.H"
|
||||||
#include "pointMesh.H"
|
#include "pointMesh.H"
|
||||||
#include "mapLagrangian.H"
|
#include "mapLagrangian.H"
|
||||||
#include "MapVolFields.H"
|
#include "MapVolFields.H"
|
||||||
|
|||||||
@ -501,12 +501,12 @@ polyBoundaryMesh = $(polyMesh)/polyBoundaryMesh
|
|||||||
$(polyBoundaryMesh)/polyBoundaryMesh.C
|
$(polyBoundaryMesh)/polyBoundaryMesh.C
|
||||||
$(polyBoundaryMesh)/polyBoundaryMeshEntries.C
|
$(polyBoundaryMesh)/polyBoundaryMeshEntries.C
|
||||||
|
|
||||||
meshes/ProcessorTopology/commSchedule.C
|
|
||||||
|
|
||||||
globalMeshData = $(polyMesh)/globalMeshData
|
globalMeshData = $(polyMesh)/globalMeshData
|
||||||
$(globalMeshData)/globalMeshData.C
|
$(globalMeshData)/globalMeshData.C
|
||||||
$(globalMeshData)/globalPoints.C
|
$(globalMeshData)/globalPoints.C
|
||||||
$(globalMeshData)/globalIndex.C
|
$(globalMeshData)/globalIndex.C
|
||||||
|
$(globalMeshData)/commSchedule.C
|
||||||
|
$(globalMeshData)/processorTopology.C
|
||||||
|
|
||||||
$(polyMesh)/syncTools/syncTools.C
|
$(polyMesh)/syncTools/syncTools.C
|
||||||
$(polyMesh)/polyMeshTetDecomposition/polyMeshTetDecomposition.C
|
$(polyMesh)/polyMeshTetDecomposition/polyMeshTetDecomposition.C
|
||||||
|
|||||||
@ -1,122 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2020 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::ProcessorTopology
|
|
||||||
|
|
||||||
Description
|
|
||||||
Determines processor-processor connection. After instantiation contains
|
|
||||||
on all processors the processor-processor connection table.
|
|
||||||
|
|
||||||
*this[proci] gives the list of neighbouring processors.
|
|
||||||
|
|
||||||
TODO: This does not currently correctly support multiple processor
|
|
||||||
patches connecting two processors.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
ProcessorTopology.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef ProcessorTopology_H
|
|
||||||
#define ProcessorTopology_H
|
|
||||||
|
|
||||||
#include "labelList.H"
|
|
||||||
#include "lduSchedule.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class ProcessorTopology Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template<class Container, class ProcPatch>
|
|
||||||
class ProcessorTopology
|
|
||||||
:
|
|
||||||
public labelListList
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Local map from neighbour proc to patchi. Different per processor!
|
|
||||||
// -1 or patchi for connection to procID
|
|
||||||
labelList procPatchMap_;
|
|
||||||
|
|
||||||
//- Order in which the patches should be initialised/evaluated
|
|
||||||
// corresponding to the schedule
|
|
||||||
lduSchedule patchSchedule_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Return all neighbouring processors of this processor. Set
|
|
||||||
// procPatchMap_.
|
|
||||||
labelList procNeighbours(const label nProcs, const Container&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from boundaryMesh
|
|
||||||
ProcessorTopology(const Container& patches, const label comm);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- From neighbour processor to index in boundaryMesh. Local information
|
|
||||||
// (so not same over all processors)
|
|
||||||
const labelList& procPatchMap() const
|
|
||||||
{
|
|
||||||
return procPatchMap_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Order in which the patches should be initialised/evaluated
|
|
||||||
// corresponding to the schedule
|
|
||||||
const lduSchedule& patchSchedule() const
|
|
||||||
{
|
|
||||||
return patchSchedule_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Calculate non-blocking (i.e. unscheduled) schedule
|
|
||||||
static lduSchedule nonBlockingSchedule(const Container& patches);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "ProcessorTopology.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -1768,11 +1768,11 @@ void Foam::globalMeshData::calcGlobalCoPointSlaves() const
|
|||||||
|
|
||||||
Foam::globalMeshData::globalMeshData(const polyMesh& mesh)
|
Foam::globalMeshData::globalMeshData(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
processorTopology(mesh.boundaryMesh(), UPstream::worldComm),
|
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
nTotalPoints_(-1),
|
nTotalPoints_(-1),
|
||||||
nTotalFaces_(-1),
|
nTotalFaces_(-1),
|
||||||
nTotalCells_(-1),
|
nTotalCells_(-1),
|
||||||
|
processorTopology_(mesh.boundaryMesh(), UPstream::worldComm),
|
||||||
processorPatches_(0),
|
processorPatches_(0),
|
||||||
processorPatchIndices_(0),
|
processorPatchIndices_(0),
|
||||||
processorPatchNeighbours_(0),
|
processorPatchNeighbours_(0),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -104,8 +104,6 @@ class PackedBoolList;
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class globalMeshData
|
class globalMeshData
|
||||||
:
|
|
||||||
public processorTopology
|
|
||||||
{
|
{
|
||||||
|
|
||||||
// Private Data
|
// Private Data
|
||||||
@ -128,6 +126,9 @@ class globalMeshData
|
|||||||
|
|
||||||
// Processor patch addressing (be careful if not running in parallel!)
|
// Processor patch addressing (be careful if not running in parallel!)
|
||||||
|
|
||||||
|
//- Processor topology class
|
||||||
|
processorTopology processorTopology_;
|
||||||
|
|
||||||
//- List of processor patch labels
|
//- List of processor patch labels
|
||||||
// (size of list = number of processor patches)
|
// (size of list = number of processor patches)
|
||||||
labelList processorPatches_;
|
labelList processorPatches_;
|
||||||
@ -251,9 +252,10 @@ class globalMeshData
|
|||||||
//- Calculate shared edge addressing
|
//- Calculate shared edge addressing
|
||||||
void calcSharedEdges() const;
|
void calcSharedEdges() const;
|
||||||
|
|
||||||
//- Calculate global point addressing.
|
//- Calculate global point addressing.
|
||||||
void calcGlobalPointSlaves() const;
|
void calcGlobalPointSlaves() const;
|
||||||
|
|
||||||
|
|
||||||
// Global edge addressing
|
// Global edge addressing
|
||||||
|
|
||||||
//- Calculate connected points
|
//- Calculate connected points
|
||||||
@ -293,6 +295,7 @@ class globalMeshData
|
|||||||
//- Calculate global point to global boundary cell addressing.
|
//- Calculate global point to global boundary cell addressing.
|
||||||
void calcGlobalPointBoundaryCells() const;
|
void calcGlobalPointBoundaryCells() const;
|
||||||
|
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
|
||||||
// Point to collocated points. Note that not all points on
|
// Point to collocated points. Note that not all points on
|
||||||
@ -395,6 +398,19 @@ public:
|
|||||||
|
|
||||||
// Processor patch addressing (be careful when not running in parallel)
|
// Processor patch addressing (be careful when not running in parallel)
|
||||||
|
|
||||||
|
//- Return the processor-processor connection table
|
||||||
|
const labelListList& procNbrProcs() const
|
||||||
|
{
|
||||||
|
return processorTopology_.procNbrProcs();
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Order in which the patches should be initialised/evaluated
|
||||||
|
// corresponding to the schedule
|
||||||
|
const lduSchedule& patchSchedule() const
|
||||||
|
{
|
||||||
|
return processorTopology_.patchSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
//- Return list of processor patch labels
|
//- Return list of processor patch labels
|
||||||
// (size of list = number of processor patches)
|
// (size of list = number of processor patches)
|
||||||
const labelList& processorPatches() const
|
const labelList& processorPatches() const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,19 +23,17 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "ProcessorTopology.H"
|
#include "processorTopology.H"
|
||||||
#include "ListOps.H"
|
#include "polyBoundaryMesh.H"
|
||||||
#include "Pstream.H"
|
#include "processorPolyPatch.H"
|
||||||
#include "commSchedule.H"
|
#include "commSchedule.H"
|
||||||
#include "boolList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Container, class ProcPatch>
|
Foam::labelList Foam::processorTopology::procNeighbours
|
||||||
Foam::labelList Foam::ProcessorTopology<Container, ProcPatch>::procNeighbours
|
|
||||||
(
|
(
|
||||||
const label nProcs,
|
const label nProcs,
|
||||||
const Container& patches
|
const polyBoundaryMesh& patches
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Determine number of processor neighbours and max neighbour id.
|
// Determine number of processor neighbours and max neighbour id.
|
||||||
@ -48,12 +46,12 @@ Foam::labelList Foam::ProcessorTopology<Container, ProcPatch>::procNeighbours
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const typename Container::const_reference patch = patches[patchi];
|
const polyPatch& patch = patches[patchi];
|
||||||
|
|
||||||
if (isA<ProcPatch>(patch))
|
if (isA<processorPolyPatch>(patch))
|
||||||
{
|
{
|
||||||
const ProcPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const ProcPatch>(patch);
|
refCast<const processorPolyPatch>(patch);
|
||||||
|
|
||||||
label pNeighbProcNo = procPatch.neighbProcNo();
|
label pNeighbProcNo = procPatch.neighbProcNo();
|
||||||
|
|
||||||
@ -85,12 +83,12 @@ Foam::labelList Foam::ProcessorTopology<Container, ProcPatch>::procNeighbours
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const typename Container::const_reference patch = patches[patchi];
|
const polyPatch& patch = patches[patchi];
|
||||||
|
|
||||||
if (isA<ProcPatch>(patch))
|
if (isA<processorPolyPatch>(patch))
|
||||||
{
|
{
|
||||||
const ProcPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const ProcPatch>(patch);
|
refCast<const processorPolyPatch>(patch);
|
||||||
|
|
||||||
// Construct reverse map
|
// Construct reverse map
|
||||||
procPatchMap_[procPatch.neighbProcNo()] = patchi;
|
procPatchMap_[procPatch.neighbProcNo()] = patchi;
|
||||||
@ -101,27 +99,82 @@ Foam::labelList Foam::ProcessorTopology<Container, ProcPatch>::procNeighbours
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::lduSchedule Foam::processorTopology::nonBlockingSchedule
|
||||||
|
(
|
||||||
|
const polyBoundaryMesh& patches
|
||||||
|
)
|
||||||
|
{
|
||||||
|
lduSchedule patchSchedule(2*patches.size());
|
||||||
|
|
||||||
|
label patchEvali = 0;
|
||||||
|
|
||||||
|
// 1. All non-processor patches
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Have evaluate directly after initEvaluate. Could have them separated
|
||||||
|
// as long as they're not intermingled with processor patches since
|
||||||
|
// then e.g. any reduce parallel traffic would interfere with the
|
||||||
|
// processor swaps.
|
||||||
|
|
||||||
|
forAll(patches, patchi)
|
||||||
|
{
|
||||||
|
if (!isA<processorPolyPatch>(patches[patchi]))
|
||||||
|
{
|
||||||
|
patchSchedule[patchEvali].patch = patchi;
|
||||||
|
patchSchedule[patchEvali++].init = true;
|
||||||
|
patchSchedule[patchEvali].patch = patchi;
|
||||||
|
patchSchedule[patchEvali++].init = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. All processor patches
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// 2a. initEvaluate
|
||||||
|
forAll(patches, patchi)
|
||||||
|
{
|
||||||
|
if (isA<processorPolyPatch>(patches[patchi]))
|
||||||
|
{
|
||||||
|
patchSchedule[patchEvali].patch = patchi;
|
||||||
|
patchSchedule[patchEvali++].init = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2b. evaluate
|
||||||
|
forAll(patches, patchi)
|
||||||
|
{
|
||||||
|
if (isA<processorPolyPatch>(patches[patchi]))
|
||||||
|
{
|
||||||
|
patchSchedule[patchEvali].patch = patchi;
|
||||||
|
patchSchedule[patchEvali++].init = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return patchSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Container, class ProcPatch>
|
Foam::processorTopology::processorTopology
|
||||||
Foam::ProcessorTopology<Container, ProcPatch>::ProcessorTopology
|
|
||||||
(
|
(
|
||||||
const Container& patches,
|
const polyBoundaryMesh& patches,
|
||||||
const label comm
|
const label comm
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
labelListList(Pstream::nProcs(comm)),
|
procNbrProcs_(Pstream::nProcs(comm)),
|
||||||
|
procPatchMap_(),
|
||||||
patchSchedule_(2*patches.size())
|
patchSchedule_(2*patches.size())
|
||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
// Fill my 'slot' with my neighbours
|
// Fill my 'slot' with my neighbours
|
||||||
operator[](Pstream::myProcNo(comm)) =
|
procNbrProcs_[Pstream::myProcNo(comm)] =
|
||||||
procNeighbours(this->size(), patches);
|
procNeighbours(procNbrProcs_.size(), patches);
|
||||||
|
|
||||||
// Distribute to all processors
|
// Distribute to all processors
|
||||||
Pstream::gatherList(*this, Pstream::msgType(), comm);
|
Pstream::gatherList(procNbrProcs_, Pstream::msgType(), comm);
|
||||||
Pstream::scatterList(*this, Pstream::msgType(), comm);
|
Pstream::scatterList(procNbrProcs_, Pstream::msgType(), comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
@ -137,7 +190,7 @@ Foam::ProcessorTopology<Container, ProcPatch>::ProcessorTopology
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (!isA<ProcPatch>(patches[patchi]))
|
if (!isA<processorPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
patchSchedule_[patchEvali].patch = patchi;
|
patchSchedule_[patchEvali].patch = patchi;
|
||||||
patchSchedule_[patchEvali++].init = true;
|
patchSchedule_[patchEvali++].init = true;
|
||||||
@ -153,15 +206,15 @@ Foam::ProcessorTopology<Container, ProcPatch>::ProcessorTopology
|
|||||||
// to determine the schedule. Each processor pair stands for both
|
// to determine the schedule. Each processor pair stands for both
|
||||||
// send and receive.
|
// send and receive.
|
||||||
label nComms = 0;
|
label nComms = 0;
|
||||||
forAll(*this, proci)
|
forAll(procNbrProcs_, proci)
|
||||||
{
|
{
|
||||||
nComms += operator[](proci).size();
|
nComms += procNbrProcs_[proci].size();
|
||||||
}
|
}
|
||||||
DynamicList<labelPair> comms(nComms);
|
DynamicList<labelPair> comms(nComms);
|
||||||
|
|
||||||
forAll(*this, proci)
|
forAll(procNbrProcs_, proci)
|
||||||
{
|
{
|
||||||
const labelList& nbrs = operator[](proci);
|
const labelList& nbrs = procNbrProcs_[proci];
|
||||||
|
|
||||||
forAll(nbrs, i)
|
forAll(nbrs, i)
|
||||||
{
|
{
|
||||||
@ -218,63 +271,4 @@ Foam::ProcessorTopology<Container, ProcPatch>::ProcessorTopology
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Container, class ProcPatch>
|
|
||||||
Foam::lduSchedule
|
|
||||||
Foam::ProcessorTopology<Container, ProcPatch>::nonBlockingSchedule
|
|
||||||
(
|
|
||||||
const Container& patches
|
|
||||||
)
|
|
||||||
{
|
|
||||||
lduSchedule patchSchedule(2*patches.size());
|
|
||||||
|
|
||||||
label patchEvali = 0;
|
|
||||||
|
|
||||||
// 1. All non-processor patches
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
// Have evaluate directly after initEvaluate. Could have them separated
|
|
||||||
// as long as they're not intermingled with processor patches since
|
|
||||||
// then e.g. any reduce parallel traffic would interfere with the
|
|
||||||
// processor swaps.
|
|
||||||
|
|
||||||
forAll(patches, patchi)
|
|
||||||
{
|
|
||||||
if (!isA<ProcPatch>(patches[patchi]))
|
|
||||||
{
|
|
||||||
patchSchedule[patchEvali].patch = patchi;
|
|
||||||
patchSchedule[patchEvali++].init = true;
|
|
||||||
patchSchedule[patchEvali].patch = patchi;
|
|
||||||
patchSchedule[patchEvali++].init = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. All processor patches
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
// 2a. initEvaluate
|
|
||||||
forAll(patches, patchi)
|
|
||||||
{
|
|
||||||
if (isA<ProcPatch>(patches[patchi]))
|
|
||||||
{
|
|
||||||
patchSchedule[patchEvali].patch = patchi;
|
|
||||||
patchSchedule[patchEvali++].init = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2b. evaluate
|
|
||||||
forAll(patches, patchi)
|
|
||||||
{
|
|
||||||
if (isA<ProcPatch>(patches[patchi]))
|
|
||||||
{
|
|
||||||
patchSchedule[patchEvali].patch = patchi;
|
|
||||||
patchSchedule[patchEvali++].init = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return patchSchedule;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -21,22 +21,90 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::ProcessorTopology
|
||||||
|
|
||||||
|
Description
|
||||||
|
Determines processor-processor connection. After instantiation contains
|
||||||
|
on all processors the processor-processor connection table.
|
||||||
|
|
||||||
|
TODO: This does not currently correctly support multiple processor
|
||||||
|
patches connecting two processors.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
ProcessorTopology.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef processorTopology_H
|
#ifndef processorTopology_H
|
||||||
#define processorTopology_H
|
#define processorTopology_H
|
||||||
|
|
||||||
#include "ProcessorTopology.H"
|
#include "labelList.H"
|
||||||
#include "processorPolyPatch.H"
|
#include "lduSchedule.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// Forward declaration of friend functions and operators
|
||||||
|
|
||||||
|
class polyBoundaryMesh;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class processorTopology Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class processorTopology
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Processor-processor connection table
|
||||||
|
labelListList procNbrProcs_;
|
||||||
|
|
||||||
|
//- Local map from neighbour proc to patchi. Different per processor!
|
||||||
|
// -1 or patchi for connection to procID
|
||||||
|
labelList procPatchMap_;
|
||||||
|
|
||||||
|
//- Order in which the patches should be initialised/evaluated
|
||||||
|
// corresponding to the schedule
|
||||||
|
lduSchedule patchSchedule_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Return all neighbouring processors of this processor. Set
|
||||||
|
// procPatchMap_.
|
||||||
|
labelList procNeighbours(const label nProcs, const polyBoundaryMesh&);
|
||||||
|
|
||||||
|
//- Calculate non-blocking (i.e. unscheduled) schedule
|
||||||
|
lduSchedule nonBlockingSchedule(const polyBoundaryMesh& patches);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from boundaryMesh
|
||||||
|
processorTopology(const polyBoundaryMesh& patches, const label comm);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the processor-processor connection table
|
||||||
|
const labelListList& procNbrProcs() const
|
||||||
|
{
|
||||||
|
return procNbrProcs_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Order in which the patches should be initialised/evaluated
|
||||||
|
// corresponding to the schedule
|
||||||
|
const lduSchedule& patchSchedule() const
|
||||||
|
{
|
||||||
|
return patchSchedule_;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
typedef ProcessorTopology<polyPatchList, processorPolyPatch> processorTopology;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "ensightParts.H"
|
#include "ensightParts.H"
|
||||||
|
#include "processorPolyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvMeshTools.H"
|
#include "fvMeshTools.H"
|
||||||
|
#include "processorPolyPatch.H"
|
||||||
#include "pointFields.H"
|
#include "pointFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -597,12 +597,12 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
|
|||||||
if (patchSchedule[patchEvalI].init)
|
if (patchSchedule[patchEvalI].init)
|
||||||
{
|
{
|
||||||
displacementBf[patchi]
|
displacementBf[patchi]
|
||||||
.initEvaluate(Pstream::commsTypes::blocking);
|
.initEvaluate(Pstream::commsTypes::scheduled);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displacementBf[patchi]
|
displacementBf[patchi]
|
||||||
.evaluate(Pstream::commsTypes::blocking);
|
.evaluate(Pstream::commsTypes::scheduled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -618,12 +618,12 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
|
|||||||
if (patchSchedule[patchEvalI].init)
|
if (patchSchedule[patchEvalI].init)
|
||||||
{
|
{
|
||||||
displacementBf[patchi]
|
displacementBf[patchi]
|
||||||
.initEvaluate(Pstream::commsTypes::blocking);
|
.initEvaluate(Pstream::commsTypes::scheduled);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displacementBf[patchi]
|
displacementBf[patchi]
|
||||||
.evaluate(Pstream::commsTypes::blocking);
|
.evaluate(Pstream::commsTypes::scheduled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -156,7 +156,7 @@ void Foam::Cloud<ParticleType>::move
|
|||||||
const labelList& procPatchNeighbours = pData.processorPatchNeighbours();
|
const labelList& procPatchNeighbours = pData.processorPatchNeighbours();
|
||||||
|
|
||||||
// Which processors this processor is connected to
|
// Which processors this processor is connected to
|
||||||
const labelList& neighbourProcs = pData[Pstream::myProcNo()];
|
const labelList& neighbourProcs = pData.procNbrProcs()[Pstream::myProcNo()];
|
||||||
|
|
||||||
// Indexing from the processor number into the neighbourProcs list
|
// Indexing from the processor number into the neighbourProcs list
|
||||||
labelList neighbourProcIndices(Pstream::nProcs(), -1);
|
labelList neighbourProcIndices(Pstream::nProcs(), -1);
|
||||||
|
|||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
#include "meshToMeshMethod.H"
|
#include "meshToMeshMethod.H"
|
||||||
|
#include "processorPolyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,6 +25,7 @@ License
|
|||||||
|
|
||||||
#include "thresholdCellFaces.H"
|
#include "thresholdCellFaces.H"
|
||||||
#include "emptyPolyPatch.H"
|
#include "emptyPolyPatch.H"
|
||||||
|
#include "processorPolyPatch.H"
|
||||||
#include "polygonTriangulate.H"
|
#include "polygonTriangulate.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user