Go to the documentation of this file.
60 const Foam::scalar Foam::perfectInterface::tol_ = 1
e-3;
76 ctrs[patchFacei] = pp[patchFacei].centre(
points);
85 Foam::perfectInterface::perfectInterface
90 const word& faceZoneName,
91 const word& masterPatchName,
92 const word& slavePatchName
102 Foam::perfectInterface::perfectInterface
138 Pout<<
"bool perfectInterface::changeTopology() const "
139 <<
"for object " <<
name() <<
" : "
140 <<
"Inactive" <<
endl;
174 scalar minLen = GREAT;
178 minLen =
min(minLen, edges0[edgeI].
mag(pts0));
180 scalar typDim = tol_*minLen;
184 Pout<<
"typDim:" << typDim <<
" edges0:" << edges0.size()
185 <<
" pts0:" << pts0.size() <<
" pts1:" << pts1.size()
186 <<
" pp0:" << pp0.size() <<
" pp1:" << pp1.size() <<
endl;
196 renumberPoints[i] = i;
213 <<
"Points on patch sides do not match to within tolerance "
219 renumberPoints[meshPts1[i]] = meshPts0[from1To0Points[i]];
231 calcFaceCentres(pp0),
232 calcFaceCentres(pp1),
241 <<
"Face centres of patch sides do not match to within tolerance "
256 label meshPointi = meshPts1[i];
258 if (meshPointi != renumberPoints[meshPointi])
262 affectedFaces.insert(
pFaces);
267 affectedFaces.erase(pp1.addressing()[i]);
275 label facei = pp0.addressing()[i];
277 if (affectedFaces.erase(facei))
280 <<
"Found face " << facei <<
" vertices "
281 <<
mesh.
faces()[facei] <<
" whose points are"
282 <<
" used both by master patch and slave patch" <<
endl;
288 for (
const label facei : affectedFaces)
292 face newFace(
f.size());
296 newFace[fp] = renumberPoints[
f[fp]];
314 bool zoneFlip =
false;
344 label meshPointi = meshPts1[i];
346 if (meshPointi != renumberPoints[meshPointi])
356 label facei = pp1.addressing()[i];
369 label facei = pp0.addressing()[i];
373 face newFace(
f.size());
377 newFace[fp] = renumberPoints[
f[fp]];
382 label pp1Facei = pp1.addressing()[from0To1Faces[i]];
410 newFace.reverseFace(),
430 Pout<<
"bool perfectInterface::setRefinement(polyTopoChange&) const : "
431 <<
"for object " <<
name() <<
" : "
432 <<
"masterPatchID_:" << masterPatchID_
433 <<
" slavePatchID_:" << slavePatchID_
434 <<
" faceZoneID_:" << faceZoneID_ <<
endl;
439 masterPatchID_.active()
440 && slavePatchID_.active()
441 && faceZoneID_.active()
462 setRefinement(pp0, pp1,
ref);
489 << faceZoneID_.name() <<
nl
490 << masterPatchID_.name() <<
nl
491 << slavePatchID_.name() <<
endl;
502 os.
writeEntry(
"faceZoneName", faceZoneID_.name());
503 os.
writeEntry(
"masterPatchName", masterPatchID_.name());
504 os.
writeEntry(
"slavePatchName", slavePatchID_.name());
int debug
Static debugging option.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
vectorField pointField
pointField is a vectorField.
virtual const pointField & points() const
Return raw points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A class for handling words, derived from Foam::string.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
Class containing data for point removal.
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
List of mesh modifiers defining the mesh dynamics.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
const labelListList & pointFaces() const
Direct mesh changes based on v1.3 polyTopoChange syntax.
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Class describing modification of a face.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
virtual void writeDict(Ostream &) const
Write dictionary.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
A class for handling keywords in dictionaries.
Determine correspondence between points. See below.
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]=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]
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
labelRange range() const
Return start/size range of this patch.
virtual const labelList & faceOwner() const
Return face owner.
A List with indirect addressing.
virtual bool changeTopology() const
Check for topology change.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
virtual Ostream & endBlock()
Write end block group.
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.
const labelIOList & zoneID
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const Field< point_type > & localPoints() const
Return pointField of points in patch.
Virtual base class for mesh modifiers.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const polyMesh & mesh() const
Return the mesh reference.
Class containing data for face removal.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar e
Elementary charge.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
const polyBoundaryMesh & patches
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A face is a list of labels corresponding to mesh vertices.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const boolList & flipMap() const
Return face flip map.
defineTypeNameAndDebug(combustionModel, 0)
bool matchPoints(const UList< point > &pts0, const UList< point > &pts1, const UList< scalar > &matchDistance, const bool verbose, labelList &from0To1, const point &origin=point::zero)
Determine correspondence between pointFields. Gets passed.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const labelList & faceNeighbour() const
Return face neighbour.
A list of faces which address into the list of points.
virtual void write(Ostream &) const
Write.