Go to the documentation of this file.
38 namespace decompositionConstraints
44 decompositionConstraint,
45 singleProcessorFaceSets,
53 void Foam::decompositionConstraints::singleProcessorFaceSets::printInfo()
const
55 for (
const auto& nameAndProc : setNameAndProcs_)
57 Info<<
" all cells connected to faceSet "
58 << nameAndProc.first()
59 <<
" on processor " << nameAndProc.second() <<
endl;
75 coeffDict_.lookupCompat(
"sets", {{
"singleProcessorFaceSets", 1806}})
81 <<
" : adding constraints to keep" <<
endl;
95 setNameAndProcs_(setNameAndProcs)
100 <<
" : adding constraints to keep" <<
endl;
119 <<
" : adding constraints to keep" <<
endl;
141 forAll(specifiedProcessorFaces, setI)
143 const labelList& faceLabels = specifiedProcessorFaces[setI];
144 for (
const label facei : faceLabels)
146 faceToSet[facei] = setI;
150 forAll(setNameAndProcs_, setI)
156 const label destProcI = setNameAndProcs_[setI].second();
159 const faceSet fz(
mesh, setNameAndProcs_[setI].first());
163 for (
const label facei : fz)
165 const label seti = faceToSet[facei];
179 if (nMatch[setI] == fz.size())
185 else if (nMatch[setI] > 0)
198 specifiedProcessor.
append(destProcI);
206 forAll(specifiedProcessorFaces, setI)
208 const labelList& faceLabels = specifiedProcessorFaces[setI];
209 for (
const label facei : faceLabels)
213 for (
const label pointi :
f)
215 procFacePoint[pointi] =
true;
223 label nUnblocked = 0;
225 forAll(procFacePoint, pointi)
227 if (procFacePoint[pointi])
232 if (blockedFace[
pFaces[i]])
234 blockedFace[
pFaces[i]] =
false;
244 Info<<
type() <<
" : unblocked " << nUnblocked <<
" faces" <<
endl;
276 forAll(specifiedProcessorFaces, setI)
281 label procI = specifiedProcessor[setI];
288 procI = decomposition[
mesh.faceOwner()[
set[0]]];
300 procFacePoint[
f[fp]] =
true;
306 forAll(procFacePoint, pointi)
308 if (procFacePoint[pointi])
311 for (
const label faceI :
pFaces)
313 const label own =
mesh.faceOwner()[faceI];
315 if (decomposition[own] != procI)
317 decomposition[own] = procI;
321 if (
mesh.isInternalFace(faceI))
323 const label nei =
mesh.faceNeighbour()[faceI];
324 if (decomposition[nei] != procI)
326 decomposition[nei] = procI;
338 Info<<
type() <<
" : changed decomposition on " << nChanged
int debug
Static debugging option.
List< label > labelList
A List of labels.
Abstract class for handling decomposition constraints.
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
defineTypeName(geometric)
void resize(const label len)
Adjust allocated size of list.
static constexpr const zero Zero
Global zero (0)
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
singleProcessorFaceSets(const dictionary &dict)
Construct with constraint dictionary.
messageStream Info
Information stream (stdout output on master, null elsewhere)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void append(T *ptr)
Append an element to the end of the list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add this constraint to list of constraints.
addToRunTimeSelectionTable(decompositionConstraint, geometric, dictionary)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual void apply(const polyMesh &mesh, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections, labelList &decomposition) const
Add this constraint post-decomposition.
A face is a list of labels corresponding to mesh vertices.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::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].reset(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]