35 namespace decompositionConstraints
60 if (decompositionConstraint::debug)
62 Info<<
type() <<
" : setting constraints to preserve baffles"
74 if (decompositionConstraint::debug)
76 Info<<
type() <<
" : setting constraints to preserve baffles"
99 if (decompositionConstraint::debug & 2)
101 Info<<
type() <<
" : setting constraints to preserve "
103 <<
" baffles" <<
endl;
111 forAll(explicitConnections, i)
137 <<
"When adding baffle between faces "
141 <<
" : face " <<
p[0] <<
" already is connected to face "
142 << p0Slave <<
" at " << mesh.
faceCentres()[p0Slave]
143 <<
" and face " <<
p[1] <<
" already is connected to face "
144 << p1Slave <<
" at " << mesh.
faceCentres()[p1Slave]
154 if (otherFaceI != -1 && faceI < otherFaceI)
165 if (otherFaceI != -1 && faceI < otherFaceI)
167 explicitConnections[
n++] =
labelPair(faceI, otherFaceI);
174 forAll(explicitConnections, i)
176 blockedFace[explicitConnections[i].
first()] =
false;
177 blockedFace[explicitConnections[i].second()] =
false;
202 const labelPair& baffle = bafflePairs[i];
211 if (decomposition[nei0] != procI)
213 decomposition[nei0] = procI;
219 if (decomposition[own1] != procI)
221 decomposition[own1] = procI;
227 if (decomposition[nei1] != procI)
229 decomposition[nei1] = procI;
234 if (decompositionConstraint::debug & 2)
237 Info<<
type() <<
" : changed decomposition on " << nChanged
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
const Type & second() const
Return second.
static int compare(const Pair< label > &a, const Pair< label > &b)
Compare Pairs.
const Type & first() const
Return first.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
T & first()
Return the first element of the list.
Detects baffles and keeps owner and neighbour on same processor.
virtual void apply(const polyMesh &mesh, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections, labelList &decomposition) const
Apply any additional post-decomposition constraints.
preserveBafflesConstraint()
Construct from components.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add my constraints to list of constraints.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A topoSetSource to select faces based on usage in another faceSet.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Mesh consisting of general polyhedral cells.
virtual const labelList & faceOwner() const
Return face owner.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const vectorField & faceCentres() const
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
A class for handling words, derived from string.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
defineTypeName(preserveBafflesConstraint)
addToRunTimeSelectionTable(decompositionConstraint, preserveBafflesConstraint, dictionary)
Pair< label > labelPair
Label pair.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.