38namespace decompositionConstraints
61 if (decompositionConstraint::debug)
64 <<
" : setting constraints to preserve baffles"
75 if (decompositionConstraint::debug)
78 <<
" : setting constraints to preserve baffles"
101 if (decompositionConstraint::debug & 2)
103 Info<<
type() <<
" : setting constraints to preserve "
105 <<
" baffles" <<
endl;
113 for (
const labelPair&
p : explicitConnections)
136 <<
"When adding baffle between faces "
137 <<
p[0] <<
" at " <<
mesh.faceCentres()[
p[0]]
139 <<
p[1] <<
" at " <<
mesh.faceCentres()[
p[1]]
140 <<
" : face " <<
p[0] <<
" already is connected to face "
141 << p0Slave <<
" at " <<
mesh.faceCentres()[p0Slave]
142 <<
" and face " <<
p[1] <<
" already is connected to face "
143 << p1Slave <<
" at " <<
mesh.faceCentres()[p1Slave]
153 if (otherFaceI != -1 && faceI < otherFaceI)
159 explicitConnections.setSize(
n);
164 if (otherFaceI != -1 && faceI < otherFaceI)
166 explicitConnections[
n++] =
labelPair(faceI, otherFaceI);
173 for (
const labelPair&
p : explicitConnections)
175 blockedFace[
p.first()] =
false;
176 blockedFace[
p.second()] =
false;
199 for (
const labelPair& baffle : bafflePairs)
201 const label f0 = baffle.first();
202 const label f1 = baffle.second();
204 const label procI = decomposition[
mesh.faceOwner()[f0]];
206 if (
mesh.isInternalFace(f0))
208 const label nei0 =
mesh.faceNeighbour()[f0];
209 if (decomposition[nei0] != procI)
211 decomposition[nei0] = procI;
216 const label own1 =
mesh.faceOwner()[f1];
217 if (decomposition[own1] != procI)
219 decomposition[own1] = procI;
222 if (
mesh.isInternalFace(f1))
224 const label nei1 =
mesh.faceNeighbour()[f1];
225 if (decomposition[nei1] != procI)
227 decomposition[nei1] = procI;
232 if (decompositionConstraint::debug & 2)
235 Info<<
type() <<
" : changed decomposition on " << nChanged
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void setSize(const label n)
Alias for resize()
static int compare(const Pair< label > &a, const Pair< label > &b)
Compare Pairs.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void size(const label n)
Older name for setAddressableSize.
virtual void apply()=0
Apply bins.
Abstract class for handling decomposition constraints.
Detects baffles and keeps owner and neighbour on same processor.
preserveBaffles()
Construct from components.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A topoSetFaceSource to select faces based on usage in another faceSet.
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Mesh consisting of general polyhedral cells.
#define defineTypeName(Type)
Define the typeName.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Pair< label > labelPair
A pair of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
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=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
#define forAll(list, i)
Loop across all elements in list.