Go to the documentation of this file.
83 <<
"Not all zones and patches needed in the definition "
84 <<
"have been found. Please check your mesh definition."
96 <<
"Please check your mesh definition."
102 Pout<<
"Sliding interface object " <<
name() <<
" :" <<
nl
111 clearPointProjection();
112 clearAttachedAddressing();
126 const word& masterFaceZoneName,
127 const word& slaveFaceZoneName,
128 const word& cutPointZoneName,
129 const word& cutFaceZoneName,
130 const word& masterPatchName,
131 const word& slavePatchName,
133 const bool coupleDecouple,
169 coupleDecouple_(coupleDecouple),
171 projectionAlgo_(algo),
173 pointMergeTol_(pointMergeTolDefault_),
174 edgeMergeTol_(edgeMergeTolDefault_),
175 nFacesPerSlaveEdge_(nFacesPerSlaveEdgeDefault_),
176 edgeFaceEscapeLimit_(edgeFaceEscapeLimitDefault_),
177 integralAdjTol_(integralAdjTolDefault_),
178 edgeMasterCatchFraction_(edgeMasterCatchFractionDefault_),
179 edgeCoPlanarTol_(edgeCoPlanarTolDefault_),
180 edgeEndCutoffTol_(edgeEndCutoffTolDefault_),
181 cutFaceMasterPtr_(NULL),
182 cutFaceSlavePtr_(NULL),
183 masterFaceCellsPtr_(NULL),
184 slaveFaceCellsPtr_(NULL),
185 masterStickOutFacesPtr_(NULL),
186 slaveStickOutFacesPtr_(NULL),
187 retiredPointMapPtr_(NULL),
188 cutPointEdgePairMapPtr_(NULL),
189 slavePointPointHitsPtr_(NULL),
190 slavePointEdgeHitsPtr_(NULL),
191 slavePointFaceHitsPtr_(NULL),
192 masterPointEdgeHitsPtr_(NULL),
193 projectedSlavePointsPtr_(NULL)
200 <<
"Creation of a sliding interface from components "
201 <<
"in attached state not supported."
206 calcAttachedAddressing();
251 matchType_(typeOfMatchNames_.read((
dict.
lookup(
"typeOfMatch")))),
252 coupleDecouple_(
dict.
lookup(
"coupleDecouple")),
259 cutFaceMasterPtr_(NULL),
260 cutFaceSlavePtr_(NULL),
261 masterFaceCellsPtr_(NULL),
262 slaveFaceCellsPtr_(NULL),
263 masterStickOutFacesPtr_(NULL),
264 slaveStickOutFacesPtr_(NULL),
265 retiredPointMapPtr_(NULL),
266 cutPointEdgePairMapPtr_(NULL),
267 slavePointPointHitsPtr_(NULL),
268 slavePointEdgeHitsPtr_(NULL),
269 slavePointFaceHitsPtr_(NULL),
270 masterPointEdgeHitsPtr_(NULL),
271 projectedSlavePointsPtr_(NULL)
284 Pout<<
"slidingInterface::slidingInterface(...) "
285 <<
" for object " <<
name <<
" : "
286 <<
"Interface attached. Reading master and slave face zones "
287 <<
"and retired point lookup." <<
endl;
294 masterStickOutFacesPtr_ =
296 slaveStickOutFacesPtr_ =
300 cutPointEdgePairMapPtr_ =
305 calcAttachedAddressing();
329 return masterFaceZoneID_;
335 return slaveFaceZoneID_;
346 Pout<<
"bool slidingInterface::changeTopology() const "
347 <<
"for object " <<
name() <<
" : "
348 <<
"Couple-decouple mode." <<
endl;
365 && !topoChanger().
mesh().changing()
375 return projectPoints();
387 decoupleInterface(ref);
392 coupleInterface(ref);
406 coupleInterface(ref);
417 Pout<<
"void slidingInterface::modifyMotionPoints("
418 <<
"pointField& motionPoints) const for object " <<
name() <<
" : "
419 <<
"Adjusting motion points." <<
endl;
427 if (cutPoints.
size() && !projectedSlavePointsPtr_)
433 const pointField& projectedSlavePoints = *projectedSlavePointsPtr_;
458 if (rpmIter != rpm.end())
466 motionPoints[cutPoints[pointI]] =
467 projectedSlavePoints[slaveZonePointMap.find(rpmIter())()];
475 cpepm.find(cutPoints[pointI]);
477 if (cpepmIter != cpepm.end())
490 const edge& globalMasterEdge = cpepmIter().first();
492 const label curMasterEdgeIndex =
499 globalMasterEdge.
start()
503 globalMasterEdge.
end()
508 const edge& cme = masterEdges[curMasterEdgeIndex];
514 const edge& globalSlaveEdge = cpepmIter().second();
516 const label curSlaveEdgeIndex =
523 globalSlaveEdge.
start()
527 globalSlaveEdge.
end()
532 const edge& curSlaveEdge = slaveEdges[curSlaveEdgeIndex];
536 const point& a = projectedSlavePoints[curSlaveEdge.
start()];
537 const point&
b = projectedSlavePoints[curSlaveEdge.
end()];
542 slaveLocalPoints[curSlaveEdge.
start()]
543 + slavePointNormals[curSlaveEdge.
start()]
544 + slaveLocalPoints[curSlaveEdge.
end()]
545 + slavePointNormals[curSlaveEdge.
end()]
552 curSlaveEdge.
line(slaveLocalPoints);
553 const scalar curSlaveLineMag = curSlaveLine.
mag();
558 cme.
line(masterLocalPoints)
563 cutOnMaster > edgeEndCutoffTol_
564 && cutOnMaster < 1.0 - edgeEndCutoffTol_
568 point masterCutPoint =
569 masterLocalPoints[cme.
start()]
570 + cutOnMaster*cme.
vec(masterLocalPoints);
583 - curSlaveLine.
start()
584 ) & curSlaveLine.
vec()
585 )/
sqr(curSlaveLineMag);
590 edgeCoPlanarTol_*
mag(
b - a);
594 cutOnSlave > edgeEndCutoffTol_
595 && cutOnSlave < 1.0 - edgeEndCutoffTol_
600 motionPoints[cutPoints[pointI]] =
606 Pout<<
"Missed slave edge!!! This is an error. "
608 << cme.
line(masterLocalPoints)
609 <<
" slave edge: " << curSlaveLine
610 <<
" point: " << masterCutPoint
615 - curSlaveLine.
start()
616 ) & curSlaveLine.
vec()
617 )/
sqr(curSlaveLineMag)
623 Pout<<
"Missed master edge!!! This is an error"
630 <<
"Cut point " << cutPoints[pointI]
631 <<
" not recognised as either the projected "
632 <<
"or as intersection point. Error in point "
633 <<
"projection or data mapping"
650 Pout<<
"void slidingInterface::updateMesh(const mapPolyMesh& m)"
651 <<
" const for object " <<
name() <<
" : "
652 <<
"Updating topology." <<
endl;
680 if (!projectedSlavePointsPtr_)
685 return *projectedSlavePointsPtr_;
702 "nFacesPerSlaveEdge",
707 "edgeFaceEscapeLimit",
717 "edgeMasterCatchFraction",
718 edgeMasterCatchFraction_
733 Info<<
"Sliding interface parameters:" <<
nl
734 <<
"pointMergeTol : " << pointMergeTol_ <<
nl
735 <<
"edgeMergeTol : " << edgeMergeTol_ <<
nl
736 <<
"nFacesPerSlaveEdge : " << nFacesPerSlaveEdge_ <<
nl
737 <<
"edgeFaceEscapeLimit : " << edgeFaceEscapeLimit_ <<
nl
738 <<
"integralAdjTol : " << integralAdjTol_ <<
nl
739 <<
"edgeMasterCatchFraction : " << edgeMasterCatchFraction_ <<
nl
740 <<
"edgeCoPlanarTol : " << edgeCoPlanarTol_ <<
nl
741 <<
"edgeEndCutoffTol : " << edgeEndCutoffTol_ <<
endl;
750 << masterFaceZoneID_.name() <<
nl
751 << slaveFaceZoneID_.name() <<
nl
752 << cutPointZoneID_.name() <<
nl
753 << cutFaceZoneID_.name() <<
nl
754 << masterPatchID_.name() <<
nl
755 << slavePatchID_.name() <<
nl
756 << typeOfMatchNames_[matchType_] <<
nl
757 << coupleDecouple_ <<
nl
758 << attached_ <<
endl;
763 #define WRITE_NON_DEFAULT(name) \
764 if ( name ## _ != name ## Default_ )\
766 os << " " #name " " << name ## _ << token::END_STATEMENT << nl; \
774 <<
" masterFaceZoneName " << masterFaceZoneID_.name()
776 <<
" slaveFaceZoneName " << slaveFaceZoneID_.name()
778 <<
" cutPointZoneName " << cutPointZoneID_.name()
780 <<
" cutFaceZoneName " << cutFaceZoneID_.name()
782 <<
" masterPatchName " << masterPatchID_.name()
784 <<
" slavePatchName " << slavePatchID_.name()
786 <<
" typeOfMatch " << typeOfMatchNames_[matchType_]
788 <<
" coupleDecouple " << coupleDecouple_
792 <<
" attached " << attached_
794 <<
" active " << active()
799 masterFaceCellsPtr_->writeEntry(
"masterFaceCells", os);
800 slaveFaceCellsPtr_->writeEntry(
"slaveFaceCells", os);
801 masterStickOutFacesPtr_->writeEntry(
"masterStickOutFaces", os);
802 slaveStickOutFacesPtr_->writeEntry(
"slaveStickOutFaces", os);
804 os <<
" retiredPointMap " << retiredPointMap()
806 <<
" cutPointEdgePairMap " << cutPointEdgePairMap()
void clearAddressing() const
Clear addressing.
label whichPoint(const label gp) const
Given a global point index, return the local point.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
bool hit() const
Is there a hit.
A class for handling words, derived from string.
List< label > labelList
A List of labels.
faceZoneID cutFaceZoneID_
Cut face zone ID.
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
void clearOut() const
Clear out.
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
#define forAll(list, i)
Loop across all elements in list.
This class describes the interaction of a face and a point. It carries the info of a successful hit a...
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const faceZoneID & slaveFaceZoneID() const
Return slave face zone ID.
vector vec(const pointField &) const
Return the vector (end - start)
typeOfMatch
Type of match.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const Field< PointType > & localPoints() const
Return pointField of points in patch.
bool read(const char *, int32_t &)
List of mesh modifiers defining the mesh dynamics.
polyPatchID masterPatchID_
Master patch ID.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Direct mesh changes based on v1.3 polyTopoChange syntax.
pointZoneID cutPointZoneID_
Cut point zone ID.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
static const NamedEnum< typeOfMatch, 2 > typeOfMatchNames_
Direction names.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointRef start() const
Return first vertex.
static const NamedEnum< algorithm, 3 > algorithmNames_
Projection algorithm names.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
void setTolerances(const dictionary &, bool report=false)
Set the tolerances from the values in a dictionary.
virtual ~slidingInterface()
Destructor.
const faceZoneMesh & faceZones() const
Return face zone mesh.
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
label end() const
Return end vertex label.
void deleteDemandDrivenData(DataPtr &dataPtr)
scalar distance() const
Return distance to hit.
#define WRITE_NON_DEFAULT(name)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
const pointZoneMesh & pointZones() const
Return point zone mesh.
scalar mag() const
Return scalar magnitude.
A list of keyword definitions, which are a keyword followed by any number of values (e....
scalar lineIntersect(const line< Point, PointRef > &l) const
Return the cutting point between the plane and.
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
label whichEdge(const edge &e) const
Given an edge in local point labels, return its index.
Virtual base class for mesh modifiers.
const word & name() const
Return name of this modifier.
faceZoneID slaveFaceZoneID_
Slave face zone ID.
const Field< PointType > & pointNormals() const
Return point normals for patch.
faceZoneID masterFaceZoneID_
Master face zone ID.
slidingInterface(const slidingInterface &)
Disallow default bitwise copy construct.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
label start() const
Return start vertex label.
prefixOSstream Pout(cout, "Pout")
const polyMesh & mesh() const
Return the mesh reference.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
linePointRef line(const pointField &) const
Return edge line.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const dimensionedScalar c
Speed of light in a vacuum.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void checkDefinition()
Check validity of construction data.
polyPatchID slavePatchID_
Slave patch ID.
const faceZoneID & masterFaceZoneID() const
Return master face zone ID.
const Point & missPoint() const
Return miss point.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
virtual void writeDict(Ostream &) const
Write dictionary.
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
defineTypeNameAndDebug(combustionModel, 0)
Point vec() const
Return start-end vector.
bool active() const
Has the zone been found.
const Point & hitPoint() const
Return hit point.
word name(const complex &)
Return a string representation of a complex.
virtual void write(Ostream &) const
Write.
label index() const
Return index of first matching zone.
Initialise the NamedEnum HashTable from the static list of names.
const pointField & pointProjection() const
Return projected points for a slave patch.
virtual bool changeTopology() const
Check for topology change.
A list of faces which address into the list of points.