diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index c89c1f9d09..4f92ff17ad 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1048,7 +1048,7 @@ int main(int argc, char *argv[]) if (iter != fluentToFoamType.end()) { // See if we have a periodic and can derive the other side. - word neighbPatchName; + word nbrPatchName; if (iter() == cyclicPolyPatch::typeName) { // Periodic @@ -1056,22 +1056,22 @@ int main(int argc, char *argv[]) if (n != string::npos) { - neighbPatchName = name.substr(0, n) + "-SIDE-2"; + nbrPatchName = name.substr(0, n) + "-SIDE-2"; } else { n = name.rfind("-SIDE-2"); if (n != string::npos) { - neighbPatchName = name.substr(0, n) + "-SIDE-1"; + nbrPatchName = name.substr(0, n) + "-SIDE-1"; } } } - if (neighbPatchName.size()) + if (nbrPatchName.size()) { Info<< "Adding cyclicPolyPatch for Fluent zone " << name - << " with neighbour patch " << neighbPatchName + << " with neighbour patch " << nbrPatchName << endl; newPatches[patchi] = new cyclicPolyPatch @@ -1082,7 +1082,7 @@ int main(int argc, char *argv[]) patchi, mesh.boundaryMesh(), cyclicPolyPatch::typeName, - neighbPatchName, + nbrPatchName, cyclicPolyPatch::NOORDERING ); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 0b12ead36e..18c1c67552 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -554,7 +554,7 @@ void Foam::writeAMIWeightsSums(const polyMesh& mesh) { Info<< "Calculating AMI weights between owner patch: " << cpp.name() << " and neighbour patch: " - << cpp.neighbPatch().name() << endl; + << cpp.nbrPatch().name() << endl; writeAMIWeightsSum ( @@ -566,8 +566,8 @@ void Foam::writeAMIWeightsSums(const polyMesh& mesh) writeAMIWeightsSum ( mesh, - cpp.neighbPatch(), - cpp.neighbWeightsSum(), + cpp.nbrPatch(), + cpp.nbrWeightsSum(), fileName("postProcessing") / "tgt_" + tmName ); } diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index ee5fb16337..f16e0436fd 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -224,7 +224,7 @@ void writeCyclicMatchObjs(const fileName& prefix, const polyMesh& mesh) ); } - const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch(); + const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch(); { OFstream str(prefix+nbrPatch.name()+".obj"); Pout<< "Writing " << nbrPatch.name() @@ -306,7 +306,7 @@ void syncPoints pointField patchInfo(procPatch.nPoints(), nullValue); const labelList& meshPts = procPatch.meshPoints(); - const labelList& nbrPts = procPatch.neighbPoints(); + const labelList& nbrPts = procPatch.nbrPoints(); forAll(nbrPts, pointi) { @@ -395,7 +395,7 @@ void syncPoints const edgeList& coupledPoints = cycPatch.coupledPoints(); const labelList& meshPts = cycPatch.meshPoints(); - const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch(); + const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch(); const labelList& nbrMeshPts = nbrPatch.meshPoints(); pointField half0Values(coupledPoints.size()); @@ -782,7 +782,7 @@ int main(int argc, char *argv[]) != cyclicPolyPatch::TRANSLATIONAL ) { - const cyclicPolyPatch& nbr = cycpp.neighbPatch(); + const cyclicPolyPatch& nbr = cycpp.nbrPatch(); const_cast(cpp.transform().t()) = nbr[0].centre(mesh.points()) diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C index f7c731ef74..17242f0baf 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -186,7 +186,7 @@ void Foam::domainDecomposition::decomposeMesh(const fileName& dict) const labelUList& patchFaceCells = pp.faceCells(); const labelUList& nbrPatchFaceCells = - pp.neighbPatch().faceCells(); + pp.nbrPatch().faceCells(); forAll(patchFaceCells, facei) { diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionTemplates.C b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionTemplates.C index aa9fedfb6f..d0d918ddd5 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionTemplates.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ void Foam::domainDecomposition::processInterCyclics // cyclic: check opposite side on this processor const labelUList& patchFaceCells = pp.faceCells(); const labelUList& nbrPatchFaceCells = - pp.neighbPatch().faceCells(); + pp.nbrPatch().faceCells(); // Store old sizes. Used to detect which inter-proc patches // have been added to. diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C index 354a8a0d80..3060682be8 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C @@ -111,7 +111,7 @@ void Foam::cyclicPointPatchField::swapAddSeparated ) const { // Get neighbouring pointPatch - const cyclicPointPatch& nbrPatch = cyclicPatch_.neighbPatch(); + const cyclicPointPatch& nbrPatch = cyclicPatch_.nbrPatch(); if (cyclicPatch_.cyclicPatch().owner()) { diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C index 04da996bd2..22e47a654e 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -237,7 +237,7 @@ void Foam::LUscalarMatrix::convert const cyclicLduInterface& cycInterface = refCast(interface); - label nbrInt = cycInterface.neighbPatchID(); + label nbrInt = cycInterface.nbrPatchID(); const label* __restrict__ uPtr = interfaces[nbrInt].interface().faceCells().begin(); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H index 41ecf2af20..2316ae8067 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H @@ -67,12 +67,12 @@ public: // Access //- Return neighbour - virtual label neighbPatchID() const = 0; + virtual label nbrPatchID() const = 0; virtual bool owner() const = 0; //- Return processor number - virtual const cyclicLduInterface& neighbPatch() const = 0; + virtual const cyclicLduInterface& nbrPatch() const = 0; //- Return transformation between the coupled patches virtual const transformer& transform() const = 0; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C index 57149b0542..f8cf44ad02 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C @@ -114,7 +114,7 @@ void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix // Get neighbouring field scalarField pnf ( - cyclicInterface_.neighbPatch().interfaceInternalField(psiInternal) + cyclicInterface_.nbrPatch().interfaceInternalField(psiInternal) ); transformCoupleField(pnf, cmpt); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C index 27501a39d5..3160fc46e8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C @@ -79,9 +79,9 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface ) : GAMGInterface(index, coarseInterfaces), - neighbPatchID_ + nbrPatchID_ ( - refCast(fineInterface).neighbPatchID() + refCast(fineInterface).nbrPatchID() ), owner_(refCast(fineInterface).owner()), transform_(refCast(fineInterface).transform()) @@ -156,7 +156,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface ) : GAMGInterface(index, coarseInterfaces, is), - neighbPatchID_(readLabel(is)), + nbrPatchID_(readLabel(is)), owner_(readBool(is)), transform_(is) {} @@ -176,7 +176,7 @@ Foam::tmp Foam::cyclicGAMGInterface::internalFieldTransfer const labelUList& iF ) const { - const cyclicGAMGInterface& nbr = neighbPatch(); + const cyclicGAMGInterface& nbr = nbrPatch(); const labelUList& nbrFaceCells = nbr.faceCells(); tmp tpnf(new labelField(size())); @@ -194,7 +194,7 @@ Foam::tmp Foam::cyclicGAMGInterface::internalFieldTransfer void Foam::cyclicGAMGInterface::write(Ostream& os) const { GAMGInterface::write(os); - os << token::SPACE << neighbPatchID_ + os << token::SPACE << nbrPatchID_ << token::SPACE << owner_ << token::SPACE << transform_; } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H index 34314062a3..9ad3f8ce1b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H @@ -55,7 +55,7 @@ class cyclicGAMGInterface // Private Data //- Neighbour patch number - label neighbPatchID_; + label nbrPatchID_; //- Am I owner? bool owner_; @@ -116,9 +116,9 @@ public: //- Cyclic interface functions //- Return neighbour processor number - virtual label neighbPatchID() const + virtual label nbrPatchID() const { - return neighbPatchID_; + return nbrPatchID_; } virtual bool owner() const @@ -126,11 +126,11 @@ public: return owner_; } - virtual const cyclicGAMGInterface& neighbPatch() const + virtual const cyclicGAMGInterface& nbrPatch() const { return dynamic_cast ( - coarseInterfaces_[neighbPatchID()] + coarseInterfaces_[nbrPatchID()] ); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H index a004be98aa..f92c13676a 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H @@ -125,9 +125,9 @@ public: } //- Return neighbour point patch - const cyclicPointPatch& neighbPatch() const + const cyclicPointPatch& nbrPatch() const { - label patchi = cyclicPolyPatch_.neighbPatchID(); + label patchi = cyclicPolyPatch_.nbrPatchID(); const pointPatch& pp = this->boundaryMesh()[patchi]; return refCast(pp); } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C index 3493ca5b81..d562634ef7 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -706,7 +706,7 @@ void Foam::globalPoints::receivePatchPoints { const labelPairList infoB = addSendTransform ( - cycPatch.neighbPatchID(), + cycPatch.nbrPatchID(), procPoints_[procPointB()] ); @@ -841,7 +841,7 @@ Foam::labelList Foam::globalPoints::reverseMeshPoints const cyclicPolyPatch& pp ) { - const cyclicPolyPatch& nbrPatch = pp.neighbPatch(); + const cyclicPolyPatch& nbrPatch = pp.nbrPatch(); faceList masterFaces(nbrPatch.size()); diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index 595b1f2f9a..296132805c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -207,7 +207,7 @@ void Foam::polyBoundaryMesh::clearGeom() void Foam::polyBoundaryMesh::clearAddressing() { - neighbourEdgesPtr_.clear(); + nbrEdgesPtr_.clear(); patchIDPtr_.clear(); groupPatchIDsPtr_.clear(); @@ -270,7 +270,7 @@ void Foam::polyBoundaryMesh::calcGeometry() const Foam::List& -Foam::polyBoundaryMesh::neighbourEdges() const +Foam::polyBoundaryMesh::nbrEdges() const { if (Pstream::parRun()) { @@ -279,10 +279,10 @@ Foam::polyBoundaryMesh::neighbourEdges() const << " boundaries." << endl; } - if (!neighbourEdgesPtr_.valid()) + if (!nbrEdgesPtr_.valid()) { - neighbourEdgesPtr_.reset(new List(size())); - List& neighbourEdges = neighbourEdgesPtr_(); + nbrEdgesPtr_.reset(new List(size())); + List& nbrEdges = nbrEdgesPtr_(); // Initialize. label nEdgePairs = 0; @@ -290,11 +290,11 @@ Foam::polyBoundaryMesh::neighbourEdges() const { const polyPatch& pp = operator[](patchi); - neighbourEdges[patchi].setSize(pp.nEdges() - pp.nInternalEdges()); + nbrEdges[patchi].setSize(pp.nEdges() - pp.nInternalEdges()); - forAll(neighbourEdges[patchi], i) + forAll(nbrEdges[patchi], i) { - labelPair& edgeInfo = neighbourEdges[patchi][i]; + labelPair& edgeInfo = nbrEdges[patchi][i]; edgeInfo[0] = -1; edgeInfo[1] = -1; @@ -348,10 +348,10 @@ Foam::polyBoundaryMesh::neighbourEdges() const // Second occurrence. Store. const labelPair& edgeInfo = fnd(); - neighbourEdges[patchi][edgei - pp.nInternalEdges()] = + nbrEdges[patchi][edgei - pp.nInternalEdges()] = edgeInfo; - neighbourEdges[edgeInfo[0]][edgeInfo[1]] + nbrEdges[edgeInfo[0]][edgeInfo[1]] = labelPair(patchi, edgei - pp.nInternalEdges()); // Found all two occurrences of this edge so remove from @@ -374,11 +374,11 @@ Foam::polyBoundaryMesh::neighbourEdges() const { const polyPatch& pp = operator[](patchi); - const labelPairList& nbrEdges = neighbourEdges[patchi]; + const labelPairList& nbrEdgesp = nbrEdges[patchi]; - forAll(nbrEdges, i) + forAll(nbrEdgesp, i) { - const labelPair& edgeInfo = nbrEdges[i]; + const labelPair& edgeInfo = nbrEdgesp[i]; if (edgeInfo[0] == -1 || edgeInfo[1] == -1) { @@ -398,7 +398,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const } } - return neighbourEdgesPtr_(); + return nbrEdgesPtr_(); } @@ -1058,7 +1058,7 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p) void Foam::polyBoundaryMesh::updateMesh() { - neighbourEdgesPtr_.clear(); + nbrEdgesPtr_.clear(); patchIDPtr_.clear(); groupPatchIDsPtr_.clear(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H index 4f86b2bd49..5a923beb52 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,7 +73,7 @@ class polyBoundaryMesh mutable autoPtr> groupPatchIDsPtr_; //- Edges of neighbouring patches - mutable autoPtr> neighbourEdgesPtr_; + mutable autoPtr> nbrEdgesPtr_; // Private Member Functions @@ -149,7 +149,7 @@ public: // it as much as possible consistent with coupled patch addressing // (where coupling is by local patch face index). // Only valid for singly connected polyBoundaryMesh and not parallel - const List& neighbourEdges() const; + const List& nbrEdges() const; //- Return a list of patch names wordList names() const; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 0393a0ca2e..efac328797 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -51,10 +51,10 @@ namespace Foam void Foam::cyclicPolyPatch::calcTransformTensors ( - const vectorField& Cf, - const vectorField& Cr, - const vectorField& nf, - const vectorField& nr, + const vectorField& thisPatchCtrs, + const vectorField& nbrPatchCtrs, + const vectorField& thisPatchNormals, + const vectorField& nbrPatchNormals, const scalarField& smallDist, const scalar absTol, const orderingType ordering, @@ -65,11 +65,12 @@ void Foam::cyclicPolyPatch::calcTransformTensors { Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl << " transform:" << transformTypeNames[transform] << nl - << " (half)size:" << Cf.size() << nl + << " (half)size:" << thisPatchCtrs.size() << nl << " absTol:" << absTol << nl << " smallDist min:" << min(smallDist) << nl << " smallDist max:" << max(smallDist) << nl - << " sum(mag(nf & nr)):" << sum(mag(nf & nr)) << endl; + << " sum(mag(thisPatchNormals & nbrPatchNormals)):" + << sum(mag(thisPatchNormals & nbrPatchNormals)) << endl; } // Tolerance calculation. @@ -80,14 +81,14 @@ void Foam::cyclicPolyPatch::calcTransformTensors // Then the overall error of summing the normals is sqrt(size())*absTol // - separation calculation: pass in from the outside an allowable error. - if (Cf.size() == 0) + if (thisPatchCtrs.size() == 0) { // Dummy geometry. Assume non-separated, parallel. transform_ = transformer(); } else { - scalar error = absTol*Foam::sqrt(1.0*Cf.size()); + scalar error = absTol*Foam::sqrt(1.0*thisPatchCtrs.size()); if (debug) { @@ -100,19 +101,31 @@ void Foam::cyclicPolyPatch::calcTransformTensors || ( transform != TRANSLATIONAL && ordering != COINCIDENTFULLMATCH - && (sum(mag(nf & nr)) < Cf.size() - error) + && ( + sum(mag(thisPatchNormals & nbrPatchNormals)) + < thisPatchCtrs.size() - error + ) ) ) { // Type is rotation or unknown and normals not aligned - tensorField forwardT(Cf.size()); - tensorField reverseT(Cf.size()); + tensorField forwardT(thisPatchCtrs.size()); + tensorField reverseT(thisPatchCtrs.size()); forAll(forwardT, facei) { - forwardT[facei] = rotationTensor(-nr[facei], nf[facei]); - reverseT[facei] = rotationTensor(nf[facei], -nr[facei]); + forwardT[facei] = rotationTensor + ( + -nbrPatchNormals[facei], + thisPatchNormals[facei] + ); + + reverseT[facei] = rotationTensor + ( + thisPatchNormals[facei], + -nbrPatchNormals[facei] + ); } if (sum(mag(forwardT - forwardT[0])) > error) @@ -137,7 +150,7 @@ void Foam::cyclicPolyPatch::calcTransformTensors bool sameSeparation = true; bool doneWarning = false; - const vectorField separation(Cr - Cf); + const vectorField separation(nbrPatchCtrs - thisPatchCtrs); forAll(separation, facei) { @@ -228,29 +241,29 @@ void Foam::cyclicPolyPatch::calcTransforms() { if (size()) { - // Half0 - const cyclicPolyPatch& half0 = *this; - vectorField half0Areas(half0.size()); - forAll(half0, facei) + // thisPatch + const cyclicPolyPatch& thisPatch = *this; + vectorField thisPatchAreas(thisPatch.size()); + forAll(thisPatch, facei) { - half0Areas[facei] = half0[facei].area(half0.points()); + thisPatchAreas[facei] = thisPatch[facei].area(thisPatch.points()); } - // Half1 - const cyclicPolyPatch& half1 = neighbPatch(); - vectorField half1Areas(half1.size()); - forAll(half1, facei) + // nbrPatch + const cyclicPolyPatch& nbrPatch = this->nbrPatch(); + vectorField nbrPatchAreas(nbrPatch.size()); + forAll(nbrPatch, facei) { - half1Areas[facei] = half1[facei].area(half1.points()); + nbrPatchAreas[facei] = nbrPatch[facei].area(nbrPatch.points()); } calcTransforms ( - half0, - half0.faceCentres(), - half0Areas, - half1.faceCentres(), - half1Areas + thisPatch, + thisPatch.faceCentres(), + thisPatchAreas, + nbrPatch.faceCentres(), + nbrPatchAreas ); } } @@ -258,11 +271,11 @@ void Foam::cyclicPolyPatch::calcTransforms() void Foam::cyclicPolyPatch::calcTransforms ( - const primitivePatch& half0, - const pointField& half0Ctrs, - const vectorField& half0Areas, - const pointField& half1Ctrs, - const vectorField& half1Areas + const primitivePatch& thisPatch, + const pointField& thisPatchCtrs, + const vectorField& thisPatchAreas, + const pointField& nbrPatchCtrs, + const vectorField& nbrPatchAreas ) { if (debug && owner()) @@ -272,27 +285,28 @@ void Foam::cyclicPolyPatch::calcTransforms fileName nm0(casePath/name()+"_faces.obj"); Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name() << " faces to OBJ file " << nm0 << endl; - writeOBJ(nm0, half0, half0.points()); + writeOBJ(nm0, thisPatch, thisPatch.points()); } - const cyclicPolyPatch& half1 = neighbPatch(); + const cyclicPolyPatch& nbrPatch = this->nbrPatch(); { - fileName nm1(casePath/half1.name()+"_faces.obj"); - Pout<< "cyclicPolyPatch::calcTransforms : Writing " << half1.name() + fileName nm1(casePath/nbrPatch.name()+"_faces.obj"); + Pout<< "cyclicPolyPatch::calcTransforms : Writing " + << nbrPatch.name() << " faces to OBJ file " << nm1 << endl; - writeOBJ(nm1, half1, half1.points()); + writeOBJ(nm1, nbrPatch, nbrPatch.points()); } { - OFstream str(casePath/name()+"_to_" + half1.name() + ".obj"); + OFstream str(casePath/name()+"_to_" + nbrPatch.name() + ".obj"); label vertI = 0; Pout<< "cyclicPolyPatch::calcTransforms :" << " Writing coupled face centres as lines to " << str.name() << endl; - forAll(half0Ctrs, i) + forAll(thisPatchCtrs, i) { - const point& p0 = half0Ctrs[i]; + const point& p0 = thisPatchCtrs[i]; str << "v " << p0.x() << ' ' << p0.y() << ' ' << p0.z() << nl; vertI++; - const point& p1 = half1Ctrs[i]; + const point& p1 = nbrPatchCtrs[i]; str << "v " << p1.x() << ' ' << p1.y() << ' ' << p1.z() << nl; vertI++; str << "l " << vertI-1 << ' ' << vertI << nl; @@ -303,42 +317,42 @@ void Foam::cyclicPolyPatch::calcTransforms // Some sanity checks - if (half0Ctrs.size() != half1Ctrs.size()) + if (thisPatchCtrs.size() != nbrPatchCtrs.size()) { FatalErrorInFunction << "For patch " << name() - << " there are " << half0Ctrs.size() - << " face centres, for the neighbour patch " << neighbPatch().name() - << " there are " << half1Ctrs.size() + << " there are " << thisPatchCtrs.size() + << " face centres, for the neighbour patch " << nbrPatch().name() + << " there are " << nbrPatchCtrs.size() << exit(FatalError); } - if (transformType() != neighbPatch().transformType()) + if (transformType() != nbrPatch().transformType()) { FatalErrorInFunction << "Patch " << name() << " has transform type " << transformTypeNames[transformType()] - << ", neighbour patch " << neighbPatchName() + << ", neighbour patch " << nbrPatchName() << " has transform type " - << neighbPatch().transformTypeNames[neighbPatch().transformType()] + << nbrPatch().transformTypeNames[nbrPatch().transformType()] << exit(FatalError); } // Calculate transformation tensors - if (half0Ctrs.size() > 0) + if (thisPatchCtrs.size() > 0) { - vectorField half0Normals(half0Areas.size()); - vectorField half1Normals(half1Areas.size()); + vectorField thisPatchNormals(thisPatchAreas.size()); + vectorField nbrPatchNormals(nbrPatchAreas.size()); scalar maxAreaDiff = -great; label maxAreaFacei = -1; - forAll(half0, facei) + forAll(thisPatch, facei) { - scalar magSf = mag(half0Areas[facei]); - scalar nbrMagSf = mag(half1Areas[facei]); + scalar magSf = mag(thisPatchAreas[facei]); + scalar nbrMagSf = mag(nbrPatchAreas[facei]); scalar avSf = (magSf + nbrMagSf)/2.0; if (magSf < rootVSmall && nbrMagSf < rootVSmall) @@ -346,8 +360,8 @@ void Foam::cyclicPolyPatch::calcTransforms // Undetermined normal. Use dummy normal to force separation // check. (note use of sqrt(vSmall) since that is how mag // scales) - half0Normals[facei] = point(1, 0, 0); - half1Normals[facei] = half0Normals[facei]; + thisPatchNormals[facei] = point(1, 0, 0); + nbrPatchNormals[facei] = thisPatchNormals[facei]; } else { @@ -372,9 +386,9 @@ void Foam::cyclicPolyPatch::calcTransforms << " matching tolerance:" << matchTolerance() << endl << "Mesh face:" << start()+facei - << " fc:" << half0Ctrs[facei] + << " fc:" << thisPatchCtrs[facei] << endl - << "Neighbour fc:" << half1Ctrs[facei] + << "Neighbour fc:" << nbrPatchCtrs[facei] << endl << "If you are certain your matching is correct" << " you can increase the 'matchTolerance' setting" @@ -385,8 +399,8 @@ void Foam::cyclicPolyPatch::calcTransforms } else { - half0Normals[facei] = half0Areas[facei] / magSf; - half1Normals[facei] = half1Areas[facei] / nbrMagSf; + thisPatchNormals[facei] = thisPatchAreas[facei] / magSf; + nbrPatchNormals[facei] = nbrPatchAreas[facei] / nbrMagSf; } } } @@ -398,8 +412,8 @@ void Foam::cyclicPolyPatch::calcTransforms Pout<< "cyclicPolyPatch::calcTransforms :" << " patch:" << name() << " Max area error:" << 100*maxAreaDiff << "% at face:" - << maxAreaFacei << " at:" << half0Ctrs[maxAreaFacei] - << " coupled face at:" << half1Ctrs[maxAreaFacei] + << maxAreaFacei << " at:" << thisPatchCtrs[maxAreaFacei] + << " coupled face at:" << nbrPatchCtrs[maxAreaFacei] << endl; } @@ -410,8 +424,8 @@ void Foam::cyclicPolyPatch::calcTransforms { // Calculate using the given rotation axis and centre. Do not // use calculated normals. - vector n0 = findFaceMaxRadius(half0Ctrs); - vector n1 = -findFaceMaxRadius(half1Ctrs); + vector n0 = findFaceMaxRadius(thisPatchCtrs); + vector n1 = -findFaceMaxRadius(nbrPatchCtrs); n0 /= mag(n0) + vSmall; n1 /= mag(n1) + vSmall; @@ -455,31 +469,31 @@ void Foam::cyclicPolyPatch::calcTransforms << separation_ << endl; } - const scalarField half0Tols + const scalarField thisPatchTols ( matchTolerance() *calcFaceTol ( - half0, - half0.points(), - static_cast(half0Ctrs) + thisPatch, + thisPatch.points(), + static_cast(thisPatchCtrs) ) ); // Check that separation vectors are same. - const scalar avgTol = average(half0Tols); + const scalar avgTol = average(thisPatchTols); if ( - mag(separation_ + neighbPatch().separation_) > avgTol + mag(separation_ + nbrPatch().separation_) > avgTol ) { WarningInFunction << "Specified separation vector " << separation_ << " differs by that of neighbouring patch " - << neighbPatch().separation_ + << nbrPatch().separation_ << " by more than tolerance " << avgTol << endl << "patch:" << name() - << " neighbour:" << neighbPatchName() + << " neighbour:" << nbrPatchName() << endl; } @@ -488,24 +502,24 @@ void Foam::cyclicPolyPatch::calcTransforms } else { - const scalarField half0Tols + const scalarField thisPatchTols ( matchTolerance() *calcFaceTol ( - half0, - half0.points(), - static_cast(half0Ctrs) + thisPatch, + thisPatch.points(), + static_cast(thisPatchCtrs) ) ); calcTransformTensors ( - static_cast(half0Ctrs), - static_cast(half1Ctrs), - half0Normals, - half1Normals, - half0Tols, + thisPatchCtrs, + nbrPatchCtrs, + thisPatchNormals, + nbrPatchNormals, + thisPatchTols, matchTolerance(), ordering(), transformType() @@ -520,35 +534,35 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors const primitivePatch& pp0, const primitivePatch& pp1, - pointField& half0Ctrs, - pointField& half1Ctrs, + pointField& thisPatchCtrs, + pointField& nbrPatchCtrs, pointField& anchors0, scalarField& tols ) const { // Get geometric data on both halves. - half0Ctrs = pp0.faceCentres(); + thisPatchCtrs = pp0.faceCentres(); anchors0 = getAnchorPoints(pp0, pp0.points(), ordering()); - half1Ctrs = pp1.faceCentres(); + nbrPatchCtrs = pp1.faceCentres(); if (debug) { Pout<< "cyclicPolyPatch::getCentresAndAnchors :" << " patch:" << name() << nl - << "half0 untransformed faceCentres (avg) : " - << gAverage(half0Ctrs) << nl - << "half1 untransformed faceCentres (avg) : " - << gAverage(half1Ctrs) << endl; + << "thisPatch untransformed faceCentres (avg) : " + << gAverage(thisPatchCtrs) << nl + << "nbrPatch untransformed faceCentres (avg) : " + << gAverage(nbrPatchCtrs) << endl; } - if (half0Ctrs.size()) + if (thisPatchCtrs.size()) { switch (transformType()) { case ROTATIONAL: { - vector n0 = findFaceMaxRadius(half0Ctrs); - vector n1 = -findFaceMaxRadius(half1Ctrs); + vector n0 = findFaceMaxRadius(thisPatchCtrs); + vector n1 = -findFaceMaxRadius(nbrPatchCtrs); n0 /= mag(n0) + vSmall; n1 /= mag(n1) + vSmall; @@ -581,13 +595,13 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors const tensor revT(E1.T() & E0); // Rotation - forAll(half0Ctrs, facei) + forAll(thisPatchCtrs, facei) { - half0Ctrs[facei] = + thisPatchCtrs[facei] = Foam::transform ( revT, - half0Ctrs[facei] - rotationCentre_ + thisPatchCtrs[facei] - rotationCentre_ ) + rotationCentre_; anchors0[facei] = @@ -616,7 +630,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors // Note: getCentresAndAnchors gets called on the slave side // so separation is owner-slave points. - half0Ctrs -= separation_; + thisPatchCtrs -= separation_; anchors0 -= separation_; break; } @@ -647,12 +661,12 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors const tensor revT(rotationTensor(n0, -n1)); // Rotation - forAll(half0Ctrs, facei) + forAll(thisPatchCtrs, facei) { - half0Ctrs[facei] = Foam::transform + thisPatchCtrs[facei] = Foam::transform ( revT, - half0Ctrs[facei] + thisPatchCtrs[facei] ); anchors0[facei] = Foam::transform ( @@ -677,7 +691,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors << " ctr0:" << ctr0 << " ctr1:" << ctr1 << endl; } - half0Ctrs += ctr1 - ctr0; + thisPatchCtrs += ctr1 - ctr0; anchors0 += ctr1 - ctr0; } break; @@ -686,7 +700,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors } // Calculate typical distance per face - tols = matchTolerance()*calcFaceTol(pp1, pp1.points(), half1Ctrs); + tols = matchTolerance()*calcFaceTol(pp1, pp1.points(), nbrPatchCtrs); } @@ -730,8 +744,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch ) : coupledPolyPatch(name, size, start, index, bm, patchType, ordering), - neighbPatchName_(word::null), - neighbPatchID_(-1), + nbrPatchName_(word::null), + nbrPatchID_(-1), rotationAxis_(Zero), rotationCentre_(Zero), coupledPointsPtr_(nullptr), @@ -750,13 +764,13 @@ Foam::cyclicPolyPatch::cyclicPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const word& neighbPatchName, + const word& nbrPatchName, const orderingType ordering ) : coupledPolyPatch(name, size, start, index, bm, patchType, ordering), - neighbPatchName_(neighbPatchName), - neighbPatchID_(-1), + nbrPatchName_(nbrPatchName), + nbrPatchID_(-1), rotationAxis_(Zero), rotationCentre_(Zero), coupledPointsPtr_(nullptr), @@ -779,15 +793,15 @@ Foam::cyclicPolyPatch::cyclicPolyPatch : coupledPolyPatch(name, dict, index, bm, patchType, ordering), cyclicTransform(dict), - neighbPatchName_(dict.lookupOrDefault("neighbourPatch", word::null)), + nbrPatchName_(dict.lookupOrDefault("neighbourPatch", word::null)), coupleGroup_(dict), - neighbPatchID_(-1), + nbrPatchID_(-1), rotationAxis_(Zero), rotationCentre_(Zero), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) { - if (neighbPatchName_ == word::null && !coupleGroup_.valid()) + if (nbrPatchName_ == word::null && !coupleGroup_.valid()) { FatalIOErrorInFunction ( @@ -798,10 +812,10 @@ Foam::cyclicPolyPatch::cyclicPolyPatch << " to split cyclics." << exit(FatalIOError); } - if (neighbPatchName_ == name) + if (nbrPatchName_ == name) { FatalIOErrorInFunction(dict) - << "Neighbour patch name " << neighbPatchName_ + << "Neighbour patch name " << nbrPatchName_ << " cannot be the same as this patch " << name << exit(FatalIOError); } @@ -849,9 +863,9 @@ Foam::cyclicPolyPatch::cyclicPolyPatch : coupledPolyPatch(pp, bm), cyclicTransform(pp), - neighbPatchName_(pp.neighbPatchName_), + nbrPatchName_(pp.nbrPatchName_), coupleGroup_(pp.coupleGroup_), - neighbPatchID_(-1), + nbrPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), coupledPointsPtr_(nullptr), @@ -869,23 +883,23 @@ Foam::cyclicPolyPatch::cyclicPolyPatch const label index, const label newSize, const label newStart, - const word& neighbName + const word& neiName ) : coupledPolyPatch(pp, bm, index, newSize, newStart), cyclicTransform(pp), - neighbPatchName_(neighbName), + nbrPatchName_(neiName), coupleGroup_(pp.coupleGroup_), - neighbPatchID_(-1), + nbrPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) { - if (neighbName == name()) + if (neiName == name()) { FatalErrorInFunction - << "Neighbour patch name " << neighbName + << "Neighbour patch name " << neiName << " cannot be the same as this patch " << name() << exit(FatalError); } @@ -906,9 +920,9 @@ Foam::cyclicPolyPatch::cyclicPolyPatch : coupledPolyPatch(pp, bm, index, mapAddressing, newStart), cyclicTransform(pp), - neighbPatchName_(pp.neighbPatchName_), + nbrPatchName_(pp.nbrPatchName_), coupleGroup_(pp.coupleGroup_), - neighbPatchID_(-1), + nbrPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), coupledPointsPtr_(nullptr), @@ -927,29 +941,29 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::word& Foam::cyclicPolyPatch::neighbPatchName() const +const Foam::word& Foam::cyclicPolyPatch::nbrPatchName() const { - if (neighbPatchName_.empty()) + if (nbrPatchName_.empty()) { // Try and use patchGroup to find samplePatch and sampleRegion label patchID = coupleGroup_.findOtherPatchID(*this); - neighbPatchName_ = boundaryMesh()[patchID].name(); + nbrPatchName_ = boundaryMesh()[patchID].name(); } - return neighbPatchName_; + return nbrPatchName_; } -Foam::label Foam::cyclicPolyPatch::neighbPatchID() const +Foam::label Foam::cyclicPolyPatch::nbrPatchID() const { - if (neighbPatchID_ == -1) + if (nbrPatchID_ == -1) { - neighbPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName()); + nbrPatchID_ = this->boundaryMesh().findPatchID(nbrPatchName()); - if (neighbPatchID_ == -1) + if (nbrPatchID_ == -1) { FatalErrorInFunction - << "Illegal neighbourPatch name " << neighbPatchName() + << "Illegal neighbourPatch name " << nbrPatchName() << endl << "Valid patch names are " << this->boundaryMesh().names() << exit(FatalError); @@ -958,20 +972,20 @@ Foam::label Foam::cyclicPolyPatch::neighbPatchID() const // Check that it is a cyclic const cyclicPolyPatch& nbrPatch = refCast ( - this->boundaryMesh()[neighbPatchID_] + this->boundaryMesh()[nbrPatchID_] ); - if (nbrPatch.neighbPatchName() != name()) + if (nbrPatch.nbrPatchName() != name()) { WarningInFunction << "Patch " << name() - << " specifies neighbour patch " << neighbPatchName() + << " specifies neighbour patch " << nbrPatchName() << endl << " but that in return specifies " - << nbrPatch.neighbPatchName() + << nbrPatch.nbrPatchName() << endl; } } - return neighbPatchID_; + return nbrPatchID_; } @@ -1066,9 +1080,9 @@ void Foam::cyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) faceCentres(), faceAreas(), faceCellCentres(), - neighbPatch().faceCentres(), - neighbPatch().faceAreas(), - neighbPatch().faceCellCentres() + nbrPatch().faceCentres(), + nbrPatch().faceAreas(), + nbrPatch().faceCellCentres() ); } @@ -1112,8 +1126,8 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledPoints() const { if (!coupledPointsPtr_) { - const faceList& nbrLocalFaces = neighbPatch().localFaces(); - const labelList& nbrMeshPoints = neighbPatch().meshPoints(); + const faceList& nbrLocalFaces = nbrPatch().localFaces(); + const labelList& nbrMeshPoints = nbrPatch().meshPoints(); // Now all we know is that relative face index in *this is same // as coupled face in nbrPatch and also that the 0th vertex @@ -1233,8 +1247,8 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledEdges() const // Use the edgeMap to get the edges on the B side. - const cyclicPolyPatch& neighbPatch = this->neighbPatch(); - const labelList& nbrMp = neighbPatch.meshPoints(); + const cyclicPolyPatch& nbrPatch = this->nbrPatch(); + const labelList& nbrMp = nbrPatch.meshPoints(); const labelList& mp = meshPoints(); @@ -1243,15 +1257,15 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledEdges() const edgeList& coupledEdges = *coupledEdgesPtr_; label coupleI = 0; - forAll(neighbPatch, patchFacei) + forAll(nbrPatch, patchFacei) { - const labelList& fEdges = neighbPatch.faceEdges()[patchFacei]; + const labelList& fEdges = nbrPatch.faceEdges()[patchFacei]; forAll(fEdges, i) { label edgeI = fEdges[i]; - const edge& e = neighbPatch.edges()[edgeI]; + const edge& e = nbrPatch.edges()[edgeI]; // Look up A edge from HashTable. EdgeMap