Decomposition/redistribution: Separated choice of mesh decomposition and redistribution methods

When snappyHexMesh is run in parallel it re-balances the mesh during refinement
and layer addition by redistribution which requires a decomposition method
that operates in parallel, e.g. hierachical or ptscotch.  decomposePar uses a
decomposition method which operates in serial e.g. hierachical but NOT
ptscotch.  In order to run decomposePar followed by snappyHexMesh in parallel it
has been necessary to change the method specified in decomposeParDict but now
this is avoided by separately specifying the decomposition and distribution
methods, e.g. in the incompressible/simpleFoam/motorBike case:

numberOfSubdomains  6;

decomposer      hierarchical;
distributor     ptscotch;

hierarchicalCoeffs
{
    n               (3 2 1);
    order           xyz;
}

The distributor entry is also used for run-time mesh redistribution, e.g. in the
multiphase/interFoam/RAS/floatingObject case re-distribution for load-balancing
is enabled in constant/dynamicMeshDict:

distributor
{
    type            distributor;

    libs            ("libfvMeshDistributors.so");

    redistributionInterval  10;
}

which uses the distributor specified in system/decomposeParDict:

distributor     hierarchical;

This rationalisation provides the structure for development of mesh
redistribution and load-balancing.
This commit is contained in:
Henry Weller
2021-12-15 22:12:00 +00:00
parent 349addce38
commit f97f6326f0
86 changed files with 358 additions and 1391 deletions

View File

@ -803,18 +803,13 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
bFTreePtr_(),
allBackgroundMeshBounds_(Pstream::nProcs()),
globalBackgroundBounds_(),
decomposeDict_
decomposerPtr_
(
IOobject
decompositionMethod::NewDecomposer
(
"decomposeParDict",
runTime_.system(),
runTime_,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
decompositionMethod::decomposeParDict(runTime)
)
),
decomposerPtr_(decompositionMethod::New(decomposeDict_)),
spanScale_(coeffsDict.lookup<scalar>("spanScale")),
minCellSizeLimit_
(
@ -831,15 +826,6 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
<< exit(FatalError);
}
if (!decomposerPtr_().parallelAware())
{
FatalErrorInFunction
<< "You have selected decomposition method "
<< decomposerPtr_().typeName
<< " which is not parallel aware." << endl
<< exit(FatalError);
}
Info<< nl << "Building initial background mesh decomposition" << endl;
initialRefinement();

View File

@ -124,9 +124,6 @@ class backgroundMeshDecomposition
// a point that is not found on any processor is in the domain at all
treeBoundBox globalBackgroundBounds_;
//- Decomposition dictionary
IOdictionary decomposeDict_;
//- Decomposition method
autoPtr<decompositionMethod> decomposerPtr_;

View File

@ -522,27 +522,18 @@ int main(int argc, char *argv[])
printMeshData(mesh);
// Allocate a decomposer
IOdictionary decompositionDict
(
IOobject
(
"decomposeParDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
autoPtr<decompositionMethod> decomposer
(
decompositionMethod::New
decompositionMethod::NewDecomposer
(
decompositionDict
decompositionMethod::decomposeParDict(runTime)
)
);
labelList decomp = decomposer().decompose(mesh, mesh.cellCentres());
const labelList decomp
(
decomposer().decompose(mesh, mesh.cellCentres())
);
// Global matching tolerance
const scalar tolDim = getMergeDistance

View File

@ -753,23 +753,12 @@ int main(int argc, char *argv[])
const Switch keepPatches(meshDict.lookupOrDefault("keepPatches", false));
// Read decomposePar dictionary
dictionary decomposeDict;
{
if (Pstream::parRun())
{
decomposeDict = IOdictionary
(
IOobject
(
"decomposeParDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
decomposeDict = decompositionMethod::decomposeParDict(runTime);
}
else
{
@ -1220,30 +1209,14 @@ int main(int argc, char *argv[])
// Decomposition
autoPtr<decompositionMethod> decomposerPtr
(
decompositionMethod::New
(
decomposeDict
)
decompositionMethod::NewDistributor(decomposeDict)
);
decompositionMethod& decomposer = decomposerPtr();
if (Pstream::parRun() && !decomposer.parallelAware())
{
FatalErrorInFunction
<< "You have selected decomposition method "
<< decomposer.typeName
<< " which is not parallel aware." << endl
<< "Please select one that is (hierarchical, ptscotch)"
<< exit(FatalError);
}
// Mesh distribution engine (uses tolerance to reconstruct meshes)
fvMeshDistribute distributor(mesh);
// Now do the real work -refinement -snapping -layers
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -844,9 +844,9 @@ int main(int argc, char *argv[])
bool oldParRun = UPstream::parRun();
UPstream::parRun() = false;
autoPtr<decompositionMethod> decomposePtr = decompositionMethod::New
autoPtr<decompositionMethod> decomposePtr
(
decomposeDict
decompositionMethod::NewDecomposer(decomposeDict)
);
labelList cellToRegion

View File

@ -3,6 +3,7 @@ domainDecomposition.C
domainDecompositionMesh.C
domainDecompositionDistribute.C
dimFieldDecomposer.C
fvFieldDecomposer.C
pointFieldDecomposer.C
lagrangianFieldDecomposer.C

View File

@ -1,5 +1,4 @@
EXE_INC = \
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
@ -9,7 +8,6 @@ EXE_INC = \
EXE_LIBS = \
-ldynamicMesh \
-ldecompose \
-lgenericPatchFields \
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \
-llagrangian \

View File

@ -79,10 +79,12 @@ Usage
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
#include "fvCFD.H"
#include "IOobjectList.H"
#include "domainDecomposition.H"
#include "decompositionMethod.H"
#include "argList.H"
#include "timeSelector.H"
#include "regionProperties.H"
#include "labelIOField.H"
#include "labelFieldIOField.H"
#include "scalarIOField.H"
@ -95,16 +97,14 @@ Usage
#include "symmTensorFieldIOField.H"
#include "tensorIOField.H"
#include "tensorFieldIOField.H"
#include "pointFields.H"
#include "regionProperties.H"
#include "systemDict.H"
#include "readFields.H"
#include "dimFieldDecomposer.H"
#include "fvFieldDecomposer.H"
#include "pointFieldDecomposer.H"
#include "lagrangianFieldDecomposer.H"
#include "decompositionModel.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -277,9 +277,6 @@ int main(int argc, char *argv[])
bool forceOverwrite = args.optionFound("force");
bool ifRequiredDecomposition = args.optionFound("ifRequired");
const word dictName("decomposeParDict");
if (decomposeGeomOnly)
{
Info<< "Skipping decomposing fields"
@ -381,16 +378,10 @@ int main(int argc, char *argv[])
// Determine the existing processor count directly
label nProcs = fileHandler().nProcs(runTime.path(), regionDir);
// Get the dictionary IO
const typeIOobject<IOdictionary> dictIO
(
systemDictIO(dictName, args, runTime, regionName)
);
// Get requested numberOfSubdomains. Note: have no mesh yet so
// cannot use decompositionModel::New
// Get requested numberOfSubdomains
const label nDomains =
IOdictionary(dictIO).lookup<label>("numberOfSubdomains");
decompositionMethod::decomposeParDict(runTime)
.lookup<label>("numberOfSubdomains");
// Give file handler a chance to determine the output directory
const_cast<fileOperation&>(fileHandler()).setNProcs(nDomains);
@ -405,7 +396,7 @@ int main(int argc, char *argv[])
<< nProcs << " domains"
<< nl
<< "instead of " << nDomains
<< " domains as specified in " << dictName
<< " domains as specified in decomposeParDict"
<< nl
<< exit(FatalError);
}
@ -431,14 +422,13 @@ int main(int argc, char *argv[])
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
dictIO.objectPath()
)
);
// Decompose the mesh
if (!decomposeFieldsOnly)
{
mesh.decomposeMesh(dictIO.objectPath());
mesh.decomposeMesh();
mesh.writeDecomposition(decomposeSets);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,6 @@ License
#include "dimFieldDecomposer.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dimFieldDecomposer::dimFieldDecomposer

View File

@ -24,20 +24,12 @@ License
\*---------------------------------------------------------------------------*/
#include "domainDecomposition.H"
#include "dictionary.H"
#include "labelIOList.H"
#include "processorPolyPatch.H"
#include "processorCyclicPolyPatch.H"
#include "fvMesh.H"
#include "OSspecific.H"
#include "Map.H"
#include "DynamicList.H"
#include "decompositionMethod.H"
#include "fvFieldDecomposer.H"
#include "IOobjectList.H"
#include "cellSet.H"
#include "faceSet.H"
#include "pointSet.H"
#include "decompositionModel.H"
#include "hexRef8Data.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -71,8 +63,7 @@ void Foam::domainDecomposition::mark
Foam::domainDecomposition::domainDecomposition
(
const IOobject& io,
const fileName& dictFile
const IOobject& io
)
:
fvMesh(io, false),
@ -96,11 +87,8 @@ Foam::domainDecomposition::domainDecomposition
),
nProcs_
(
decompositionModel::New
(
*this,
dictFile
).lookup<int>("numberOfSubdomains")
decompositionMethod::decomposeParDict(time())
.lookup<int>("numberOfSubdomains")
),
distributed_(false),
cellToProc_(nCells()),
@ -115,11 +103,11 @@ Foam::domainDecomposition::domainDecomposition
procProcessorPatchSubPatchIDs_(nProcs_),
procProcessorPatchSubPatchStarts_(nProcs_)
{
decompositionModel::New
decompositionMethod::decomposeParDict(time()).readIfPresent
(
*this,
dictFile
).readIfPresent("distributed", distributed_);
"distributed",
distributed_
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,7 +114,7 @@ class domainDecomposition
// Private Member Functions
void distributeCells(const fileName& dictFile);
void distributeCells();
//- Mark all elements with value or -2 if occur twice
static void mark
@ -156,12 +156,8 @@ public:
// Constructors
//- Construct from IOobject and decomposition dictionary name
domainDecomposition
(
const IOobject& io,
const fileName& dictFile
);
//- Construct from IOobject
domainDecomposition(const IOobject& io);
//- Destructor
@ -182,8 +178,8 @@ public:
return distributed_;
}
//- Decompose mesh.
void decomposeMesh(const fileName& dict);
//- Decompose mesh
void decomposeMesh();
//- Write decomposition
bool writeDecomposition(const bool decomposeSets);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,26 +25,23 @@ License
#include "domainDecomposition.H"
#include "decompositionMethod.H"
#include "cpuTime.H"
#include "cellSet.H"
#include "regionSplit.H"
#include "Tuple2.H"
#include "faceSet.H"
#include "decompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::domainDecomposition::distributeCells(const fileName& dict)
void Foam::domainDecomposition::distributeCells()
{
Info<< "\nCalculating distribution of cells" << endl;
cpuTime decompositionTime;
const decompositionModel& method = decompositionModel::New(*this, dict);
const dictionary decomposeParDict
(
decompositionMethod::decomposeParDict(time())
);
scalarField cellWeights;
if (method.found("weightField"))
if (decomposeParDict.found("weightField"))
{
word weightName = method.lookup("weightField");
const word weightName = decomposeParDict.lookup("weightField");
volScalarField weights
(
@ -61,7 +58,9 @@ void Foam::domainDecomposition::distributeCells(const fileName& dict)
cellWeights = weights.primitiveField();
}
cellToProc_ = method.decomposer().decompose(*this, cellWeights);
cellToProc_ =
decompositionMethod::NewDecomposer(decomposeParDict)
->decompose(*this, cellWeights);
Info<< "\nFinished decomposition in "
<< decompositionTime.elapsedCpuTime()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,9 +31,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "domainDecomposition.H"
#include "IOstreams.H"
#include "boolList.H"
#include "cyclicPolyPatch.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -94,10 +91,10 @@ void Foam::domainDecomposition::addInterProcFace
}
void Foam::domainDecomposition::decomposeMesh(const fileName& dict)
void Foam::domainDecomposition::decomposeMesh()
{
// Decide which cell goes to which processor
distributeCells(dict);
distributeCells();
// Distribute the cells according to the given processor label

View File

@ -25,7 +25,6 @@ License
#include "fvFieldDecomposer.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::labelList Foam::fvFieldDecomposer::patchFieldDecomposer::alignAddressing

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,6 @@ License
\*---------------------------------------------------------------------------*/
#include "GeometricField.H"
#include "readFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -400,45 +400,19 @@ int main(int argc, char *argv[])
printMeshData(mesh);
IOdictionary decompositionDict
(
IOobject
(
"decomposeParDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
labelList finalDecomp;
// Create decompositionMethod and new decomposition
{
autoPtr<decompositionMethod> decomposer
autoPtr<decompositionMethod> distributor
(
decompositionMethod::New
decompositionMethod::NewDistributor
(
decompositionDict
decompositionMethod::decomposeParDict(runTime)
)
);
if (!decomposer().parallelAware())
{
WarningInFunction
<< "You have selected decomposition method "
<< decomposer().typeName
<< " which does" << endl
<< "not synchronise the decomposition across"
<< " processor patches." << endl
<< " You might want to select a decomposition method which"
<< " is aware of this. Continuing."
<< endl;
}
finalDecomp = decomposer().decompose(mesh, mesh.cellCentres());
finalDecomp = distributor().decompose(mesh, mesh.cellCentres());
}
// Dump decomposition to volScalarField

View File

@ -1,10 +1,12 @@
EXE_INC = \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-ldecompositionMethods \
-lsampling \
-lmeshTools \
-llagrangian \

View File

@ -32,11 +32,16 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "argList.H"
#include "fvMesh.H"
#include "surfaceMesh.H"
#include "decompositionMethod.H"
#include "meshToMesh0.H"
#include "processorFvPatch.H"
#include "MapMeshes.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void mapConsistentMesh
@ -320,20 +325,14 @@ int main(int argc, char *argv[])
if (parallelSource && !parallelTarget)
{
IOdictionary decompositionDict
const int nProcs
(
IOobject
decompositionMethod::decomposeParDict(runTimeSource).lookup<int>
(
"decomposeParDict",
runTimeSource.system(),
runTimeSource,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
"numberOfSubdomains"
)
);
const int nProcs(decompositionDict.lookup<int>("numberOfSubdomains"));
Info<< "Create target mesh\n" << endl;
fvMesh meshTarget
@ -401,20 +400,14 @@ int main(int argc, char *argv[])
}
else if (!parallelSource && parallelTarget)
{
IOdictionary decompositionDict
const int nProcs
(
IOobject
decompositionMethod::decomposeParDict(runTimeSource).lookup<int>
(
"decomposeParDict",
runTimeTarget.system(),
runTimeTarget,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
"numberOfSubdomains"
)
);
const int nProcs(decompositionDict.lookup<int>("numberOfSubdomains"));
Info<< "Create source mesh\n" << endl;
#include "setTimeIndex.H"
@ -482,39 +475,20 @@ int main(int argc, char *argv[])
}
else if (parallelSource && parallelTarget)
{
IOdictionary decompositionDictSource
(
IOobject
(
"decomposeParDict",
runTimeSource.system(),
runTimeSource,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
const int nProcsSource
(
decompositionDictSource.lookup<int>("numberOfSubdomains")
);
IOdictionary decompositionDictTarget
(
IOobject
decompositionMethod::decomposeParDict(runTimeSource).lookup<int>
(
"decomposeParDict",
runTimeTarget.system(),
runTimeTarget,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
"numberOfSubdomains"
)
);
const int nProcsTarget
(
decompositionDictTarget.lookup<int>("numberOfSubdomains")
decompositionMethod::decomposeParDict(runTimeTarget).lookup<int>
(
"numberOfSubdomains"
)
);
List<boundBox> bbsTarget(nProcsTarget);

View File

@ -16,7 +16,6 @@ FoamFile
numberOfSubdomains 2;
// Optional decomposition constraints
/*
constraints
@ -28,12 +27,14 @@ constraints
// sharing the same points
type preserveBaffles;
}
preserveFaceZones
{
//- Keep owner and neighbour on same processor for faces in zones
type preserveFaceZones;
zones (".*");
}
preservePatches
{
//- Keep owner and neighbour on same processor for faces in patches
@ -43,6 +44,7 @@ constraints
type preservePatches;
patches (".*");
}
singleProcessorFaceSets
{
//- Keep all of faceSet on a single processor. This puts all cells
@ -55,6 +57,7 @@ constraints
type singleProcessorFaceSets;
singleProcessorFaceSets ((f1 -1));
}
refinementHistory
{
//- Decompose cells such that all cell originating from single cell
@ -64,31 +67,6 @@ constraints
}
*/
// Deprecated form of specifying decomposition constraints:
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
//- Keep owner and neighbour on same processor for faces in patches:
// (makes sense only for cyclic patches. Not suitable for e.g. cyclicAMI
// since these are not coupled on the patch level. Use
// singleProcessorFaceSets for those)
// preservePatches (cyclic_half0 cyclic_half1);
//- Keep all of faceSet on a single processor. This puts all cells
// connected with a point, edge or face on the same processor.
// (just having face connected cells might not guarantee a balanced
// decomposition)
// The processor can be -1 (the decompositionMethod chooses the processor
// for a good load balance) or explicitly provided (upsets balance).
// singleProcessorFaceSets ((f0 -1));
//- Keep owner and neighbour of baffles on same processor (i.e. keep it
// detectable as a baffle). Baffles are two boundary face sharing the
// same points.
// preserveBaffles true;
//- Use the volScalarField named here as a weight for each cell in the
// decomposition. For example, use a particle population field to decompose
// for a balanced number of particles in a lagrangian simulation.

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,13 +43,7 @@ static const char* notImplementedMessage =
namespace Foam
{
defineTypeNameAndDebug(metisDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
metisDecomp,
dictionary
);
addToRunTimeSelectionTable(decompositionMethod, metisDecomp, decomposer);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,10 +48,11 @@ namespace Foam
(
decompositionMethod,
ptscotchDecomp,
dictionary
distributor
);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::ptscotchDecomp::check(const int retVal, const char* str)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,10 +47,18 @@ namespace Foam
(
decompositionMethod,
scotchDecomp,
dictionary
decomposer
);
addToRunTimeSelectionTable
(
decompositionMethod,
scotchDecomp,
distributor
);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::scotchDecomp::check(const int retVal, const char* str)

View File

@ -1,3 +1,3 @@
decomposer/fvMeshDistributorDecomposer.C
distributor/fvMeshDistributorsDistributor.C
LIB = $(FOAM_LIBBIN)/libfvMeshDistributors

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "fvMeshDistributorDecomposer.H"
#include "fvMeshDistributorsDistributor.H"
#include "decompositionMethod.H"
#include "fvMeshDistribute.H"
#include "mapDistributePolyMesh.H"
@ -35,11 +35,11 @@ namespace Foam
{
namespace fvMeshDistributors
{
defineTypeNameAndDebug(decomposer, 0);
defineTypeNameAndDebug(distributor, 0);
addToRunTimeSelectionTable
(
fvMeshDistributor,
decomposer,
distributor,
fvMesh
);
}
@ -48,77 +48,54 @@ namespace fvMeshDistributors
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::fvMeshDistributors::decomposer::readDict()
void Foam::fvMeshDistributors::distributor::readDict()
{
const dictionary& decomposerDict(dict());
const dictionary& distributorDict(dict());
redistributionInterval_ =
decomposerDict.lookupOrDefault("redistributionInterval", 10);
distributorDict.lookupOrDefault("redistributionInterval", 10);
maxImbalance_ =
decomposerDict.lookupOrDefault<scalar>("maxImbalance", 0.1);
distributorDict.lookupOrDefault<scalar>("maxImbalance", 0.1);
}
void Foam::fvMeshDistributors::decomposer::redecompose()
void Foam::fvMeshDistributors::distributor::distribute()
{
fvMesh& mesh = this->mesh();
IOdictionary decompositionDict
// Create new decomposition distribution
labelList distribution
(
IOobject
(
"decomposeParDict",
mesh.time().system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
distributor_->decompose(mesh, mesh.cellCentres())
);
labelList finalDecomp;
// Create decompositionMethod and new decomposition
{
autoPtr<decompositionMethod> decomposer
(
decompositionMethod::New
(
decompositionDict
)
);
if (!decomposer().parallelAware())
{
WarningInFunction
<< "You have selected decomposition method "
<< decomposer().typeName
<< " which does" << endl
<< "not synchronise the decomposition across"
<< " processor patches." << endl
<< " You might want to select a decomposition method which"
<< " is aware of this. Continuing."
<< endl;
}
finalDecomp = decomposer().decompose(mesh, mesh.cellCentres());
}
// Mesh distribution engine
fvMeshDistribute distributor(mesh);
// Do actual sending/receiving of mesh
autoPtr<mapDistributePolyMesh> map = distributor.distribute(finalDecomp);
autoPtr<mapDistributePolyMesh> map
(
distributor.distribute(distribution)
);
// Distribute the mesh data
mesh.distribute(map);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvMeshDistributors::decomposer::decomposer(fvMesh& mesh)
Foam::fvMeshDistributors::distributor::distributor(fvMesh& mesh)
:
fvMeshDistributor(mesh),
distributor_
(
decompositionMethod::NewDistributor
(
decompositionMethod::decomposeParDict(mesh.time())
)
),
redistributionInterval_(1),
maxImbalance_(0.1),
timeIndex_(-1)
@ -129,13 +106,13 @@ Foam::fvMeshDistributors::decomposer::decomposer(fvMesh& mesh)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::fvMeshDistributors::decomposer::~decomposer()
Foam::fvMeshDistributors::distributor::~distributor()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fvMeshDistributors::decomposer::update()
bool Foam::fvMeshDistributors::distributor::update()
{
if
(
@ -158,13 +135,9 @@ bool Foam::fvMeshDistributors::decomposer::update()
if (imbalance > maxImbalance_)
{
if (debug)
{
Info<< "Redistributing mesh with imbalance "
<< imbalance << endl;
}
Info<< "Redistributing mesh with imbalance " << imbalance << endl;
redecompose();
distribute();
return true;
}
@ -180,18 +153,18 @@ bool Foam::fvMeshDistributors::decomposer::update()
}
void Foam::fvMeshDistributors::decomposer::updateMesh(const mapPolyMesh&)
void Foam::fvMeshDistributors::distributor::updateMesh(const mapPolyMesh&)
{}
void Foam::fvMeshDistributors::decomposer::distribute
void Foam::fvMeshDistributors::distributor::distribute
(
const mapDistributePolyMesh&
)
{}
bool Foam::fvMeshDistributors::decomposer::write(const bool write) const
bool Foam::fvMeshDistributors::distributor::write(const bool write) const
{
return true;
}

View File

@ -22,17 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fvMeshDistributor::decomposer
Foam::fvMeshDistributors::distributor
Description
Dynamic mesh redistribution using the decomposer
Dynamic mesh redistribution using the distributor specified in
decomposeParDict
Usage
Example of single field based refinement in all cells:
\verbatim
distributor
{
type decomposer;
type distributor;
libs ("libfvMeshDistributors.so");
@ -46,12 +47,12 @@ Usage
\endverbatim
SourceFiles
fvMeshDistributorDecomposer.C
fvMeshDistributorsDistributor.C
\*---------------------------------------------------------------------------*/
#ifndef fvMeshDistributorDecomposer_H
#define fvMeshDistributorDecomposer_H
#ifndef fvMeshDistributorsDistributor_H
#define fvMeshDistributorsDistributor_H
#include "fvMeshDistributor.H"
@ -59,19 +60,24 @@ SourceFiles
namespace Foam
{
class decompositionMethod;
namespace fvMeshDistributors
{
/*---------------------------------------------------------------------------*\
Class decomposer Declaration
Class distributor Declaration
\*---------------------------------------------------------------------------*/
class decomposer
class distributor
:
public fvMeshDistributor
{
// Private Member Data
//- Cache the decomposer/distributor
autoPtr<decompositionMethod> distributor_;
//- Time-step interval between redistribution calls
label redistributionInterval_;
@ -88,32 +94,32 @@ class decomposer
//- Read the projection parameters from dictionary
void readDict();
//- Re-decompose the mesh for redistribution
void redecompose();
//- Distribute the mesh and mesh data
void distribute();
public:
//- Runtime type information
TypeName("decomposer");
TypeName("distributor");
// Constructors
//- Construct from fvMesh
explicit decomposer(fvMesh& mesh);
explicit distributor(fvMesh& mesh);
//- Disallow default bitwise copy construction
decomposer(const decomposer&) = delete;
distributor(const distributor&) = delete;
//- Destructor
virtual ~decomposer();
virtual ~distributor();
// Member Functions
//- Distribute the mesh
//- Distribute the
virtual bool update();
//- Update corresponding to the given map
@ -132,7 +138,7 @@ public:
// Member Operators
//- Disallow default bitwise assignment
void operator=(const decomposer&) = delete;
void operator=(const distributor&) = delete;
};

View File

@ -41,6 +41,5 @@ fi
wclean metisDecomp
wclean decompositionMethods
wclean decompose
#------------------------------------------------------------------------------

View File

@ -53,7 +53,6 @@ fi
(cd metisDecomp && ./Allwmake $targetType)
wmake $targetType decompositionMethods
wmake $targetType decompose
#------------------------------------------------------------------------------

View File

@ -1,4 +0,0 @@
decompositionModel.C
fvFieldDecomposer.C
LIB = $(FOAM_LIBBIN)/libdecompose

View File

@ -1,11 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldecompositionMethods \
-llagrangian

View File

@ -1,164 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "decompositionModel.H"
#include "polyMesh.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(decompositionModel, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::decompositionModel::decompositionModel
(
const polyMesh& mesh,
const fileName& decompDictFile
)
:
MeshObject
<
polyMesh,
Foam::UpdateableMeshObject,
decompositionModel
>(mesh),
IOdictionary
(
selectIO
(
IOobject
(
"decomposeParDict",
mesh.time().system(),
mesh.local(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // io.registerObject()
),
decompDictFile
)
)
{}
Foam::decompositionModel::decompositionModel
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile
)
:
MeshObject
<
polyMesh,
Foam::UpdateableMeshObject,
decompositionModel
>(mesh),
IOdictionary
(
selectIO
(
IOobject
(
"decomposeParDict",
mesh.time().system(),
mesh.local(),
mesh,
(dict.size() ? IOobject::NO_READ : IOobject::MUST_READ),
IOobject::NO_WRITE,
false // io.registerObject()
),
decompDictFile
),
dict
)
{}
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
const Foam::decompositionModel& Foam::decompositionModel::New
(
const polyMesh& mesh,
const fileName& decompDictFile
)
{
return
MeshObject
<
polyMesh,
Foam::UpdateableMeshObject,
decompositionModel
>::New(mesh, decompDictFile);
}
const Foam::decompositionModel& Foam::decompositionModel::New
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile
)
{
return
MeshObject
<
polyMesh,
Foam::UpdateableMeshObject,
decompositionModel
>::New(mesh, dict, decompDictFile);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::IOobject Foam::decompositionModel::selectIO
(
const IOobject& io,
const fileName& f
)
{
return
(
f.size()
? IOobject // construct from filePath instead
(
fileName(f).toAbsolute(),
io.db(),
io.readOpt(),
io.writeOpt(),
io.registerObject()
)
: io
);
}
// ************************************************************************* //

View File

@ -1,145 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::decompositionModel
Description
MeshObject wrapper of decompositionMethod
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef decompositionModel_H
#define decompositionModel_H
#include "IOdictionary.H"
#include "MeshObject.H"
#include "decompositionMethod.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class mapPolyMesh;
class polyMesh;
/*---------------------------------------------------------------------------*\
Class decompositionModel Declaration
\*---------------------------------------------------------------------------*/
class decompositionModel
:
public MeshObject
<
polyMesh,
UpdateableMeshObject,
decompositionModel
>,
public IOdictionary
{
// Private Data
mutable autoPtr<decompositionMethod> decomposerPtr_;
public:
// Declare name of the class and its debug switch
ClassName("decompositionModel");
// Selectors
//- Read (optionally from absolute path) & register on mesh
static const decompositionModel& New
(
const polyMesh& mesh,
const fileName& decompDictFile = ""
);
//- Read (optionally from supplied dictionary) & register on mesh
static const decompositionModel& New
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile = ""
);
// Constructors
//- Construct from typeName or optional path to controlDictionary
decompositionModel(const polyMesh&, const fileName& = "");
//- Construct from typeName or optional path to controlDictionary
decompositionModel
(
const polyMesh&,
const dictionary& dict,
const fileName& = ""
);
// Member Functions
decompositionMethod& decomposer() const
{
if (!decomposerPtr_.valid())
{
decomposerPtr_ = decompositionMethod::New(*this);
}
return decomposerPtr_();
}
//- Helper: return IOobject with optionally absolute path provided
static IOobject selectIO(const IOobject&, const fileName&);
// UpdateableMeshObject
virtual bool movePoints()
{
return false;
}
virtual void updateMesh(const mapPolyMesh&)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -21,12 +21,10 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InClass
decompositionMethod
\*---------------------------------------------------------------------------*/
#include "decompositionMethod.H"
#include "Time.H"
#include "globalIndex.H"
#include "syncTools.H"
#include "Tuple2.H"
@ -46,9 +44,11 @@ InClass
namespace Foam
{
defineTypeNameAndDebug(decompositionMethod, 0);
defineRunTimeSelectionTable(decompositionMethod, dictionary);
defineRunTimeSelectionTable(decompositionMethod, decomposer);
defineRunTimeSelectionTable(decompositionMethod, distributor);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::decompositionMethod::decompositionMethod
@ -64,15 +64,9 @@ Foam::decompositionMethod::decompositionMethod
{
// Read any constraints
wordList constraintTypes_;
if (decompositionDict_.found("constraints"))
{
// PtrList<dictionary> constraintsList
//(
// decompositionDict_.lookup("constraints")
//);
// forAll(constraintsList, i)
//{
// const dictionary& dict = constraintsList[i];
const dictionary& constraintsList = decompositionDict_.subDict
(
"constraints"
@ -93,106 +87,37 @@ Foam::decompositionMethod::decompositionMethod
);
}
}
// Backwards compatibility
if
(
decompositionDict_.found("preserveBaffles")
&& findIndex
(
constraintTypes_,
decompositionConstraints::preserveBafflesConstraint::typeName
) == -1
)
{
constraints_.append
(
new decompositionConstraints::preserveBafflesConstraint()
);
}
if
(
decompositionDict_.found("preservePatches")
&& findIndex
(
constraintTypes_,
decompositionConstraints::preservePatchesConstraint::typeName
) == -1
)
{
const wordReList pNames(decompositionDict_.lookup("preservePatches"));
constraints_.append
(
new decompositionConstraints::preservePatchesConstraint(pNames)
);
}
if
(
decompositionDict_.found("preserveFaceZones")
&& findIndex
(
constraintTypes_,
decompositionConstraints::preserveFaceZonesConstraint::typeName
) == -1
)
{
const wordReList zNames(decompositionDict_.lookup("preserveFaceZones"));
constraints_.append
(
new decompositionConstraints::preserveFaceZonesConstraint(zNames)
);
}
if
(
decompositionDict_.found("singleProcessorFaceSets")
&& findIndex
(
constraintTypes_,
decompositionConstraints::preserveFaceZonesConstraint::typeName
) == -1
)
{
const List<Tuple2<word, label>> zNameAndProcs
(
decompositionDict_.lookup("singleProcessorFaceSets")
);
constraints_.append
(
new decompositionConstraints::singleProcessorFaceSetsConstraint
(
zNameAndProcs
)
);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
Foam::autoPtr<Foam::decompositionMethod>
Foam::decompositionMethod::NewDecomposer
(
const dictionary& decompositionDict
)
{
const word methodType(decompositionDict.lookup("method"));
const word methodType
(
decompositionDict.lookupBackwardsCompatible<word>
(
{"decomposer", "method"}
)
);
Info<< "Selecting decompositionMethod " << methodType << endl;
Info<< "Selecting decomposer " << methodType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(methodType);
decomposerConstructorTable::iterator cstrIter =
decomposerConstructorTablePtr_->find(methodType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (cstrIter == decomposerConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown decompositionMethod "
<< "Unknown decomposer "
<< methodType << nl << nl
<< "Valid decompositionMethods are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< "Valid decomposers are : " << endl
<< decomposerConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -200,6 +125,56 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
}
Foam::autoPtr<Foam::decompositionMethod>
Foam::decompositionMethod::NewDistributor
(
const dictionary& distributionDict
)
{
const word methodType
(
distributionDict.lookupBackwardsCompatible<word>
(
{"distributor", "method"}
)
);
Info<< "Selecting distributor " << methodType << endl;
distributorConstructorTable::iterator cstrIter =
distributorConstructorTablePtr_->find(methodType);
if (cstrIter == distributorConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown distributor "
<< methodType << nl << nl
<< "Valid distributors are : " << endl
<< distributorConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<decompositionMethod>(cstrIter()(distributionDict));
}
Foam::dictionary Foam::decompositionMethod::decomposeParDict(const Time& time)
{
return IOdictionary
(
IOobject
(
"decomposeParDict",
time.system(),
time,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
}
Foam::labelList Foam::decompositionMethod::decompose
(
const polyMesh& mesh,

View File

@ -71,7 +71,18 @@ public:
(
autoPtr,
decompositionMethod,
dictionary,
decomposer,
(
const dictionary& decompositionDict
),
(decompositionDict)
);
declareRunTimeSelectionTable
(
autoPtr,
decompositionMethod,
distributor,
(
const dictionary& decompositionDict
),
@ -91,7 +102,13 @@ public:
// Selectors
//- Return a reference to the selected decomposition method
static autoPtr<decompositionMethod> New
static autoPtr<decompositionMethod> NewDecomposer
(
const dictionary& decompositionDict
);
//- Return a reference to the selected decomposition method
static autoPtr<decompositionMethod> NewDistributor
(
const dictionary& decompositionDict
);
@ -109,9 +126,8 @@ public:
return nProcessors_;
}
//- Is method parallel aware (i.e. does it synchronise domains across
// proc boundaries)
virtual bool parallelAware() const = 0;
//- Read and return the decomposeParDict
static dictionary decomposeParDict(const Time& time);
// No topology (implemented by geometric decomposers)
@ -275,7 +291,6 @@ public:
const List<labelPair>& explicitConnections
);
//- Decompose a mesh. Apply all constraints from decomposeParDict
// ('preserveFaceZones' etc). Calls either
// - no constraints, empty weights:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,10 +38,18 @@ namespace Foam
(
decompositionMethod,
hierarchGeomDecomp,
dictionary
decomposer
);
addToRunTimeSelectionTable
(
decompositionMethod,
hierarchGeomDecomp,
distributor
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::hierarchGeomDecomp::setDecompOrder()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -177,12 +177,6 @@ public:
// Member Functions
//- Hierarchgeom is aware of processor boundaries
virtual bool parallelAware() const
{
return true;
}
//- Return for every coordinate the wanted processor number.
virtual labelList decompose
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,7 +41,14 @@ namespace Foam
(
decompositionMethod,
manualDecomp,
dictionary
decomposer
);
addToRunTimeSelectionTable
(
decompositionMethod,
manualDecomp,
distributor
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,13 +75,6 @@ public:
// Member Functions
//- 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)
virtual labelList decompose

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,14 @@ namespace Foam
(
decompositionMethod,
multiLevelDecomp,
dictionary
decomposer
);
addToRunTimeSelectionTable
(
decompositionMethod,
multiLevelDecomp,
distributor
);
}
@ -253,10 +260,12 @@ void Foam::multiLevelDecomp::decompose
<< endl;
}
autoPtr<decompositionMethod> method0 = decompositionMethod::New
(
myDict
);
autoPtr<decompositionMethod> method0 =
decompositionMethod::NewDecomposer
(
myDict
);
labelList dist
(
method0().decompose
@ -336,7 +345,7 @@ Foam::multiLevelDecomp::multiLevelDecomp(const dictionary& decompositionDict)
label i = 0;
forAllConstIter(dictionary, methodsDict_, iter)
{
methods_.set(i++, decompositionMethod::New(iter().dict()));
methods_.set(i++, decompositionMethod::NewDecomposer(iter().dict()));
}
label n = 1;
@ -362,19 +371,6 @@ Foam::multiLevelDecomp::multiLevelDecomp(const dictionary& decompositionDict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::multiLevelDecomp::parallelAware() const
{
forAll(methods_, i)
{
if (!methods_[i].parallelAware())
{
return false;
}
}
return true;
}
Foam::labelList Foam::multiLevelDecomp::decompose
(
const polyMesh& mesh,

View File

@ -106,10 +106,6 @@ public:
// Member Functions
//- Is method parallel aware (i.e. does it synchronise domains across
// proc boundaries)
virtual bool parallelAware() const;
//- Inherit decompose from decompositionMethod
using decompositionMethod::decompose;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,8 +31,8 @@ License
namespace Foam
{
defineTypeName(noDecomp);
addToRunTimeSelectionTable(decompositionMethod, noDecomp, dictionary);
addToRunTimeSelectionTable(decompositionMethod, noDecomp, decomposer);
addToRunTimeSelectionTable(decompositionMethod, noDecomp, distributor);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,13 +70,6 @@ public:
// Member Functions
//- 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)
virtual labelList decompose

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,10 +39,18 @@ namespace Foam
(
decompositionMethod,
simpleGeomDecomp,
dictionary
decomposer
);
addToRunTimeSelectionTable
(
decompositionMethod,
simpleGeomDecomp,
distributor
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// assignToProcessorGroup : given nCells cells and nProcGroup processor

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,13 +91,6 @@ public:
// Member Functions
virtual bool parallelAware() const
{
// simpleDecomp sends all points to the master which does
// the decomposition.
return true;
}
virtual labelList decompose(const pointField&);
virtual labelList decompose(const pointField&, const scalarField&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,14 @@ namespace Foam
(
decompositionMethod,
structuredDecomp,
dictionary
decomposer
);
addToRunTimeSelectionTable
(
decompositionMethod,
structuredDecomp,
distributor
);
}
@ -53,18 +60,12 @@ Foam::structuredDecomp::structuredDecomp(const dictionary& decompositionDict)
patches_(methodDict_.lookup("patches"))
{
methodDict_.set("numberOfSubdomains", nDomains());
method_ = decompositionMethod::New(methodDict_);
method_ = decompositionMethod::NewDecomposer(methodDict_);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::structuredDecomp::parallelAware() const
{
return method_().parallelAware();
}
Foam::labelList Foam::structuredDecomp::decompose
(
const polyMesh& mesh,

View File

@ -79,10 +79,6 @@ public:
// Member Functions
//- Is method parallel aware (i.e. does it synchronise domains across
// proc boundaries)
virtual bool parallelAware() const;
//- Return for every coordinate the wanted processor number. Use the
// mesh connectivity (if needed)
virtual labelList decompose

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,7 @@ extern "C"
namespace Foam
{
defineTypeNameAndDebug(metisDecomp, 0);
addToRunTimeSelectionTable(decompositionMethod, metisDecomp, dictionary);
addToRunTimeSelectionTable(decompositionMethod, metisDecomp, decomposer);
}

View File

@ -82,12 +82,6 @@ public:
// Member Functions
virtual bool parallelAware() const
{
// Metis does not know about proc boundaries
return false;
}
//- Inherit decompose from decompositionMethod
using decompositionMethod::decompose;

View File

@ -55,9 +55,15 @@ namespace Foam
{
defineTypeNameAndDebug(ptscotchDecomp, 0);
addToRunTimeSelectionTable(decompositionMethod, ptscotchDecomp, dictionary);
addToRunTimeSelectionTable
(
decompositionMethod,
ptscotchDecomp,
distributor
);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::ptscotchDecomp::check(const int retVal, const char* str)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,12 +114,6 @@ public:
// Member Functions
virtual bool parallelAware() const
{
// ptscotch does not know about proc boundaries
return true;
}
//- Inherit decompose from decompositionMethod
using decompositionMethod::decompose;

View File

@ -57,10 +57,18 @@ namespace Foam
(
decompositionMethod,
scotchDecomp,
dictionary
decomposer
);
addToRunTimeSelectionTable
(
decompositionMethod,
scotchDecomp,
distributor
);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::scotchDecomp::check(const int retVal, const char* str)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -273,12 +273,6 @@ public:
// Member Functions
virtual bool parallelAware() const
{
// Knows about coupled boundaries
return true;
}
//- Inherit decompose from decompositionMethod
using decompositionMethod::decompose;

View File

@ -813,36 +813,19 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
const triSurface& s
)
{
if (!decomposer_.valid())
if (!distributor_.valid())
{
// Use current decomposer.
// Use current distributor.
// Note: or always use hierarchical?
IOdictionary decomposeDict
distributor_ = decompositionMethod::NewDistributor
(
IOobject
(
"decomposeParDict",
searchableSurface::time().system(),
searchableSurface::time(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
decompositionMethod::decomposeParDict(searchableSurface::time())
);
decomposer_ = decompositionMethod::New(decomposeDict);
if (!decomposer_().parallelAware())
if (!isA<geomDecomp>(distributor_()))
{
FatalErrorInFunction
<< "The decomposition method " << decomposer_().typeName
<< " does not decompose in parallel."
<< " Please choose one that does." << exit(FatalError);
}
if (!isA<geomDecomp>(decomposer_()))
{
FatalErrorInFunction
<< "The decomposition method " << decomposer_().typeName
<< "The decomposition method " << distributor_().typeName
<< " is not a geometric decomposition method." << endl
<< "Only geometric decomposition methods are currently"
<< " supported."
@ -858,10 +841,10 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
}
geomDecomp& decomposer = refCast<geomDecomp>(decomposer_());
geomDecomp& distributor = refCast<geomDecomp>(distributor_());
// Do the actual decomposition
labelList distribution(decomposer.decompose(triCentres));
labelList distribution(distributor.decompose(triCentres));
// Find bounding box for all triangles on new distribution.

View File

@ -97,7 +97,7 @@ private:
scalar mergeDist_;
//- Decomposition used when independently decomposing surface.
autoPtr<decompositionMethod> decomposer_;
autoPtr<decompositionMethod> distributor_;
//- Bounding box settings
IOdictionary dict_;

View File

@ -1,26 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -10,7 +10,7 @@ runApplication foamSetupCHT
runApplication foamDictionary -entry internalField -set "uniform 348" 0/solid/T
runApplication decomposePar -allRegions -dict system/decomposeParDict
runApplication decomposePar -allRegions
printf "\n%s\n" "Creating files for paraview post-processing"
paraFoam -touchAll

View File

@ -1,42 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
simpleCoeffs
{
n (2 2 1);
}
hierarchicalCoeffs
{
n (1 1 1);
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -1,42 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method simple;
simpleCoeffs
{
n (2 2 1);
}
hierarchicalCoeffs
{
n (1 1 1);
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -9,123 +9,18 @@ FoamFile
{
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
//- Keep owner and neighbour on same processor for faces in patches:
// (makes sense only for cyclic patches)
//preservePatches (cyclic_half0 cyclic_half1);
//- Keep all of faceSet on a single processor. This puts all cells
// connected with a point, edge or face on the same processor.
// (just having face connected cells might not guarantee a balanced
// decomposition)
// The processor can be -1 (the decompositionMethod chooses the processor
// for a good load balance) or explicitly provided (upsets balance).
//singleProcessorFaceSets ((f0 -1));
//- Use the volScalarField named here as a weight for each cell in the
// decomposition. For example, use a particle population field to decompose
// for a balanced number of particles in a lagrangian simulation.
// weightField dsmcRhoNMean;
// method scotch;
// method hierarchical;
method simple;
// method metis;
// method manual;
// method multiLevel;
// method structured; // does 2D decomposition of structured mesh
multiLevelCoeffs
{
// Decomposition methods to apply in turn. This is like hierarchical but
// fully general - every method can be used at every level.
level0
{
numberOfSubdomains 64;
// method simple;
// simpleCoeffs
//{
// n (2 1 1);
//}
method scotch;
}
level1
{
numberOfSubdomains 4;
method scotch;
}
}
// Desired output
simpleCoeffs
{
n (1 2 2);
}
hierarchicalCoeffs
{
n (1 2 1);
order xyz;
}
metisCoeffs
{
/*
processorWeights
(
1
1
1
1
);
*/
}
scotchCoeffs
{
// processorWeights
//(
// 1
// 1
// 1
// 1
//);
// writeGraph true;
// strategy "b";
}
manualCoeffs
{
dataFile "decompositionData";
}
structuredCoeffs
{
// Patches to do 2D decomposition on. Structured mesh only; cells have
// to be in 'columns' on top of patches.
patches (bottomPatch);
}
//// Is the case distributed? Note: command-line argument -roots takes
//// precedence
//distributed yes;
//// Per slave (so nProcs-1 entries) the directory above the case.
//roots
//(
// "/tmp"
// "/tmp"
//);
// ************************************************************************* //

View File

@ -8,10 +8,7 @@ cd ${0%/*} || exit 1 # Run from this directory
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/geometry/
runApplication blockMesh
cp system/decomposeParDict.hierarchical system/decomposeParDict
runApplication decomposePar -copyZero
cp system/decomposeParDict.ptscotch system/decomposeParDict
runParallel snappyHexMesh -overwrite
find . -type f -iname "*level*" -exec rm {} \;

View File

@ -14,14 +14,10 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
numberOfSubdomains 8;
method hierarchical;
simpleCoeffs
{
n (4 1 1);
}
decomposer hierarchical;
distributor ptscotch;
hierarchicalCoeffs
{
@ -29,10 +25,5 @@ hierarchicalCoeffs
order xyz;
}
manualCoeffs
{
dataFile "cellDecomposition";
}
// ************************************************************************* //

View File

@ -1,38 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method hierarchical;
simpleCoeffs
{
n (4 1 1);
}
hierarchicalCoeffs
{
n (4 2 1);
order xyz;
}
manualCoeffs
{
dataFile "cellDecomposition";
}
// ************************************************************************* //

View File

@ -1,38 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method ptscotch;
simpleCoeffs
{
n (4 1 1);
}
hierarchicalCoeffs
{
n (4 2 1);
order xyz;
}
manualCoeffs
{
dataFile "cellDecomposition";
}
// ************************************************************************* //

View File

@ -108,9 +108,6 @@ runApplication decomposePar -copyZero
refineBackgroundMesh $nRefine
# echo "Switching to ptscotch for dynamic load balancing with snappyHexMesh"
# setKeyword method ptscotch system/decomposeParDict
runParallel snappyHexMesh -overwrite
runParallel checkMesh

View File

@ -15,7 +15,7 @@ FoamFile
application simpleFoam;
startFrom latestTime;
startFrom startTime;
startTime 0;

View File

@ -14,15 +14,10 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 6;
numberOfSubdomains 6;
method hierarchical;
// method ptscotch;
simpleCoeffs
{
n (4 1 1);
}
decomposer hierarchical;
distributor ptscotch;
hierarchicalCoeffs
{
@ -30,10 +25,5 @@ hierarchicalCoeffs
order xyz;
}
manualCoeffs
{
dataFile "cellDecomposition";
}
// ************************************************************************* //

View File

@ -5,9 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication -a foamDictionary -entry "method" -set "hierarchical" system/decomposeParDict
runApplication decomposePar -copyZero
runApplication -a foamDictionary -entry "method" -set "ptscotch" system/decomposeParDict
runParallel snappyHexMesh -overwrite
runParallel topoSet

View File

@ -16,7 +16,8 @@ FoamFile
numberOfSubdomains 4;
method hierarchical;
decomposer hierarchical;
distributor ptscotch;
hierarchicalCoeffs
{

View File

@ -1,44 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 2;
method scotch;
//method ptscotch;
// method hierarchical;
simpleCoeffs
{
n (2 2 1);
}
hierarchicalCoeffs
{
n (2 1 1);
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -17,28 +17,6 @@ FoamFile
numberOfSubdomains 2;
method scotch;
//method ptscotch;
// method hierarchical;
simpleCoeffs
{
n (2 2 1);
}
hierarchicalCoeffs
{
n (2 1 1);
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -1,43 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
//method scotch;
method hierarchical;
simpleCoeffs
{
n (2 2 2);
}
hierarchicalCoeffs
{
n (2 2 2);
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -16,32 +16,14 @@ FoamFile
numberOfSubdomains 4;
method ptscotch; // simple;
simpleCoeffs
{
n (2 2 1);
}
decomposer hierarchical;
distributor ptscotch;
hierarchicalCoeffs
{
n (1 1 1);
n (2 2 1);
order xyz;
}
metisCoeffs
{
processorWeights ( 1 1 1 1 );
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -122,7 +122,7 @@ topoChanger
distributor
{
type decomposer;
type distributor;
libs ("libfvMeshDistributors.so");

View File

@ -16,7 +16,8 @@ FoamFile
numberOfSubdomains 8;
method hierarchical;
decomposer hierarchical;
distributor hierarchical;
simpleCoeffs
{

View File

@ -15,22 +15,11 @@ FoamFile
numberOfSubdomains 4;
/*
Main methods are:
1) Geometric: "simple"; "hierarchical", with ordered sorting, e.g. xyz, yxz
2) Scotch: "scotch", when running in serial; "ptscotch", running in parallel
*/
method hierarchical;
simpleCoeffs
{
n (1 4 1); // total must match numberOfSubdomains
}
hierarchicalCoeffs
{
n (1 4 1); // total must match numberOfSubdomains
n (1 4 1);
order xyz;
}

View File

@ -15,22 +15,11 @@ FoamFile
numberOfSubdomains 4;
/*
Main methods are:
1) Geometric: "simple"; "hierarchical", with ordered sorting, e.g. xyz, yxz
2) Scotch: "scotch", when running in serial; "ptscotch", running in parallel
*/
method hierarchical;
simpleCoeffs
{
n (4 1 1); // total must match numberOfSubdomains
}
hierarchicalCoeffs
{
n (4 1 1); // total must match numberOfSubdomains
n (4 1 1);
order xyz;
}

View File

@ -15,22 +15,11 @@ FoamFile
numberOfSubdomains 4;
/*
Main methods are:
1) Geometric: "simple"; "hierarchical", with ordered sorting, e.g. xyz, yxz
2) Scotch: "scotch", when running in serial; "ptscotch", running in parallel
*/
method hierarchical;
simpleCoeffs
{
n (4 1 1); // total must match numberOfSubdomains
}
hierarchicalCoeffs
{
n (4 1 1); // total must match numberOfSubdomains
n (4 1 1);
order xyz;
}