55 Info<<
type() <<
"Decomp : running in parallel." 56 <<
" Decomposing all of graph on master processor." <<
endl;
60 const label numCells =
max(0, (xadj.
size()-1));
80 allXadj.
resize(globalCells.totalSize()+1);
81 allXadj.
last() = globalAdjncy.totalSize();
87 for (
const int proci : globalCells.subProcs())
102 procSlot.size_bytes(),
142 for (
const int proci : globalCells.subProcs())
146 globalAdjncy.inplaceToGlobal(proci, procSlot);
154 allWeights = globalCells.gather(cWeights);
178 globalCells.scatter(allDecomp, decomp);
188 const word& derivedType,
195 coeffsDict_(findCoeffsDict(derivedType +
"Coeffs",
select))
211 <<
"Can only use this decomposition method for entire mesh" <<
nl 212 <<
"and supply one coordinate (cellCentre) for every cell." <<
nl 214 <<
"The number of cells in the mesh " <<
mesh.
nCells() <<
nl 218 CompactListList<label> cellCells;
253 <<
"Size of cell-to-coarse map " << agglom.
size()
254 <<
" differs from number of cells in mesh " <<
mesh.
nCells()
262 CompactListList<label> cellCells;
286 forAll(fineDistribution, i)
288 fineDistribution[i] = decomp[agglom[i]];
291 return fineDistribution;
302 if (cellCentres.size() != globalCellCells.size())
305 <<
"Inconsistent number of cells (" << globalCellCells.size()
306 <<
") and number of cell centres (" << cellCentres.size()
void size(const label n)
Older name for setAddressableSize.
static label read(const UPstream::commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, UPstream::Request *req=nullptr)
Read buffer contents from given processor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void resize(const label len)
Adjust allocated size of list.
commsTypes
Communications types.
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...
#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.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests)
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
static int & msgType() noexcept
Message tag of standard messages.
static CompactListList< T > pack(const UList< SubListType > &lists, const bool checkOverflow=false)
Construct by packing together the list of lists.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
List< labelList > labelListList
List of labelList.
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
static void waitRequests()
Wait for all requests to finish.
#define forAll(list, i)
Loop across all elements in list.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Foam::word regionName(Foam::polyMesh::defaultRegion)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A List obtained as a section of another List.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
vectorField pointField
pointField is a vectorField.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static constexpr int masterNo() noexcept
Relative rank for the master process - is always 0.
virtual labelList decompose(const polyMesh &mesh, const pointField &points, const scalarField &pointWeights) const
Return for every coordinate the wanted processor number.
metisLikeDecomp(const metisLikeDecomp &)=delete
No copy construct.
Abstract base class for domain decomposition.
int debug
Static debugging option.
virtual label decomposeSerial(const labelList &adjncy, const labelList &xadj, const List< scalar > &cellWeights, labelList &decomp) const =0
Decomposition with metis-like parameters.
T & last()
Access last element of the list, position [size()-1].
label nCells() const noexcept
Number of mesh cells.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal)
Write buffer contents to given processor.
"nonBlocking" : (MPI_Isend, MPI_Irecv)
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual label decomposeGeneral(const labelList &adjncy, const labelList &xadj, const List< scalar > &cellWeights, labelList &decomp) const
Serial and/or collect/distribute for parallel operation.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
std::streamsize size_bytes() const noexcept
Number of contiguous bytes for the List data.