35 namespace decompositionConstraints
41 decompositionConstraint,
42 singleProcessorFaceSetsConstraint,
59 setNameAndProcs_(coeffDict_.lookup(
"singleProcessorFaceSets"))
61 if (decompositionConstraint::debug)
64 <<
" : adding constraints to keep" <<
endl;
66 forAll(setNameAndProcs_, setI)
68 Info<<
" all cells connected to faceSet " 69 << setNameAndProcs_[setI].first()
70 <<
" on processor " << setNameAndProcs_[setI].second() <<
endl;
83 setNameAndProcs_(setNameAndProcs)
85 if (decompositionConstraint::debug)
88 <<
" : adding constraints to keep" <<
endl;
90 forAll(setNameAndProcs_, setI)
92 Info<<
" all cells connected to faceSet " 93 << setNameAndProcs_[setI].first()
94 <<
" on processor " << setNameAndProcs_[setI].second() <<
endl;
115 forAll(specifiedProcessorFaces, setI)
117 const labelList& faceLabels = specifiedProcessorFaces[setI];
120 faceToSet[faceLabels[i]] = setI;
125 forAll(setNameAndProcs_, setI)
131 const label destProcI = setNameAndProcs_[setI].second();
134 const faceSet fz(mesh, setNameAndProcs_[setI].first());
140 label setI = faceToSet[iter.key()];
154 if (nMatch[setI] == fz.
size())
160 else if (nMatch[setI] > 0)
174 specifiedProcessor.
append(destProcI);
182 forAll(specifiedProcessorFaces, setI)
184 const labelList&
set = specifiedProcessorFaces[setI];
190 procFacePoint[f[fp]] =
true;
198 label nUnblocked = 0;
200 forAll(procFacePoint, pointi)
202 if (procFacePoint[pointi])
207 if (blockedFace[pFaces[i]])
209 blockedFace[pFaces[i]] =
false;
216 if (decompositionConstraint::debug & 2)
219 Info<<
type() <<
" : unblocked " << nUnblocked <<
" faces" <<
endl;
251 forAll(specifiedProcessorFaces, setI)
253 const labelList&
set = specifiedProcessorFaces[setI];
256 label procI = specifiedProcessor[setI];
263 procI = decomposition[mesh.
faceOwner()[
set[0]]];
275 procFacePoint[f[fp]] =
true;
281 forAll(procFacePoint, pointi)
283 if (procFacePoint[pointi])
288 label faceI = pFaces[i];
291 if (decomposition[own] != procI)
293 decomposition[own] = procI;
299 if (decomposition[nei] != procI)
301 decomposition[nei] = procI;
310 if (decompositionConstraint::debug & 2)
313 Info<<
type() <<
" : changed decomposition on " << nChanged
void append(T *)
Append an element at the end of the list.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A face is a list of labels corresponding to mesh vertices.
singleProcessorFaceSetsConstraint(const dictionary &constraintsDict, const word &type)
Construct with generic dictionary with optional entry for type.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A 2-tuple for storing two objects of different types.
virtual const labelList & faceNeighbour() const
Return face neighbour.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Ostream & endl(Ostream &os)
Add newline and flush stream.
label size() const
Return number of elements in table.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add my constraints to list of constraints.
Macros for easy insertion into run-time selection tables.
addToRunTimeSelectionTable(decompositionConstraint, preserveBafflesConstraint, dictionary)
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
virtual const labelList & faceOwner() const
Return face owner.
List< label > labelList
A List of labels.
virtual const faceList & faces() const
Return raw faces.
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, &mergedCyclicPolyPatch::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]
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
List< Key > sortedToc() const
Return the table of contents as a sorted list.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
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.
const labelListList & pointFaces() const
Mesh consisting of general polyhedral cells.
defineTypeName(preserveBafflesConstraint)