38 namespace decompositionConstraints
44 decompositionConstraint,
64 <<
" : setting constraints to preserve baffles" 78 <<
" : setting constraints to preserve baffles" 103 Info<<
type() <<
" : setting constraints to preserve " 105 <<
" baffles" <<
endl;
113 for (
const labelPair&
p : explicitConnections)
115 faceToFace[
p[0]] =
p[1];
116 faceToFace[
p[1]] =
p[0];
122 if (faceToFace[
p[0]] == -1 && faceToFace[
p[1]] == -1)
124 faceToFace[
p[0]] =
p[1];
125 faceToFace[
p[1]] =
p[0];
133 const label p0Slave = faceToFace[
p[0]];
134 const label p1Slave = faceToFace[
p[1]];
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]
152 label otherFaceI = faceToFace[faceI];
153 if (otherFaceI != -1 && faceI < otherFaceI)
159 explicitConnections.setSize(
n);
163 label otherFaceI = faceToFace[faceI];
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;
234 Info<<
type() <<
" : changed decomposition on "
Abstract class for handling decomposition constraints.
void size(const label n)
Older name for setAddressableSize.
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.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add my constraints to list of constraints.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Macros for easy insertion into run-time selection tables.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
#define forAll(list, i)
Loop across all elements in list.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void setSize(const label n)
Alias for resize()
static int compare(const Pair< label > &a, const Pair< label > &b)
Compare Pairs.
int debug
Static debugging option.
Pair< label > labelPair
A pair of labels.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
addToRunTimeSelectionTable(decompositionConstraint, geometric, dictionary)
messageStream Info
Information stream (stdout output on master, null elsewhere)
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
defineTypeName(geometric)
preserveBaffles()
Construct from components.