ENH: consolidate decomposition model, constructors for decomposition methods

- make regionName an optional constructor parameter, which eliminates
  a separate set of constructors and construction tables. Adjust
  internals to treat a missing/empty regionName as a no-op.

- pass in fallback dictionary content via new IOdictionary constructor
  with a pointer

ENH: further relax check for matching number of processor dirs

- if the "numberOfSubdomains" entry is missing (or even zero)
  ignore checks of processor dirs as meaningless.
This commit is contained in:
Mark Olesen
2021-04-23 16:44:09 +02:00
parent dedb1c0c90
commit 86f627b9e6
35 changed files with 369 additions and 667 deletions

View File

@ -60,7 +60,7 @@ int main(int argc, char *argv[])
(
"decomposeParDict",
"file",
"read decomposePar dictionary from specified location"
"Use specified file for decomposePar dictionary"
);
#include "addRegionOption.H"
argList::addBoolOption

View File

@ -457,7 +457,7 @@ int main(int argc, char *argv[])
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
false // do not register
),
decompDictFile
)

View File

@ -1057,7 +1057,7 @@ void Foam::argList::parse
<< "Date : " << dateString.c_str() << nl
<< "Time : " << timeString.c_str() << nl
<< "Host : " << Foam::hostName().c_str() << nl
<< "PID : " << pid() << endl;
<< "PID : " << pid() << nl;
}
jobInfo.add("startDate", dateString);
@ -1281,13 +1281,24 @@ void Foam::argList::parse
if (dictStream && dictStream->good())
{
dictionary decompDict(*dictStream);
decompDict.readEntry("numberOfSubdomains", dictNProcs);
bool nDomainsMandatory = false;
if (decompDict.getOrDefault("distributed", false))
{
nDomainsMandatory = true;
parRunControl_.distributed(true);
decompDict.readEntry("roots", roots);
}
// Get numberOfSubdomains if it exists.
// - mandatory when running with distributed roots
decompDict.readEntry
(
"numberOfSubdomains",
dictNProcs,
keyType::LITERAL,
nDomainsMandatory
);
}
else
{
@ -1325,7 +1336,7 @@ void Foam::argList::parse
roots.resize(Pstream::nProcs()-1, rootName);
// Adjust dictNProcs for command-line '-roots' option
if (dictNProcs < 0)
if (dictNProcs <= 0)
{
dictNProcs = roots.size()+1;
}
@ -1494,7 +1505,7 @@ void Foam::argList::parse
if (Pstream::master() && bannerEnabled())
{
Info<< "Case : " << (rootPath_/globalCase_).c_str() << nl
<< "nProcs : " << nProcs << endl;
<< "nProcs : " << nProcs << nl;
if (parRunControl_.parRun())
{
@ -1532,13 +1543,13 @@ void Foam::argList::parse
<< " commsType : "
<< Pstream::commsTypeNames[Pstream::defaultCommsType] << nl
<< " polling iterations : " << Pstream::nPollProcInterfaces
<< endl;
<< nl;
if (UPstream::allWorlds().size() > 1)
{
Info<< " worlds : "
<< flatOutput(UPstream::allWorlds()) << nl
<< " world : " << UPstream::myWorld()
<< endl;
<< nl;
}
}
}
@ -1613,7 +1624,7 @@ void Foam::argList::parse
Info<< "Disallowing";
}
Info<< " user-supplied system call operations" << nl
<< endl;
<< nl;
IOobject::writeDivider(Info);
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,7 +42,6 @@ static const char* notImplementedMessage =
namespace Foam
{
defineTypeNameAndDebug(kahipDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
@ -71,15 +70,6 @@ Foam::label Foam::kahipDecomp::decomposeSerial
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kahipDecomp::kahipDecomp
(
const dictionary& decompDict
)
:
metisLikeDecomp("kahip", decompDict)
{}
Foam::kahipDecomp::kahipDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,7 +43,6 @@ static const char* notImplementedMessage =
namespace Foam
{
defineTypeNameAndDebug(metisDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
@ -72,15 +71,6 @@ Foam::label Foam::metisDecomp::decomposeSerial
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::metisDecomp::metisDecomp
(
const dictionary& decompDict
)
:
metisLikeDecomp("metis", decompDict)
{}
Foam::metisDecomp::metisDecomp
(
const dictionary& decompDict,

View File

@ -45,7 +45,6 @@ static const char* notImplementedMessage =
namespace Foam
{
defineTypeNameAndDebug(ptscotchDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
@ -99,13 +98,6 @@ Foam::label Foam::ptscotchDecomp::decompose
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ptscotchDecomp::ptscotchDecomp(const dictionary& decompDict)
:
decompositionMethod(decompDict),
coeffsDict_()
{}
Foam::ptscotchDecomp::ptscotchDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,7 +45,6 @@ static const char* notImplementedMessage =
namespace Foam
{
defineTypeNameAndDebug(scotchDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
@ -81,15 +80,6 @@ Foam::label Foam::scotchDecomp::decomposeSerial
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::scotchDecomp::scotchDecomp
(
const dictionary& decompDict
)
:
metisLikeDecomp("scotch", decompDict)
{}
Foam::scotchDecomp::scotchDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2016 OpenFOAM Foundation
Copyright (C) 2015-2018 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,7 +45,8 @@ const Foam::word Foam::decompositionModel::canonicalName("decomposeParDict");
Foam::decompositionModel::decompositionModel
(
const polyMesh& mesh,
const fileName& decompDictFile
const fileName& decompDictFile,
const dictionary* fallback
)
:
MeshObject
@ -60,52 +61,18 @@ Foam::decompositionModel::decompositionModel
(
IOobject
(
canonicalName,
decompositionModel::canonicalName,
mesh.time().system(),
mesh.local(),
mesh.thisDb(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false, //io.registerObject(),
true //io.globalObject()
),
decompDictFile
)
)
{}
Foam::decompositionModel::decompositionModel
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile
)
:
MeshObject
<
polyMesh,
Foam::UpdateableMeshObject,
decompositionModel
>(mesh),
IOdictionary
(
IOobject::selectIO
(
IOobject
(
canonicalName,
mesh.time().system(),
mesh.local(),
mesh.thisDb(),
(dict.size() ? IOobject::NO_READ : IOobject::MUST_READ),
(fallback ? IOobject::READ_IF_PRESENT : IOobject::MUST_READ),
IOobject::NO_WRITE,
false, //io.registerObject(),
true //io.globalObject()
),
decompDictFile
),
dict
fallback
)
{}
@ -115,7 +82,8 @@ Foam::decompositionModel::decompositionModel
const Foam::decompositionModel& Foam::decompositionModel::New
(
const polyMesh& mesh,
const fileName& decompDictFile
const fileName& decompDictFile,
const dictionary* content
)
{
return
@ -124,24 +92,24 @@ const Foam::decompositionModel& Foam::decompositionModel::New
polyMesh,
Foam::UpdateableMeshObject,
decompositionModel
>::New(mesh, decompDictFile);
>::New(mesh, decompDictFile, content);
}
const Foam::decompositionModel& Foam::decompositionModel::New
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile
)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::decompositionMethod& Foam::decompositionModel::decomposer() const
{
return
MeshObject
<
polyMesh,
Foam::UpdateableMeshObject,
decompositionModel
>::New(mesh, dict, decompDictFile);
if (!decomposerPtr_)
{
decomposerPtr_ =
decompositionMethod::New
(
*this,
this->mesh().name() // Name of mesh region
);
}
return *decomposerPtr_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2016 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -47,7 +47,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class mapPolyMesh;
class polyMesh;
@ -65,7 +65,6 @@ class decompositionModel
>,
public IOdictionary
{
// Private Data
mutable autoPtr<decompositionMethod> decomposerPtr_;
@ -81,61 +80,38 @@ public:
static const word canonicalName;
// Selectors
//- Read (optionally from absolute path) and register on mesh
static const decompositionModel& New
(
const polyMesh& mesh,
const fileName& decompDictFile = ""
);
//- Read (optionally from supplied dictionary) and 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
//- Construct from typeName, optional decomposeParDict path/name
//- or with fallback content
explicit decompositionModel
(
const polyMesh& mesh,
const fileName& decompDictFile = ""
const fileName& decompDictFile = "",
const dictionary* fallback = nullptr
);
//- Construct from typeName or optional path to controlDictionary
decompositionModel
// Selectors
//- Read and register on mesh,
//- optionally with alternative decomposeParDict path/name
//- or with fallback content
static const decompositionModel& New
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile = ""
const fileName& decompDictFile = "",
const dictionary* fallback = nullptr
);
// Member Functions
decompositionMethod& decomposer() const
{
if (!decomposerPtr_)
{
decomposerPtr_ =
decompositionMethod::New
(
*this,
this->mesh().name() // Name of mesh region
);
}
return *decomposerPtr_;
}
//- Return demand-driven decomposition method
decompositionMethod& decomposer() const;
// UpdateableMeshObject
// UpdateableMeshObject Functions
virtual bool movePoints()
{
@ -148,18 +124,44 @@ public:
// Housekeeping
//- Deprecated(2021-04) compatibility constructor
// \deprecated(2021-04)
FOAM_DEPRECATED(2021-04)
decompositionModel
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile = ""
)
:
decompositionModel(mesh, decompDictFile, &dict)
{}
//- Deprecated(2021-04) compatibility selector
// \deprecated(2021-04)
FOAM_DEPRECATED(2021-04)
static const decompositionModel& New
(
const polyMesh& mesh,
const dictionary& dict,
const fileName& decompDictFile = ""
)
{
return Foam::decompositionModel::New(mesh, decompDictFile, &dict);
}
//- Deprecated(2018-08) compatibility method
// \deprecated(2018-08) - use IOobject::selectIO directly
FOAM_DEPRECATED_FOR(2018-08, "IOobject::selectIO")
static IOobject selectIO
(
const IOobject& io,
const fileName& altFile,
const word& ioName = ""
const fileName& file,
const word& name = ""
)
{
return IOobject::selectIO(io, altFile, ioName);
return IOobject::selectIO(io, file, name);
}
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,31 +49,48 @@ namespace Foam
{
defineTypeNameAndDebug(decompositionMethod, 0);
defineRunTimeSelectionTable(decompositionMethod, dictionary);
defineRunTimeSelectionTable(decompositionMethod, dictionaryRegion);
// Fallback name when searching for optional coefficients directories
static const word defaultName("coeffs");
} // End namespace Foam
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
namespace Foam
{
// Find named coefficents dictionary, or use default "coeffs"
static inline const dictionary* cfindCoeffsDict
(
const dictionary& dict,
const word& coeffsName,
const bool allowDefault
)
{
const dictionary* dictptr = dict.findDict(coeffsName);
if (!dictptr && allowDefault)
{
dictptr = dict.findDict("coeffs");
}
return dictptr;
}
} // End namespace Foam
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
Foam::label Foam::decompositionMethod::nDomains(const dictionary& decompDict)
{
return decompDict.get<label>("numberOfSubdomains");
}
Foam::label Foam::decompositionMethod::nDomains
(
const dictionary& decompDict,
const word& regionName
)
{
const label nDomainsGlobal = nDomains(decompDict);
const label nDomainsGlobal = decompDict.get<label>("numberOfSubdomains");
const dictionary& regionDict(optionalRegionDict(decompDict, regionName));
if (!regionName.empty())
{
const dictionary& regionDict =
optionalRegionDict(decompDict, regionName);
label nDomainsRegion;
if (regionDict.readIfPresent("numberOfSubdomains", nDomainsRegion))
@ -89,6 +106,7 @@ Foam::label Foam::decompositionMethod::nDomains
<< nl << nl
<< endl;
}
}
return nDomainsGlobal;
}
@ -100,19 +118,16 @@ const Foam::dictionary& Foam::decompositionMethod::optionalRegionDict
const word& regionName
)
{
auto finder = decompDict.csearch("regions");
if (!regionName.empty() && finder.isDict())
const dictionary* dictptr = nullptr;
if
(
!regionName.empty()
&& (dictptr = decompDict.findDict("regions")) != nullptr
)
{
finder = finder.dict().csearch(regionName);
if (finder.isDict())
{
return finder.dict();
dictptr = dictptr->findDict(regionName);
}
}
return dictionary::null;
return (dictptr ? *dictptr : dictionary::null);
}
@ -232,19 +247,14 @@ const Foam::dictionary& Foam::decompositionMethod::findCoeffsDict
int select
)
{
dictionary::const_searcher fnd;
const bool allowDefault = !(select & selectionType::EXACT);
if
(
(fnd = dict.csearch(coeffsName)).isDict()
||
(
!(select & selectionType::EXACT)
&& (fnd = dict.csearch(defaultName)).isDict()
)
)
const dictionary* dictptr =
cfindCoeffsDict(dict, coeffsName, allowDefault);
if (dictptr)
{
return fnd.dict();
return *dictptr;
}
// Not found
@ -261,7 +271,7 @@ const Foam::dictionary& Foam::decompositionMethod::findCoeffsDict
return dictionary::null;
}
return dict;
return dict; // Return original dictionary
}
@ -271,36 +281,24 @@ const Foam::dictionary& Foam::decompositionMethod::findCoeffsDict
int select
) const
{
dictionary::const_searcher fnd;
const bool allowDefault = !(select & selectionType::EXACT);
if
(
!decompRegionDict_.empty()
&&
(
(fnd = decompRegionDict_.csearch(coeffsName)).isDict()
||
(
!(select & selectionType::EXACT)
&& (fnd = decompRegionDict_.csearch(defaultName)).isDict()
)
)
)
const dictionary* dictptr = nullptr;
if (!decompRegionDict_.empty())
{
return fnd.dict();
// Region-specific dictionary
dictptr = cfindCoeffsDict(decompRegionDict_, coeffsName, allowDefault);
}
if (!dictptr)
{
// General
dictptr = cfindCoeffsDict(decompDict_, coeffsName, allowDefault);
}
if
(
(fnd = decompDict_.csearch(coeffsName)).isDict()
||
(
!(select & selectionType::EXACT)
&& (fnd = decompDict_.csearch(defaultName)).isDict()
)
)
if (dictptr)
{
return fnd.dict();
return *dictptr;
}
// Not found
@ -317,25 +315,12 @@ const Foam::dictionary& Foam::decompositionMethod::findCoeffsDict
return dictionary::null;
}
return decompDict_;
return decompDict_; // Return general dictionary
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::decompositionMethod::decompositionMethod
(
const dictionary& decompDict
)
:
decompDict_(decompDict),
decompRegionDict_(dictionary::null),
nDomains_(nDomains(decompDict))
{
readConstraints();
}
Foam::decompositionMethod::decompositionMethod
(
const dictionary& decompDict,
@ -357,10 +342,14 @@ Foam::decompositionMethod::decompositionMethod
Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
(
const dictionary& decompDict
const dictionary& decompDict,
const word& regionName
)
{
const word methodType(decompDict.get<word>("method"));
word methodType(decompDict.get<word>("method"));
const dictionary& regionDict = optionalRegionDict(decompDict, regionName);
regionDict.readIfPresent("method", methodType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType);
@ -377,52 +366,14 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
// verbose
{
Info<< "Selecting decompositionMethod " << methodType
<< " [" << (nDomains(decompDict)) << "]" << endl;
}
Info<< "Decomposition method " << methodType
<< " [" << (nDomains(decompDict, regionName)) << ']';
return autoPtr<decompositionMethod>(cstrIter()(decompDict));
}
Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
(
const dictionary& decompDict,
const word& regionName
)
if (!regionName.empty())
{
const dictionary& regionDict(optionalRegionDict(decompDict, regionName));
if (regionDict.empty())
{
// No region-specific information - just forward to normal routine
return decompositionMethod::New(decompDict);
Info<< " (region " << regionName << ')';
}
word methodType(decompDict.get<word>("method"));
regionDict.readIfPresent("method", methodType);
auto cstrIter = dictionaryRegionConstructorTablePtr_->cfind(methodType);
if (!cstrIter.found())
{
WarningInFunction
<< nl
<< "Unknown region decompositionMethod "
<< methodType << nl << nl
<< "Valid decompositionMethods : " << endl
<< dictionaryRegionConstructorTablePtr_->sortedToc() << nl
<< "Reverting to non-region version" << nl
<< endl;
return decompositionMethod::New(decompDict);
}
// verbose
{
Info<< "Selecting decompositionMethod " << methodType
<< " [" << (nDomains(decompDict, regionName)) << "] (region "
<< regionName << ")" << endl;
Info<< endl;
}
return autoPtr<decompositionMethod>(cstrIter()(decompDict, regionName));
@ -1368,4 +1319,27 @@ Foam::labelList Foam::decompositionMethod::decompose
}
// * * * * * * * * * * * * * * * Stub Functions * * * * * * * * * * * * * * //
Foam::labelList Foam::decompositionMethod::decompose
(
const pointField& points,
const scalarField& pointWeights
) const
{
NotImplemented;
return labelList();
}
Foam::labelList Foam::decompositionMethod::decompose
(
const pointField& points
) const
{
NotImplemented;
return labelList();
}
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2018 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -150,17 +150,6 @@ public:
autoPtr,
decompositionMethod,
dictionary,
(
const dictionary& decompDict
),
(decompDict)
);
declareRunTimeSelectionTable
(
autoPtr,
decompositionMethod,
dictionaryRegion,
(
const dictionary& decompDict,
const word& regionName
@ -171,19 +160,17 @@ public:
// Static Methods
//- Return the \c numberOfSubdomains entry from the dictionary
static label nDomains(const dictionary& decompDict);
//- Return the \c numberOfSubdomains from a region within the
// "regions" sub-dictionary
//- Return region-specific or top-level \c numberOfSubdomains entry.
// The region-specific version is found within the "regions"
// sub-dictionary.
static label nDomains
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);
//- Return an optional region dictionary from "regions" sub-dictionary
// or dictionary::null on failure.
//- Return an optional region-specific dictionary
//- from "regions" sub-dictionary, or dictionary::null on failure
static const dictionary& optionalRegionDict
(
const dictionary& decompDict,
@ -193,31 +180,23 @@ public:
// Selectors
//- Return a reference to the selected decomposition method
static autoPtr<decompositionMethod> New
(
const dictionary& decompDict
);
//- Return a reference to the selected decomposition method,
//- with region specification
//- optionally region-specific
static autoPtr<decompositionMethod> New
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);
// Constructors
//- Construct given the decomposition dictionary
decompositionMethod(const dictionary& decompDict);
//- Construct given the decomposition dictionary for specific region
decompositionMethod
//- Construct given the decomposition dictionary,
//- optionally region-specific
explicit decompositionMethod
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);
@ -228,7 +207,7 @@ public:
// Member Functions
//- Number of domains
inline label nDomains() const
inline label nDomains() const noexcept
{
return nDomains_;
}
@ -240,23 +219,15 @@ public:
// No topology (implemented by geometric decomposers)
//- Return for every coordinate the wanted processor number.
//- Return the wanted processor number for every coordinate.
virtual labelList decompose
(
const pointField& points,
const scalarField& pointWeights
) const
{
NotImplemented;
return labelList();
}
) const;
//- Decompose with uniform weights on the points
virtual labelList decompose(const pointField& points) const
{
NotImplemented;
return labelList();
}
virtual labelList decompose(const pointField& points) const;
// Topology provided by mesh
@ -419,7 +390,6 @@ public:
const polyMesh& mesh,
const scalarField& cWeights
) const;
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,20 +36,12 @@ License
namespace Foam
{
defineTypeNameAndDebug(hierarchGeomDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
hierarchGeomDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
hierarchGeomDecomp,
dictionaryRegion
);
}
@ -718,18 +710,6 @@ Foam::label Foam::hierarchGeomDecomp::sortComponent
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::hierarchGeomDecomp::hierarchGeomDecomp
(
const dictionary& decompDict
)
:
geomDecomp(typeName, decompDict),
order_({0,1,2})
{
setOrder();
}
Foam::hierarchGeomDecomp::hierarchGeomDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -187,14 +187,11 @@ public:
// Constructors
//- Construct given the decomposition dictionary
hierarchGeomDecomp(const dictionary& decompDict);
//- Construct for decomposition dictionary and region name
hierarchGeomDecomp
//- Construct given decomposition dictionary and optional region name
explicit hierarchGeomDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017-2018 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,40 +30,22 @@ License
#include "labelIOList.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(manualDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
manualDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
manualDecomp,
dictionaryRegion
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::manualDecomp::manualDecomp(const dictionary& decompDict)
:
decompositionMethod(decompDict),
dataFile_
(
findCoeffsDict(typeName + "Coeffs").get<fileName>("dataFile")
)
{}
Foam::manualDecomp::manualDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2018 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -57,7 +57,7 @@ class manualDecomp
:
public decompositionMethod
{
// Private data
// Private Data
fileName dataFile_;
@ -79,14 +79,11 @@ public:
// Constructors
//- Construct given the decomposition dictionary
manualDecomp(const dictionary& decompDict);
//- Construct given the decomposition dictionary and region name
manualDecomp
//- Construct given decomposition dictionary and optional region name
explicit manualDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);
@ -124,7 +121,6 @@ public:
NotImplemented;
return labelList();
}
};

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -154,18 +154,6 @@ Foam::label Foam::metisLikeDecomp::decomposeGeneral
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::metisLikeDecomp::metisLikeDecomp
(
const word& derivedType,
const dictionary& decompDict,
int select
)
:
decompositionMethod(decompDict),
coeffsDict_(findCoeffsDict(derivedType + "Coeffs", select))
{}
Foam::metisLikeDecomp::metisLikeDecomp
(
const word& derivedType,
@ -191,10 +179,10 @@ Foam::labelList Foam::metisLikeDecomp::decompose
if (points.size() != mesh.nCells())
{
FatalErrorInFunction
<< "Can use this decomposition method only for entire mesh" << nl
<< "Can only use this decomposition method for entire mesh" << nl
<< "and supply one coordinate (cellCentre) for every cell." << nl
<< "The number of coordinates " << points.size() << nl
<< "The number of cells in the mesh " << mesh.nCells()
<< "The number of cells in the mesh " << mesh.nCells() << nl
<< exit(FatalError);
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -81,6 +81,7 @@ protected:
labelList& decomp
) const = 0;
//- No copy construct
metisLikeDecomp(const metisLikeDecomp&) = delete;
@ -88,23 +89,21 @@ protected:
void operator=(const metisLikeDecomp&) = delete;
public:
// Constructors
//- Construct for derived type name and decomposition dictionary.
// The default search for the coefficients will return dictionary::null
// on failure. This avoids a name clash of a metis "method" with the
// top level.
metisLikeDecomp
(
const word& derivedType,
const dictionary& decompDict,
int select = selectionType::NULL_DICT
);
)
:
metisLikeDecomp(derivedType, decompDict, "", select)
{}
//- Construct for derived type name, decomposition dictionary
//- and region name
//- and (optional) region name
// The default search for the coefficients will return dictionary::null
// on failure. This avoids a name clash of a metis "method" with the
// top level.
@ -116,6 +115,7 @@ public:
int select = selectionType::NULL_DICT
);
public:
//- Destructor
virtual ~metisLikeDecomp() = default;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017-2018 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,25 +32,17 @@ License
#include "globalIndex.H"
#include "mapDistribute.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(multiLevelDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
multiLevelDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
multiLevelDecomp,
dictionaryRegion
);
}
@ -568,25 +560,6 @@ void Foam::multiLevelDecomp::decompose
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::multiLevelDecomp::multiLevelDecomp(const dictionary& decompDict)
:
decompositionMethod(decompDict),
coeffsDict_
(
findCoeffsDict
(
typeName + "Coeffs",
(selectionType::EXACT | selectionType::MANDATORY)
)
),
methodsDict_(),
methods_()
{
createMethodsDict();
setMethods();
}
Foam::multiLevelDecomp::multiLevelDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2018 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -51,7 +51,7 @@ class multiLevelDecomp
:
public decompositionMethod
{
// Private data
// Private Data
//- Original coefficients for this method
const dictionary& coeffsDict_;
@ -114,14 +114,11 @@ public:
// Constructors
//- Construct given the decomposition dictionary
multiLevelDecomp(const dictionary& decompDict);
//- Construct given decomposition dictionary and region name
multiLevelDecomp
//- Construct given decomposition dictionary and optional region name
explicit multiLevelDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,12 +29,11 @@ License
#include "noDecomp.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeName(noDecomp);
addNamedToRunTimeSelectionTable
(
decompositionMethod,
@ -42,25 +41,11 @@ namespace Foam
dictionary,
none
);
addNamedToRunTimeSelectionTable
(
decompositionMethod,
noDecomp,
dictionaryRegion,
none
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::noDecomp::noDecomp(const dictionary& decompDict)
:
decompositionMethod(decompDict)
{}
Foam::noDecomp::noDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2017-2018 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -53,7 +53,6 @@ class noDecomp
:
public decompositionMethod
{
// Private Member Functions
//- No copy construct
@ -66,19 +65,16 @@ class noDecomp
public:
//- Runtime type information
TypeName("noDecomp");
TypeNameNoDebug("none");
// Constructors
//- Construct given the decomposition dictionary
noDecomp(const dictionary& decompDict);
//- Construct given the decomposition dictionary and region name
noDecomp
//- Construct given decomposition dictionary and optional region name
explicit noDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);
@ -88,7 +84,7 @@ public:
// Member Functions
//- Does not care about proc boundaries, it is all up to the user.
//- Does not care about proc boundaries
virtual bool parallelAware() const
{
return true;
@ -122,7 +118,6 @@ public:
{
return labelList(globalCellCells.size(), Pstream::myProcNo());
}
};

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,25 +29,17 @@ License
#include "Random.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(randomDecomp, 0);
defineTypeName(randomDecomp);
addToRunTimeSelectionTable
(
decompositionMethod,
randomDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
randomDecomp,
dictionaryRegion
);
}
@ -70,12 +62,6 @@ Foam::labelList Foam::randomDecomp::randomMap(const label nCells) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::randomDecomp::randomDecomp(const dictionary& decompDict)
:
decompositionMethod(decompDict)
{}
Foam::randomDecomp::randomDecomp
(
const dictionary& decompDict,

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -65,19 +65,16 @@ class randomDecomp
public:
//- Runtime type information
TypeName("random");
TypeNameNoDebug("random");
// Constructors
//- Construct given the decomposition dictionary
randomDecomp(const dictionary& decompDict);
//- Construct for decomposition dictionary and region name
randomDecomp
//- Construct for decomposition dictionary and optional region name
explicit randomDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);
@ -93,6 +90,7 @@ public:
return true;
}
// No topology (implemented by geometric decomposers)
//- Return for every coordinate the wanted processor number.

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,28 +32,51 @@ License
#include "globalIndex.H"
#include "SubField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(simpleGeomDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
simpleGeomDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
simpleGeomDecomp,
dictionaryRegion
);
}
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
namespace Foam
{
// A list compare binary predicate for normal sort by vector component
struct vectorLessOp
{
const UList<vector>& values;
direction sortCmpt;
vectorLessOp(const UList<vector>& list, direction cmpt = vector::X)
:
values(list),
sortCmpt(cmpt)
{}
void setComponent(direction cmpt)
{
sortCmpt = cmpt;
}
bool operator()(const label a, const label b) const
{
return values[a][sortCmpt] < values[b][sortCmpt];
}
};
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// assignToProcessorGroup : given nCells cells and nProcGroup processor
@ -149,24 +172,20 @@ Foam::labelList Foam::simpleGeomDecomp::decomposeOneProc
labelList processorGroups(points.size());
labelList pointIndices(points.size());
forAll(pointIndices, i)
{
pointIndices[i] = i;
}
labelList pointIndices(identity(points.size()));
const pointField rotatedPoints(rotDelta_ & points);
vectorLessOp sorter(rotatedPoints);
// and one to take the processor group id's. For each direction.
// we assign the processors to groups of processors labelled
// 0..nX to give a banded structure on the mesh. Then we
// construct the actual processor number by treating this as
// the units part of the processor number.
sort
(
pointIndices,
UList<scalar>::less(rotatedPoints.component(vector::X))
);
sorter.setComponent(vector::X);
Foam::sort(pointIndices, sorter);
assignToProcessorGroup(processorGroups, n_.x());
@ -178,11 +197,9 @@ Foam::labelList Foam::simpleGeomDecomp::decomposeOneProc
// now do the same thing in the Y direction. These processor group
// numbers add multiples of nX to the proc. number (columns)
sort
(
pointIndices,
UList<scalar>::less(rotatedPoints.component(vector::Y))
);
sorter.setComponent(vector::Y);
Foam::sort(pointIndices, sorter);
assignToProcessorGroup(processorGroups, n_.y());
@ -194,11 +211,9 @@ Foam::labelList Foam::simpleGeomDecomp::decomposeOneProc
// finally in the Z direction. Now we add multiples of nX*nY to give
// layers
sort
(
pointIndices,
UList<scalar>::less(rotatedPoints.component(vector::Z))
);
sorter.setComponent(vector::Z);
Foam::sort(pointIndices, sorter);
assignToProcessorGroup(processorGroups, n_.z());
@ -222,24 +237,20 @@ Foam::labelList Foam::simpleGeomDecomp::decomposeOneProc
labelList processorGroups(points.size());
labelList pointIndices(points.size());
forAll(pointIndices, i)
{
pointIndices[i] = i;
}
labelList pointIndices(identity(points.size()));
const pointField rotatedPoints(rotDelta_ & points);
vectorLessOp sorter(rotatedPoints);
// and one to take the processor group id's. For each direction.
// we assign the processors to groups of processors labelled
// 0..nX to give a banded structure on the mesh. Then we
// construct the actual processor number by treating this as
// the units part of the processor number.
sort
(
pointIndices,
UList<scalar>::less(rotatedPoints.component(vector::X))
);
sorter.setComponent(vector::X);
Foam::sort(pointIndices, sorter);
const scalar summedWeights = sum(weights);
assignToProcessorGroup
@ -259,11 +270,9 @@ Foam::labelList Foam::simpleGeomDecomp::decomposeOneProc
// now do the same thing in the Y direction. These processor group
// numbers add multiples of nX to the proc. number (columns)
sort
(
pointIndices,
UList<scalar>::less(rotatedPoints.component(vector::Y))
);
sorter.setComponent(vector::Y);
Foam::sort(pointIndices, sorter);
assignToProcessorGroup
(
@ -282,11 +291,9 @@ Foam::labelList Foam::simpleGeomDecomp::decomposeOneProc
// finally in the Z direction. Now we add multiples of nX*nY to give
// layers
sort
(
pointIndices,
UList<scalar>::less(rotatedPoints.component(vector::Z))
);
sorter.setComponent(vector::Z);
Foam::sort(pointIndices, sorter);
assignToProcessorGroup
(
@ -308,12 +315,6 @@ Foam::labelList Foam::simpleGeomDecomp::decomposeOneProc
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::simpleGeomDecomp::simpleGeomDecomp(const dictionary& decompDict)
:
geomDecomp(typeName, decompDict)
{}
Foam::simpleGeomDecomp::simpleGeomDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -95,14 +95,11 @@ public:
// Constructors
//- Construct given decomposition dictionary
simpleGeomDecomp(const dictionary& decompDict);
//- Construct given decomposition dictionary and region name
simpleGeomDecomp
//- Construct given decomposition dictionary and optional region name
explicit simpleGeomDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,12 +32,11 @@ License
#include "topoDistanceData.H"
#include "fvMeshSubset.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(structuredDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
@ -49,7 +48,11 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::structuredDecomp::structuredDecomp(const dictionary& decompDict)
Foam::structuredDecomp::structuredDecomp
(
const dictionary& decompDict,
const word& regionName
)
:
decompositionMethod(decompDict),
methodDict_(findCoeffsDict(typeName + "Coeffs", selectionType::MANDATORY)),

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -52,7 +52,7 @@ class structuredDecomp
:
public decompositionMethod
{
// Private data
// Private Data
dictionary methodDict_;
@ -78,8 +78,12 @@ public:
// Constructors
//- Construct given the decomposition dictionary
structuredDecomp(const dictionary& decompDict);
//- Construct given decomposition dictionary. Region ignored
explicit structuredDecomp
(
const dictionary& decompDict,
const word& regionName = ""
);
//- Destructor

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -44,20 +44,12 @@ License
namespace Foam
{
defineTypeNameAndDebug(kahipDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
kahipDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
kahipDecomp,
dictionaryRegion
);
}
@ -273,12 +265,6 @@ Foam::label Foam::kahipDecomp::decomposeSerial
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kahipDecomp::kahipDecomp(const dictionary& decompDict)
:
metisLikeDecomp(typeName, decompDict, selectionType::NULL_DICT)
{}
Foam::kahipDecomp::kahipDecomp
(
const dictionary& decompDict,

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -121,14 +121,11 @@ public:
// Constructors
//- Construct given the decomposition dictionary
kahipDecomp(const dictionary& decompDict);
//- Construct given the decomposition dictionary and region name
kahipDecomp
//- Construct given decomposition dictionary and optional region name
explicit kahipDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -55,20 +55,12 @@ License
namespace Foam
{
defineTypeNameAndDebug(metisDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
metisDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
metisDecomp,
dictionaryRegion
);
}
@ -246,12 +238,6 @@ Foam::label Foam::metisDecomp::decomposeSerial
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::metisDecomp::metisDecomp(const dictionary& decompDict)
:
metisLikeDecomp(typeName, decompDict, selectionType::NULL_DICT)
{}
Foam::metisDecomp::metisDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -105,14 +105,11 @@ public:
// Constructors
//- Construct given the decomposition dictionary
metisDecomp(const dictionary& decompDict);
//- Construct given the decomposition dictionary and region name
metisDecomp
//- Construct given decomposition dictionary and optional region name
explicit metisDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -61,20 +61,12 @@ static_assert
namespace Foam
{
defineTypeNameAndDebug(ptscotchDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
ptscotchDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
ptscotchDecomp,
dictionaryRegion
);
}
@ -644,13 +636,6 @@ Foam::label Foam::ptscotchDecomp::decompose
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ptscotchDecomp::ptscotchDecomp(const dictionary& decompDict)
:
decompositionMethod(decompDict),
coeffsDict_(findCoeffsDict("scotchCoeffs", selectionType::NULL_DICT))
{}
Foam::ptscotchDecomp::ptscotchDecomp
(
const dictionary& decompDict,
@ -677,11 +662,10 @@ Foam::labelList Foam::ptscotchDecomp::decompose
if (points.size() != mesh.nCells())
{
FatalErrorInFunction
<< "Can use this decomposition method only for the whole mesh"
<< endl
<< "and supply one coordinate (cellCentre) for every cell." << endl
<< "The number of coordinates " << points.size() << endl
<< "The number of cells in the mesh " << mesh.nCells()
<< "Can only use this decomposition method for entire mesh" << nl
<< "and supply one coordinate (cellCentre) for every cell." << nl
<< "The number of coordinates " << points.size() << nl
<< "The number of cells in the mesh " << mesh.nCells() << nl
<< exit(FatalError);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -70,7 +70,7 @@ class ptscotchDecomp
:
public decompositionMethod
{
// Private data
// Private Data
//- Original coefficients for this method
dictionary coeffsDict_;
@ -123,12 +123,12 @@ public:
// Constructors
//- Construct given the decomposition dictionary
ptscotchDecomp(const dictionary& decompDict);
//- Construct given the decomposition dictionary and region name
ptscotchDecomp(const dictionary& decompDict, const word& regionName);
//- Construct given decomposition dictionary and optional region name
explicit ptscotchDecomp
(
const dictionary& decompDict,
const word& regionName = ""
);
//- Destructor

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,20 +60,12 @@ static_assert
namespace Foam
{
defineTypeNameAndDebug(scotchDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
scotchDecomp,
dictionary
);
addToRunTimeSelectionTable
(
decompositionMethod,
scotchDecomp,
dictionaryRegion
);
}
@ -380,12 +372,6 @@ Foam::label Foam::scotchDecomp::decomposeSerial
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::scotchDecomp::scotchDecomp(const dictionary& decompDict)
:
metisLikeDecomp(typeName, decompDict, selectionType::NULL_DICT)
{}
Foam::scotchDecomp::scotchDecomp
(
const dictionary& decompDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -276,14 +276,11 @@ public:
// Constructors
//- Construct given the decomposition dictionary
scotchDecomp(const dictionary& decompDict);
//- Construct given the decomposition dictionary and region name
scotchDecomp
//- Construct given decomposition dictionary and optional region name
explicit scotchDecomp
(
const dictionary& decompDict,
const word& regionName
const word& regionName = ""
);