Rationalised and standardised the naming of neighbour patch functions in the cyclic patch implementations
This commit is contained in:
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@ -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<vector&>(cpp.transform().t()) =
|
||||
nbr[0].centre(mesh.points())
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -111,7 +111,7 @@ void Foam::cyclicPointPatchField<Type>::swapAddSeparated
|
||||
) const
|
||||
{
|
||||
// Get neighbouring pointPatch
|
||||
const cyclicPointPatch& nbrPatch = cyclicPatch_.neighbPatch();
|
||||
const cyclicPointPatch& nbrPatch = cyclicPatch_.nbrPatch();
|
||||
|
||||
if (cyclicPatch_.cyclicPatch().owner())
|
||||
{
|
||||
|
||||
@ -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<const cyclicLduInterface>(interface);
|
||||
label nbrInt = cycInterface.neighbPatchID();
|
||||
label nbrInt = cycInterface.nbrPatchID();
|
||||
const label* __restrict__ uPtr =
|
||||
interfaces[nbrInt].interface().faceCells().begin();
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -114,7 +114,7 @@ void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
|
||||
// Get neighbouring field
|
||||
scalarField pnf
|
||||
(
|
||||
cyclicInterface_.neighbPatch().interfaceInternalField(psiInternal)
|
||||
cyclicInterface_.nbrPatch().interfaceInternalField(psiInternal)
|
||||
);
|
||||
|
||||
transformCoupleField(pnf, cmpt);
|
||||
|
||||
@ -79,9 +79,9 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
|
||||
)
|
||||
:
|
||||
GAMGInterface(index, coarseInterfaces),
|
||||
neighbPatchID_
|
||||
nbrPatchID_
|
||||
(
|
||||
refCast<const cyclicLduInterface>(fineInterface).neighbPatchID()
|
||||
refCast<const cyclicLduInterface>(fineInterface).nbrPatchID()
|
||||
),
|
||||
owner_(refCast<const cyclicLduInterface>(fineInterface).owner()),
|
||||
transform_(refCast<const cyclicLduInterface>(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::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
|
||||
const labelUList& iF
|
||||
) const
|
||||
{
|
||||
const cyclicGAMGInterface& nbr = neighbPatch();
|
||||
const cyclicGAMGInterface& nbr = nbrPatch();
|
||||
const labelUList& nbrFaceCells = nbr.faceCells();
|
||||
|
||||
tmp<labelField> tpnf(new labelField(size()));
|
||||
@ -194,7 +194,7 @@ Foam::tmp<Foam::labelField> 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_;
|
||||
}
|
||||
|
||||
@ -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<const cyclicGAMGInterface&>
|
||||
(
|
||||
coarseInterfaces_[neighbPatchID()]
|
||||
coarseInterfaces_[nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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<const cyclicPointPatch>(pp);
|
||||
}
|
||||
|
||||
@ -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());
|
||||
|
||||
|
||||
@ -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::labelPairList>&
|
||||
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<labelPairList>(size()));
|
||||
List<labelPairList>& neighbourEdges = neighbourEdgesPtr_();
|
||||
nbrEdgesPtr_.reset(new List<labelPairList>(size()));
|
||||
List<labelPairList>& 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();
|
||||
|
||||
|
||||
@ -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<HashTable<labelList, word>> groupPatchIDsPtr_;
|
||||
|
||||
//- Edges of neighbouring patches
|
||||
mutable autoPtr<List<labelPairList>> neighbourEdgesPtr_;
|
||||
mutable autoPtr<List<labelPairList>> 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<labelPairList>& neighbourEdges() const;
|
||||
const List<labelPairList>& nbrEdges() const;
|
||||
|
||||
//- Return a list of patch names
|
||||
wordList names() const;
|
||||
|
||||
@ -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<const pointField&>(half0Ctrs)
|
||||
thisPatch,
|
||||
thisPatch.points(),
|
||||
static_cast<const pointField&>(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<const pointField&>(half0Ctrs)
|
||||
thisPatch,
|
||||
thisPatch.points(),
|
||||
static_cast<const pointField&>(thisPatchCtrs)
|
||||
)
|
||||
);
|
||||
|
||||
calcTransformTensors
|
||||
(
|
||||
static_cast<const pointField&>(half0Ctrs),
|
||||
static_cast<const pointField&>(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<const cyclicPolyPatch>
|
||||
(
|
||||
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<label>::iterator iter = edgeMap.find(e);
|
||||
@ -1311,9 +1325,9 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledEdges() const
|
||||
const edge& e = coupledEdges[i];
|
||||
|
||||
const point& a = edges()[e[0]].centre(localPoints());
|
||||
const point& b = neighbPatch.edges()[e[1]].centre
|
||||
const point& b = nbrPatch.edges()[e[1]].centre
|
||||
(
|
||||
neighbPatch.localPoints()
|
||||
nbrPatch.localPoints()
|
||||
);
|
||||
|
||||
str<< "v " << a.x() << ' ' << a.y() << ' ' << a.z() << nl;
|
||||
@ -1362,7 +1376,7 @@ bool Foam::cyclicPolyPatch::order
|
||||
{
|
||||
Pout<< "order : of " << pp.size()
|
||||
<< " faces of patch:" << name()
|
||||
<< " neighbour:" << neighbPatchName()
|
||||
<< " neighbour:" << nbrPatchName()
|
||||
<< endl;
|
||||
}
|
||||
faceMap.setSize(pp.size());
|
||||
@ -1391,35 +1405,35 @@ bool Foam::cyclicPolyPatch::order
|
||||
else
|
||||
{
|
||||
// Get stored geometry from initOrder invocation of owner.
|
||||
const primitivePatch& pp0 = neighbPatch().ownerPatchPtr_();
|
||||
const primitivePatch& pp0 = nbrPatch().ownerPatchPtr_();
|
||||
|
||||
// Get geometric quantities
|
||||
pointField half0Ctrs, half1Ctrs, anchors0;
|
||||
pointField thisPatchCtrs, nbrPatchCtrs, anchors0;
|
||||
scalarField tols;
|
||||
getCentresAndAnchors
|
||||
(
|
||||
pp0,
|
||||
pp,
|
||||
|
||||
half0Ctrs,
|
||||
half1Ctrs,
|
||||
thisPatchCtrs,
|
||||
nbrPatchCtrs,
|
||||
anchors0,
|
||||
tols
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "half0 transformed faceCentres (avg) : "
|
||||
<< gAverage(half0Ctrs) << nl
|
||||
<< "half1 untransformed faceCentres (avg) : "
|
||||
<< gAverage(half1Ctrs) << endl;
|
||||
Pout<< "thisPatch transformed faceCentres (avg) : "
|
||||
<< gAverage(thisPatchCtrs) << nl
|
||||
<< "nbrPatch untransformed faceCentres (avg) : "
|
||||
<< gAverage(nbrPatchCtrs) << endl;
|
||||
}
|
||||
|
||||
// Geometric match of face centre vectors
|
||||
bool matchedAll = matchPoints
|
||||
(
|
||||
half1Ctrs,
|
||||
half0Ctrs,
|
||||
nbrPatchCtrs,
|
||||
thisPatchCtrs,
|
||||
tols,
|
||||
true,
|
||||
faceMap
|
||||
@ -1431,7 +1445,7 @@ bool Foam::cyclicPolyPatch::order
|
||||
fileName nm0
|
||||
(
|
||||
boundaryMesh().mesh().time().path()
|
||||
/neighbPatch().name()+"_faces.obj"
|
||||
/nbrPatch().name()+"_faces.obj"
|
||||
);
|
||||
Pout<< "cyclicPolyPatch::order : Writing neighbour"
|
||||
<< " faces to OBJ file " << nm0 << endl;
|
||||
@ -1457,17 +1471,17 @@ bool Foam::cyclicPolyPatch::order
|
||||
<< endl;
|
||||
|
||||
// Recalculate untransformed face centres
|
||||
// pointField rawHalf0Ctrs =
|
||||
// calcFaceCentres(half0Faces, pp.points());
|
||||
// pointField rawthisPatchCtrs =
|
||||
// calcFaceCentres(thisPatchFaces, pp.points());
|
||||
label vertI = 0;
|
||||
|
||||
forAll(half1Ctrs, i)
|
||||
forAll(nbrPatchCtrs, i)
|
||||
{
|
||||
if (faceMap[i] != -1)
|
||||
{
|
||||
// Write edge between c1 and c0
|
||||
const point& c0 = half0Ctrs[faceMap[i]];
|
||||
const point& c1 = half1Ctrs[i];
|
||||
const point& c0 = thisPatchCtrs[faceMap[i]];
|
||||
const point& c1 = nbrPatchCtrs[i];
|
||||
writeOBJ(ccStr, c0, c1, vertI);
|
||||
}
|
||||
}
|
||||
@ -1545,9 +1559,9 @@ void Foam::cyclicPolyPatch::write(Ostream& os) const
|
||||
{
|
||||
coupledPolyPatch::write(os);
|
||||
|
||||
if (!neighbPatchName_.empty())
|
||||
if (!nbrPatchName_.empty())
|
||||
{
|
||||
writeEntry(os, "neighbourPatch", neighbPatchName_);
|
||||
writeEntry(os, "neighbourPatch", nbrPatchName_);
|
||||
}
|
||||
|
||||
coupleGroup_.write(os);
|
||||
|
||||
@ -69,14 +69,14 @@ class cyclicPolyPatch
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Name of other half
|
||||
mutable word neighbPatchName_;
|
||||
//- Name of cyclic neighbour patch
|
||||
mutable word nbrPatchName_;
|
||||
|
||||
//- Optional patchGroup to find neighbPatch
|
||||
//- Optional patchGroup to find neighbour patch
|
||||
const coupleGroupIdentifier coupleGroup_;
|
||||
|
||||
//- Index of other half
|
||||
mutable label neighbPatchID_;
|
||||
//- Index of cyclic neighbour patch
|
||||
mutable label nbrPatchID_;
|
||||
|
||||
// Specified transformation
|
||||
|
||||
@ -94,12 +94,11 @@ class cyclicPolyPatch
|
||||
point rotationCentre_;
|
||||
|
||||
//- List of edges formed from connected points. e[0] is the point on
|
||||
// the first half of the patch, e[1] the corresponding point on the
|
||||
// second half.
|
||||
// this patch, e[1] the corresponding point on the cyclic neighbour.
|
||||
mutable edgeList* coupledPointsPtr_;
|
||||
|
||||
//- List of connected edges. e[0] is the edge on the first half of the
|
||||
// patch, e[1] the corresponding edge on the second half.
|
||||
//- List of connected edges. e[0] is the edge on this patch,
|
||||
// e[1] the corresponding edge on the cyclic neigbour
|
||||
mutable edgeList* coupledEdgesPtr_;
|
||||
|
||||
//- Temporary storage of owner side patch during ordering.
|
||||
@ -115,10 +114,10 @@ class cyclicPolyPatch
|
||||
// translational transform
|
||||
void 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 = UNKNOWN,
|
||||
@ -130,26 +129,24 @@ class cyclicPolyPatch
|
||||
|
||||
void 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
|
||||
);
|
||||
|
||||
// Face ordering
|
||||
|
||||
// Given a split of faces into left and right half calculate the
|
||||
// centres and anchor points. Transform the left points so they
|
||||
// align with the right ones
|
||||
// Transform the points of this patch so they align with those of
|
||||
// the cyclic neighbour
|
||||
void getCentresAndAnchors
|
||||
(
|
||||
const primitivePatch& pp0,
|
||||
const primitivePatch& pp1,
|
||||
|
||||
pointField& half0Ctrs,
|
||||
pointField& half1Ctrs,
|
||||
pointField& anchors0,
|
||||
const primitivePatch& thisPatch,
|
||||
const primitivePatch& nbrPatch,
|
||||
pointField& thisPatchCtrs,
|
||||
pointField& nbrPatchCtrs,
|
||||
pointField& anchors,
|
||||
scalarField& tols
|
||||
) const;
|
||||
|
||||
@ -236,7 +233,7 @@ public:
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType,
|
||||
const word& neighbPatchName,
|
||||
const word& nbrPatchName,
|
||||
const orderingType ordering
|
||||
);
|
||||
|
||||
@ -263,7 +260,7 @@ public:
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart,
|
||||
const word& neighbPatchName
|
||||
const word& nbrPatchName
|
||||
);
|
||||
|
||||
//- Construct given the original patch and a map
|
||||
@ -301,7 +298,7 @@ public:
|
||||
index,
|
||||
newSize,
|
||||
newStart,
|
||||
neighbPatchName_
|
||||
nbrPatchName_
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -330,14 +327,14 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Neighbour patch name
|
||||
const word& neighbPatchName() const;
|
||||
const word& nbrPatchName() const;
|
||||
|
||||
//- Neighbour patchID
|
||||
virtual label neighbPatchID() const;
|
||||
virtual label nbrPatchID() const;
|
||||
|
||||
virtual bool owner() const
|
||||
{
|
||||
return index() < neighbPatchID();
|
||||
return index() < nbrPatchID();
|
||||
}
|
||||
|
||||
virtual bool neighbour() const
|
||||
@ -345,9 +342,9 @@ public:
|
||||
return !owner();
|
||||
}
|
||||
|
||||
const cyclicPolyPatch& neighbPatch() const
|
||||
const cyclicPolyPatch& nbrPatch() const
|
||||
{
|
||||
const polyPatch& pp = this->boundaryMesh()[neighbPatchID()];
|
||||
const polyPatch& pp = this->boundaryMesh()[nbrPatchID()];
|
||||
return refCast<const cyclicPolyPatch>(pp);
|
||||
}
|
||||
|
||||
@ -379,11 +376,11 @@ public:
|
||||
label transformGlobalFace(const label facei) const
|
||||
{
|
||||
label offset = facei-start();
|
||||
label neighbStart = neighbPatch().start();
|
||||
label neiStart = nbrPatch().start();
|
||||
|
||||
if (offset >= 0 && offset < size())
|
||||
{
|
||||
return neighbStart+offset;
|
||||
return neiStart+offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -107,10 +107,10 @@ public:
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart,
|
||||
const word& neighbPatchName
|
||||
const word& nbrPatchName
|
||||
)
|
||||
:
|
||||
cyclicPolyPatch(pp, bm, index, newSize, newStart, neighbPatchName)
|
||||
cyclicPolyPatch(pp, bm, index, newSize, newStart, nbrPatchName)
|
||||
{}
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ public:
|
||||
index,
|
||||
newSize,
|
||||
newStart,
|
||||
neighbPatchName()
|
||||
nbrPatchName()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -172,8 +172,8 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
|
||||
Foam::processorPolyPatch::~processorPolyPatch()
|
||||
{
|
||||
neighbPointsPtr_.clear();
|
||||
neighbEdgesPtr_.clear();
|
||||
nbrPointsPtr_.clear();
|
||||
nbrEdgesPtr_.clear();
|
||||
}
|
||||
|
||||
|
||||
@ -385,8 +385,8 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
// For completeness
|
||||
polyPatch::updateMesh(pBufs);
|
||||
|
||||
neighbPointsPtr_.clear();
|
||||
neighbEdgesPtr_.clear();
|
||||
nbrPointsPtr_.clear();
|
||||
nbrEdgesPtr_.clear();
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
@ -419,8 +419,8 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
// Convert points.
|
||||
// ~~~~~~~~~~~~~~~
|
||||
|
||||
neighbPointsPtr_.reset(new labelList(nPoints(), -1));
|
||||
labelList& neighbPoints = neighbPointsPtr_();
|
||||
nbrPointsPtr_.reset(new labelList(nPoints(), -1));
|
||||
labelList& nbrPoints = nbrPointsPtr_();
|
||||
|
||||
forAll(nbrPointFace, nbrPointi)
|
||||
{
|
||||
@ -430,32 +430,32 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
label index = (f.size() - nbrPointIndex[nbrPointi]) % f.size();
|
||||
label patchPointi = f[index];
|
||||
|
||||
if (neighbPoints[patchPointi] == -1)
|
||||
if (nbrPoints[patchPointi] == -1)
|
||||
{
|
||||
// First reference of point
|
||||
neighbPoints[patchPointi] = nbrPointi;
|
||||
nbrPoints[patchPointi] = nbrPointi;
|
||||
}
|
||||
else if (neighbPoints[patchPointi] >= 0)
|
||||
else if (nbrPoints[patchPointi] >= 0)
|
||||
{
|
||||
// Point already visited. Mark as duplicate.
|
||||
neighbPoints[patchPointi] = -2;
|
||||
nbrPoints[patchPointi] = -2;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset all duplicate entries to -1.
|
||||
forAll(neighbPoints, patchPointi)
|
||||
forAll(nbrPoints, patchPointi)
|
||||
{
|
||||
if (neighbPoints[patchPointi] == -2)
|
||||
if (nbrPoints[patchPointi] == -2)
|
||||
{
|
||||
neighbPoints[patchPointi] = -1;
|
||||
nbrPoints[patchPointi] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert edges.
|
||||
// ~~~~~~~~~~~~~~
|
||||
|
||||
neighbEdgesPtr_.reset(new labelList(nEdges(), -1));
|
||||
labelList& neighbEdges = neighbEdgesPtr_();
|
||||
nbrEdgesPtr_.reset(new labelList(nEdges(), -1));
|
||||
labelList& nbrEdges = nbrEdgesPtr_();
|
||||
|
||||
forAll(nbrEdgeFace, nbrEdgeI)
|
||||
{
|
||||
@ -464,24 +464,24 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
label index = (f.size() - nbrEdgeIndex[nbrEdgeI] - 1) % f.size();
|
||||
label patchEdgeI = f[index];
|
||||
|
||||
if (neighbEdges[patchEdgeI] == -1)
|
||||
if (nbrEdges[patchEdgeI] == -1)
|
||||
{
|
||||
// First reference of edge
|
||||
neighbEdges[patchEdgeI] = nbrEdgeI;
|
||||
nbrEdges[patchEdgeI] = nbrEdgeI;
|
||||
}
|
||||
else if (neighbEdges[patchEdgeI] >= 0)
|
||||
else if (nbrEdges[patchEdgeI] >= 0)
|
||||
{
|
||||
// Edge already visited. Mark as duplicate.
|
||||
neighbEdges[patchEdgeI] = -2;
|
||||
nbrEdges[patchEdgeI] = -2;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset all duplicate entries to -1.
|
||||
forAll(neighbEdges, patchEdgeI)
|
||||
forAll(nbrEdges, patchEdgeI)
|
||||
{
|
||||
if (neighbEdges[patchEdgeI] == -2)
|
||||
if (nbrEdges[patchEdgeI] == -2)
|
||||
{
|
||||
neighbEdges[patchEdgeI] = -1;
|
||||
nbrEdges[patchEdgeI] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -492,27 +492,27 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::processorPolyPatch::neighbPoints() const
|
||||
const Foam::labelList& Foam::processorPolyPatch::nbrPoints() const
|
||||
{
|
||||
if (!neighbPointsPtr_.valid())
|
||||
if (!nbrPointsPtr_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No extended addressing calculated for patch " << name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
return neighbPointsPtr_();
|
||||
return nbrPointsPtr_();
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::processorPolyPatch::neighbEdges() const
|
||||
const Foam::labelList& Foam::processorPolyPatch::nbrEdges() const
|
||||
{
|
||||
if (!neighbEdgesPtr_.valid())
|
||||
if (!nbrEdgesPtr_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No extended addressing calculated for patch " << name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
return neighbEdgesPtr_();
|
||||
return nbrEdgesPtr_();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -72,12 +72,12 @@ class processorPolyPatch
|
||||
vectorField neighbFaceCellCentres_;
|
||||
|
||||
//- Corresponding neighbouring local point label for every local point
|
||||
// (so localPoints()[i] == neighb.localPoints()[neighbPoints_[i]])
|
||||
mutable autoPtr<labelList> neighbPointsPtr_;
|
||||
// (so localPoints()[i] == neighb.localPoints()[nbrPoints_[i]])
|
||||
mutable autoPtr<labelList> nbrPointsPtr_;
|
||||
|
||||
//- Corresponding neighbouring local edge label for every local edge
|
||||
// (so edges()[i] == neighb.edges()[neighbEdges_[i]])
|
||||
mutable autoPtr<labelList> neighbEdgesPtr_;
|
||||
// (so edges()[i] == neighb.edges()[nbrEdges_[i]])
|
||||
mutable autoPtr<labelList> nbrEdgesPtr_;
|
||||
|
||||
protected:
|
||||
|
||||
@ -313,10 +313,10 @@ public:
|
||||
}
|
||||
|
||||
//- Return neighbour point labels. WIP.
|
||||
const labelList& neighbPoints() const;
|
||||
const labelList& nbrPoints() const;
|
||||
|
||||
//- Return neighbour edge labels. WIP.
|
||||
const labelList& neighbEdges() const;
|
||||
const labelList& nbrEdges() const;
|
||||
|
||||
//- Return message tag to use for communication
|
||||
virtual int tag() const
|
||||
|
||||
@ -200,7 +200,7 @@ int Foam::processorCyclicPolyPatch::tag() const
|
||||
}
|
||||
else
|
||||
{
|
||||
tag_ = Hash<word>()(cycPatch.neighbPatch().name()) % 32768u;
|
||||
tag_ = Hash<word>()(cycPatch.nbrPatch().name()) % 32768u;
|
||||
}
|
||||
|
||||
if (tag_ == Pstream::msgType() || tag_ == -1)
|
||||
@ -271,7 +271,7 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||
neighbFaceCellCentres()
|
||||
);
|
||||
|
||||
const_cast<cyclicPolyPatch&>(pp.neighbPatch()).calcGeometry
|
||||
const_cast<cyclicPolyPatch&>(pp.nbrPatch()).calcGeometry
|
||||
(
|
||||
*this,
|
||||
neighbFaceCentres(),
|
||||
|
||||
@ -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
|
||||
@ -147,7 +147,7 @@ void Foam::syncTools::syncPointMap
|
||||
// Get data per patchPoint in neighbouring point numbers.
|
||||
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
const labelList& nbrPts = procPatch.neighbPoints();
|
||||
const labelList& nbrPts = procPatch.nbrPoints();
|
||||
|
||||
// Extract local values. Create map from nbrPoint to value.
|
||||
// Note: how small initial size?
|
||||
@ -219,7 +219,7 @@ void Foam::syncTools::syncPointMap
|
||||
{
|
||||
// Owner does all.
|
||||
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
||||
const labelList& meshPtsA = cycPatch.meshPoints();
|
||||
const labelList& meshPtsB = nbrPatch.meshPoints();
|
||||
@ -429,7 +429,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
|
||||
const edgeList& edges = procPatch.edges();
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
const labelList& nbrPts = procPatch.neighbPoints();
|
||||
const labelList& nbrPts = procPatch.nbrPoints();
|
||||
|
||||
EdgeMap<T> patchInfo(edges.size() / 20);
|
||||
|
||||
@ -516,7 +516,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
const edgeList& coupledEdges = cycPatch.coupledEdges();
|
||||
const labelList& meshPtsA = cycPatch.meshPoints();
|
||||
const edgeList& edgesA = cycPatch.edges();
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||
const labelList& meshPtsB = nbrPatch.meshPoints();
|
||||
const edgeList& edgesB = nbrPatch.edges();
|
||||
|
||||
@ -830,7 +830,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
// Field<T> patchInfo(procPatch.nPoints());
|
||||
//
|
||||
// const labelList& meshPts = procPatch.meshPoints();
|
||||
// const labelList& nbrPts = procPatch.neighbPoints();
|
||||
// const labelList& nbrPts = procPatch.nbrPoints();
|
||||
//
|
||||
// forAll(nbrPts, pointi)
|
||||
// {
|
||||
@ -892,7 +892,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
//
|
||||
// const edgeList& coupledPoints = cycPatch.coupledPoints();
|
||||
// const labelList& meshPts = cycPatch.meshPoints();
|
||||
// const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||
// const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||
// const labelList& nbrMeshPoints = nbrPatch.meshPoints();
|
||||
//
|
||||
// Field<T> half0Values(coupledPoints.size());
|
||||
@ -1381,7 +1381,7 @@ void Foam::syncTools::syncBoundaryFaceList
|
||||
if (cycPatch.owner())
|
||||
{
|
||||
// Owner does all.
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||
label ownStart = cycPatch.start()-mesh.nInternalFaces();
|
||||
label nbrStart = nbrPatch.start()-mesh.nInternalFaces();
|
||||
|
||||
@ -1506,7 +1506,7 @@ void Foam::syncTools::syncFaceList
|
||||
if (cycPatch.owner())
|
||||
{
|
||||
// Owner does all.
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||
|
||||
for (label i = 0; i < cycPatch.size(); i++)
|
||||
{
|
||||
|
||||
@ -126,7 +126,7 @@ Foam::cyclicFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
const Field<Type>& iField = this->primitiveField();
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
||||
cyclicPatch().cyclicPatch().nbrPatch().faceCells();
|
||||
|
||||
tmp<Field<Type>> tpnf(new Field<Type>(this->size()));
|
||||
Field<Type>& pnf = tpnf.ref();
|
||||
@ -143,7 +143,7 @@ Foam::cyclicFvPatchField<Type>::patchNeighbourField() const
|
||||
|
||||
template<class Type>
|
||||
const Foam::cyclicFvPatchField<Type>&
|
||||
Foam::cyclicFvPatchField<Type>::neighbourPatchField() const
|
||||
Foam::cyclicFvPatchField<Type>::nbrPatchField() const
|
||||
{
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld =
|
||||
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
||||
@ -153,7 +153,7 @@ Foam::cyclicFvPatchField<Type>::neighbourPatchField() const
|
||||
|
||||
return refCast<const cyclicFvPatchField<Type>>
|
||||
(
|
||||
fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
|
||||
fld.boundaryField()[this->cyclicPatch().nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ void Foam::cyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
||||
cyclicPatch().cyclicPatch().nbrPatch().faceCells();
|
||||
|
||||
scalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
@ -196,7 +196,7 @@ void Foam::cyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
||||
cyclicPatch().cyclicPatch().nbrPatch().faceCells();
|
||||
|
||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ public:
|
||||
tmp<Field<Type>> patchNeighbourField() const;
|
||||
|
||||
//- Return reference to neighbour patchField
|
||||
const cyclicFvPatchField<Type>& neighbourPatchField() const;
|
||||
const cyclicFvPatchField<Type>& nbrPatchField() const;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
|
||||
@ -142,7 +142,7 @@ Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
const Field<Type>& iField = this->primitiveField();
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
||||
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().faceCells();
|
||||
|
||||
Field<Type> pnf(iField, nbrFaceCells);
|
||||
|
||||
@ -164,7 +164,7 @@ Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
||||
|
||||
template<class Type>
|
||||
const Foam::cyclicAMIFvPatchField<Type>&
|
||||
Foam::cyclicAMIFvPatchField<Type>::neighbourPatchField() const
|
||||
Foam::cyclicAMIFvPatchField<Type>::nbrPatchField() const
|
||||
{
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld =
|
||||
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
||||
@ -174,7 +174,7 @@ Foam::cyclicAMIFvPatchField<Type>::neighbourPatchField() const
|
||||
|
||||
return refCast<const cyclicAMIFvPatchField<Type>>
|
||||
(
|
||||
fld.boundaryField()[cyclicAMIPatch_.neighbPatchID()]
|
||||
fld.boundaryField()[cyclicAMIPatch_.nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
||||
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().faceCells();
|
||||
|
||||
scalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
@ -227,7 +227,7 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
||||
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().faceCells();
|
||||
|
||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ public:
|
||||
virtual tmp<Field<Type>> patchNeighbourField() const;
|
||||
|
||||
//- Return reference to neighbour patchField
|
||||
const cyclicAMIFvPatchField<Type>& neighbourPatchField() const;
|
||||
const cyclicAMIFvPatchField<Type>& nbrPatchField() const;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
|
||||
@ -96,7 +96,7 @@ Foam::jumpCyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
const Field<Type>& iField = this->primitiveField();
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().nbrPatch().faceCells();
|
||||
|
||||
Field<Type> pnf(iField, nbrFaceCells);
|
||||
tmp<Field<Type>> tpnf;
|
||||
@ -151,7 +151,7 @@ void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().nbrPatch().faceCells();
|
||||
|
||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,7 +49,7 @@ void Foam::jumpCyclicAMIFvPatchField<scalar>::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().nbrPatch().faceCells();
|
||||
|
||||
scalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
|
||||
@ -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
|
||||
@ -119,7 +119,7 @@ Foam::tmp<Foam::Field<Type>> Foam::fixedJumpFvPatchField<Type>::jump() const
|
||||
{
|
||||
return refCast<const fixedJumpFvPatchField<Type>>
|
||||
(
|
||||
this->neighbourPatchField()
|
||||
this->nbrPatchField()
|
||||
).jump();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -120,7 +120,7 @@ Foam::tmp<Foam::Field<Type>> Foam::fixedJumpAMIFvPatchField<Type>::jump() const
|
||||
const fixedJumpAMIFvPatchField& nbrPatch =
|
||||
refCast<const fixedJumpAMIFvPatchField<Type>>
|
||||
(
|
||||
this->neighbourPatchField()
|
||||
this->nbrPatchField()
|
||||
);
|
||||
|
||||
if (this->cyclicAMIPatch().applyLowWeightCorrection())
|
||||
|
||||
@ -94,9 +94,9 @@ public:
|
||||
}
|
||||
|
||||
//- Return neighbour
|
||||
virtual label neighbPatchID() const
|
||||
virtual label nbrPatchID() const
|
||||
{
|
||||
return cyclicPolyPatch_.neighbPatchID();
|
||||
return cyclicPolyPatch_.nbrPatchID();
|
||||
}
|
||||
|
||||
virtual bool owner() const
|
||||
@ -105,11 +105,11 @@ public:
|
||||
}
|
||||
|
||||
//- Return processor number
|
||||
virtual const cyclicFvPatch& neighbPatch() const
|
||||
virtual const cyclicFvPatch& nbrPatch() const
|
||||
{
|
||||
return refCast<const cyclicFvPatch>
|
||||
(
|
||||
this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
|
||||
this->boundaryMesh()[cyclicPolyPatch_.nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public:
|
||||
{
|
||||
return refCast<const cyclicFvPatch>
|
||||
(
|
||||
this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
|
||||
this->boundaryMesh()[cyclicPolyPatch_.nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -117,7 +117,7 @@ public:
|
||||
{
|
||||
return refCast<const cyclicACMIFvPatch>
|
||||
(
|
||||
this->boundaryMesh()[this->cyclicAMIPatch().neighbPatchID()]
|
||||
this->boundaryMesh()[this->cyclicAMIPatch().nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -101,9 +101,9 @@ public:
|
||||
}
|
||||
|
||||
//- Return the neighbour patch ID
|
||||
virtual label neighbPatchID() const
|
||||
virtual label nbrPatchID() const
|
||||
{
|
||||
return cyclicAMIPolyPatch_.neighbPatchID();
|
||||
return cyclicAMIPolyPatch_.nbrPatchID();
|
||||
}
|
||||
|
||||
//- Is this side the owner?
|
||||
@ -113,11 +113,11 @@ public:
|
||||
}
|
||||
|
||||
//- Return the neighbour patch
|
||||
virtual const cyclicAMIFvPatch& neighbPatch() const
|
||||
virtual const cyclicAMIFvPatch& nbrPatch() const
|
||||
{
|
||||
return refCast<const cyclicAMIFvPatch>
|
||||
(
|
||||
this->boundaryMesh()[cyclicAMIPolyPatch_.neighbPatchID()]
|
||||
this->boundaryMesh()[cyclicAMIPolyPatch_.nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ public:
|
||||
{
|
||||
return refCast<const cyclicAMIFvPatch>
|
||||
(
|
||||
this->boundaryMesh()[cyclicAMIPolyPatch_.neighbPatchID()]
|
||||
this->boundaryMesh()[cyclicAMIPolyPatch_.nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -115,9 +115,9 @@ public:
|
||||
// Access
|
||||
|
||||
//- Return neighbour
|
||||
virtual label neighbPatchID() const
|
||||
virtual label nbrPatchID() const
|
||||
{
|
||||
return regionCoupledBase_.neighbPatchID();
|
||||
return regionCoupledBase_.nbrPatchID();
|
||||
}
|
||||
|
||||
//- Is it the owner?
|
||||
@ -127,13 +127,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return regionCoupledBase neighb Patch
|
||||
virtual const regionCoupledBaseFvPatch& neighbPatch() const
|
||||
virtual const regionCoupledBaseFvPatch& nbrPatch() const
|
||||
{
|
||||
return refCast<const regionCoupledBaseFvPatch>
|
||||
(
|
||||
nbrFvMesh().boundary()
|
||||
[
|
||||
regionCoupledBase_.neighbPatchID()
|
||||
regionCoupledBase_.nbrPatchID()
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -181,7 +181,7 @@ public:
|
||||
(
|
||||
nbrFvMesh().boundary()
|
||||
[
|
||||
regionCoupledBase_.neighbPatchID()
|
||||
regionCoupledBase_.nbrPatchID()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -70,7 +70,7 @@ class regionCoupledFvPatch
|
||||
(
|
||||
nbrFvMesh().boundary()
|
||||
[
|
||||
neighbPatchID()
|
||||
nbrPatchID()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -70,7 +70,7 @@ class regionCoupledWallFvPatch
|
||||
{
|
||||
return refCast<const regionCoupledWallFvPatch>
|
||||
(
|
||||
nbrFvMesh().boundary()[neighbPatchID()]
|
||||
nbrFvMesh().boundary()[nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -265,7 +265,7 @@ void Foam::particle::hitCyclicPatch(TrackCloudType&, trackingData&)
|
||||
{
|
||||
const cyclicPolyPatch& cpp =
|
||||
static_cast<const cyclicPolyPatch&>(mesh_.boundaryMesh()[patch()]);
|
||||
const cyclicPolyPatch& receiveCpp = cpp.neighbPatch();
|
||||
const cyclicPolyPatch& receiveCpp = cpp.nbrPatch();
|
||||
|
||||
// Set the topology
|
||||
facei_ = tetFacei_ = cpp.transformGlobalFace(facei_);
|
||||
@ -299,7 +299,7 @@ void Foam::particle::hitCyclicAMIPatch
|
||||
{
|
||||
const cyclicAMIPolyPatch& cpp =
|
||||
static_cast<const cyclicAMIPolyPatch&>(mesh_.boundaryMesh()[patch()]);
|
||||
const cyclicAMIPolyPatch& receiveCpp = cpp.neighbPatch();
|
||||
const cyclicAMIPolyPatch& receiveCpp = cpp.nbrPatch();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -371,7 +371,7 @@ private:
|
||||
const labelList& neiLevel,
|
||||
const pointField& neiCc,
|
||||
labelList& ownPatch,
|
||||
labelList& neiPatch
|
||||
labelList& nbrPatch
|
||||
) const;
|
||||
|
||||
//- Repatches external face or creates baffle for internal face
|
||||
@ -381,7 +381,7 @@ private:
|
||||
(
|
||||
const label facei,
|
||||
const label ownPatch,
|
||||
const label neiPatch,
|
||||
const label nbrPatch,
|
||||
polyTopoChange& meshMod
|
||||
) const;
|
||||
|
||||
@ -854,12 +854,12 @@ public:
|
||||
autoPtr<mapPolyMesh> dupNonManifoldPoints();
|
||||
|
||||
//- Create baffle for every internal face where ownPatch != -1.
|
||||
// External faces get repatched according to ownPatch (neiPatch
|
||||
// External faces get repatched according to ownPatch (nbrPatch
|
||||
// should be -1 for these)
|
||||
autoPtr<mapPolyMesh> createBaffles
|
||||
(
|
||||
const labelList& ownPatch,
|
||||
const labelList& neiPatch
|
||||
const labelList& nbrPatch
|
||||
);
|
||||
|
||||
//- Debug helper: check faceZones are not on processor patches
|
||||
|
||||
@ -55,7 +55,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
||||
(
|
||||
const label facei,
|
||||
const label ownPatch,
|
||||
const label neiPatch,
|
||||
const label nbrPatch,
|
||||
polyTopoChange& meshMod
|
||||
) const
|
||||
{
|
||||
@ -90,7 +90,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
||||
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
if (neiPatch == -1)
|
||||
if (nbrPatch == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No neighbour patch for internal face " << facei
|
||||
@ -115,7 +115,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFaceID,
|
||||
true, // face flip
|
||||
neiPatch, // patch for face
|
||||
nbrPatch, // patch for face
|
||||
zoneID, // zone for face
|
||||
reverseFlip // face flip in zone
|
||||
)
|
||||
@ -131,7 +131,7 @@ void Foam::meshRefinement::getBafflePatches
|
||||
const labelList& neiLevel,
|
||||
const pointField& neiCc,
|
||||
labelList& ownPatch,
|
||||
labelList& neiPatch
|
||||
labelList& nbrPatch
|
||||
) const
|
||||
{
|
||||
autoPtr<OFstream> str;
|
||||
@ -161,8 +161,8 @@ void Foam::meshRefinement::getBafflePatches
|
||||
|
||||
ownPatch.setSize(mesh_.nFaces());
|
||||
ownPatch = -1;
|
||||
neiPatch.setSize(mesh_.nFaces());
|
||||
neiPatch = -1;
|
||||
nbrPatch.setSize(mesh_.nFaces());
|
||||
nbrPatch = -1;
|
||||
|
||||
|
||||
// Collect candidate faces
|
||||
@ -251,12 +251,12 @@ void Foam::meshRefinement::getBafflePatches
|
||||
[
|
||||
surfaces_.globalRegion(surface1[i], region1[i])
|
||||
];
|
||||
neiPatch[facei] = globalToMasterPatch
|
||||
nbrPatch[facei] = globalToMasterPatch
|
||||
[
|
||||
surfaces_.globalRegion(surface2[i], region2[i])
|
||||
];
|
||||
|
||||
if (ownPatch[facei] == -1 || neiPatch[facei] == -1)
|
||||
if (ownPatch[facei] == -1 || nbrPatch[facei] == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "problem." << abort(FatalError);
|
||||
@ -273,7 +273,7 @@ void Foam::meshRefinement::getBafflePatches
|
||||
// not used when creating baffles from proc faces.
|
||||
// - tolerances issues occasionally crop up.
|
||||
syncTools::syncFaceList(mesh_, ownPatch, maxEqOp<label>());
|
||||
syncTools::syncFaceList(mesh_, neiPatch, maxEqOp<label>());
|
||||
syncTools::syncFaceList(mesh_, nbrPatch, maxEqOp<label>());
|
||||
}
|
||||
|
||||
|
||||
@ -345,19 +345,19 @@ Foam::Map<Foam::labelPair> Foam::meshRefinement::getZoneBafflePatches
|
||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
||||
(
|
||||
const labelList& ownPatch,
|
||||
const labelList& neiPatch
|
||||
const labelList& nbrPatch
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
ownPatch.size() != mesh_.nFaces()
|
||||
|| neiPatch.size() != mesh_.nFaces()
|
||||
|| nbrPatch.size() != mesh_.nFaces()
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Illegal size :"
|
||||
<< " ownPatch:" << ownPatch.size()
|
||||
<< " neiPatch:" << neiPatch.size()
|
||||
<< " nbrPatch:" << nbrPatch.size()
|
||||
<< ". Should be number of faces:" << mesh_.nFaces()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -366,7 +366,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
||||
{
|
||||
labelList syncedOwnPatch(ownPatch);
|
||||
syncTools::syncFaceList(mesh_, syncedOwnPatch, maxEqOp<label>());
|
||||
labelList syncedNeiPatch(neiPatch);
|
||||
labelList syncedNeiPatch(nbrPatch);
|
||||
syncTools::syncFaceList(mesh_, syncedNeiPatch, maxEqOp<label>());
|
||||
|
||||
forAll(syncedOwnPatch, facei)
|
||||
@ -374,7 +374,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
||||
if
|
||||
(
|
||||
(ownPatch[facei] == -1 && syncedOwnPatch[facei] != -1)
|
||||
|| (neiPatch[facei] == -1 && syncedNeiPatch[facei] != -1)
|
||||
|| (nbrPatch[facei] == -1 && syncedNeiPatch[facei] != -1)
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -383,7 +383,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
||||
<< " fc:" << mesh_.faceCentres()[facei] << endl
|
||||
<< "ownPatch:" << ownPatch[facei]
|
||||
<< " syncedOwnPatch:" << syncedOwnPatch[facei]
|
||||
<< " neiPatch:" << neiPatch[facei]
|
||||
<< " nbrPatch:" << nbrPatch[facei]
|
||||
<< " syncedNeiPatch:" << syncedNeiPatch[facei]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -405,7 +405,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
||||
(
|
||||
facei,
|
||||
ownPatch[facei], // owner side patch
|
||||
neiPatch[facei], // neighbour side patch
|
||||
nbrPatch[facei], // neighbour side patch
|
||||
meshMod
|
||||
);
|
||||
nBaffles++;
|
||||
@ -547,15 +547,15 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
|
||||
{
|
||||
// Convert into labelLists
|
||||
labelList ownPatch(mesh_.nFaces(), -1);
|
||||
labelList neiPatch(mesh_.nFaces(), -1);
|
||||
labelList nbrPatch(mesh_.nFaces(), -1);
|
||||
forAllConstIter(Map<labelPair>, faceToPatch, iter)
|
||||
{
|
||||
ownPatch[iter.key()] = iter().first();
|
||||
neiPatch[iter.key()] = iter().second();
|
||||
nbrPatch[iter.key()] = iter().second();
|
||||
}
|
||||
|
||||
// Create baffles. both sides same patch.
|
||||
map = createBaffles(ownPatch, neiPatch);
|
||||
map = createBaffles(ownPatch, nbrPatch);
|
||||
|
||||
// Get pairs of faces created.
|
||||
// Just loop over faceMap and store baffle if we encounter a slave
|
||||
@ -2302,7 +2302,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
|
||||
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||
calcNeighbourData(neiLevel, neiCc);
|
||||
|
||||
labelList ownPatch, neiPatch;
|
||||
labelList ownPatch, nbrPatch;
|
||||
getBafflePatches
|
||||
(
|
||||
globalToMasterPatch,
|
||||
@ -2310,10 +2310,10 @@ void Foam::meshRefinement::baffleAndSplitMesh
|
||||
neiCc,
|
||||
|
||||
ownPatch,
|
||||
neiPatch
|
||||
nbrPatch
|
||||
);
|
||||
|
||||
createBaffles(ownPatch, neiPatch);
|
||||
createBaffles(ownPatch, nbrPatch);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -2477,7 +2477,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
||||
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||
calcNeighbourData(neiLevel, neiCc);
|
||||
|
||||
labelList ownPatch, neiPatch;
|
||||
labelList ownPatch, nbrPatch;
|
||||
getBafflePatches
|
||||
(
|
||||
globalToMasterPatch,
|
||||
@ -2485,7 +2485,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
||||
neiCc,
|
||||
|
||||
ownPatch,
|
||||
neiPatch
|
||||
nbrPatch
|
||||
);
|
||||
|
||||
// Analyse regions. Reuse regionsplit
|
||||
@ -2493,7 +2493,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
||||
|
||||
forAll(ownPatch, facei)
|
||||
{
|
||||
if (ownPatch[facei] != -1 || neiPatch[facei] != -1)
|
||||
if (ownPatch[facei] != -1 || nbrPatch[facei] != -1)
|
||||
{
|
||||
blockedFace[facei] = true;
|
||||
}
|
||||
@ -2568,7 +2568,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
||||
}
|
||||
else if (ownRegion != keepRegionI && neiRegion == keepRegionI)
|
||||
{
|
||||
label newPatchi = neiPatch[facei];
|
||||
label newPatchi = nbrPatch[facei];
|
||||
if (newPatchi == -1)
|
||||
{
|
||||
newPatchi = max(defaultPatch, ownPatch[facei]);
|
||||
|
||||
@ -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
|
||||
@ -1961,7 +1961,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
labelList ownPatch(mesh.nFaces(), -1);
|
||||
labelList neiPatch(mesh.nFaces(), -1);
|
||||
labelList nbrPatch(mesh.nFaces(), -1);
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
@ -1972,7 +1972,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
forAll(pp, i)
|
||||
{
|
||||
ownPatch[pp.start()+i] = patchi;
|
||||
neiPatch[pp.start()+i] = patchi;
|
||||
nbrPatch[pp.start()+i] = patchi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1984,7 +1984,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
if (closestPatch[i] != -1 && closestPatch[i] != ownPatch[facei])
|
||||
{
|
||||
ownPatch[facei] = closestPatch[i];
|
||||
neiPatch[facei] = closestPatch[i];
|
||||
nbrPatch[facei] = closestPatch[i];
|
||||
nChanged++;
|
||||
}
|
||||
}
|
||||
@ -1993,7 +1993,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
<< " faces in = " << mesh.time().cpuTimeIncrement() << " s\n" << nl
|
||||
<< endl;
|
||||
|
||||
return meshRefiner_.createBaffles(ownPatch, neiPatch);
|
||||
return meshRefiner_.createBaffles(ownPatch, nbrPatch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ void Foam::cyclicAMIGAMGInterfaceField::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const cyclicAMIGAMGInterface& thisInterface = cyclicAMIInterface_;
|
||||
const cyclicAMIGAMGInterface& neiInterface = thisInterface.neighbPatch();
|
||||
const cyclicAMIGAMGInterface& neiInterface = thisInterface.nbrPatch();
|
||||
|
||||
// Get neighbouring field
|
||||
scalarField pnf(neiInterface.interfaceInternalField(psiInternal));
|
||||
|
||||
@ -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
|
||||
@ -190,7 +190,7 @@ Foam::tmp<Foam::labelField> Foam::cyclicAMIGAMGInterface::internalFieldTransfer
|
||||
) const
|
||||
{
|
||||
const cyclicAMIGAMGInterface& nbr =
|
||||
dynamic_cast<const cyclicAMIGAMGInterface&>(neighbPatch());
|
||||
dynamic_cast<const cyclicAMIGAMGInterface&>(nbrPatch());
|
||||
|
||||
const labelUList& nbrFaceCells = nbr.faceCells();
|
||||
|
||||
|
||||
@ -109,9 +109,9 @@ public:
|
||||
//- Cyclic interface functions
|
||||
|
||||
//- Return neighbour processor number
|
||||
virtual label neighbPatchID() const
|
||||
virtual label nbrPatchID() const
|
||||
{
|
||||
return fineCyclicAMIInterface_.neighbPatchID();
|
||||
return fineCyclicAMIInterface_.nbrPatchID();
|
||||
}
|
||||
|
||||
//- Does this side own the interface?
|
||||
@ -121,11 +121,11 @@ public:
|
||||
}
|
||||
|
||||
//- Return neighbour patch
|
||||
virtual const cyclicAMIGAMGInterface& neighbPatch() const
|
||||
virtual const cyclicAMIGAMGInterface& nbrPatch() const
|
||||
{
|
||||
return dynamic_cast<const cyclicAMIGAMGInterface&>
|
||||
(
|
||||
coarseInterfaces_[neighbPatchID()]
|
||||
coarseInterfaces_[nbrPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -104,7 +104,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI() const
|
||||
if (tgtMask_.size())
|
||||
{
|
||||
const cyclicACMIPolyPatch& cp =
|
||||
refCast<const cyclicACMIPolyPatch>(this->neighbPatch());
|
||||
refCast<const cyclicACMIPolyPatch>(this->nbrPatch());
|
||||
const polyPatch& pp = cp.nonOverlapPatch();
|
||||
|
||||
vectorField::subField Sf = cp.faceAreas();
|
||||
@ -349,9 +349,9 @@ Foam::cyclicACMIPolyPatch::~cyclicACMIPolyPatch()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::cyclicACMIPolyPatch& Foam::cyclicACMIPolyPatch::neighbPatch() const
|
||||
const Foam::cyclicACMIPolyPatch& Foam::cyclicACMIPolyPatch::nbrPatch() const
|
||||
{
|
||||
const polyPatch& pp = this->boundaryMesh()[neighbPatchID()];
|
||||
const polyPatch& pp = this->boundaryMesh()[nbrPatchID()];
|
||||
return refCast<const cyclicACMIPolyPatch>(pp);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -179,7 +179,7 @@ public:
|
||||
index,
|
||||
newSize,
|
||||
newStart,
|
||||
neighbPatchName(),
|
||||
nbrPatchName(),
|
||||
nonOverlapPatchName_
|
||||
)
|
||||
);
|
||||
@ -224,7 +224,7 @@ public:
|
||||
inline bool updated() const;
|
||||
|
||||
//- Return a reference to the neighbour patch
|
||||
virtual const cyclicACMIPolyPatch& neighbPatch() const;
|
||||
virtual const cyclicACMIPolyPatch& nbrPatch() const;
|
||||
|
||||
//- Non-overlapping patch name
|
||||
inline const word& nonOverlapPatchName() const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -69,7 +69,7 @@ inline const Foam::scalarField& Foam::cyclicACMIPolyPatch::mask() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().tgtMask();
|
||||
return nbrPatch().tgtMask();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -72,13 +72,13 @@ public:
|
||||
// Access
|
||||
|
||||
//- Return neighbour
|
||||
virtual label neighbPatchID() const = 0;
|
||||
virtual label nbrPatchID() const = 0;
|
||||
|
||||
//- Does this side own the interface?
|
||||
virtual bool owner() const = 0;
|
||||
|
||||
//- Return processor number
|
||||
virtual const cyclicAMILduInterface& neighbPatch() const = 0;
|
||||
virtual const cyclicAMILduInterface& nbrPatch() const = 0;
|
||||
|
||||
//- Return a reference to the AMI interpolators
|
||||
virtual const PtrList<AMIInterpolation>& AMIs() const = 0;
|
||||
|
||||
@ -122,9 +122,9 @@ public:
|
||||
}
|
||||
|
||||
//- Return neighbour point patch
|
||||
const cyclicAMIPointPatch& neighbPatch() const
|
||||
const cyclicAMIPointPatch& nbrPatch() const
|
||||
{
|
||||
label patchi = cyclicAMIPolyPatch_.neighbPatchID();
|
||||
label patchi = cyclicAMIPolyPatch_.nbrPatchID();
|
||||
const pointPatch& pp = this->boundaryMesh()[patchi];
|
||||
return refCast<const cyclicAMIPointPatch>(pp);
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ void Foam::cyclicAMIPointPatchField<Type>::swapAddSeparated
|
||||
// all swaps on the side that gets evaluated first.
|
||||
|
||||
// Get neighbouring pointPatch
|
||||
const cyclicAMIPointPatch& nbrPatch = cyclicAMIPatch_.neighbPatch();
|
||||
const cyclicAMIPointPatch& nbrPatch = cyclicAMIPatch_.nbrPatch();
|
||||
|
||||
// Get neighbouring pointPatchField
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& fld =
|
||||
@ -196,7 +196,7 @@ void Foam::cyclicAMIPointPatchField<Type>::swapAddSeparated
|
||||
Field<Type> nbrFcFld(nbrPpi().pointToFaceInterpolate(nbrPtFld));
|
||||
|
||||
fcFld =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().interpolate
|
||||
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().interpolate
|
||||
(
|
||||
fcFld,
|
||||
nbrFcFld
|
||||
@ -205,7 +205,7 @@ void Foam::cyclicAMIPointPatchField<Type>::swapAddSeparated
|
||||
else
|
||||
{
|
||||
fcFld =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().interpolate
|
||||
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().interpolate
|
||||
(
|
||||
fcFld
|
||||
);
|
||||
|
||||
@ -94,7 +94,7 @@ class cyclicAMIPointPatchField
|
||||
(
|
||||
new PrimitivePatchInterpolation<primitivePatch>
|
||||
(
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch()
|
||||
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -70,21 +70,21 @@ Foam::vector Foam::cyclicAMIPolyPatch::findFaceNormalMaxRadius
|
||||
|
||||
void Foam::cyclicAMIPolyPatch::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 (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);
|
||||
}
|
||||
|
||||
@ -124,9 +124,9 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
|
||||
|
||||
// Check - assume correct angle when difference in face areas
|
||||
// is the smallest
|
||||
const vector transformedAreaPos = gSum(half1Areas & revTPos);
|
||||
const vector transformedAreaNeg = gSum(half1Areas & revTNeg);
|
||||
const vector area0 = gSum(half0Areas);
|
||||
const vector transformedAreaPos = gSum(nbrPatchAreas & revTPos);
|
||||
const vector transformedAreaNeg = gSum(nbrPatchAreas & revTNeg);
|
||||
const vector area0 = gSum(thisPatchAreas);
|
||||
const scalar magArea0 = mag(area0) + rootVSmall;
|
||||
|
||||
// Areas have opposite sign, so sum should be zero when correct
|
||||
@ -157,7 +157,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
|
||||
<< " % indicating a possible error in the specified "
|
||||
<< "angle of rotation" << nl
|
||||
<< " owner patch : " << name() << nl
|
||||
<< " neighbour patch : " << neighbPatch().name()
|
||||
<< " neighbour patch : " << nbrPatch().name()
|
||||
<< nl
|
||||
<< " angle : "
|
||||
<< radToDeg(rotationAngle_) << " deg" << nl
|
||||
@ -182,13 +182,13 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
|
||||
{
|
||||
point n0 = Zero;
|
||||
point n1 = Zero;
|
||||
if (half0Ctrs.size())
|
||||
if (thisPatchCtrs.size())
|
||||
{
|
||||
n0 = findFaceNormalMaxRadius(half0Ctrs);
|
||||
n0 = findFaceNormalMaxRadius(thisPatchCtrs);
|
||||
}
|
||||
if (half1Ctrs.size())
|
||||
if (nbrPatchCtrs.size())
|
||||
{
|
||||
n1 = -findFaceNormalMaxRadius(half1Ctrs);
|
||||
n1 = -findFaceNormalMaxRadius(nbrPatchCtrs);
|
||||
}
|
||||
|
||||
reduce(n0, maxMagSqrOp<point>());
|
||||
@ -276,18 +276,18 @@ void Foam::cyclicAMIPolyPatch::resetAMI() const
|
||||
{
|
||||
if (owner())
|
||||
{
|
||||
const polyPatch& nbr = neighbPatch();
|
||||
const polyPatch& nbr = nbrPatch();
|
||||
pointField nbrPoints
|
||||
(
|
||||
neighbPatch().boundaryMesh().mesh().points(),
|
||||
neighbPatch().meshPoints()
|
||||
nbrPatch().boundaryMesh().mesh().points(),
|
||||
nbrPatch().meshPoints()
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
const Time& t = boundaryMesh().mesh().time();
|
||||
OFstream os(t.path()/name() + "_neighbourPatch-org.obj");
|
||||
meshTools::writeOBJ(os, neighbPatch().localFaces(), nbrPoints);
|
||||
meshTools::writeOBJ(os, nbrPatch().localFaces(), nbrPoints);
|
||||
}
|
||||
|
||||
// Transform neighbour patch to local system
|
||||
@ -347,27 +347,27 @@ void Foam::cyclicAMIPolyPatch::resetAMI() const
|
||||
|
||||
void Foam::cyclicAMIPolyPatch::calcTransforms()
|
||||
{
|
||||
const cyclicAMIPolyPatch& half0 = *this;
|
||||
vectorField half0Areas(half0.size());
|
||||
forAll(half0, facei)
|
||||
const cyclicAMIPolyPatch& thisPatch = *this;
|
||||
vectorField thisPatchAreas(thisPatch.size());
|
||||
forAll(thisPatch, facei)
|
||||
{
|
||||
half0Areas[facei] = half0[facei].area(half0.points());
|
||||
thisPatchAreas[facei] = thisPatch[facei].area(thisPatch.points());
|
||||
}
|
||||
|
||||
const cyclicAMIPolyPatch& half1 = neighbPatch();
|
||||
vectorField half1Areas(half1.size());
|
||||
forAll(half1, facei)
|
||||
const cyclicAMIPolyPatch& 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
|
||||
);
|
||||
|
||||
if (debug)
|
||||
@ -396,9 +396,9 @@ void Foam::cyclicAMIPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||
faceCentres(),
|
||||
faceAreas(),
|
||||
faceCellCentres(),
|
||||
neighbPatch().faceCentres(),
|
||||
neighbPatch().faceAreas(),
|
||||
neighbPatch().faceCellCentres()
|
||||
nbrPatch().faceCentres(),
|
||||
nbrPatch().faceAreas(),
|
||||
nbrPatch().faceCellCentres()
|
||||
);
|
||||
}
|
||||
|
||||
@ -704,16 +704,16 @@ Foam::cyclicAMIPolyPatch::~cyclicAMIPolyPatch()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
|
||||
Foam::label Foam::cyclicAMIPolyPatch::nbrPatchID() const
|
||||
{
|
||||
if (nbrPatchID_ == -1)
|
||||
{
|
||||
nbrPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName());
|
||||
nbrPatchID_ = this->boundaryMesh().findPatchID(nbrPatchName());
|
||||
|
||||
if (nbrPatchID_ == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Illegal neighbourPatch name " << neighbPatchName()
|
||||
<< "Illegal neighbourPatch name " << nbrPatchName()
|
||||
<< nl << "Valid patch names are "
|
||||
<< this->boundaryMesh().names()
|
||||
<< exit(FatalError);
|
||||
@ -726,13 +726,13 @@ Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
|
||||
this->boundaryMesh()[nbrPatchID_]
|
||||
);
|
||||
|
||||
if (nbrPatch.neighbPatchName() != name())
|
||||
if (nbrPatch.nbrPatchName() != name())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Patch " << name()
|
||||
<< " specifies neighbour patch " << neighbPatchName()
|
||||
<< " specifies neighbour patch " << nbrPatchName()
|
||||
<< nl << " but that in return specifies "
|
||||
<< nbrPatch.neighbPatchName() << endl;
|
||||
<< nbrPatch.nbrPatchName() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -742,13 +742,13 @@ Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
|
||||
|
||||
bool Foam::cyclicAMIPolyPatch::owner() const
|
||||
{
|
||||
return index() < neighbPatchID();
|
||||
return index() < nbrPatchID();
|
||||
}
|
||||
|
||||
|
||||
const Foam::cyclicAMIPolyPatch& Foam::cyclicAMIPolyPatch::neighbPatch() const
|
||||
const Foam::cyclicAMIPolyPatch& Foam::cyclicAMIPolyPatch::nbrPatch() const
|
||||
{
|
||||
const polyPatch& pp = this->boundaryMesh()[neighbPatchID()];
|
||||
const polyPatch& pp = this->boundaryMesh()[nbrPatchID()];
|
||||
return refCast<const cyclicAMIPolyPatch>(pp);
|
||||
}
|
||||
|
||||
@ -831,7 +831,7 @@ bool Foam::cyclicAMIPolyPatch::applyLowWeightCorrection() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().AMILowWeightCorrection_ > 0;
|
||||
return nbrPatch().AMILowWeightCorrection_ > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -844,12 +844,12 @@ const Foam::scalarField& Foam::cyclicAMIPolyPatch::weightsSum() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().AMIs()[0].tgtWeightsSum();
|
||||
return nbrPatch().AMIs()[0].tgtWeightsSum();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const Foam::scalarField& Foam::cyclicAMIPolyPatch::neighbWeightsSum() const
|
||||
const Foam::scalarField& Foam::cyclicAMIPolyPatch::nbrWeightsSum() const
|
||||
{
|
||||
if (owner())
|
||||
{
|
||||
@ -857,7 +857,7 @@ const Foam::scalarField& Foam::cyclicAMIPolyPatch::neighbWeightsSum() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().AMIs()[0].srcWeightsSum();
|
||||
return nbrPatch().AMIs()[0].srcWeightsSum();
|
||||
}
|
||||
}
|
||||
|
||||
@ -969,7 +969,7 @@ Foam::tmp<Foam::scalarField> Foam::cyclicAMIPolyPatch::interpolate
|
||||
const scalarUList& defaultValues
|
||||
) const
|
||||
{
|
||||
const cyclicAMIPolyPatch& nei = neighbPatch();
|
||||
const cyclicAMIPolyPatch& nei = nbrPatch();
|
||||
|
||||
tmp<scalarField> result(new scalarField(size(), Zero));
|
||||
|
||||
@ -1069,7 +1069,7 @@ Foam::labelPair Foam::cyclicAMIPolyPatch::pointAMIAndFace
|
||||
const vector ntt = AMITransforms()[i].transform(nt);
|
||||
|
||||
const label nbrFacei =
|
||||
AMIs()[i].tgtPointFace(*this, neighbPatch(), ntt, facei, ptt);
|
||||
AMIs()[i].tgtPointFace(*this, nbrPatch(), ntt, facei, ptt);
|
||||
|
||||
if (nbrFacei >= 0)
|
||||
{
|
||||
@ -1080,17 +1080,17 @@ Foam::labelPair Foam::cyclicAMIPolyPatch::pointAMIAndFace
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(neighbPatch().AMIs(), i)
|
||||
forAll(nbrPatch().AMIs(), i)
|
||||
{
|
||||
point ptt =
|
||||
neighbPatch().AMITransforms()[i].invTransformPosition(pt);
|
||||
nbrPatch().AMITransforms()[i].invTransformPosition(pt);
|
||||
const vector ntt =
|
||||
neighbPatch().AMITransforms()[i].invTransform(nt);
|
||||
nbrPatch().AMITransforms()[i].invTransform(nt);
|
||||
|
||||
const label nbrFacei =
|
||||
neighbPatch().AMIs()[i].srcPointFace
|
||||
nbrPatch().AMIs()[i].srcPointFace
|
||||
(
|
||||
neighbPatch(),
|
||||
nbrPatch(),
|
||||
*this,
|
||||
ntt,
|
||||
facei,
|
||||
@ -1111,7 +1111,7 @@ Foam::labelPair Foam::cyclicAMIPolyPatch::pointAMIAndFace
|
||||
|
||||
Foam::label Foam::cyclicAMIPolyPatch::singlePatchProc() const
|
||||
{
|
||||
const cyclicAMIPolyPatch& patch = owner() ? *this : neighbPatch();
|
||||
const cyclicAMIPolyPatch& patch = owner() ? *this : nbrPatch();
|
||||
|
||||
const label proc = patch.AMIs()[0].singlePatchProc();
|
||||
|
||||
|
||||
@ -62,11 +62,11 @@ class cyclicAMIPolyPatch
|
||||
|
||||
void 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& neiPatchCtrs,
|
||||
const vectorField& neiPatchAreas
|
||||
);
|
||||
|
||||
|
||||
@ -74,13 +74,13 @@ protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Name of other half
|
||||
//- Name of cyclic neighbour patch
|
||||
mutable word nbrPatchName_;
|
||||
|
||||
//- Optional patchGroup to find neighbPatch
|
||||
//- Optional patchGroup to find nbrPatch
|
||||
const coupleGroupIdentifier coupleGroup_;
|
||||
|
||||
//- Index of other half
|
||||
//- Index of cyclic neighbour patch
|
||||
mutable label nbrPatchID_;
|
||||
|
||||
// Specified transformation
|
||||
@ -291,16 +291,16 @@ public:
|
||||
}
|
||||
|
||||
//- Neighbour patch name
|
||||
inline const word& neighbPatchName() const;
|
||||
inline const word& nbrPatchName() const;
|
||||
|
||||
//- Neighbour patch ID
|
||||
virtual label neighbPatchID() const;
|
||||
virtual label nbrPatchID() const;
|
||||
|
||||
//- Does this side own the patch?
|
||||
virtual bool owner() const;
|
||||
|
||||
//- Return a reference to the neighbour patch
|
||||
virtual const cyclicAMIPolyPatch& neighbPatch() const;
|
||||
virtual const cyclicAMIPolyPatch& nbrPatch() const;
|
||||
|
||||
//- Return a reference to the projection surface
|
||||
const autoPtr<searchableSurface>& surfPtr() const;
|
||||
@ -318,7 +318,7 @@ public:
|
||||
virtual const scalarField& weightsSum() const;
|
||||
|
||||
//- Return the weights sum for the neighbour patch
|
||||
virtual const scalarField& neighbWeightsSum() const;
|
||||
virtual const scalarField& nbrWeightsSum() const;
|
||||
|
||||
|
||||
// Transformations
|
||||
|
||||
@ -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
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::word& Foam::cyclicAMIPolyPatch::neighbPatchName() const
|
||||
inline const Foam::word& Foam::cyclicAMIPolyPatch::nbrPatchName() const
|
||||
{
|
||||
if (nbrPatchName_.empty())
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -32,7 +32,7 @@ Foam::tmp<Foam::Field<Type>> Foam::cyclicAMIPolyPatch::interpolate
|
||||
const UList<Type>& defaultValues
|
||||
) const
|
||||
{
|
||||
const cyclicAMIPolyPatch& nei = neighbPatch();
|
||||
const cyclicAMIPolyPatch& nei = nbrPatch();
|
||||
|
||||
tmp<Field<Type>> result(new Field<Type>(size(), Zero));
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
||||
|
||||
Info<< indent << typeName <<" : Creating addressing and weights between "
|
||||
<< returnReduce(this->size(), sumOp<label>()) << " source faces and "
|
||||
<< returnReduce(neighbPatch().size(), sumOp<label>()) << " target faces"
|
||||
<< returnReduce(nbrPatch().size(), sumOp<label>()) << " target faces"
|
||||
<< endl;
|
||||
|
||||
// Get the transform associated with the transform patch
|
||||
@ -91,12 +91,12 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
||||
{
|
||||
const coupledPolyPatch& transformPatch = this->transformPatch();
|
||||
|
||||
if (transformPatch.name() != neighbPatch().transformPatch().name())
|
||||
if (transformPatch.name() != nbrPatch().transformPatch().name())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Transform patch " << transformPatch.name() << " for "
|
||||
<< typeName << " patch " << name() << " is not the same as for "
|
||||
<< "the neighbour patch " << neighbPatch().name() << ". "
|
||||
<< "the neighbour patch " << nbrPatch().name() << ". "
|
||||
<< "This is not allowed." << exit(FatalError);
|
||||
}
|
||||
|
||||
@ -128,12 +128,12 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
||||
label n = 0;
|
||||
{
|
||||
const scalarField thisMagAreas(mag(this->faceAreas()));
|
||||
const scalarField nbrMagAreas(mag(neighbPatch().faceAreas()));
|
||||
const scalarField nbrMagAreas(mag(nbrPatch().faceAreas()));
|
||||
|
||||
vector thisCentre =
|
||||
gSum(this->faceCentres()*thisMagAreas)/gSum(thisMagAreas);
|
||||
vector nbrCentre =
|
||||
gSum(neighbPatch().faceCentres()*nbrMagAreas)/gSum(nbrMagAreas);
|
||||
gSum(nbrPatch().faceCentres()*nbrMagAreas)/gSum(nbrMagAreas);
|
||||
|
||||
scalar dLeft = mag(t.transformPosition(thisCentre) - nbrCentre);
|
||||
scalar d = mag(thisCentre - nbrCentre);
|
||||
@ -189,7 +189,7 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
||||
|
||||
// Create copies of this patch and the neighbour patch's points
|
||||
pointField thisPoints(localPoints());
|
||||
const pointField nbrPoints(neighbPatch().localPoints());
|
||||
const pointField nbrPoints(nbrPatch().localPoints());
|
||||
|
||||
// Create primitive patches
|
||||
primitivePatch thisPatch
|
||||
@ -199,7 +199,7 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
||||
);
|
||||
primitivePatch nbrPatch
|
||||
(
|
||||
SubList<face>(neighbPatch().localFaces(), neighbPatch().size()),
|
||||
SubList<face>(this->nbrPatch().localFaces(), this->nbrPatch().size()),
|
||||
nbrPoints
|
||||
);
|
||||
|
||||
@ -406,9 +406,9 @@ Foam::cyclicRepeatAMIPolyPatch::~cyclicRepeatAMIPolyPatch()
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::cyclicRepeatAMIPolyPatch&
|
||||
Foam::cyclicRepeatAMIPolyPatch::neighbPatch() const
|
||||
Foam::cyclicRepeatAMIPolyPatch::nbrPatch() const
|
||||
{
|
||||
const polyPatch& pp = this->boundaryMesh()[neighbPatchID()];
|
||||
const polyPatch& pp = this->boundaryMesh()[nbrPatchID()];
|
||||
|
||||
return refCast<const cyclicRepeatAMIPolyPatch>(pp);
|
||||
}
|
||||
@ -455,11 +455,11 @@ const Foam::scalarField& Foam::cyclicRepeatAMIPolyPatch::weightsSum() const
|
||||
|
||||
|
||||
const Foam::scalarField&
|
||||
Foam::cyclicRepeatAMIPolyPatch::neighbWeightsSum() const
|
||||
Foam::cyclicRepeatAMIPolyPatch::nbrWeightsSum() const
|
||||
{
|
||||
// See above.
|
||||
|
||||
return cyclicAMIPolyPatch::neighbWeightsSum();
|
||||
return cyclicAMIPolyPatch::nbrWeightsSum();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -192,7 +192,7 @@ public:
|
||||
// Access
|
||||
|
||||
//- Return a reference to the neighbour patch
|
||||
virtual const cyclicRepeatAMIPolyPatch& neighbPatch() const;
|
||||
virtual const cyclicRepeatAMIPolyPatch& nbrPatch() const;
|
||||
|
||||
//- Neighbour patch name
|
||||
inline const word& transformPatchName() const;
|
||||
@ -207,7 +207,7 @@ public:
|
||||
virtual const scalarField& weightsSum() const;
|
||||
|
||||
//- Return the weights sum for the neighbour patch
|
||||
virtual const scalarField& neighbWeightsSum() const;
|
||||
virtual const scalarField& nbrWeightsSum() const;
|
||||
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
|
||||
@ -88,7 +88,7 @@ namespace Foam
|
||||
}
|
||||
else
|
||||
{
|
||||
meshFacei = patch_.neighbPatch().start() + facei;
|
||||
meshFacei = patch_.nbrPatch().start() + facei;
|
||||
}
|
||||
x.updateFace
|
||||
(
|
||||
@ -260,7 +260,7 @@ void Foam::FaceCellWave<Type, TrackingData>::checkCyclic
|
||||
// For debugging: check status on both sides of cyclic
|
||||
|
||||
const cyclicPolyPatch& nbrPatch =
|
||||
refCast<const cyclicPolyPatch>(patch).neighbPatch();
|
||||
refCast<const cyclicPolyPatch>(patch).nbrPatch();
|
||||
|
||||
forAll(patch, patchFacei)
|
||||
{
|
||||
@ -640,7 +640,7 @@ void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
|
||||
if (isA<cyclicPolyPatch>(patch))
|
||||
{
|
||||
const cyclicPolyPatch& nbrPatch =
|
||||
refCast<const cyclicPolyPatch>(patch).neighbPatch();
|
||||
refCast<const cyclicPolyPatch>(patch).nbrPatch();
|
||||
|
||||
// Allocate buffers
|
||||
label nReceiveFaces;
|
||||
@ -732,7 +732,7 @@ void Foam::FaceCellWave<Type, TrackingData>::handleAMICyclicPatches()
|
||||
|
||||
{
|
||||
const cyclicAMIPolyPatch& nbrPatch =
|
||||
refCast<const cyclicAMIPolyPatch>(patch).neighbPatch();
|
||||
refCast<const cyclicAMIPolyPatch>(patch).nbrPatch();
|
||||
|
||||
// Get nbrPatch data (so not just changed faces)
|
||||
typename List<Type>::subList sendInfo
|
||||
@ -784,16 +784,16 @@ void Foam::FaceCellWave<Type, TrackingData>::handleAMICyclicPatches()
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(cycPatch.neighbPatch().AMIs(), i)
|
||||
forAll(cycPatch.nbrPatch().AMIs(), i)
|
||||
{
|
||||
List<Type> sendInfoT(sendInfo);
|
||||
transform
|
||||
(
|
||||
cycPatch.neighbPatch().AMITransforms()[i],
|
||||
cycPatch.nbrPatch().AMITransforms()[i],
|
||||
sendInfoT.size(),
|
||||
sendInfoT
|
||||
);
|
||||
cycPatch.neighbPatch().AMIs()[i].interpolateToTarget
|
||||
cycPatch.nbrPatch().AMIs()[i].interpolateToTarget
|
||||
(
|
||||
sendInfoT,
|
||||
cmb,
|
||||
|
||||
@ -313,7 +313,7 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleProcPatches()
|
||||
nbrPoints.reserve(procPatch.nPoints());
|
||||
|
||||
// Get all changed points in reverse order
|
||||
const labelList& neighbPoints = procPatch.neighbPoints();
|
||||
const labelList& neighbPoints = procPatch.nbrPoints();
|
||||
forAll(neighbPoints, thisPointi)
|
||||
{
|
||||
label meshPointi = procPatch.meshPoints()[thisPointi];
|
||||
@ -428,7 +428,7 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleCyclicPatches()
|
||||
|
||||
// Collect nbrPatch points that have changed
|
||||
{
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||
const edgeList& pairs = cycPatch.coupledPoints();
|
||||
const labelList& meshPoints = nbrPatch.meshPoints();
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
@ -130,7 +130,7 @@ Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface
|
||||
nbrLduInterface
|
||||
(
|
||||
nbrLevel,
|
||||
neighbPatchID()
|
||||
nbrPatchID()
|
||||
).faceCells();
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ internalFieldTransfer
|
||||
) const
|
||||
{
|
||||
/*
|
||||
// const labelUList& nbrFaceCells = neighbPatch().faceCells();
|
||||
// const labelUList& nbrFaceCells = nbrPatch().faceCells();
|
||||
|
||||
const labelUList& nbrFaceCells = nbrLduInterface().faceCells();
|
||||
|
||||
|
||||
@ -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
|
||||
@ -104,9 +104,9 @@ public:
|
||||
//- Cyclic interface functions
|
||||
|
||||
//- Return neighbour processor number
|
||||
virtual label neighbPatchID() const
|
||||
virtual label nbrPatchID() const
|
||||
{
|
||||
return fineRegionCoupledLduInterface_.neighbPatchID();
|
||||
return fineRegionCoupledLduInterface_.nbrPatchID();
|
||||
}
|
||||
|
||||
virtual bool owner() const
|
||||
@ -114,11 +114,11 @@ public:
|
||||
return fineRegionCoupledLduInterface_.owner();
|
||||
}
|
||||
|
||||
virtual const regionCoupledBaseGAMGInterface& neighbPatch() const
|
||||
virtual const regionCoupledBaseGAMGInterface& nbrPatch() const
|
||||
{
|
||||
return dynamic_cast<const regionCoupledBaseGAMGInterface&>
|
||||
(
|
||||
fineRegionCoupledLduInterface_.neighbPatch()
|
||||
fineRegionCoupledLduInterface_.nbrPatch()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -74,13 +74,13 @@ public:
|
||||
// Access
|
||||
|
||||
//- Return neighbour
|
||||
virtual label neighbPatchID() const = 0;
|
||||
virtual label nbrPatchID() const = 0;
|
||||
|
||||
//- Is it owner?
|
||||
virtual bool owner() const = 0;
|
||||
|
||||
//- Return neighb regionCoupledLduInterface
|
||||
virtual const regionCoupledLduInterface& neighbPatch() const = 0;
|
||||
virtual const regionCoupledLduInterface& nbrPatch() const = 0;
|
||||
|
||||
//- Return AMI
|
||||
// virtual const AMIInterpolation& AMI() const = 0;
|
||||
|
||||
@ -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
|
||||
@ -45,7 +45,7 @@ void Foam::regionCoupledBase::resetAMI() const
|
||||
{
|
||||
AMIPtr_.clear();
|
||||
|
||||
const polyPatch& nbr = refCast<const polyPatch>(neighbPatch());
|
||||
const polyPatch& nbr = refCast<const polyPatch>(nbrPatch());
|
||||
pointField nbrPoints = nbr.localPoints();
|
||||
|
||||
if (debug)
|
||||
@ -183,7 +183,7 @@ Foam::regionCoupledBase::~regionCoupledBase()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::regionCoupledBase::neighbPatchID() const
|
||||
Foam::label Foam::regionCoupledBase::nbrPatchID() const
|
||||
{
|
||||
if (nbrPatchID_ == -1)
|
||||
{
|
||||
@ -238,7 +238,7 @@ bool Foam::regionCoupledBase::owner() const
|
||||
{
|
||||
if (nbrRegionName_ == patch_.boundaryMesh().mesh().name())
|
||||
{
|
||||
return patch_.index() < neighbPatchID();
|
||||
return patch_.index() < nbrPatchID();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -298,7 +298,7 @@ const Foam::AMIInterpolation& Foam::regionCoupledBase::AMI() const
|
||||
|
||||
|
||||
const Foam::regionCoupledBase&
|
||||
Foam::regionCoupledBase::neighbPatch() const
|
||||
Foam::regionCoupledBase::nbrPatch() const
|
||||
{
|
||||
const polyMesh& mesh =
|
||||
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
|
||||
@ -306,7 +306,7 @@ Foam::regionCoupledBase::neighbPatch() const
|
||||
nbrRegionName_
|
||||
);
|
||||
|
||||
const polyPatch& pp = mesh.boundaryMesh()[neighbPatchID()];
|
||||
const polyPatch& pp = mesh.boundaryMesh()[nbrPatchID()];
|
||||
return refCast<const regionCoupledBase>(pp);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -140,13 +140,13 @@ public:
|
||||
}
|
||||
|
||||
//- Neighbour patch ID
|
||||
label neighbPatchID() const;
|
||||
label nbrPatchID() const;
|
||||
|
||||
//- Does this side own the patch?
|
||||
bool owner() const;
|
||||
|
||||
//- Return a reference to the neighbour patch
|
||||
const regionCoupledBase& neighbPatch() const;
|
||||
const regionCoupledBase& nbrPatch() const;
|
||||
|
||||
//- Return a reference to the projection surface
|
||||
const autoPtr<searchableSurface>& surfPtr() const;
|
||||
|
||||
@ -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
|
||||
@ -37,7 +37,7 @@ Foam::tmp<Foam::Field<Type>> Foam::regionCoupledBase::interpolate
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().AMI().interpolateToTarget(fld);
|
||||
return nbrPatch().AMI().interpolateToTarget(fld);
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ Foam::tmp<Foam::Field<Type>> Foam::regionCoupledBase::interpolate
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().AMI().interpolateToTarget(tFld);
|
||||
return nbrPatch().AMI().interpolateToTarget(tFld);
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ void Foam::regionCoupledBase::interpolate
|
||||
}
|
||||
else
|
||||
{
|
||||
neighbPatch().AMI().interpolateToTarget(fld, bop, result);
|
||||
nbrPatch().AMI().interpolateToTarget(fld, bop, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user