mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: make decomposition methods const (issue #796)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -60,7 +60,7 @@ Foam::label Foam::kahipDecomp::decomposeSerial
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cellWeights,
|
||||
List<label>& decomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,7 +60,7 @@ Foam::label Foam::metisDecomp::decomposeSerial
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cellWeights,
|
||||
List<label>& decomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -54,7 +54,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::ptscotchDecomp::graphPath(const polyMesh& unused)
|
||||
void Foam::ptscotchDecomp::graphPath(const polyMesh& unused) const
|
||||
{}
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
@ -139,7 +139,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
const labelList& agglom,
|
||||
const pointField& agglomPoints,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
@ -153,7 +153,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cellCentres,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,7 +53,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::scotchDecomp::graphPath(const polyMesh& unused)
|
||||
void Foam::scotchDecomp::graphPath(const polyMesh& unused) const
|
||||
{}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::label Foam::scotchDecomp::decomposeSerial
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cWeights,
|
||||
List<label>& decomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
@ -104,7 +104,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
@ -119,7 +119,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||
const labelList& agglom,
|
||||
const pointField& agglomPoints,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
@ -133,7 +133,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cellCentres,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< notImplementedMessage << exit(FatalError);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -75,10 +75,4 @@ Foam::decompositionConstraint::New
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::decompositionConstraint::~decompositionConstraint()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,11 +45,11 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
// Forward declarations
|
||||
class polyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class decompositionConstraint Declaration
|
||||
Class decompositionConstraint Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class decompositionConstraint
|
||||
@ -65,11 +65,11 @@ private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
decompositionConstraint(const decompositionConstraint&);
|
||||
//- No copy construct
|
||||
decompositionConstraint(const decompositionConstraint&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const decompositionConstraint&);
|
||||
//- No copy assignment
|
||||
void operator=(const decompositionConstraint&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
@ -102,6 +102,7 @@ public:
|
||||
const word& type
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected decompositionConstraint
|
||||
@ -113,7 +114,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~decompositionConstraint();
|
||||
virtual ~decompositionConstraint() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -128,9 +129,9 @@ public:
|
||||
List<labelPair>& explicitConnections
|
||||
) const = 0;
|
||||
|
||||
//- Apply any additional post-decomposition constraints. Usually no
|
||||
// need to do anything since decomposition method should have already
|
||||
// obeyed the constraints
|
||||
//- Apply any additional post-decomposition constraints.
|
||||
// Usually no need to do anything since decomposition method
|
||||
// should have already obeyed the constraints
|
||||
virtual void apply
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -108,18 +108,15 @@ void Foam::decompositionConstraints::preserveBafflesConstraint::add
|
||||
{
|
||||
// Convert into face-to-face addressing
|
||||
labelList faceToFace(mesh.nFaces(), -1);
|
||||
forAll(explicitConnections, i)
|
||||
for (const labelPair& p : explicitConnections)
|
||||
{
|
||||
const labelPair& p = explicitConnections[i];
|
||||
faceToFace[p[0]] = p[1];
|
||||
faceToFace[p[1]] = p[0];
|
||||
}
|
||||
|
||||
// Merge in bafflePairs
|
||||
forAll(bafflePairs, i)
|
||||
for (const labelPair& p : bafflePairs)
|
||||
{
|
||||
const labelPair& p = bafflePairs[i];
|
||||
|
||||
if (faceToFace[p[0]] == -1 && faceToFace[p[1]] == -1)
|
||||
{
|
||||
faceToFace[p[0]] = p[1];
|
||||
@ -131,8 +128,8 @@ void Foam::decompositionConstraints::preserveBafflesConstraint::add
|
||||
}
|
||||
else
|
||||
{
|
||||
label p0Slave = faceToFace[p[0]];
|
||||
label p1Slave = faceToFace[p[1]];
|
||||
const label p0Slave = faceToFace[p[0]];
|
||||
const label p1Slave = faceToFace[p[1]];
|
||||
IOWarningInFunction(coeffDict_)
|
||||
<< "When adding baffle between faces "
|
||||
<< p[0] << " at " << mesh.faceCentres()[p[0]]
|
||||
@ -171,10 +168,10 @@ void Foam::decompositionConstraints::preserveBafflesConstraint::add
|
||||
|
||||
// Make sure blockedFace is uptodate
|
||||
blockedFace.setSize(mesh.nFaces(), true);
|
||||
forAll(explicitConnections, i)
|
||||
for (const labelPair& p : explicitConnections)
|
||||
{
|
||||
blockedFace[explicitConnections[i].first()] = false;
|
||||
blockedFace[explicitConnections[i].second()] = false;
|
||||
blockedFace[p.first()] = false;
|
||||
blockedFace[p.second()] = false;
|
||||
}
|
||||
syncTools::syncFaceList(mesh, blockedFace, andEqOp<bool>());
|
||||
}
|
||||
@ -197,33 +194,32 @@ void Foam::decompositionConstraints::preserveBafflesConstraint::apply
|
||||
|
||||
label nChanged = 0;
|
||||
|
||||
forAll(bafflePairs, i)
|
||||
for (const labelPair& baffle : bafflePairs)
|
||||
{
|
||||
const labelPair& baffle = bafflePairs[i];
|
||||
label f0 = baffle.first();
|
||||
label f1 = baffle.second();
|
||||
const label f0 = baffle.first();
|
||||
const label f1 = baffle.second();
|
||||
|
||||
const label procI = decomposition[mesh.faceOwner()[f0]];
|
||||
|
||||
if (mesh.isInternalFace(f0))
|
||||
{
|
||||
label nei0 = mesh.faceNeighbour()[f0];
|
||||
const label nei0 = mesh.faceNeighbour()[f0];
|
||||
if (decomposition[nei0] != procI)
|
||||
{
|
||||
decomposition[nei0] = procI;
|
||||
nChanged++;
|
||||
++nChanged;
|
||||
}
|
||||
}
|
||||
|
||||
label own1 = mesh.faceOwner()[f1];
|
||||
const label own1 = mesh.faceOwner()[f1];
|
||||
if (decomposition[own1] != procI)
|
||||
{
|
||||
decomposition[own1] = procI;
|
||||
nChanged++;
|
||||
++nChanged;
|
||||
}
|
||||
if (mesh.isInternalFace(f1))
|
||||
{
|
||||
label nei1 = mesh.faceNeighbour()[f1];
|
||||
const label nei1 = mesh.faceNeighbour()[f1];
|
||||
if (decomposition[nei1] != procI)
|
||||
{
|
||||
decomposition[nei1] = procI;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,8 +53,6 @@ class preserveBafflesConstraint
|
||||
:
|
||||
public decompositionConstraint
|
||||
{
|
||||
// Private data
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -75,8 +73,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~preserveBafflesConstraint()
|
||||
{}
|
||||
virtual ~preserveBafflesConstraint() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -99,20 +99,20 @@ void Foam::decompositionConstraints::preserveFaceZonesConstraint::add
|
||||
|
||||
const faceZoneMesh& fZones = mesh.faceZones();
|
||||
|
||||
const labelList zoneIDs = findStrings(zones_, fZones.names());
|
||||
const labelList zoneIDs(findStrings(zones_, fZones.names()));
|
||||
|
||||
label nUnblocked = 0;
|
||||
|
||||
forAll(zoneIDs, i)
|
||||
for (const label zonei : zoneIDs)
|
||||
{
|
||||
const faceZone& fz = fZones[zoneIDs[i]];
|
||||
const faceZone& fz = fZones[zonei];
|
||||
|
||||
forAll(fz, i)
|
||||
for (const label meshFacei : fz)
|
||||
{
|
||||
if (blockedFace[fz[i]])
|
||||
if (blockedFace[meshFacei])
|
||||
{
|
||||
blockedFace[fz[i]] = false;
|
||||
nUnblocked++;
|
||||
blockedFace[meshFacei] = false;
|
||||
++nUnblocked;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -148,16 +148,17 @@ void Foam::decompositionConstraints::preserveFaceZonesConstraint::apply
|
||||
|
||||
labelList destProc(mesh.nFaces()-mesh.nInternalFaces(), labelMax);
|
||||
|
||||
forAll(pbm, patchi)
|
||||
for (const polyPatch& pp : pbm)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
label bFacei = pp.start() - mesh.nInternalFaces();
|
||||
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
|
||||
forAll(faceCells, i)
|
||||
for (const label celli : faceCells)
|
||||
{
|
||||
label bFaceI = pp.start()+i-mesh.nInternalFaces();
|
||||
destProc[bFaceI] = decomposition[faceCells[i]];
|
||||
destProc[bFacei] = decomposition[celli];
|
||||
|
||||
++bFacei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,36 +170,34 @@ void Foam::decompositionConstraints::preserveFaceZonesConstraint::apply
|
||||
|
||||
const faceZoneMesh& fZones = mesh.faceZones();
|
||||
|
||||
const labelList zoneIDs = findStrings(zones_, fZones.names());
|
||||
const labelList zoneIDs(findStrings(zones_, fZones.names()));
|
||||
|
||||
label nChanged = 0;
|
||||
|
||||
forAll(zoneIDs, i)
|
||||
for (const label zonei : zoneIDs)
|
||||
{
|
||||
const faceZone& fz = fZones[zoneIDs[i]];
|
||||
const faceZone& fz = fZones[zonei];
|
||||
|
||||
forAll(fz, i)
|
||||
for (const label facei : fz)
|
||||
{
|
||||
label faceI = fz[i];
|
||||
const label own = mesh.faceOwner()[facei];
|
||||
|
||||
label own = mesh.faceOwner()[faceI];
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh.faceNeighbour()[faceI];
|
||||
const label nei = mesh.faceNeighbour()[facei];
|
||||
if (decomposition[own] != decomposition[nei])
|
||||
{
|
||||
decomposition[nei] = decomposition[own];
|
||||
nChanged++;
|
||||
++nChanged;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
label bFaceI = faceI-mesh.nInternalFaces();
|
||||
const label bFaceI = facei-mesh.nInternalFaces();
|
||||
if (decomposition[own] != destProc[bFaceI])
|
||||
{
|
||||
decomposition[own] = destProc[bFaceI];
|
||||
nChanged++;
|
||||
++nChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -103,16 +103,18 @@ void Foam::decompositionConstraints::preservePatchesConstraint::add
|
||||
|
||||
label nUnblocked = 0;
|
||||
|
||||
forAll(patchIDs, i)
|
||||
for (const label patchi : patchIDs)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchIDs[i]];
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
if (blockedFace[pp.start() + i])
|
||||
const label meshFacei = pp.start() + i;
|
||||
|
||||
if (blockedFace[meshFacei])
|
||||
{
|
||||
blockedFace[pp.start() + i] = false;
|
||||
nUnblocked++;
|
||||
blockedFace[meshFacei] = false;
|
||||
++nUnblocked;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -137,8 +139,7 @@ void Foam::decompositionConstraints::preservePatchesConstraint::apply
|
||||
labelList& decomposition
|
||||
) const
|
||||
{
|
||||
// If the decomposition has not enforced the constraint do it over
|
||||
// here.
|
||||
// If the decomposition has not enforced the constraint, do it over here.
|
||||
|
||||
// Synchronise decomposition on patchIDs
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -147,10 +148,8 @@ void Foam::decompositionConstraints::preservePatchesConstraint::apply
|
||||
|
||||
labelList destProc(mesh.nFaces()-mesh.nInternalFaces(), labelMax);
|
||||
|
||||
forAll(pbm, patchi)
|
||||
for (const polyPatch& pp : pbm)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
|
||||
forAll(faceCells, i)
|
||||
@ -170,9 +169,9 @@ void Foam::decompositionConstraints::preservePatchesConstraint::apply
|
||||
|
||||
label nChanged = 0;
|
||||
|
||||
forAll(patchIDs, i)
|
||||
for (const label patchi : patchIDs)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchIDs[i]];
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
|
||||
@ -183,7 +182,7 @@ void Foam::decompositionConstraints::preservePatchesConstraint::apply
|
||||
if (decomposition[faceCells[i]] != destProc[bFaceI])
|
||||
{
|
||||
decomposition[faceCells[i]] = destProc[bFaceI];
|
||||
nChanged++;
|
||||
++nChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,7 +48,7 @@ namespace decompositionConstraints
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class preservePatchesConstraint Declaration
|
||||
Class preservePatchesConstraint Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class preservePatchesConstraint
|
||||
@ -80,7 +80,6 @@ public:
|
||||
preservePatchesConstraint(const UList<wordRe>& patches);
|
||||
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~preservePatchesConstraint() = default;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -55,7 +55,7 @@ Foam::refinementHistoryConstraint::refinementHistoryConstraint
|
||||
{
|
||||
if (decompositionConstraint::debug)
|
||||
{
|
||||
Info<< type() << " : setting constraints to preserve refinement history"
|
||||
Info<< type() << " : setting constraints to refinement history"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,7 @@ void Foam::refinementHistoryConstraint::add
|
||||
const refinementHistory& history =
|
||||
(
|
||||
storagePtr.valid()
|
||||
? storagePtr()
|
||||
? *storagePtr
|
||||
: *refPtr
|
||||
);
|
||||
|
||||
@ -190,7 +190,7 @@ void Foam::refinementHistoryConstraint::apply
|
||||
const refinementHistory& history =
|
||||
(
|
||||
storagePtr.valid()
|
||||
? storagePtr()
|
||||
? *storagePtr
|
||||
: *refPtr
|
||||
);
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,7 +43,6 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class refinementHistoryConstraint Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -52,8 +51,6 @@ class refinementHistoryConstraint
|
||||
:
|
||||
public decompositionConstraint
|
||||
{
|
||||
// Private data
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -74,8 +71,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~refinementHistoryConstraint()
|
||||
{}
|
||||
virtual ~refinementHistoryConstraint() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -83,8 +83,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~singleProcessorFaceSetsConstraint()
|
||||
{}
|
||||
virtual ~singleProcessorFaceSetsConstraint() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -424,7 +424,7 @@ Foam::labelList Foam::decompositionMethod::decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points
|
||||
)
|
||||
) const
|
||||
{
|
||||
scalarField weights(points.size(), 1.0);
|
||||
|
||||
@ -438,7 +438,7 @@ Foam::labelList Foam::decompositionMethod::decompose
|
||||
const labelList& fineToCoarse,
|
||||
const pointField& coarsePoints,
|
||||
const scalarField& coarseWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
CompactListList<label> coarseCellCells;
|
||||
calcCellCells
|
||||
@ -478,16 +478,16 @@ Foam::labelList Foam::decompositionMethod::decompose
|
||||
const polyMesh& mesh,
|
||||
const labelList& fineToCoarse,
|
||||
const pointField& coarsePoints
|
||||
)
|
||||
) const
|
||||
{
|
||||
scalarField cWeights(coarsePoints.size(), 1.0);
|
||||
scalarField weights(coarsePoints.size(), 1.0);
|
||||
|
||||
return decompose
|
||||
(
|
||||
mesh,
|
||||
fineToCoarse,
|
||||
coarsePoints,
|
||||
cWeights
|
||||
weights
|
||||
);
|
||||
}
|
||||
|
||||
@ -496,11 +496,11 @@ Foam::labelList Foam::decompositionMethod::decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc
|
||||
)
|
||||
) const
|
||||
{
|
||||
scalarField cWeights(cc.size(), 1.0);
|
||||
scalarField weights(cc.size(), 1.0);
|
||||
|
||||
return decompose(globalCellCells, cc, cWeights);
|
||||
return decompose(globalCellCells, cc, weights);
|
||||
}
|
||||
|
||||
|
||||
@ -535,10 +535,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
|
||||
labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
|
||||
|
||||
forAll(patches, patchi)
|
||||
for (const polyPatch& pp : patches)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
{
|
||||
label facei = pp.start();
|
||||
@ -551,8 +549,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
agglom[faceOwner[facei]]
|
||||
);
|
||||
|
||||
bFacei++;
|
||||
facei++;
|
||||
++facei;
|
||||
++bFacei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -576,10 +574,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
nFacesPerCell[nei]++;
|
||||
}
|
||||
|
||||
forAll(patches, patchi)
|
||||
for (const polyPatch& pp : patches)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
{
|
||||
label facei = pp.start();
|
||||
@ -588,8 +584,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
forAll(pp, i)
|
||||
{
|
||||
const label own = agglom[faceOwner[facei]];
|
||||
const label globalNei = globalNeighbour[bFacei];
|
||||
|
||||
label globalNei = globalNeighbour[bFacei];
|
||||
if
|
||||
(
|
||||
!globalAgglom.isLocal(globalNei)
|
||||
@ -599,8 +595,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
nFacesPerCell[own]++;
|
||||
}
|
||||
|
||||
facei++;
|
||||
bFacei++;
|
||||
++facei;
|
||||
++bFacei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -627,10 +623,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
}
|
||||
|
||||
// For boundary faces is offsetted coupled neighbour
|
||||
forAll(patches, patchi)
|
||||
for (const polyPatch& pp : patches)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
{
|
||||
label facei = pp.start();
|
||||
@ -639,7 +633,6 @@ void Foam::decompositionMethod::calcCellCells
|
||||
forAll(pp, i)
|
||||
{
|
||||
const label own = agglom[faceOwner[facei]];
|
||||
|
||||
const label globalNei = globalNeighbour[bFacei];
|
||||
|
||||
if
|
||||
@ -651,8 +644,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
m[offsets[own] + nFacesPerCell[own]++] = globalNei;
|
||||
}
|
||||
|
||||
facei++;
|
||||
bFacei++;
|
||||
++facei;
|
||||
++bFacei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -741,24 +734,22 @@ void Foam::decompositionMethod::calcCellCells
|
||||
|
||||
labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
|
||||
|
||||
forAll(patches, patchi)
|
||||
for (const polyPatch& pp : patches)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
{
|
||||
label faceI = pp.start();
|
||||
label bFaceI = pp.start() - mesh.nInternalFaces();
|
||||
label facei = pp.start();
|
||||
label bFacei = pp.start() - mesh.nInternalFaces();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
globalNeighbour[bFaceI] = globalAgglom.toGlobal
|
||||
globalNeighbour[bFacei] = globalAgglom.toGlobal
|
||||
(
|
||||
agglom[faceOwner[faceI]]
|
||||
agglom[faceOwner[facei]]
|
||||
);
|
||||
|
||||
bFaceI++;
|
||||
faceI++;
|
||||
++facei;
|
||||
++bFacei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -782,20 +773,18 @@ void Foam::decompositionMethod::calcCellCells
|
||||
nFacesPerCell[nei]++;
|
||||
}
|
||||
|
||||
forAll(patches, patchi)
|
||||
for (const polyPatch& pp : patches)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
{
|
||||
label faceI = pp.start();
|
||||
label bFaceI = pp.start()-mesh.nInternalFaces();
|
||||
label facei = pp.start();
|
||||
label bFacei = pp.start() - mesh.nInternalFaces();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
const label own = agglom[faceOwner[faceI]];
|
||||
const label own = agglom[faceOwner[facei]];
|
||||
|
||||
const label globalNei = globalNeighbour[bFaceI];
|
||||
const label globalNei = globalNeighbour[bFacei];
|
||||
if
|
||||
(
|
||||
!globalAgglom.isLocal(globalNei)
|
||||
@ -805,8 +794,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
nFacesPerCell[own]++;
|
||||
}
|
||||
|
||||
faceI++;
|
||||
bFaceI++;
|
||||
++facei;
|
||||
++bFacei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -840,20 +829,18 @@ void Foam::decompositionMethod::calcCellCells
|
||||
}
|
||||
|
||||
// For boundary faces is offsetted coupled neighbour
|
||||
forAll(patches, patchi)
|
||||
for (const polyPatch& pp : patches)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
{
|
||||
label faceI = pp.start();
|
||||
label bFaceI = pp.start()-mesh.nInternalFaces();
|
||||
label facei = pp.start();
|
||||
label bFacei = pp.start()-mesh.nInternalFaces();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
const label own = agglom[faceOwner[faceI]];
|
||||
const label own = agglom[faceOwner[facei]];
|
||||
|
||||
const label globalNei = globalNeighbour[bFaceI];
|
||||
const label globalNei = globalNeighbour[bFacei];
|
||||
|
||||
if
|
||||
(
|
||||
@ -863,11 +850,11 @@ void Foam::decompositionMethod::calcCellCells
|
||||
{
|
||||
label ownIndex = offsets[own] + nFacesPerCell[own]++;
|
||||
m[ownIndex] = globalNei;
|
||||
w[ownIndex] = mag(mesh.faceAreas()[faceI]);
|
||||
w[ownIndex] = mag(mesh.faceAreas()[facei]);
|
||||
}
|
||||
|
||||
faceI++;
|
||||
bFaceI++;
|
||||
++facei;
|
||||
++bFacei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -946,10 +933,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
//
|
||||
// labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
|
||||
//
|
||||
// forAll(patches, patchi)
|
||||
// for (const polyPatch& pp : patches)
|
||||
// {
|
||||
// const polyPatch& pp = patches[patchi];
|
||||
//
|
||||
// if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
// {
|
||||
// label facei = pp.start();
|
||||
@ -962,8 +947,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
// agglom[faceOwner[facei]]
|
||||
// );
|
||||
//
|
||||
// bFacei++;
|
||||
// facei++;
|
||||
// ++facei;
|
||||
// ++bFacei;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -983,8 +968,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
// {
|
||||
// if (!blockedFace[facei])
|
||||
// {
|
||||
// label own = agglom[faceOwner[facei]];
|
||||
// label nei = agglom[faceNeighbour[facei]];
|
||||
// const label own = agglom[faceOwner[facei]];
|
||||
// const label nei = agglom[faceNeighbour[facei]];
|
||||
//
|
||||
// nFacesPerCell[own]++;
|
||||
// nFacesPerCell[nei]++;
|
||||
@ -992,10 +977,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
// }
|
||||
//
|
||||
// // 2. Coupled faces
|
||||
// forAll(patches, patchi)
|
||||
// for (const polyPatch& pp : patches)
|
||||
// {
|
||||
// const polyPatch& pp = patches[patchi];
|
||||
//
|
||||
// if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
// {
|
||||
// label facei = pp.start();
|
||||
@ -1005,9 +988,9 @@ void Foam::decompositionMethod::calcCellCells
|
||||
// {
|
||||
// if (!blockedFace[facei])
|
||||
// {
|
||||
// label own = agglom[faceOwner[facei]];
|
||||
// const label own = agglom[faceOwner[facei]];
|
||||
// const label globalNei = globalNeighbour[bFacei];
|
||||
//
|
||||
// label globalNei = globalNeighbour[bFacei];
|
||||
// if
|
||||
// (
|
||||
// !globalAgglom.isLocal(globalNei)
|
||||
@ -1017,8 +1000,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
// nFacesPerCell[own]++;
|
||||
// }
|
||||
//
|
||||
// facei++;
|
||||
// bFacei++;
|
||||
// ++facei;
|
||||
// ++bFacei;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -1121,10 +1104,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
// }
|
||||
//
|
||||
// // 2. For boundary faces is offsetted coupled neighbour
|
||||
// forAll(patches, patchi)
|
||||
// for (const polyPatch& pp : patches)
|
||||
// {
|
||||
// const polyPatch& pp = patches[patchi];
|
||||
//
|
||||
// if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
// {
|
||||
// label facei = pp.start();
|
||||
@ -1147,8 +1128,8 @@ void Foam::decompositionMethod::calcCellCells
|
||||
// m[offsets[own] + nFacesPerCell[own]++] = globalNei;
|
||||
// }
|
||||
//
|
||||
// facei++;
|
||||
// bFacei++;
|
||||
// ++facei;
|
||||
// ++bFacei;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -1304,7 +1285,7 @@ Foam::labelList Foam::decompositionMethod::decompose
|
||||
|
||||
//- Additional connections between boundary faces
|
||||
const List<labelPair>& explicitConnections
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Any weights specified?
|
||||
label nWeights = returnReduce(cellWeights.size(), sumOp<label>());
|
||||
@ -1606,9 +1587,8 @@ Foam::labelList Foam::decompositionMethod::decompose
|
||||
syncTools::swapBoundaryCellList(mesh, finalDecomp, nbrDecomp);
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
forAll(patches, patchi)
|
||||
for (const polyPatch& pp : patches)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
if (pp.coupled())
|
||||
{
|
||||
forAll(pp, i)
|
||||
@ -1649,7 +1629,7 @@ void Foam::decompositionMethod::setConstraints
|
||||
PtrList<labelList>& specifiedProcessorFaces,
|
||||
labelList& specifiedProcessor,
|
||||
List<labelPair>& explicitConnections
|
||||
)
|
||||
) const
|
||||
{
|
||||
blockedFace.setSize(mesh.nFaces());
|
||||
blockedFace = true;
|
||||
@ -1657,9 +1637,9 @@ void Foam::decompositionMethod::setConstraints
|
||||
specifiedProcessorFaces.clear();
|
||||
explicitConnections.clear();
|
||||
|
||||
forAll(constraints_, constrainti)
|
||||
for (const decompositionConstraint& decompConstraint : constraints_)
|
||||
{
|
||||
constraints_[constrainti].add
|
||||
decompConstraint.add
|
||||
(
|
||||
mesh,
|
||||
blockedFace,
|
||||
@ -1679,11 +1659,11 @@ void Foam::decompositionMethod::applyConstraints
|
||||
const labelList& specifiedProcessor,
|
||||
const List<labelPair>& explicitConnections,
|
||||
labelList& decomposition
|
||||
)
|
||||
) const
|
||||
{
|
||||
forAll(constraints_, constrainti)
|
||||
for (const decompositionConstraint& decompConstraint : constraints_)
|
||||
{
|
||||
constraints_[constrainti].apply
|
||||
decompConstraint.apply
|
||||
(
|
||||
mesh,
|
||||
blockedFace,
|
||||
@ -1700,7 +1680,7 @@ Foam::labelList Foam::decompositionMethod::decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const scalarField& cellWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Collect all constraints
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,8 +53,10 @@ class decompositionMethod
|
||||
//- Set PtrList of constraints by reading decompositionDict_.
|
||||
void readConstraints();
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
//- No copy construct
|
||||
decompositionMethod(const decompositionMethod&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const decompositionMethod&) = delete;
|
||||
|
||||
|
||||
@ -210,8 +212,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~decompositionMethod()
|
||||
{}
|
||||
virtual ~decompositionMethod() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -222,187 +223,192 @@ public:
|
||||
return nDomains_;
|
||||
}
|
||||
|
||||
//- Is method parallel aware (i.e. does it synchronize domains across
|
||||
// proc boundaries)
|
||||
//- Is method parallel aware?
|
||||
// (i.e. does it synchronize domains across proc boundaries)
|
||||
virtual bool parallelAware() const = 0;
|
||||
|
||||
|
||||
// No topology (implemented by geometric decomposers)
|
||||
// No topology (implemented by geometric decomposers)
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
{
|
||||
NotImplemented;
|
||||
return labelList(0);
|
||||
}
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return labelList(0);
|
||||
}
|
||||
|
||||
//- Like decompose but with uniform weights on the points
|
||||
virtual labelList decompose(const pointField&)
|
||||
{
|
||||
NotImplemented;
|
||||
return labelList(0);
|
||||
}
|
||||
//- Decompose with uniform weights on the points
|
||||
virtual labelList decompose(const pointField& points) const
|
||||
{
|
||||
NotImplemented;
|
||||
return labelList(0);
|
||||
}
|
||||
|
||||
|
||||
// Topology provided by mesh
|
||||
// Topology provided by mesh
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// mesh connectivity (if needed)
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
) = 0;
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Use the mesh connectivity (if needed)
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
) const = 0;
|
||||
|
||||
//- Like decompose but with uniform weights on the points
|
||||
virtual labelList decompose(const polyMesh&, const pointField&);
|
||||
//- Decompose with uniform weights on the points
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points
|
||||
) const;
|
||||
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Gets
|
||||
// passed agglomeration map (from fine to coarse cells) and coarse
|
||||
// cell
|
||||
// location. Can be overridden by decomposers that provide this
|
||||
// functionality natively. Coarse cells are local to the processor
|
||||
// (if in parallel). If you want to have coarse cells spanning
|
||||
// processors use the globalCellCells instead.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& cellToRegion,
|
||||
const pointField& regionPoints,
|
||||
const scalarField& regionWeights
|
||||
);
|
||||
//- Return for every coordinate the wanted processor number. Gets
|
||||
// passed agglomeration map (from fine to coarse cells) and coarse
|
||||
// cell
|
||||
// location. Can be overridden by decomposers that provide this
|
||||
// functionality natively. Coarse cells are local to the processor
|
||||
// (if in parallel). If you want to have coarse cells spanning
|
||||
// processors use the globalCellCells instead.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& cellToRegion,
|
||||
const pointField& regionPoints,
|
||||
const scalarField& regionWeights
|
||||
) const;
|
||||
|
||||
//- Like decompose but with uniform weights on the regions
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& cellToRegion,
|
||||
const pointField& regionPoints
|
||||
);
|
||||
//- Like decompose but with uniform weights on the regions
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& cellToRegion,
|
||||
const pointField& regionPoints
|
||||
) const;
|
||||
|
||||
|
||||
// Topology provided explicitly addressing
|
||||
// Topology provided explicitly addressing
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// The connectivity is equal to mesh.cellCells() except for
|
||||
// - in parallel the cell numbers are global cell numbers
|
||||
// (starting
|
||||
// from 0 at processor0 and then incrementing all through the
|
||||
// processors)
|
||||
// - the connections are across coupled patches
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
) = 0;
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// The connectivity is equal to mesh.cellCells() except for
|
||||
// - in parallel the cell numbers are global cell numbers
|
||||
// (starting
|
||||
// from 0 at processor0 and then incrementing all through the
|
||||
// processors)
|
||||
// - the connections are across coupled patches
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
) const = 0;
|
||||
|
||||
//- Like decompose but with uniform weights on the cells
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc
|
||||
);
|
||||
//- Like decompose but with uniform weights on the cells
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc
|
||||
) const;
|
||||
|
||||
|
||||
// Other
|
||||
// Other
|
||||
|
||||
//- Helper: determine (local or global) cellCells from mesh
|
||||
// agglomeration. Agglomeration is local to the processor.
|
||||
// local : connections are in local indices. Coupled across
|
||||
// cyclics but not processor patches.
|
||||
// global : connections are in global indices. Coupled across
|
||||
// cyclics and processor patches.
|
||||
static void calcCellCells
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& agglom,
|
||||
const label nLocalCoarse,
|
||||
const bool global,
|
||||
CompactListList<label>& cellCells
|
||||
);
|
||||
//- Helper: determine (local or global) cellCells from mesh
|
||||
// agglomeration. Agglomeration is local to the processor.
|
||||
// local : connections are in local indices. Coupled across
|
||||
// cyclics but not processor patches.
|
||||
// global : connections are in global indices. Coupled across
|
||||
// cyclics and processor patches.
|
||||
static void calcCellCells
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& agglom,
|
||||
const label nLocalCoarse,
|
||||
const bool global,
|
||||
CompactListList<label>& cellCells
|
||||
);
|
||||
|
||||
//- Helper: determine (local or global) cellCells and face weights
|
||||
// from mesh agglomeration.
|
||||
// Uses mag of faceArea as weights
|
||||
static void calcCellCells
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& agglom,
|
||||
const label nLocalCoarse,
|
||||
const bool parallel,
|
||||
CompactListList<label>& cellCells,
|
||||
CompactListList<scalar>& cellCellWeights
|
||||
);
|
||||
//- Helper: determine (local or global) cellCells and face weights
|
||||
// from mesh agglomeration.
|
||||
// Uses mag of faceArea as weights
|
||||
static void calcCellCells
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& agglom,
|
||||
const label nLocalCoarse,
|
||||
const bool parallel,
|
||||
CompactListList<label>& cellCells,
|
||||
CompactListList<scalar>& cellCellWeights
|
||||
);
|
||||
|
||||
//- Helper: extract constraints:
|
||||
// blockedface: existing faces where owner and neighbour on same
|
||||
// proc
|
||||
// explicitConnections: sets of boundary faces ,, ,,
|
||||
// specifiedProcessorFaces: groups of faces with all cells on
|
||||
// same processor.
|
||||
void setConstraints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
boolList& blockedFace,
|
||||
PtrList<labelList>& specifiedProcessorFaces,
|
||||
labelList& specifiedProcessor,
|
||||
List<labelPair>& explicitConnections
|
||||
);
|
||||
//- Helper: extract constraints:
|
||||
// blockedface: existing faces where owner and neighbour on same
|
||||
// proc
|
||||
// explicitConnections: sets of boundary faces ,, ,,
|
||||
// specifiedProcessorFaces: groups of faces with all cells on
|
||||
// same processor.
|
||||
void setConstraints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
boolList& blockedFace,
|
||||
PtrList<labelList>& specifiedProcessorFaces,
|
||||
labelList& specifiedProcessor,
|
||||
List<labelPair>& explicitConnections
|
||||
) const;
|
||||
|
||||
//- Helper: apply constraints to a decomposition. This gives
|
||||
// constraints opportunity to modify decomposition in case
|
||||
// the native decomposition method has not obeyed all constraints
|
||||
void applyConstraints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const boolList& blockedFace,
|
||||
const PtrList<labelList>& specifiedProcessorFaces,
|
||||
const labelList& specifiedProcessor,
|
||||
const List<labelPair>& explicitConnections,
|
||||
labelList& finalDecomp
|
||||
);
|
||||
//- Helper: apply constraints to a decomposition.
|
||||
// This gives constraints opportunity to modify decomposition in case
|
||||
// the native decomposition method has not obeyed all constraints
|
||||
void applyConstraints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const boolList& blockedFace,
|
||||
const PtrList<labelList>& specifiedProcessorFaces,
|
||||
const labelList& specifiedProcessor,
|
||||
const List<labelPair>& explicitConnections,
|
||||
labelList& finalDecomp
|
||||
) const;
|
||||
|
||||
// Decompose a mesh with constraints:
|
||||
// - blockedFace : whether owner and neighbour should be on same
|
||||
// processor
|
||||
// - specifiedProcessorFaces, specifiedProcessor : sets of faces
|
||||
// that should go to same processor (as specified in
|
||||
// specifiedProcessor, can be -1)
|
||||
// - explicitConnections : connections between baffle faces
|
||||
// (blockedFace should be false on these). Owner and
|
||||
// neighbour on same processor.
|
||||
// Set all to zero size to have unconstrained decomposition.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const scalarField& cellWeights,
|
||||
const boolList& blockedFace,
|
||||
const PtrList<labelList>& specifiedProcessorFaces,
|
||||
const labelList& specifiedProcessor,
|
||||
const List<labelPair>& explicitConnections
|
||||
);
|
||||
// Decompose a mesh with constraints:
|
||||
// - blockedFace : whether owner and neighbour should be on same
|
||||
// processor
|
||||
// - specifiedProcessorFaces, specifiedProcessor : sets of faces
|
||||
// that should go to same processor (as specified in
|
||||
// specifiedProcessor, can be -1)
|
||||
// - explicitConnections : connections between baffle faces
|
||||
// (blockedFace should be false on these). Owner and
|
||||
// neighbour on same processor.
|
||||
// Set all to zero size to have unconstrained decomposition.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const scalarField& cellWeights,
|
||||
const boolList& blockedFace,
|
||||
const PtrList<labelList>& specifiedProcessorFaces,
|
||||
const labelList& specifiedProcessor,
|
||||
const List<labelPair>& explicitConnections
|
||||
) const;
|
||||
|
||||
|
||||
//- Decompose a mesh. Apply all constraints from decomposeParDict
|
||||
// ('preserveFaceZones' etc). Calls either
|
||||
// - no constraints, empty weights:
|
||||
// decompose(mesh, cellCentres())
|
||||
// - no constraints, set weights:
|
||||
// decompose(mesh, cellCentres(), cellWeights)
|
||||
// - valid constraints:
|
||||
// decompose(mesh, cellToRegion, regionPoints, regionWeights)
|
||||
labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const scalarField& cWeights
|
||||
);
|
||||
//- Decompose a mesh.
|
||||
// Apply all constraints from decomposeParDict
|
||||
// ('preserveFaceZones' etc). Calls either
|
||||
// - no constraints, empty weights:
|
||||
// decompose(mesh, cellCentres())
|
||||
// - no constraints, set weights:
|
||||
// decompose(mesh, cellCentres(), cellWeights)
|
||||
// - valid constraints:
|
||||
// decompose(mesh, cellToRegion, regionPoints, regionWeights)
|
||||
labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const scalarField& cWeights
|
||||
) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -99,15 +99,17 @@ public:
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
) = 0;
|
||||
) const = 0;
|
||||
|
||||
//- Like decompose but with uniform weights on the points
|
||||
virtual labelList decompose(const pointField&) = 0;
|
||||
//- Decompose with uniform weights on the points
|
||||
virtual labelList decompose(const pointField& points) const = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -154,7 +154,7 @@ void Foam::hierarchGeomDecomp::calculateSortedWeightedSizes
|
||||
sortedWeightedSizes[0] = 0;
|
||||
forAll(current, i)
|
||||
{
|
||||
label pointi = current[indices[i]];
|
||||
const label pointi = current[indices[i]];
|
||||
sortedWeightedSizes[i + 1] = sortedWeightedSizes[i] + weights[pointi];
|
||||
}
|
||||
// Non-dimensionalise and multiply by size.
|
||||
@ -332,7 +332,7 @@ void Foam::hierarchGeomDecomp::sortComponent
|
||||
const direction componentIndex, // index in decompOrder_
|
||||
const label mult, // multiplication factor for finalDecomp
|
||||
labelList& finalDecomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Current component
|
||||
label compI = decompOrder_[componentIndex];
|
||||
@ -348,7 +348,7 @@ void Foam::hierarchGeomDecomp::sortComponent
|
||||
|
||||
forAll(current, i)
|
||||
{
|
||||
label pointi = current[i];
|
||||
const label pointi = current[i];
|
||||
|
||||
sortedCoord[i] = points[pointi][compI];
|
||||
}
|
||||
@ -514,7 +514,7 @@ void Foam::hierarchGeomDecomp::sortComponent
|
||||
const direction componentIndex, // index in decompOrder_
|
||||
const label mult, // multiplication factor for finalDecomp
|
||||
labelList& finalDecomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Current component
|
||||
label compI = decompOrder_[componentIndex];
|
||||
@ -688,10 +688,39 @@ void Foam::hierarchGeomDecomp::sortComponent
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::hierarchGeomDecomp::hierarchGeomDecomp
|
||||
(
|
||||
const dictionary& decompDict
|
||||
)
|
||||
:
|
||||
geomDecomp(typeName, decompDict),
|
||||
decompOrder_({0,1,2})
|
||||
{
|
||||
setDecompOrder();
|
||||
}
|
||||
|
||||
|
||||
Foam::hierarchGeomDecomp::hierarchGeomDecomp
|
||||
(
|
||||
const dictionary& decompDict,
|
||||
const word& regionName
|
||||
)
|
||||
:
|
||||
geomDecomp(typeName, decompDict, regionName),
|
||||
decompOrder_({0,1,2})
|
||||
{
|
||||
setDecompOrder();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::labelList Foam::hierarchGeomDecomp::decompose
|
||||
(
|
||||
const pointField& points
|
||||
)
|
||||
) const
|
||||
{
|
||||
// construct a list for the final result
|
||||
labelList finalDecomp(points.size(), 0);
|
||||
@ -732,7 +761,7 @@ Foam::labelList Foam::hierarchGeomDecomp::decompose
|
||||
(
|
||||
const pointField& points,
|
||||
const scalarField& weights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// construct a list for the final result
|
||||
labelList finalDecomp(points.size(), 0);
|
||||
@ -770,31 +799,4 @@ Foam::labelList Foam::hierarchGeomDecomp::decompose
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::hierarchGeomDecomp::hierarchGeomDecomp
|
||||
(
|
||||
const dictionary& decompDict
|
||||
)
|
||||
:
|
||||
geomDecomp(typeName, decompDict),
|
||||
decompOrder_({0,1,2})
|
||||
{
|
||||
setDecompOrder();
|
||||
}
|
||||
|
||||
|
||||
Foam::hierarchGeomDecomp::hierarchGeomDecomp
|
||||
(
|
||||
const dictionary& decompDict,
|
||||
const word& regionName
|
||||
)
|
||||
:
|
||||
geomDecomp(typeName, decompDict, regionName),
|
||||
decompOrder_({0,1,2})
|
||||
{
|
||||
setDecompOrder();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -148,7 +148,7 @@ class hierarchGeomDecomp
|
||||
const direction componentIndex, // index in decompOrder_
|
||||
const label prevMult, // multiplication factor
|
||||
labelList& finalDecomp // overall decomposition
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Recursively sort in x,y,z (or rather acc. to decompOrder_)
|
||||
//- Using weighted points.
|
||||
@ -161,12 +161,15 @@ class hierarchGeomDecomp
|
||||
const direction componentIndex, // index in decompOrder_
|
||||
const label prevMult, // multiplication factor
|
||||
labelList& finalDecomp // overall decomposition
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const hierarchGeomDecomp&) = delete;
|
||||
|
||||
//- No copy construct
|
||||
hierarchGeomDecomp(const hierarchGeomDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const hierarchGeomDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -188,13 +191,12 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~hierarchGeomDecomp()
|
||||
{}
|
||||
virtual ~hierarchGeomDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Hierarchgeom is aware of processor boundaries
|
||||
//- Hierarchical is aware of processor boundaries
|
||||
virtual bool parallelAware() const
|
||||
{
|
||||
return true;
|
||||
@ -205,34 +207,40 @@ public:
|
||||
(
|
||||
const pointField&,
|
||||
const scalarField& weights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Without weights. Code for weighted decomposition is a bit complex
|
||||
//- Decompose with uniform weights.
|
||||
// Code for weighted decomposition is a bit complex,
|
||||
// so kept separate for now.
|
||||
virtual labelList decompose(const pointField&);
|
||||
virtual labelList decompose(const pointField&) const;
|
||||
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// mesh connectivity (if needed)
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Use the mesh connectivity (if needed).
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
return decompose(cc, cWeights);
|
||||
}
|
||||
|
||||
//- Without weights. Code for weighted decomposition is a bit complex
|
||||
//- Decompose with uniform weights.
|
||||
// Code for weighted decomposition is a bit complex,
|
||||
// so kept separate for now.
|
||||
virtual labelList decompose(const polyMesh& mesh, const pointField& cc)
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& cc
|
||||
) const
|
||||
{
|
||||
return decompose(cc);
|
||||
}
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Explicitly
|
||||
// provided connectivity - does not use mesh_.
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Explicitly provided connectivity - does not use mesh_.
|
||||
// The connectivity is equal to mesh.cellCells() except for
|
||||
// - in parallel the cell numbers are global cell numbers (starting
|
||||
// from 0 at processor0 and then incrementing all through the
|
||||
@ -243,7 +251,7 @@ public:
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
return decompose(cc, cWeights);
|
||||
}
|
||||
@ -252,7 +260,7 @@ public:
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc
|
||||
)
|
||||
) const
|
||||
{
|
||||
return decompose(cc);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,7 +77,7 @@ Foam::labelList Foam::manualDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
labelIOList finalDecomp
|
||||
(
|
||||
@ -92,7 +92,7 @@ Foam::labelList Foam::manualDecomp::decompose
|
||||
)
|
||||
);
|
||||
|
||||
// check if the final decomposition is OK
|
||||
// Check if the final decomposition is OK
|
||||
|
||||
if (finalDecomp.size() != points.size())
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -61,10 +61,12 @@ class manualDecomp
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const manualDecomp&) = delete;
|
||||
//- No copy construct
|
||||
manualDecomp(const manualDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const manualDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -86,30 +88,29 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~manualDecomp()
|
||||
{}
|
||||
virtual ~manualDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Manual decompose does not care about proc boundaries - is all
|
||||
// up to the user.
|
||||
//- Manual decompose does not care about proc boundaries.
|
||||
//- Is all up to the user.
|
||||
virtual bool parallelAware() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// mesh connectivity (if needed)
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Use the mesh connectivity (if needed)
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Explicitly
|
||||
// provided connectivity - does not use mesh_.
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Explicitly provided connectivity - does not use mesh_.
|
||||
// The connectivity is equal to mesh.cellCells() except for
|
||||
// - in parallel the cell numbers are global cell numbers (starting
|
||||
// from 0 at processor0 and then incrementing all through the
|
||||
@ -120,7 +121,7 @@ public:
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return labelList(0);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ Foam::label Foam::metisLikeDecomp::decomposeGeneral
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cWeights,
|
||||
List<label>& decomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
if (!Pstream::parRun())
|
||||
{
|
||||
@ -182,7 +182,7 @@ Foam::labelList Foam::metisLikeDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
if (points.size() != mesh.nCells())
|
||||
{
|
||||
@ -218,7 +218,7 @@ Foam::labelList Foam::metisLikeDecomp::decompose
|
||||
const labelList& agglom,
|
||||
const pointField& agglomPoints,
|
||||
const scalarField& agglomWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
if (agglom.size() != mesh.nCells())
|
||||
{
|
||||
@ -264,7 +264,7 @@ Foam::labelList Foam::metisLikeDecomp::decompose
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cellCentres,
|
||||
const scalarField& cellWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
if (cellCentres.size() != globalCellCells.size())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -53,10 +53,12 @@ class metisLikeDecomp
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const metisLikeDecomp&) = delete;
|
||||
//- No copy construct
|
||||
metisLikeDecomp(const metisLikeDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const metisLikeDecomp&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@ -75,7 +77,7 @@ protected:
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cellWeights,
|
||||
List<label>& decomp
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Decomposition with metis-like parameters
|
||||
virtual label decomposeSerial
|
||||
@ -84,7 +86,7 @@ protected:
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cellWeights,
|
||||
List<label>& decomp
|
||||
) = 0;
|
||||
) const = 0;
|
||||
|
||||
public:
|
||||
|
||||
@ -116,8 +118,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~metisLikeDecomp()
|
||||
{}
|
||||
virtual ~metisLikeDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -135,7 +136,7 @@ public:
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Gets passed agglomeration map (from fine to coarse cells) and coarse
|
||||
@ -148,7 +149,7 @@ public:
|
||||
const labelList& agglom,
|
||||
const pointField& regionPoints,
|
||||
const scalarField& regionWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Explicitly provided mesh connectivity.
|
||||
@ -163,7 +164,7 @@ public:
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cellCentres,
|
||||
const scalarField& cellWeights
|
||||
);
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -330,7 +330,7 @@ void Foam::multiLevelDecomp::decompose
|
||||
const label leafOffset,
|
||||
|
||||
labelList& finalDecomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
labelList dist
|
||||
(
|
||||
@ -611,9 +611,9 @@ Foam::multiLevelDecomp::multiLevelDecomp
|
||||
|
||||
bool Foam::multiLevelDecomp::parallelAware() const
|
||||
{
|
||||
forAll(methods_, i)
|
||||
for (const decompositionMethod& meth : methods_)
|
||||
{
|
||||
if (!methods_[i].parallelAware())
|
||||
if (!meth.parallelAware())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -628,7 +628,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
CompactListList<label> cellCells;
|
||||
calcCellCells(mesh, identity(cc.size()), cc.size(), true, cellCells);
|
||||
@ -657,7 +657,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
||||
const labelListList& globalPointPoints,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
labelList finalDecomp(points.size(), 0);
|
||||
labelList pointMap(identity(points.size()));
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -93,12 +93,15 @@ class multiLevelDecomp
|
||||
const label leafOffset,
|
||||
|
||||
labelList& finalDecomp
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const multiLevelDecomp&) = delete;
|
||||
|
||||
//- No copy construct
|
||||
multiLevelDecomp(const multiLevelDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const multiLevelDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -120,36 +123,35 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~multiLevelDecomp()
|
||||
{}
|
||||
virtual ~multiLevelDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Is method parallel aware (i.e. does it synchronize domains across
|
||||
// proc boundaries)
|
||||
//- Is method parallel aware?
|
||||
// i.e. does it synchronize domains across proc boundaries
|
||||
virtual bool parallelAware() const;
|
||||
|
||||
//- Inherit decompose from decompositionMethod
|
||||
using decompositionMethod::decompose;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// mesh connectivity (if needed)
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Use the mesh connectivity (if needed)
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Explicitly
|
||||
// provided connectivity - does not use mesh_.
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Explicitly provided connectivity - does not use mesh_.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
);
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,10 +53,12 @@ class noDecomp
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const noDecomp&) = delete;
|
||||
//- No copy construct
|
||||
noDecomp(const noDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const noDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -78,14 +80,12 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~noDecomp()
|
||||
{}
|
||||
virtual ~noDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Manual decompose does not care about proc boundaries - it is all
|
||||
//- up to the user.
|
||||
//- Does not care about proc boundaries, it is all up to the user.
|
||||
virtual bool parallelAware() const
|
||||
{
|
||||
return true;
|
||||
@ -98,7 +98,7 @@ public:
|
||||
const polyMesh& mesh,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
return labelList(cc.size(), Pstream::myProcNo());
|
||||
}
|
||||
@ -115,7 +115,7 @@ public:
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
return labelList(globalCellCells.size(), Pstream::myProcNo());
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -63,7 +63,7 @@ void Foam::simpleGeomDecomp::assignToProcessorGroup
|
||||
(
|
||||
labelList& processorGroup,
|
||||
const label nProcGroup
|
||||
) const
|
||||
)
|
||||
{
|
||||
label jump = processorGroup.size()/nProcGroup;
|
||||
label jumpb = jump + 1;
|
||||
@ -100,7 +100,7 @@ void Foam::simpleGeomDecomp::assignToProcessorGroup
|
||||
const labelList& indices,
|
||||
const scalarField& weights,
|
||||
const scalar summedWeights
|
||||
) const
|
||||
)
|
||||
{
|
||||
// This routine gets the sorted points.
|
||||
// Easiest to explain with an example.
|
||||
@ -326,7 +326,7 @@ Foam::simpleGeomDecomp::simpleGeomDecomp
|
||||
Foam::labelList Foam::simpleGeomDecomp::decompose
|
||||
(
|
||||
const pointField& points
|
||||
)
|
||||
) const
|
||||
{
|
||||
if (!Pstream::parRun())
|
||||
{
|
||||
@ -347,7 +347,7 @@ Foam::labelList Foam::simpleGeomDecomp::decompose
|
||||
nTotalPoints += points.size();
|
||||
|
||||
// Add slaves
|
||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||
for (int slave=1; slave<Pstream::nProcs(); ++slave)
|
||||
{
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
pointField nbrPoints(fromSlave);
|
||||
@ -364,7 +364,7 @@ Foam::labelList Foam::simpleGeomDecomp::decompose
|
||||
labelList finalDecomp(decomposeOneProc(allPoints));
|
||||
|
||||
// Send back
|
||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||
for (int slave=1; slave<Pstream::nProcs(); ++slave)
|
||||
{
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << SubField<label>
|
||||
@ -409,7 +409,7 @@ Foam::labelList Foam::simpleGeomDecomp::decompose
|
||||
(
|
||||
const pointField& points,
|
||||
const scalarField& weights
|
||||
)
|
||||
) const
|
||||
{
|
||||
if (!Pstream::parRun())
|
||||
{
|
||||
@ -432,7 +432,7 @@ Foam::labelList Foam::simpleGeomDecomp::decompose
|
||||
nTotalPoints += points.size();
|
||||
|
||||
// Add slaves
|
||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||
for (int slave=1; slave<Pstream::nProcs(); ++slave)
|
||||
{
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
pointField nbrPoints(fromSlave);
|
||||
@ -456,7 +456,7 @@ Foam::labelList Foam::simpleGeomDecomp::decompose
|
||||
labelList finalDecomp(decomposeOneProc(allPoints, allWeights));
|
||||
|
||||
// Send back
|
||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||
for (int slave=1; slave<Pstream::nProcs(); ++slave)
|
||||
{
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << SubField<label>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -57,16 +57,16 @@ class simpleGeomDecomp
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
void assignToProcessorGroup(labelList&, const label) const;
|
||||
static void assignToProcessorGroup(labelList&, const label);
|
||||
|
||||
void assignToProcessorGroup
|
||||
static void assignToProcessorGroup
|
||||
(
|
||||
labelList& processorGroup,
|
||||
const label nProcGroup,
|
||||
const labelList& indices,
|
||||
const scalarField& weights,
|
||||
const scalar summedWeights
|
||||
) const;
|
||||
);
|
||||
|
||||
labelList decomposeOneProc(const pointField& points) const;
|
||||
|
||||
@ -76,8 +76,11 @@ class simpleGeomDecomp
|
||||
const scalarField& weights
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
|
||||
//- No copy construct
|
||||
void operator=(const simpleGeomDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
simpleGeomDecomp(const simpleGeomDecomp&) = delete;
|
||||
|
||||
|
||||
@ -101,36 +104,46 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~simpleGeomDecomp()
|
||||
{}
|
||||
virtual ~simpleGeomDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Simple sends all points to the master for decomposition.
|
||||
virtual bool parallelAware() const
|
||||
{
|
||||
// simpleDecomp sends all points to the master which does
|
||||
// the decomposition.
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual labelList decompose(const pointField&);
|
||||
//- Decompose with uniform weights.
|
||||
virtual labelList decompose(const pointField& points) const;
|
||||
|
||||
virtual labelList decompose(const pointField&, const scalarField&);
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const pointField& points,
|
||||
const scalarField& weights
|
||||
) const;
|
||||
|
||||
virtual labelList decompose(const polyMesh&, const pointField& points)
|
||||
//- Decompose with uniform weights.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh&,
|
||||
const pointField& points
|
||||
) const
|
||||
{
|
||||
return decompose(points);
|
||||
}
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh&,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
const scalarField& weights
|
||||
) const
|
||||
{
|
||||
return decompose(points, pointWeights);
|
||||
return decompose(points, weights);
|
||||
}
|
||||
|
||||
//- Explicitly provided connectivity
|
||||
@ -139,7 +152,7 @@ public:
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
return decompose(cc, cWeights);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -70,7 +70,7 @@ Foam::labelList Foam::structuredDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
const labelHashSet patchIDs(pbm.patchSet(patches_));
|
||||
@ -165,14 +165,14 @@ Foam::labelList Foam::structuredDecomp::decompose
|
||||
|
||||
Foam::labelList Foam::structuredDecomp::decompose
|
||||
(
|
||||
const labelListList& globalPointPoints,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
|
||||
return labelList::null();
|
||||
return labelList(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,10 +60,12 @@ class structuredDecomp
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const structuredDecomp&) = delete;
|
||||
//- No copy construct
|
||||
structuredDecomp(const structuredDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const structuredDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -83,27 +85,27 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Is method parallel aware (i.e. does it synchronize domains across
|
||||
// proc boundaries)
|
||||
//- Is method parallel aware
|
||||
// (i.e. does it synchronize domains across proc boundaries)
|
||||
virtual bool parallelAware() const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// mesh connectivity (if needed)
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Use the mesh connectivity (if needed)
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Explicitly
|
||||
// provided connectivity - does not use mesh_.
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Explicitly provided connectivity - does not use mesh_.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
);
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -78,7 +78,7 @@ Foam::label Foam::kahipDecomp::decomposeSerial
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cWeights,
|
||||
List<label>& decomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Default setup
|
||||
enum configs kahipConfig = configs::FAST;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -84,12 +84,15 @@ class kahipDecomp
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cellWeights,
|
||||
List<label>& decomp
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const kahipDecomp&) = delete;
|
||||
|
||||
//- No copy construct
|
||||
kahipDecomp(const kahipDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const kahipDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -127,8 +130,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~kahipDecomp()
|
||||
{}
|
||||
virtual ~kahipDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -64,7 +64,7 @@ Foam::label Foam::metisDecomp::decomposeSerial
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cWeights,
|
||||
List<label>& decomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Method of decomposition
|
||||
// recursive: multi-level recursive bisection (default)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -83,12 +83,16 @@ class metisDecomp
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cellWeights,
|
||||
List<label>& decomp
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const metisDecomp&) = delete;
|
||||
|
||||
//- No copy construct
|
||||
metisDecomp(const metisDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const metisDecomp&) = delete;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -110,8 +114,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~metisDecomp()
|
||||
{}
|
||||
virtual ~metisDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -213,7 +213,7 @@ License
|
||||
#include <mpi.h>
|
||||
#include "ptscotch.h"
|
||||
|
||||
// Hack: scotch generates floating point errors so need to switch of error
|
||||
// Hack: scotch generates floating point errors so need to switch off error
|
||||
// trapping!
|
||||
#ifdef __GLIBC__
|
||||
#ifndef _GNU_SOURCE
|
||||
@ -244,9 +244,10 @@ namespace Foam
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::ptscotchDecomp::graphPath(const polyMesh& mesh)
|
||||
void Foam::ptscotchDecomp::graphPath(const polyMesh& mesh) const
|
||||
{
|
||||
graphPath_ = mesh.time().path()/mesh.name();
|
||||
}
|
||||
@ -460,8 +461,8 @@ Foam::label Foam::ptscotchDecomp::decompose
|
||||
List<label>& finalDecomp
|
||||
) const
|
||||
{
|
||||
List<label> dummyAdjncy { 0 };
|
||||
List<label> dummyXadj { 0 };
|
||||
List<label> dummyAdjncy;
|
||||
List<label> dummyXadj;
|
||||
|
||||
return decompose
|
||||
(
|
||||
@ -822,7 +823,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Where to write graph
|
||||
graphPath(mesh);
|
||||
@ -873,7 +874,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
const labelList& agglom,
|
||||
const pointField& agglomPoints,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Where to write graph
|
||||
graphPath(mesh);
|
||||
@ -927,7 +928,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cellCentres,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Where to write graph
|
||||
graphPath_ = "ptscotch";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -73,13 +73,13 @@ class ptscotchDecomp
|
||||
dictionary coeffsDict_;
|
||||
|
||||
//- Output path and name for optional grf file.
|
||||
fileName graphPath_;
|
||||
mutable fileName graphPath_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Set graph path and name
|
||||
void graphPath(const polyMesh& mesh);
|
||||
//- Set graph path and name (mutable)
|
||||
void graphPath(const polyMesh& mesh) const;
|
||||
|
||||
//- Check and print error message
|
||||
static void check(const int, const char*);
|
||||
@ -104,10 +104,13 @@ class ptscotchDecomp
|
||||
List<label>& finalDecomp
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const ptscotchDecomp&) = delete;
|
||||
|
||||
//- No copy construct
|
||||
ptscotchDecomp(const ptscotchDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const ptscotchDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -126,33 +129,33 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ptscotchDecomp()
|
||||
{}
|
||||
virtual ~ptscotchDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual bool parallelAware() const
|
||||
{
|
||||
// ptscotch does not know about proc boundaries
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Inherit decompose from decompositionMethod
|
||||
using decompositionMethod::decompose;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// mesh connectivity (if needed). See note on weights in scotchDecomp.H
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Use the mesh connectivity (if needed).
|
||||
// See note on weights in scotchDecomp.H
|
||||
virtual labelList decompose
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Gets
|
||||
// passed agglomeration map (from fine to coarse cells) and coarse cell
|
||||
// location. Can be overridden by decomposers that provide this
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Gets passed agglomeration map (from fine to coarse cells) and
|
||||
// coarse cell location.
|
||||
// Can be overridden by decomposers that provide this
|
||||
// functionality natively. See note on weights in scotchDecomp.H
|
||||
virtual labelList decompose
|
||||
(
|
||||
@ -160,10 +163,10 @@ public:
|
||||
const labelList& agglom,
|
||||
const pointField& regionPoints,
|
||||
const scalarField& regionWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Explicitly
|
||||
// provided mesh connectivity.
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
// Explicitly provided mesh connectivity.
|
||||
// The connectivity is equal to mesh.cellCells() except for
|
||||
// - in parallel the cell numbers are global cell numbers (starting
|
||||
// from 0 at processor0 and then incrementing all through the
|
||||
@ -175,7 +178,7 @@ public:
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -166,7 +166,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::scotchDecomp::graphPath(const polyMesh& mesh)
|
||||
void Foam::scotchDecomp::graphPath(const polyMesh& mesh) const
|
||||
{
|
||||
graphPath_ = mesh.time().path()/mesh.name() + ".grf";
|
||||
}
|
||||
@ -189,7 +189,7 @@ Foam::label Foam::scotchDecomp::decomposeSerial
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cWeights,
|
||||
List<label>& decomp
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Dump graph
|
||||
if (coeffsDict_.lookupOrDefault("writeGraph", false))
|
||||
@ -476,7 +476,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Where to write graph
|
||||
graphPath(mesh);
|
||||
@ -496,7 +496,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||
const labelList& agglom,
|
||||
const pointField& agglomPoints,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Where to write graph
|
||||
graphPath(mesh);
|
||||
@ -516,7 +516,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cellCentres,
|
||||
const scalarField& cWeights
|
||||
)
|
||||
) const
|
||||
{
|
||||
// Where to write graph
|
||||
graphPath_ = "scotch.grf";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -232,13 +232,13 @@ class scotchDecomp
|
||||
// Private data
|
||||
|
||||
//- Output path and name for optional grf file.
|
||||
fileName graphPath_;
|
||||
mutable fileName graphPath_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Set graph path and name
|
||||
void graphPath(const polyMesh& mesh);
|
||||
//- Set graph path and name (mutable)
|
||||
void graphPath(const polyMesh& mesh) const;
|
||||
|
||||
//- Check and print error message
|
||||
static void check(const int, const char*);
|
||||
@ -250,12 +250,15 @@ class scotchDecomp
|
||||
const labelUList& xadj,
|
||||
const UList<scalar>& cWeights,
|
||||
List<label>& decomp
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const scotchDecomp&) = delete;
|
||||
|
||||
//- No copy construct
|
||||
scotchDecomp(const scotchDecomp&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const scotchDecomp&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -277,15 +280,14 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~scotchDecomp()
|
||||
{}
|
||||
virtual ~scotchDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Knows about coupled boundaries
|
||||
virtual bool parallelAware() const
|
||||
{
|
||||
// Knows about coupled boundaries
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -298,7 +300,7 @@ public:
|
||||
const polyMesh& mesh,
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
virtual labelList decompose
|
||||
@ -307,7 +309,7 @@ public:
|
||||
const labelList& agglom,
|
||||
const pointField& regionPoints,
|
||||
const scalarField& regionWeights
|
||||
);
|
||||
) const;
|
||||
|
||||
//- Return for every coordinate the wanted processor number.
|
||||
virtual labelList decompose
|
||||
@ -315,7 +317,7 @@ public:
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
);
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user