57 const Foam::scalar Foam::perfectInterface::tol_ = 1
e-3;
73 ctrs[patchFacei] = pp[patchFacei].centre(points);
88 const word& faceZoneName,
89 const word& masterPatchName,
90 const word& slavePatchName
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;
218 <<
"Points on patch sides do not match to within tolerance " 224 renumberPoints[meshPts1[i]] = meshPts0[from1To0Points[i]];
236 calcFaceCentres(pp0),
237 calcFaceCentres(pp1),
246 <<
"Face centres of patch sides do not match to within tolerance " 261 label meshPointi = meshPts1[i];
263 if (meshPointi != renumberPoints[meshPointi])
269 affectedFaces.insert(pFaces[pFacei]);
275 affectedFaces.erase(pp1.addressing()[i]);
283 label facei = pp0.addressing()[i];
285 if (affectedFaces.erase(facei))
288 <<
"Found face " << facei <<
" vertices " 289 << mesh.
faces()[facei] <<
" whose points are" 290 <<
" used both by master patch and slave patch" <<
endl;
298 const label facei = iter.key();
305 newFace[fp] = renumberPoints[f[fp]];
323 bool zoneFlip =
false;
353 label meshPointi = meshPts1[i];
355 if (meshPointi != renumberPoints[meshPointi])
365 label facei = pp1.addressing()[i];
374 mesh.
faceZones()[faceZoneID_.index()].flipMap();
378 label facei = pp0.addressing()[i];
386 newFace[fp] = renumberPoints[f[fp]];
391 label pp1Facei = pp1.addressing()[from0To1Faces[i]];
419 newFace.reverseFace(),
439 Pout<<
"bool perfectInterface::setRefinement(polyTopoChange&) const : " 440 <<
"for object " <<
name() <<
" : " 441 <<
"masterPatchID_:" << masterPatchID_
442 <<
" slavePatchID_:" << slavePatchID_
443 <<
" faceZoneID_:" << faceZoneID_ <<
endl;
448 masterPatchID_.active()
449 && slavePatchID_.active()
450 && faceZoneID_.active()
456 const polyPatch& patch0 = patches[masterPatchID_.index()];
457 const polyPatch& patch1 = patches[slavePatchID_.index()];
474 setRefinement(pp0, pp1, ref);
501 << faceZoneID_.name() <<
nl 502 << masterPatchID_.name() <<
nl 503 << slavePatchID_.name() <<
endl;
511 <<
" type " <<
type()
514 <<
" active " << active()
517 <<
" faceZoneName " << faceZoneID_.name()
520 <<
" masterPatchName " << masterPatchID_.name()
523 <<
" slavePatchName " << slavePatchID_.name()
const fvPatchList & patches
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual void topoChange(const polyTopoChangeMap &)
Force recalculation of locally stored data on topological change.
Class containing data for face removal.
#define forAll(list, i)
Loop across all elements in list.
bool update()
Update the mesh for topology change, mesh to mesh mapping.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Class describing modification of a face.
A face is a list of labels corresponding to mesh vertices.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
virtual const labelList & faceNeighbour() const
Return face neighbour.
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
virtual void write(Ostream &) const
Write.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
const Field< PointType > & localPoints() const
Return pointField of points in patch.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
Determine correspondence between points. See below.
Macros for easy insertion into run-time selection tables.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
virtual const pointField & points() const
Return raw points.
A list of faces which address into the list of points.
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.
vectorField pointField
pointField is a vectorField.
List of mesh modifiers defining the mesh dynamics.
A class for handling words, derived from string.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual const labelList & faceOwner() const
Return face owner.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
virtual const faceList & faces() const
Return raw faces.
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
Virtual base class for mesh modifiers.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual ~perfectInterface()
Destructor.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
#define WarningInFunction
Report a warning using Foam::Warning.
prefixOSstream Pout(cout, "Pout")
const meshFaceZones & faceZones() const
Return face zones.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
bool update(const point &, const FvWallInfoDataBase< WallInfo, Type, Derived > &w2, const scalar tol, TrackingData &td)
Evaluate distance to point. Update distSqr, origin from whomever.
virtual void writeDict(Ostream &) const
Write dictionary.
const labelListList & pointFaces() const
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
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.
const polyMesh & mesh() const
Return the mesh reference.
virtual bool changeTopology() const
Check for topology change.
perfectInterface(const word &name, const label index, const polyTopoChanger &mme, const word &faceZoneName, const word &masterPatchName, const word &slavePatchName)
Construct from components.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Class containing data for point removal.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.