35 #ifndef MPICH_SKIP_MPICXX 36 #define MPICH_SKIP_MPICXX 38 #ifndef OMPI_SKIP_MPICXX 39 #define OMPI_SKIP_MPICXX 84 word method(
"recursive");
92 METIS_SetDefaultOptions(options.data());
104 bool hasWeights = !cWeights.
empty();
107 const scalar minWeights = hasWeights ?
min(cWeights) : scalar(1);
113 <<
"Illegal minimum weight " << minWeights
117 else if (hasWeights && (cWeights.
size() != numCells))
120 <<
"Number of weights (" << cWeights.
size()
121 <<
") != number of cells (" << numCells <<
")" 131 cellWeights[i] = idx_t(cWeights[i]/minWeights);
143 if (coeffDict.readIfPresent(
"method", method))
145 if (method !=
"recursive" && method !=
"k-way")
148 <<
"Method " << method <<
" in metisCoeffs in dictionary : " 150 <<
" should be 'recursive' or 'k-way'" 154 Info<<
"metisDecomp : Using Metis method " << method
158 if (coeffDict.readIfPresent(
"options", options))
160 if (options.size() != METIS_NOPTIONS)
163 <<
"Number of options in metisCoeffs in dictionary : " 165 <<
" should be " << METIS_NOPTIONS
169 Info<<
"metisDecomp : Using Metis options " << options
173 if (coeffDict.readIfPresent(
"processorWeights", procWeights))
178 <<
"processorWeights (" << procWeights.size()
179 <<
") != number of domains (" <<
nDomains_ <<
")" <<
nl 183 procWeights /=
sum(procWeights);
191 ConstPrecisionAdaptor<idx_t, label, List> xadj_param(xadj);
192 ConstPrecisionAdaptor<idx_t, label, List> adjncy_param(adjncy);
196 PrecisionAdaptor<idx_t, label, List> decomp_param(decomp,
false);
199 labelList adjncy_dummy, xadj_dummy, decomp_dummy;
202 adjncy_dummy.
resize(1, 0);
203 adjncy_param.set(adjncy_dummy);
205 xadj_dummy.resize(2, 0);
206 xadj_param.set(xadj_dummy);
208 decomp_dummy.resize(1, 0);
209 decomp_param.clear();
210 decomp_param.set(decomp_dummy);
221 if (method ==
"recursive")
223 METIS_PartGraphRecursive
227 xadj_param.constCast().data(),
228 adjncy_param.constCast().data(),
237 decomp_param.ref().data()
246 xadj_param.constCast().data(),
247 adjncy_param.constCast().data(),
256 decomp_param.ref().data()
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
errorManipArg< error, int > exit(error &err, const int errNo=1)
void resize(const label len)
Adjust allocated size of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label nDomains_
Number of domains for the decomposition.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
T * data() noexcept
Return pointer to the underlying array serving as data storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
metisDecomp(const metisDecomp &)=delete
No copy construct.
const fileName & name() const noexcept
The dictionary name.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Generic templated field type.
A class for handling words, derived from Foam::string.
Domain decomposition using METIS-like data structures.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
const dictionary & decompDict_
Top-level decomposition dictionary (eg, decomposeParDict)
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
virtual label decomposeSerial(const labelList &adjncy, const labelList &xadj, const List< scalar > &cellWeights, labelList &decomp) const
Decompose non-parallel.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...