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
const labelListList & pointFaces() const
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.
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 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.
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.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
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.
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]
List< label > labelList
A List of labels.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void setSize(const label)
Reset size of List.
virtual const labelList & faceNeighbour() const
Return face neighbour.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
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.
Mesh consisting of general polyhedral cells.
virtual const labelList & faceOwner() const
Return face owner.
virtual const faceList & faces() const
Return raw faces.
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.
label size() const
Return the number of elements in the UPtrList.
defineTypeName(preserveBafflesConstraint)