54Foam::label Foam::cyclicPolyPatch::findMaxArea
56 const UList<point>&
points,
57 const UList<face>& faces
61 scalar maxAreaSqr = -GREAT;
67 if (maxAreaSqr < areaSqr)
86 half0Areas[facei] = half0[facei].areaNormal(half0.points());
94 half1Areas[facei] = half1[facei].areaNormal(half1.points());
118 if (
debug && owner())
123 Pout<<
"cyclicPolyPatch::calcTransforms : Writing " <<
name()
124 <<
" faces to OBJ file " << nm0 <<
endl;
125 writeOBJ(nm0, half0, half0.points());
129 fileName nm1(casePath/half1.name()+
"_faces.obj");
130 Pout<<
"cyclicPolyPatch::calcTransforms : Writing " << half1.name()
131 <<
" faces to OBJ file " << nm1 <<
endl;
132 writeOBJ(nm1, half1, half1.points());
135 OFstream str(casePath/
name()+
"_to_" + half1.name() +
".obj");
137 Pout<<
"cyclicPolyPatch::calcTransforms :"
138 <<
" Writing coupled face centres as lines to " << str.name()
142 const point&
p0 = half0Ctrs[i];
143 str <<
"v " <<
p0.x() <<
' ' <<
p0.y() <<
' ' <<
p0.z() <<
nl;
145 const point& p1 = half1Ctrs[i];
146 str <<
"v " << p1.x() <<
' ' << p1.y() <<
' ' << p1.z() <<
nl;
148 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
156 if (half0Ctrs.size() != half1Ctrs.size())
159 <<
"For patch " <<
name()
160 <<
" there are " << half0Ctrs.size()
161 <<
" face centres, for the neighbour patch " << neighbPatch().name()
162 <<
" there are " << half1Ctrs.size()
169 <<
"Patch " <<
name()
170 <<
" has transform type " << transformTypeNames[
transform()]
171 <<
", neighbour patch " << neighbPatchName()
172 <<
" has transform type "
173 << neighbPatch().transformTypeNames[neighbPatch().transform()]
180 if (half0Ctrs.size() > 0)
185 scalar maxAreaDiff = -GREAT;
186 label maxAreaFacei = -1;
190 scalar magSf =
mag(half0Areas[facei]);
191 scalar nbrMagSf =
mag(half1Areas[facei]);
192 scalar avSf = (magSf + nbrMagSf)/2.0;
194 if (magSf < ROOTVSMALL && nbrMagSf < ROOTVSMALL)
199 half0Normals[facei] =
point(1, 0, 0);
200 half1Normals[facei] = half0Normals[facei];
204 scalar areaDiff =
mag(magSf - nbrMagSf)/avSf;
206 if (areaDiff > maxAreaDiff)
208 maxAreaDiff = areaDiff;
209 maxAreaFacei = facei;
212 if (areaDiff > matchTolerance())
216 <<
" area does not match neighbour by "
218 <<
"% -- possible face ordering problem." <<
endl
219 <<
"patch:" <<
name()
220 <<
" my area:" << magSf
221 <<
" neighbour area:" << nbrMagSf
222 <<
" matching tolerance:" << matchTolerance()
224 <<
"Mesh face:" << start()+facei
225 <<
" fc:" << half0Ctrs[facei]
227 <<
"Neighbour fc:" << half1Ctrs[facei]
229 <<
"If you are certain your matching is correct"
230 <<
" you can increase the 'matchTolerance' setting"
231 <<
" in the patch dictionary in the boundary file."
233 <<
"Rerun with cyclic debug flag set"
238 half0Normals[facei] = half0Areas[facei] / magSf;
239 half1Normals[facei] = half1Areas[facei] / nbrMagSf;
248 Pout<<
"cyclicPolyPatch::calcTransforms :"
249 <<
" patch:" <<
name()
250 <<
" Max area error:" << 100*maxAreaDiff <<
"% at face:"
251 << maxAreaFacei <<
" at:" << half0Ctrs[maxAreaFacei]
252 <<
" coupled face at:" << half1Ctrs[maxAreaFacei]
263 vector n0 = findFaceMaxRadius(half0Ctrs);
264 vector n1 = -findFaceMaxRadius(half1Ctrs);
270 Pout<<
"cyclicPolyPatch::calcTransforms :"
271 <<
" patch:" <<
name()
272 <<
" Specified rotation :"
273 <<
" n0:" << n0 <<
" n1:" << n1
283 (n0 ^ rotationAxis_),
289 (-n1 ^ rotationAxis_),
292 const tensor revT(E1.T() & E0);
328 Pout<<
"cyclicPolyPatch::calcTransforms :"
329 <<
" patch:" <<
name()
330 <<
" Specified separation vector : "
331 << separationVector_ <<
endl;
335 const scalar avgTol =
average(half0Tols);
338 mag(separationVector_ + neighbPatch().separationVector_)
343 <<
"Specified separation vector " << separationVector_
344 <<
" differs by that of neighbouring patch "
345 << neighbPatch().separationVector_
346 <<
" by more than tolerance " << avgTol <<
endl
347 <<
"patch:" <<
name()
348 <<
" neighbour:" << neighbPatchName()
356 separation().size() != 1
357 ||
mag(separation()[0] - separationVector_) > avgTol
361 <<
"Specified separationVector " << separationVector_
362 <<
" differs from computed separation vector "
363 << separation() <<
endl
364 <<
"This probably means your geometry is not consistent"
365 <<
" with the specified separation and might lead"
366 <<
" to problems." <<
endl
367 <<
"Continuing with specified separation vector "
368 << separationVector_ <<
endl
369 <<
"patch:" <<
name()
370 <<
" neighbour:" << neighbPatchName()
389void Foam::cyclicPolyPatch::getCentresAndAnchors
401 half0Ctrs = pp0.faceCentres();
402 anchors0 = getAnchorPoints(pp0, pp0.points(),
transform());
403 half1Ctrs = pp1.faceCentres();
407 Pout<<
"cyclicPolyPatch::getCentresAndAnchors :"
408 <<
" patch:" <<
name() <<
nl
409 <<
"half0 untransformed faceCentres (avg) : "
411 <<
"half1 untransformed faceCentres (avg) : "
415 if (half0Ctrs.size())
421 vector n0 = findFaceMaxRadius(half0Ctrs);
422 vector n1 = -findFaceMaxRadius(half1Ctrs);
428 Pout<<
"cyclicPolyPatch::getCentresAndAnchors :"
429 <<
" patch:" <<
name()
430 <<
" Specified rotation :"
431 <<
" n0:" << n0 <<
" n1:" << n1
442 (n0 ^ rotationAxis_),
448 (-n1 ^ rotationAxis_),
451 const tensor revT(E1.T() & E0);
460 half0Ctrs[facei] - rotationCentre_
467 anchors0[facei] - rotationCentre_
480 Pout<<
"cyclicPolyPatch::getCentresAndAnchors :"
481 <<
" patch:" <<
name()
482 <<
"Specified translation : " << separationVector_
489 half0Ctrs -= separationVector_;
490 anchors0 -= separationVector_;
500 label max0I = findMaxArea(pp0.points(), pp0);
501 const vector n0 = pp0[max0I].unitNormal(pp0.points());
503 label max1I = findMaxArea(pp1.points(), pp1);
504 const vector n1 = pp1[max1I].unitNormal(pp1.points());
506 if (
mag(n0 & n1) < 1-matchTolerance())
510 Pout<<
"cyclicPolyPatch::getCentresAndAnchors :"
511 <<
" patch:" <<
name()
512 <<
" Detected rotation :"
513 <<
" n0:" << n0 <<
" n1:" << n1 <<
endl;
538 const point ctr0(
sum(pp0.localPoints())/pp0.nPoints());
539 const point ctr1(
sum(pp1.localPoints())/pp1.nPoints());
543 Pout<<
"cyclicPolyPatch::getCentresAndAnchors :"
544 <<
" patch:" <<
name()
545 <<
" Detected translation :"
546 <<
" n0:" << n0 <<
" n1:" << n1
547 <<
" ctr0:" << ctr0 <<
" ctr1:" << ctr1 <<
endl;
550 half0Ctrs += ctr1 - ctr0;
551 anchors0 += ctr1 - ctr0;
559 tols = matchTolerance()*calcFaceTol(pp1, pp1.points(), half1Ctrs);
570 const vectorField n((faceCentres - rotationCentre_) ^ rotationAxis_);
574 label facei =
findMax(magRadSqr);
578 Info<<
"findFaceMaxRadius(const pointField&) : patch: " <<
name() <<
nl
579 <<
" rotFace = " << facei <<
nl
580 <<
" point = " << faceCentres[facei] <<
nl
581 <<
" distance = " <<
Foam::sqrt(magRadSqr[facei])
598 const word& patchType,
606 rotationCentre_(
Zero),
607 separationVector_(
Zero),
608 coupledPointsPtr_(nullptr),
609 coupledEdgesPtr_(nullptr)
623 const word& neighbPatchName,
625 const vector& rotationAxis,
626 const point& rotationCentre,
627 const vector& separationVector
631 neighbPatchName_(neighbPatchName),
633 rotationAxis_(rotationAxis),
634 rotationCentre_(rotationCentre),
635 separationVector_(separationVector),
636 coupledPointsPtr_(nullptr),
637 coupledEdgesPtr_(nullptr)
650 const word& patchType
654 neighbPatchName_(
dict.getOrDefault(
"neighbourPatch",
word::null)),
658 rotationCentre_(
Zero),
659 separationVector_(
Zero),
660 coupledPointsPtr_(nullptr),
661 coupledEdgesPtr_(nullptr)
663 if (neighbPatchName_.empty() && !coupleGroup_.
good())
665 FatalIOErrorInFunction(dict)
666 <<
"No \"neighbourPatch\" provided." << endl
667 <<
"Is your mesh uptodate with split cyclics?" << endl
668 <<
"Run foamUpgradeCyclics to convert mesh and fields"
669 <<
" to split cyclics." << exit(FatalIOError);
672 if (neighbPatchName_ ==
name)
675 <<
"Neighbour patch name " << neighbPatchName_
676 <<
" cannot be the same as this patch " <<
name
684 dict.readEntry(
"rotationAxis", rotationAxis_);
685 dict.readEntry(
"rotationCentre", rotationCentre_);
687 scalar magRot =
mag(rotationAxis_);
691 <<
"Illegal rotationAxis " << rotationAxis_ <<
endl
692 <<
"Please supply a non-zero vector."
695 rotationAxis_ /= magRot;
701 dict.readEntry(
"separationVector", separationVector_);
717 const cyclicPolyPatch&
pp,
718 const polyBoundaryMesh& bm
721 coupledPolyPatch(
pp, bm),
722 neighbPatchName_(
pp.neighbPatchName_),
723 coupleGroup_(
pp.coupleGroup_),
725 rotationAxis_(
pp.rotationAxis_),
726 rotationCentre_(
pp.rotationCentre_),
727 separationVector_(
pp.separationVector_),
728 coupledPointsPtr_(nullptr),
729 coupledEdgesPtr_(nullptr)
739 const label nrbPatchID,
744 neighbPatchName_(
pp.neighbPatchName_),
745 coupleGroup_(
pp.coupleGroup_),
746 neighbPatchID_(nrbPatchID),
747 rotationAxis_(
pp.rotationAxis_),
748 rotationCentre_(
pp.rotationCentre_),
749 separationVector_(
pp.separationVector_),
750 coupledPointsPtr_(nullptr),
751 coupledEdgesPtr_(nullptr)
764 const label newStart,
765 const word& neighbName
769 neighbPatchName_(neighbName),
770 coupleGroup_(
pp.coupleGroup_),
772 rotationAxis_(
pp.rotationAxis_),
773 rotationCentre_(
pp.rotationCentre_),
774 separationVector_(
pp.separationVector_),
775 coupledPointsPtr_(nullptr),
776 coupledEdgesPtr_(nullptr)
778 if (neighbName ==
name())
781 <<
"Neighbour patch name " << neighbName
782 <<
" cannot be the same as this patch " <<
name()
793 const cyclicPolyPatch&
pp,
794 const polyBoundaryMesh& bm,
800 coupledPolyPatch(
pp, bm, index, mapAddressing, newStart),
801 neighbPatchName_(
pp.neighbPatchName_),
802 coupleGroup_(
pp.coupleGroup_),
804 rotationAxis_(
pp.rotationAxis_),
805 rotationCentre_(
pp.rotationCentre_),
806 separationVector_(
pp.separationVector_),
807 coupledPointsPtr_(nullptr),
808 coupledEdgesPtr_(nullptr)
822 if (neighbPatchName_.empty())
825 label
patchID = coupleGroup_.findOtherPatchID(*
this);
829 return neighbPatchName_;
835 if (neighbPatchID_ == -1)
837 neighbPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName());
839 if (neighbPatchID_ == -1)
842 <<
"Illegal neighbourPatch name " << neighbPatchName()
843 <<
endl <<
"Valid patch names are "
844 << this->boundaryMesh().names()
854 if (nbrPatch.neighbPatchName() !=
name())
857 <<
"Patch " <<
name()
858 <<
" specifies neighbour patch " << neighbPatchName()
859 <<
endl <<
" but that in return specifies "
860 << nbrPatch.neighbPatchName()
864 return neighbPatchID_;
883 else if (separated())
910 forwardT().size() == 1
924 else if (separated())
928 separation().size() == 1
930 : separation()[facei]
1021 coupledPointsPtr_.reset(
nullptr);
1022 coupledEdgesPtr_.reset(
nullptr);
1028 if (!coupledPointsPtr_)
1030 const faceList& nbrLocalFaces = neighbPatch().localFaces();
1031 const labelList& nbrMeshPoints = neighbPatch().meshPoints();
1040 forAll(*
this, patchFacei)
1042 const face& fA = localFaces()[patchFacei];
1043 const face& fB = nbrLocalFaces[patchFacei];
1047 label patchPointA = fA[indexA];
1049 if (coupledPoint[patchPointA] == -1)
1051 label indexB = (fB.
size() - indexA) % fB.
size();
1054 if (meshPoints()[patchPointA] != nbrMeshPoints[fB[indexB]])
1056 coupledPoint[patchPointA] = fB[indexB];
1063 auto& connected = *coupledPointsPtr_;
1066 label connectedI = 0;
1070 if (coupledPoint[i] != -1)
1072 connected[connectedI++] =
edge(i, coupledPoint[i]);
1076 connected.
setSize(connectedI);
1083 /
name() +
"_coupledPoints.obj"
1087 Pout<<
"Writing file " << str.name() <<
" with coordinates of "
1088 <<
"coupled points" <<
endl;
1092 const point& a =
points()[meshPoints()[connected[i][0]]];
1093 const point&
b =
points()[nbrMeshPoints[connected[i][1]]];
1095 str<<
"v " << a.x() <<
' ' << a.y() <<
' ' << a.z() <<
nl;
1096 str<<
"v " <<
b.x() <<
' ' <<
b.y() <<
' ' <<
b.z() <<
nl;
1099 str<<
"l " << vertI-1 <<
' ' << vertI <<
nl;
1103 return *coupledPointsPtr_;
1109 if (!coupledEdgesPtr_)
1111 const edgeList& pointCouples = coupledPoints();
1116 for (
const edge&
e : pointCouples)
1118 aToB.insert(
e[0],
e[1]);
1124 forAll(*
this, patchFacei)
1126 const labelList& fEdges = faceEdges()[patchFacei];
1128 for (
const label edgeI : fEdges)
1130 const edge&
e = edges()[edgeI];
1133 const auto fnd0 = aToB.cfind(
e[0]);
1136 const auto fnd1 = aToB.cfind(
e[1]);
1139 edgeMap.insert(
edge(fnd0(), fnd1()), edgeI);
1148 const labelList& nbrMp = neighbPatch.meshPoints();
1152 coupledEdgesPtr_.reset(
new edgeList(edgeMap.size()));
1153 auto& coupledEdges = *coupledEdgesPtr_;
1156 forAll(neighbPatch, patchFacei)
1158 const labelList& fEdges = neighbPatch.faceEdges()[patchFacei];
1160 for (
const label edgeI : fEdges)
1162 const edge&
e = neighbPatch.edges()[edgeI];
1165 auto iter = edgeMap.
find(
e);
1169 const label edgeA = iter.val();
1170 const edge& eA = edges()[edgeA];
1175 edge(mp[eA[0]], mp[eA[1]])
1176 !=
edge(nbrMp[
e[0]], nbrMp[
e[1]])
1179 coupledEdges[coupleI++] =
edge(edgeA, edgeI);
1183 edgeMap.
erase(iter);
1187 coupledEdges.setSize(coupleI);
1194 const edge&
e = coupledEdges[i];
1196 if (
e[0] < 0 ||
e[1] < 0)
1199 <<
"Problem : at position " << i
1200 <<
" illegal couple:" <<
e
1210 /
name() +
"_coupledEdges.obj"
1214 Pout<<
"Writing file " << str.name() <<
" with centres of "
1215 <<
"coupled edges" <<
endl;
1217 for (
const edge&
e : coupledEdges)
1219 const point& a = edges()[
e[0]].centre(localPoints());
1220 const point&
b = neighbPatch.edges()[
e[1]].centre
1222 neighbPatch.localPoints()
1225 str<<
"v " << a.x() <<
' ' << a.y() <<
' ' << a.z() <<
nl;
1226 str<<
"v " <<
b.x() <<
' ' <<
b.y() <<
' ' <<
b.z() <<
nl;
1229 str<<
"l " << vertI-1 <<
' ' << vertI <<
nl;
1233 return *coupledEdgesPtr_;
1247 ownerPatchPtr_.reset
1261 PstreamBuffers& pBufs,
1269 Pout<<
"order : of " <<
pp.size()
1270 <<
" faces of patch:" <<
name()
1271 <<
" neighbour:" << neighbPatchName()
1277 rotation.resize_nocopy(
pp.
size());
1292 faceMap[patchFacei] = patchFacei;
1305 getCentresAndAnchors
1318 Pout<<
"half0 transformed faceCentres (avg) : "
1320 <<
"half1 untransformed faceCentres (avg) : "
1334 if (!matchedAll ||
debug)
1340 /neighbPatch().
name()+
"_faces.obj"
1342 Pout<<
"cyclicPolyPatch::order : Writing neighbour"
1343 <<
" faces to OBJ file " << nm0 <<
endl;
1349 /
name()+
"_faces.obj"
1351 Pout<<
"cyclicPolyPatch::order : Writing my"
1352 <<
" faces to OBJ file " << nm1 <<
endl;
1358 /
name() +
"_faceCentres.obj"
1360 Pout<<
"cyclicPolyPatch::order : "
1361 <<
"Dumping currently found cyclic match as lines between"
1362 <<
" corresponding face centres to file " << ccStr.name()
1376 const point&
c1 = half1Ctrs[i];
1385 <<
"Patch:" <<
name() <<
" : "
1386 <<
"Cannot match vectors to faces on both sides of patch"
1388 <<
" Perhaps your faces do not match?"
1389 <<
" The obj files written contain the current match." <<
endl
1390 <<
" Continuing with incorrect face ordering from now on!"
1404 label newFacei =
faceMap[oldFacei];
1406 const point& wantedAnchor = anchors0[newFacei];
1408 rotation[newFacei] = getRotation
1416 if (rotation[newFacei] == -1)
1419 <<
"in patch " <<
name()
1421 <<
"Cannot find point on face " <<
pp[oldFacei]
1422 <<
" with vertices "
1424 <<
" that matches point " << wantedAnchor
1425 <<
" when matching the halves of processor patch " <<
name()
1426 <<
"Continuing with incorrect face ordering from now on!"
1433 ownerPatchPtr_.reset(
nullptr);
1439 if (
faceMap[facei] != facei || rotation[facei] != 0)
1453 if (!neighbPatchName_.empty())
1457 coupleGroup_.write(
os);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Map from edge (expressed as its endpoints) to value. Hashing (and ==) on an edge is symmetric.
Foam::label erase(InputIter first, InputIter last)
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
iterator find(const Key &key)
Find and return an iterator set at the hashed entry.
label size() const noexcept
The number of elements in table.
label size() const noexcept
The number of elements in the list.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
void setSize(label n)
Alias for resize().
A HashTable to objects of type <T> with a label key.
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
virtual const fileName & name() const override
Read/write access to the name of the stream.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name).
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
const edgeList & edges() const
const labelList & meshPoints() const
const Field< point_type > & localPoints() const
const Field< point_type > & points() const noexcept
Return reference to global points.
const labelListList & faceEdges() const
const List< face_type > & localFaces() const
Buffers for inter-processor communications streams (UOPstream, UIPstream).
static const SubList< face > & null() noexcept
A List with indirect addressing. Like IndirectList but does not store addressing.
label find(const T &val) const
Find index of the first occurrence of the value.
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
bool good() const noexcept
The patchGroup has a non-empty name.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
virtual transformType transform() const
Type of transform.
virtual bool separated() const
Are the planes separated.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual void write(Ostream &os) const
Write the polyPatch data as a dictionary.
virtual const vectorField & separation() const
If the planes are separated the separation vector.
coupledPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform)
Construct from components.
static label getRotation(const pointField &points, const face &f, const point &anchor, const scalar tol)
Get the number of vertices face f needs to be rotated such that.
virtual const tensorField & forwardT() const
Return face transformation tensor.
static void writeOBJ(Ostream &os, const point &pt)
Write point in OBJ format.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
const word & neighbPatchName() const
Neighbour patch name.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
virtual bool owner() const
Does this side own the patch ?
const edgeList & coupledEdges() const
Return connected edges (from patch local to neighbour patch local).
cyclicPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform=UNKNOWN)
Construct from components.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
const edgeList & coupledPoints() const
Return connected points (from patch local to neighbour patch local).
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not.
const vector & separationVector() const noexcept
Translation vector for translational cyclics.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
const cyclicPolyPatch & neighbPatch() const
virtual void transformPosition(pointField &l) const
Transform a patch-based position from other side to this side.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual ~cyclicPolyPatch()
Destructor.
const point & rotationCentre() const noexcept
Point on axis of rotation for rotational cyclics.
virtual void calcTransforms()
Recalculate the transformation tensors.
const vector & rotationAxis() const noexcept
Axis of rotation for rotational cyclics.
virtual label neighbPatchID() const
Neighbour patchID.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
label erase(const label vertex)
Remove an existing vertex from the edge and set its location to '-1'. A negative vertex label never r...
Smooth ATC in cells next to a set of patches supplied by type.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
A patch is a list of labels that address the faces in the global face list.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
const vectorField::subField faceAreas() const
Return face normals.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
const faceList::subList faces() const
Return mesh faces for the patch.
const vectorField::subField faceCentres() const
Return face centres.
virtual void movePoints(PstreamBuffers &, const pointField &p)
Correct patches after moving points.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
label start() const noexcept
Return start label of this patch in the polyMesh face list.
tmp< vectorField > faceCellCentres() const
Return face cell centres.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
const volScalarField & p0
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Determine correspondence between points. See below.
#define WarningInFunction
Report a warning using Foam::Warning.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
const dimensionedScalar mp
Proton mass.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
Namespace for handling debugging switches.
List< edge > edgeList
List of edge.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
List< label > labelList
A List of labels.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
messageStream Info
Information stream (stdout output on master, null elsewhere).
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field.
List< face > faceList
List of faces.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
constexpr scalar radToDeg() noexcept
Multiplication factor for radians to degrees conversion.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
vector point
Point is a vector.
List< bool > boolList
A List of bools.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
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.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
label findMax(const ListType &input, label start=0)
Linear search for the index of the max element, similar to std::max_element but for lists and returns...
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar acos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.