57 const Foam::scalar Foam::perfectInterface::tol_ = 1
e-3;
73 ctrs[patchFaceI] = pp[patchFaceI].centre(points);
83 Foam::perfectInterface::perfectInterface
88 const word& faceZoneName,
89 const word& masterPatchName,
90 const word& slavePatchName
101 Foam::perfectInterface::perfectInterface
112 dict.
lookup(
"faceZoneName"),
117 dict.
lookup(
"masterPatchName"),
122 dict.
lookup(
"slavePatchName"),
143 Pout<<
"bool perfectInterface::changeTopology() const " 144 <<
"for object " <<
name() <<
" : " 145 <<
"Inactive" <<
endl;
179 scalar minLen = GREAT;
183 minLen =
min(minLen, edges0[edgeI].
mag(pts0));
185 scalar typDim = tol_*minLen;
189 Pout<<
"typDim:" << typDim <<
" edges0:" << edges0.
size()
190 <<
" pts0:" << pts0.
size() <<
" pts1:" << pts1.
size()
191 <<
" pp0:" << pp0.size() <<
" pp1:" << pp1.size() <<
endl;
201 renumberPoints[i] = i;
219 "perfectInterface::setRefinement(polyTopoChange& ref) const" 220 ) <<
"Points on patch sides do not match to within tolerance " 226 renumberPoints[meshPts1[i]] = meshPts0[from1To0Points[i]];
238 calcFaceCentres(pp0),
239 calcFaceCentres(pp1),
249 "perfectInterface::setRefinement(polyTopoChange& ref) const" 250 ) <<
"Face centres of patch sides do not match to within tolerance " 265 label meshPointI = meshPts1[i];
267 if (meshPointI != renumberPoints[meshPointI])
273 affectedFaces.insert(pFaces[pFaceI]);
279 affectedFaces.erase(pp1.addressing()[i]);
287 label faceI = pp0.addressing()[i];
289 if (affectedFaces.erase(faceI))
293 "perfectInterface::setRefinement(polyTopoChange&) const" 294 ) <<
"Found face " << faceI <<
" vertices " 295 << mesh.
faces()[faceI] <<
" whose points are" 296 <<
" used both by master patch and slave patch" <<
endl;
304 const label faceI = iter.key();
311 newFace[fp] = renumberPoints[f[fp]];
329 bool zoneFlip =
false;
359 label meshPointI = meshPts1[i];
361 if (meshPointI != renumberPoints[meshPointI])
371 label faceI = pp1.addressing()[i];
380 mesh.
faceZones()[faceZoneID_.index()].flipMap();
384 label faceI = pp0.addressing()[i];
392 newFace[fp] = renumberPoints[f[fp]];
397 label pp1FaceI = pp1.addressing()[from0To1Faces[i]];
425 newFace.reverseFace(),
445 Pout<<
"bool perfectInterface::setRefinement(polyTopoChange&) const : " 446 <<
"for object " <<
name() <<
" : " 447 <<
"masterPatchID_:" << masterPatchID_
448 <<
" slavePatchID_:" << slavePatchID_
449 <<
" faceZoneID_:" << faceZoneID_ <<
endl;
454 masterPatchID_.active()
455 && slavePatchID_.active()
456 && faceZoneID_.active()
462 const polyPatch& patch0 = patches[masterPatchID_.index()];
463 const polyPatch& patch1 = patches[slavePatchID_.index()];
480 setRefinement(pp0, pp1, ref);
507 << faceZoneID_.name() <<
nl 508 << masterPatchID_.name() <<
nl 509 << slavePatchID_.name() <<
endl;
517 <<
" type " <<
type()
520 <<
" active " << active()
523 <<
" faceZoneName " << faceZoneID_.name()
526 <<
" masterPatchName " << masterPatchID_.name()
529 <<
" slavePatchName " << slavePatchID_.name()
A List with indirect addressing.
const boolList & flipMap() const
Return face flip map.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
const faceZoneMesh & faceZones() const
Return face zone mesh.
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
dimensioned< scalar > mag(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
Class containing data for point removal.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Virtual base class for mesh modifiers.
A subset of mesh faces organised as a primitive patch.
A class for handling words, derived from string.
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 size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
const polyMesh & mesh() const
Return the mesh reference.
A list of keyword definitions, which are a keyword followed by any number of values (e...
vectorField pointField
pointField is a vectorField.
Class containing data for face removal.
A patch is a list of labels that address the faces in the global face list.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
virtual void writeDict(Ostream &) const
Write dictionary.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
A face is a list of labels corresponding to mesh vertices.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
const double e
Elementary charge.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
virtual const pointField & points() const
Return raw points.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
virtual bool changeTopology() const
Check for topology change.
Macros for easy insertion into run-time selection tables.
List of mesh modifiers defining the mesh dynamics.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Class describing modification of a face.
const labelListList & pointFaces() const
virtual const labelList & faceOwner() const
Return face owner.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A list of faces which address into the list of points.
label start() const
Return start label of this patch in the polyMesh face list.
Mesh consisting of general polyhedral cells.
Determine correspondence between points. See below.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual void write(Ostream &) const
Write.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Direct mesh changes based on v1.3 polyTopoChange syntax.
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
virtual const faceList & faces() const
Return raw faces.
virtual ~perfectInterface()
Destructor.
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]
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual const labelList & faceNeighbour() const
Return face neighbour.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout,"Pout")
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.