Go to the documentation of this file.
35 namespace decompositionConstraints
40 decompositionConstraint,
58 setNameAndProcs_(coeffDict_.lookup(
"singleProcessorFaceSets"))
60 if (decompositionConstraint::debug)
63 <<
" : adding constraints to keep" <<
endl;
65 forAll(setNameAndProcs_, setI)
67 Info<<
" all cells connected to faceSet "
68 << setNameAndProcs_[setI].first()
69 <<
" on processor " << setNameAndProcs_[setI].second() <<
endl;
82 setNameAndProcs_(setNameAndProcs)
84 if (decompositionConstraint::debug)
87 <<
" : adding constraints to keep" <<
endl;
89 forAll(setNameAndProcs_, setI)
91 Info<<
" all cells connected to faceSet "
92 << setNameAndProcs_[setI].first()
93 <<
" on processor " << setNameAndProcs_[setI].second() <<
endl;
114 forAll(specifiedProcessorFaces, setI)
116 const labelList& faceLabels = specifiedProcessorFaces[setI];
119 faceToSet[faceLabels[i]] = setI;
124 forAll(setNameAndProcs_, setI)
130 const label destProcI = setNameAndProcs_[setI].second();
133 const faceSet fz(
mesh, setNameAndProcs_[setI].first());
139 label setI = faceToSet[iter.key()];
153 if (nMatch[setI] == fz.
size())
159 else if (nMatch[setI] > 0)
173 specifiedProcessor.
append(destProcI);
181 forAll(specifiedProcessorFaces, setI)
183 const labelList& set = specifiedProcessorFaces[setI];
189 procFacePoint[
f[fp]] =
true;
197 label nUnblocked = 0;
199 forAll(procFacePoint, pointI)
201 if (procFacePoint[pointI])
206 if (blockedFace[
pFaces[i]])
208 blockedFace[
pFaces[i]] =
false;
215 if (decompositionConstraint::debug & 2)
218 Info<<
type() <<
" : unblocked " << nUnblocked <<
" faces" <<
endl;
250 forAll(specifiedProcessorFaces, setI)
252 const labelList& set = specifiedProcessorFaces[setI];
255 label procI = specifiedProcessor[setI];
262 procI = decomposition[
mesh.faceOwner()[set[0]]];
274 procFacePoint[
f[fp]] =
true;
280 forAll(procFacePoint, pointI)
282 if (procFacePoint[pointI])
290 if (decomposition[own] != procI)
292 decomposition[own] = procI;
295 if (
mesh.isInternalFace(faceI))
298 if (decomposition[nei] != procI)
300 decomposition[nei] = procI;
309 if (decompositionConstraint::debug & 2)
312 Info<<
type() <<
" : changed decomposition on " << nChanged
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add my constraints to list of constraints.
singleProcessorFaceSetsConstraint(const dictionary &constraintsDict, const word &type)
Construct with generic dictionary with optional entry for type.
A class for handling words, derived from string.
List< label > labelList
A List of labels.
void append(T *)
Append an element at the end of the list.
addToRunTimeSelectionTable(decompositionConstraint, preserveBafflesConstraint, dictionary)
#define forAll(list, i)
Loop across all elements in list.
defineTypeName(preserveBafflesConstraint)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void append(const T &)
Append an element at the end of the list.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A list of keyword definitions, which are a keyword followed by any number of values (e....
label size() const
Return number of elements in table.
Macros for easy insertion into run-time selection tables.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Constraint to keep all cells connected to face or point of faceSet on a single processor.
void setSize(const label)
Reset size of List.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label size() const
Return the number of elements in the PtrList.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
A 2-tuple for storing two objects of different types.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
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.