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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -1048,7 +1048,7 @@ int main(int argc, char *argv[])
|
|||||||
if (iter != fluentToFoamType.end())
|
if (iter != fluentToFoamType.end())
|
||||||
{
|
{
|
||||||
// See if we have a periodic and can derive the other side.
|
// See if we have a periodic and can derive the other side.
|
||||||
word neighbPatchName;
|
word nbrPatchName;
|
||||||
if (iter() == cyclicPolyPatch::typeName)
|
if (iter() == cyclicPolyPatch::typeName)
|
||||||
{
|
{
|
||||||
// Periodic
|
// Periodic
|
||||||
@ -1056,22 +1056,22 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (n != string::npos)
|
if (n != string::npos)
|
||||||
{
|
{
|
||||||
neighbPatchName = name.substr(0, n) + "-SIDE-2";
|
nbrPatchName = name.substr(0, n) + "-SIDE-2";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n = name.rfind("-SIDE-2");
|
n = name.rfind("-SIDE-2");
|
||||||
if (n != string::npos)
|
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
|
Info<< "Adding cyclicPolyPatch for Fluent zone " << name
|
||||||
<< " with neighbour patch " << neighbPatchName
|
<< " with neighbour patch " << nbrPatchName
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
newPatches[patchi] = new cyclicPolyPatch
|
newPatches[patchi] = new cyclicPolyPatch
|
||||||
@ -1082,7 +1082,7 @@ int main(int argc, char *argv[])
|
|||||||
patchi,
|
patchi,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
cyclicPolyPatch::typeName,
|
cyclicPolyPatch::typeName,
|
||||||
neighbPatchName,
|
nbrPatchName,
|
||||||
cyclicPolyPatch::NOORDERING
|
cyclicPolyPatch::NOORDERING
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -554,7 +554,7 @@ void Foam::writeAMIWeightsSums(const polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
Info<< "Calculating AMI weights between owner patch: "
|
Info<< "Calculating AMI weights between owner patch: "
|
||||||
<< cpp.name() << " and neighbour patch: "
|
<< cpp.name() << " and neighbour patch: "
|
||||||
<< cpp.neighbPatch().name() << endl;
|
<< cpp.nbrPatch().name() << endl;
|
||||||
|
|
||||||
writeAMIWeightsSum
|
writeAMIWeightsSum
|
||||||
(
|
(
|
||||||
@ -566,8 +566,8 @@ void Foam::writeAMIWeightsSums(const polyMesh& mesh)
|
|||||||
writeAMIWeightsSum
|
writeAMIWeightsSum
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
cpp.neighbPatch(),
|
cpp.nbrPatch(),
|
||||||
cpp.neighbWeightsSum(),
|
cpp.nbrWeightsSum(),
|
||||||
fileName("postProcessing") / "tgt_" + tmName
|
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");
|
OFstream str(prefix+nbrPatch.name()+".obj");
|
||||||
Pout<< "Writing " << nbrPatch.name()
|
Pout<< "Writing " << nbrPatch.name()
|
||||||
@ -306,7 +306,7 @@ void syncPoints
|
|||||||
pointField patchInfo(procPatch.nPoints(), nullValue);
|
pointField patchInfo(procPatch.nPoints(), nullValue);
|
||||||
|
|
||||||
const labelList& meshPts = procPatch.meshPoints();
|
const labelList& meshPts = procPatch.meshPoints();
|
||||||
const labelList& nbrPts = procPatch.neighbPoints();
|
const labelList& nbrPts = procPatch.nbrPoints();
|
||||||
|
|
||||||
forAll(nbrPts, pointi)
|
forAll(nbrPts, pointi)
|
||||||
{
|
{
|
||||||
@ -395,7 +395,7 @@ void syncPoints
|
|||||||
|
|
||||||
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
||||||
const labelList& meshPts = cycPatch.meshPoints();
|
const labelList& meshPts = cycPatch.meshPoints();
|
||||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||||
const labelList& nbrMeshPts = nbrPatch.meshPoints();
|
const labelList& nbrMeshPts = nbrPatch.meshPoints();
|
||||||
|
|
||||||
pointField half0Values(coupledPoints.size());
|
pointField half0Values(coupledPoints.size());
|
||||||
@ -782,7 +782,7 @@ int main(int argc, char *argv[])
|
|||||||
!= cyclicPolyPatch::TRANSLATIONAL
|
!= cyclicPolyPatch::TRANSLATIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& nbr = cycpp.neighbPatch();
|
const cyclicPolyPatch& nbr = cycpp.nbrPatch();
|
||||||
|
|
||||||
const_cast<vector&>(cpp.transform().t()) =
|
const_cast<vector&>(cpp.transform().t()) =
|
||||||
nbr[0].centre(mesh.points())
|
nbr[0].centre(mesh.points())
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -186,7 +186,7 @@ void Foam::domainDecomposition::decomposeMesh(const fileName& dict)
|
|||||||
const labelUList& patchFaceCells = pp.faceCells();
|
const labelUList& patchFaceCells = pp.faceCells();
|
||||||
|
|
||||||
const labelUList& nbrPatchFaceCells =
|
const labelUList& nbrPatchFaceCells =
|
||||||
pp.neighbPatch().faceCells();
|
pp.nbrPatch().faceCells();
|
||||||
|
|
||||||
forAll(patchFaceCells, facei)
|
forAll(patchFaceCells, facei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -57,7 +57,7 @@ void Foam::domainDecomposition::processInterCyclics
|
|||||||
// cyclic: check opposite side on this processor
|
// cyclic: check opposite side on this processor
|
||||||
const labelUList& patchFaceCells = pp.faceCells();
|
const labelUList& patchFaceCells = pp.faceCells();
|
||||||
const labelUList& nbrPatchFaceCells =
|
const labelUList& nbrPatchFaceCells =
|
||||||
pp.neighbPatch().faceCells();
|
pp.nbrPatch().faceCells();
|
||||||
|
|
||||||
// Store old sizes. Used to detect which inter-proc patches
|
// Store old sizes. Used to detect which inter-proc patches
|
||||||
// have been added to.
|
// have been added to.
|
||||||
|
|||||||
@ -111,7 +111,7 @@ void Foam::cyclicPointPatchField<Type>::swapAddSeparated
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Get neighbouring pointPatch
|
// Get neighbouring pointPatch
|
||||||
const cyclicPointPatch& nbrPatch = cyclicPatch_.neighbPatch();
|
const cyclicPointPatch& nbrPatch = cyclicPatch_.nbrPatch();
|
||||||
|
|
||||||
if (cyclicPatch_.cyclicPatch().owner())
|
if (cyclicPatch_.cyclicPatch().owner())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -237,7 +237,7 @@ void Foam::LUscalarMatrix::convert
|
|||||||
|
|
||||||
const cyclicLduInterface& cycInterface =
|
const cyclicLduInterface& cycInterface =
|
||||||
refCast<const cyclicLduInterface>(interface);
|
refCast<const cyclicLduInterface>(interface);
|
||||||
label nbrInt = cycInterface.neighbPatchID();
|
label nbrInt = cycInterface.nbrPatchID();
|
||||||
const label* __restrict__ uPtr =
|
const label* __restrict__ uPtr =
|
||||||
interfaces[nbrInt].interface().faceCells().begin();
|
interfaces[nbrInt].interface().faceCells().begin();
|
||||||
|
|
||||||
|
|||||||
@ -67,12 +67,12 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return neighbour
|
//- Return neighbour
|
||||||
virtual label neighbPatchID() const = 0;
|
virtual label nbrPatchID() const = 0;
|
||||||
|
|
||||||
virtual bool owner() const = 0;
|
virtual bool owner() const = 0;
|
||||||
|
|
||||||
//- Return processor number
|
//- Return processor number
|
||||||
virtual const cyclicLduInterface& neighbPatch() const = 0;
|
virtual const cyclicLduInterface& nbrPatch() const = 0;
|
||||||
|
|
||||||
//- Return transformation between the coupled patches
|
//- Return transformation between the coupled patches
|
||||||
virtual const transformer& transform() const = 0;
|
virtual const transformer& transform() const = 0;
|
||||||
|
|||||||
@ -114,7 +114,7 @@ void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
|
|||||||
// Get neighbouring field
|
// Get neighbouring field
|
||||||
scalarField pnf
|
scalarField pnf
|
||||||
(
|
(
|
||||||
cyclicInterface_.neighbPatch().interfaceInternalField(psiInternal)
|
cyclicInterface_.nbrPatch().interfaceInternalField(psiInternal)
|
||||||
);
|
);
|
||||||
|
|
||||||
transformCoupleField(pnf, cmpt);
|
transformCoupleField(pnf, cmpt);
|
||||||
|
|||||||
@ -79,9 +79,9 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
GAMGInterface(index, coarseInterfaces),
|
GAMGInterface(index, coarseInterfaces),
|
||||||
neighbPatchID_
|
nbrPatchID_
|
||||||
(
|
(
|
||||||
refCast<const cyclicLduInterface>(fineInterface).neighbPatchID()
|
refCast<const cyclicLduInterface>(fineInterface).nbrPatchID()
|
||||||
),
|
),
|
||||||
owner_(refCast<const cyclicLduInterface>(fineInterface).owner()),
|
owner_(refCast<const cyclicLduInterface>(fineInterface).owner()),
|
||||||
transform_(refCast<const cyclicLduInterface>(fineInterface).transform())
|
transform_(refCast<const cyclicLduInterface>(fineInterface).transform())
|
||||||
@ -156,7 +156,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
GAMGInterface(index, coarseInterfaces, is),
|
GAMGInterface(index, coarseInterfaces, is),
|
||||||
neighbPatchID_(readLabel(is)),
|
nbrPatchID_(readLabel(is)),
|
||||||
owner_(readBool(is)),
|
owner_(readBool(is)),
|
||||||
transform_(is)
|
transform_(is)
|
||||||
{}
|
{}
|
||||||
@ -176,7 +176,7 @@ Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
|
|||||||
const labelUList& iF
|
const labelUList& iF
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const cyclicGAMGInterface& nbr = neighbPatch();
|
const cyclicGAMGInterface& nbr = nbrPatch();
|
||||||
const labelUList& nbrFaceCells = nbr.faceCells();
|
const labelUList& nbrFaceCells = nbr.faceCells();
|
||||||
|
|
||||||
tmp<labelField> tpnf(new labelField(size()));
|
tmp<labelField> tpnf(new labelField(size()));
|
||||||
@ -194,7 +194,7 @@ Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
|
|||||||
void Foam::cyclicGAMGInterface::write(Ostream& os) const
|
void Foam::cyclicGAMGInterface::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
GAMGInterface::write(os);
|
GAMGInterface::write(os);
|
||||||
os << token::SPACE << neighbPatchID_
|
os << token::SPACE << nbrPatchID_
|
||||||
<< token::SPACE << owner_
|
<< token::SPACE << owner_
|
||||||
<< token::SPACE << transform_;
|
<< token::SPACE << transform_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class cyclicGAMGInterface
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Neighbour patch number
|
//- Neighbour patch number
|
||||||
label neighbPatchID_;
|
label nbrPatchID_;
|
||||||
|
|
||||||
//- Am I owner?
|
//- Am I owner?
|
||||||
bool owner_;
|
bool owner_;
|
||||||
@ -116,9 +116,9 @@ public:
|
|||||||
//- Cyclic interface functions
|
//- Cyclic interface functions
|
||||||
|
|
||||||
//- Return neighbour processor number
|
//- Return neighbour processor number
|
||||||
virtual label neighbPatchID() const
|
virtual label nbrPatchID() const
|
||||||
{
|
{
|
||||||
return neighbPatchID_;
|
return nbrPatchID_;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool owner() const
|
virtual bool owner() const
|
||||||
@ -126,11 +126,11 @@ public:
|
|||||||
return owner_;
|
return owner_;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const cyclicGAMGInterface& neighbPatch() const
|
virtual const cyclicGAMGInterface& nbrPatch() const
|
||||||
{
|
{
|
||||||
return dynamic_cast<const cyclicGAMGInterface&>
|
return dynamic_cast<const cyclicGAMGInterface&>
|
||||||
(
|
(
|
||||||
coarseInterfaces_[neighbPatchID()]
|
coarseInterfaces_[nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -125,9 +125,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return neighbour point patch
|
//- 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];
|
const pointPatch& pp = this->boundaryMesh()[patchi];
|
||||||
return refCast<const cyclicPointPatch>(pp);
|
return refCast<const cyclicPointPatch>(pp);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -706,7 +706,7 @@ void Foam::globalPoints::receivePatchPoints
|
|||||||
{
|
{
|
||||||
const labelPairList infoB = addSendTransform
|
const labelPairList infoB = addSendTransform
|
||||||
(
|
(
|
||||||
cycPatch.neighbPatchID(),
|
cycPatch.nbrPatchID(),
|
||||||
procPoints_[procPointB()]
|
procPoints_[procPointB()]
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -841,7 +841,7 @@ Foam::labelList Foam::globalPoints::reverseMeshPoints
|
|||||||
const cyclicPolyPatch& pp
|
const cyclicPolyPatch& pp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& nbrPatch = pp.neighbPatch();
|
const cyclicPolyPatch& nbrPatch = pp.nbrPatch();
|
||||||
|
|
||||||
faceList masterFaces(nbrPatch.size());
|
faceList masterFaces(nbrPatch.size());
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -207,7 +207,7 @@ void Foam::polyBoundaryMesh::clearGeom()
|
|||||||
|
|
||||||
void Foam::polyBoundaryMesh::clearAddressing()
|
void Foam::polyBoundaryMesh::clearAddressing()
|
||||||
{
|
{
|
||||||
neighbourEdgesPtr_.clear();
|
nbrEdgesPtr_.clear();
|
||||||
patchIDPtr_.clear();
|
patchIDPtr_.clear();
|
||||||
groupPatchIDsPtr_.clear();
|
groupPatchIDsPtr_.clear();
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ void Foam::polyBoundaryMesh::calcGeometry()
|
|||||||
|
|
||||||
|
|
||||||
const Foam::List<Foam::labelPairList>&
|
const Foam::List<Foam::labelPairList>&
|
||||||
Foam::polyBoundaryMesh::neighbourEdges() const
|
Foam::polyBoundaryMesh::nbrEdges() const
|
||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
@ -279,10 +279,10 @@ Foam::polyBoundaryMesh::neighbourEdges() const
|
|||||||
<< " boundaries." << endl;
|
<< " boundaries." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!neighbourEdgesPtr_.valid())
|
if (!nbrEdgesPtr_.valid())
|
||||||
{
|
{
|
||||||
neighbourEdgesPtr_.reset(new List<labelPairList>(size()));
|
nbrEdgesPtr_.reset(new List<labelPairList>(size()));
|
||||||
List<labelPairList>& neighbourEdges = neighbourEdgesPtr_();
|
List<labelPairList>& nbrEdges = nbrEdgesPtr_();
|
||||||
|
|
||||||
// Initialize.
|
// Initialize.
|
||||||
label nEdgePairs = 0;
|
label nEdgePairs = 0;
|
||||||
@ -290,11 +290,11 @@ Foam::polyBoundaryMesh::neighbourEdges() const
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = operator[](patchi);
|
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[0] = -1;
|
||||||
edgeInfo[1] = -1;
|
edgeInfo[1] = -1;
|
||||||
@ -348,10 +348,10 @@ Foam::polyBoundaryMesh::neighbourEdges() const
|
|||||||
// Second occurrence. Store.
|
// Second occurrence. Store.
|
||||||
const labelPair& edgeInfo = fnd();
|
const labelPair& edgeInfo = fnd();
|
||||||
|
|
||||||
neighbourEdges[patchi][edgei - pp.nInternalEdges()] =
|
nbrEdges[patchi][edgei - pp.nInternalEdges()] =
|
||||||
edgeInfo;
|
edgeInfo;
|
||||||
|
|
||||||
neighbourEdges[edgeInfo[0]][edgeInfo[1]]
|
nbrEdges[edgeInfo[0]][edgeInfo[1]]
|
||||||
= labelPair(patchi, edgei - pp.nInternalEdges());
|
= labelPair(patchi, edgei - pp.nInternalEdges());
|
||||||
|
|
||||||
// Found all two occurrences of this edge so remove from
|
// Found all two occurrences of this edge so remove from
|
||||||
@ -374,11 +374,11 @@ Foam::polyBoundaryMesh::neighbourEdges() const
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = operator[](patchi);
|
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)
|
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()
|
void Foam::polyBoundaryMesh::updateMesh()
|
||||||
{
|
{
|
||||||
neighbourEdgesPtr_.clear();
|
nbrEdgesPtr_.clear();
|
||||||
patchIDPtr_.clear();
|
patchIDPtr_.clear();
|
||||||
groupPatchIDsPtr_.clear();
|
groupPatchIDsPtr_.clear();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -73,7 +73,7 @@ class polyBoundaryMesh
|
|||||||
mutable autoPtr<HashTable<labelList, word>> groupPatchIDsPtr_;
|
mutable autoPtr<HashTable<labelList, word>> groupPatchIDsPtr_;
|
||||||
|
|
||||||
//- Edges of neighbouring patches
|
//- Edges of neighbouring patches
|
||||||
mutable autoPtr<List<labelPairList>> neighbourEdgesPtr_;
|
mutable autoPtr<List<labelPairList>> nbrEdgesPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -149,7 +149,7 @@ public:
|
|||||||
// it as much as possible consistent with coupled patch addressing
|
// it as much as possible consistent with coupled patch addressing
|
||||||
// (where coupling is by local patch face index).
|
// (where coupling is by local patch face index).
|
||||||
// Only valid for singly connected polyBoundaryMesh and not parallel
|
// 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
|
//- Return a list of patch names
|
||||||
wordList names() const;
|
wordList names() const;
|
||||||
|
|||||||
@ -51,10 +51,10 @@ namespace Foam
|
|||||||
|
|
||||||
void Foam::cyclicPolyPatch::calcTransformTensors
|
void Foam::cyclicPolyPatch::calcTransformTensors
|
||||||
(
|
(
|
||||||
const vectorField& Cf,
|
const vectorField& thisPatchCtrs,
|
||||||
const vectorField& Cr,
|
const vectorField& nbrPatchCtrs,
|
||||||
const vectorField& nf,
|
const vectorField& thisPatchNormals,
|
||||||
const vectorField& nr,
|
const vectorField& nbrPatchNormals,
|
||||||
const scalarField& smallDist,
|
const scalarField& smallDist,
|
||||||
const scalar absTol,
|
const scalar absTol,
|
||||||
const orderingType ordering,
|
const orderingType ordering,
|
||||||
@ -65,11 +65,12 @@ void Foam::cyclicPolyPatch::calcTransformTensors
|
|||||||
{
|
{
|
||||||
Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl
|
Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl
|
||||||
<< " transform:" << transformTypeNames[transform] << nl
|
<< " transform:" << transformTypeNames[transform] << nl
|
||||||
<< " (half)size:" << Cf.size() << nl
|
<< " (half)size:" << thisPatchCtrs.size() << nl
|
||||||
<< " absTol:" << absTol << nl
|
<< " absTol:" << absTol << nl
|
||||||
<< " smallDist min:" << min(smallDist) << nl
|
<< " smallDist min:" << min(smallDist) << nl
|
||||||
<< " smallDist max:" << max(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.
|
// Tolerance calculation.
|
||||||
@ -80,14 +81,14 @@ void Foam::cyclicPolyPatch::calcTransformTensors
|
|||||||
// Then the overall error of summing the normals is sqrt(size())*absTol
|
// Then the overall error of summing the normals is sqrt(size())*absTol
|
||||||
// - separation calculation: pass in from the outside an allowable error.
|
// - separation calculation: pass in from the outside an allowable error.
|
||||||
|
|
||||||
if (Cf.size() == 0)
|
if (thisPatchCtrs.size() == 0)
|
||||||
{
|
{
|
||||||
// Dummy geometry. Assume non-separated, parallel.
|
// Dummy geometry. Assume non-separated, parallel.
|
||||||
transform_ = transformer();
|
transform_ = transformer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scalar error = absTol*Foam::sqrt(1.0*Cf.size());
|
scalar error = absTol*Foam::sqrt(1.0*thisPatchCtrs.size());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -100,19 +101,31 @@ void Foam::cyclicPolyPatch::calcTransformTensors
|
|||||||
|| (
|
|| (
|
||||||
transform != TRANSLATIONAL
|
transform != TRANSLATIONAL
|
||||||
&& ordering != COINCIDENTFULLMATCH
|
&& 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
|
// Type is rotation or unknown and normals not aligned
|
||||||
|
|
||||||
tensorField forwardT(Cf.size());
|
tensorField forwardT(thisPatchCtrs.size());
|
||||||
tensorField reverseT(Cf.size());
|
tensorField reverseT(thisPatchCtrs.size());
|
||||||
|
|
||||||
forAll(forwardT, facei)
|
forAll(forwardT, facei)
|
||||||
{
|
{
|
||||||
forwardT[facei] = rotationTensor(-nr[facei], nf[facei]);
|
forwardT[facei] = rotationTensor
|
||||||
reverseT[facei] = rotationTensor(nf[facei], -nr[facei]);
|
(
|
||||||
|
-nbrPatchNormals[facei],
|
||||||
|
thisPatchNormals[facei]
|
||||||
|
);
|
||||||
|
|
||||||
|
reverseT[facei] = rotationTensor
|
||||||
|
(
|
||||||
|
thisPatchNormals[facei],
|
||||||
|
-nbrPatchNormals[facei]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sum(mag(forwardT - forwardT[0])) > error)
|
if (sum(mag(forwardT - forwardT[0])) > error)
|
||||||
@ -137,7 +150,7 @@ void Foam::cyclicPolyPatch::calcTransformTensors
|
|||||||
bool sameSeparation = true;
|
bool sameSeparation = true;
|
||||||
bool doneWarning = false;
|
bool doneWarning = false;
|
||||||
|
|
||||||
const vectorField separation(Cr - Cf);
|
const vectorField separation(nbrPatchCtrs - thisPatchCtrs);
|
||||||
|
|
||||||
forAll(separation, facei)
|
forAll(separation, facei)
|
||||||
{
|
{
|
||||||
@ -228,29 +241,29 @@ void Foam::cyclicPolyPatch::calcTransforms()
|
|||||||
{
|
{
|
||||||
if (size())
|
if (size())
|
||||||
{
|
{
|
||||||
// Half0
|
// thisPatch
|
||||||
const cyclicPolyPatch& half0 = *this;
|
const cyclicPolyPatch& thisPatch = *this;
|
||||||
vectorField half0Areas(half0.size());
|
vectorField thisPatchAreas(thisPatch.size());
|
||||||
forAll(half0, facei)
|
forAll(thisPatch, facei)
|
||||||
{
|
{
|
||||||
half0Areas[facei] = half0[facei].area(half0.points());
|
thisPatchAreas[facei] = thisPatch[facei].area(thisPatch.points());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Half1
|
// nbrPatch
|
||||||
const cyclicPolyPatch& half1 = neighbPatch();
|
const cyclicPolyPatch& nbrPatch = this->nbrPatch();
|
||||||
vectorField half1Areas(half1.size());
|
vectorField nbrPatchAreas(nbrPatch.size());
|
||||||
forAll(half1, facei)
|
forAll(nbrPatch, facei)
|
||||||
{
|
{
|
||||||
half1Areas[facei] = half1[facei].area(half1.points());
|
nbrPatchAreas[facei] = nbrPatch[facei].area(nbrPatch.points());
|
||||||
}
|
}
|
||||||
|
|
||||||
calcTransforms
|
calcTransforms
|
||||||
(
|
(
|
||||||
half0,
|
thisPatch,
|
||||||
half0.faceCentres(),
|
thisPatch.faceCentres(),
|
||||||
half0Areas,
|
thisPatchAreas,
|
||||||
half1.faceCentres(),
|
nbrPatch.faceCentres(),
|
||||||
half1Areas
|
nbrPatchAreas
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,11 +271,11 @@ void Foam::cyclicPolyPatch::calcTransforms()
|
|||||||
|
|
||||||
void Foam::cyclicPolyPatch::calcTransforms
|
void Foam::cyclicPolyPatch::calcTransforms
|
||||||
(
|
(
|
||||||
const primitivePatch& half0,
|
const primitivePatch& thisPatch,
|
||||||
const pointField& half0Ctrs,
|
const pointField& thisPatchCtrs,
|
||||||
const vectorField& half0Areas,
|
const vectorField& thisPatchAreas,
|
||||||
const pointField& half1Ctrs,
|
const pointField& nbrPatchCtrs,
|
||||||
const vectorField& half1Areas
|
const vectorField& nbrPatchAreas
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug && owner())
|
if (debug && owner())
|
||||||
@ -272,27 +285,28 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
fileName nm0(casePath/name()+"_faces.obj");
|
fileName nm0(casePath/name()+"_faces.obj");
|
||||||
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name()
|
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name()
|
||||||
<< " faces to OBJ file " << nm0 << endl;
|
<< " 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");
|
fileName nm1(casePath/nbrPatch.name()+"_faces.obj");
|
||||||
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << half1.name()
|
Pout<< "cyclicPolyPatch::calcTransforms : Writing "
|
||||||
|
<< nbrPatch.name()
|
||||||
<< " faces to OBJ file " << nm1 << endl;
|
<< " 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;
|
label vertI = 0;
|
||||||
Pout<< "cyclicPolyPatch::calcTransforms :"
|
Pout<< "cyclicPolyPatch::calcTransforms :"
|
||||||
<< " Writing coupled face centres as lines to " << str.name()
|
<< " Writing coupled face centres as lines to " << str.name()
|
||||||
<< endl;
|
<< 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;
|
str << "v " << p0.x() << ' ' << p0.y() << ' ' << p0.z() << nl;
|
||||||
vertI++;
|
vertI++;
|
||||||
const point& p1 = half1Ctrs[i];
|
const point& p1 = nbrPatchCtrs[i];
|
||||||
str << "v " << p1.x() << ' ' << p1.y() << ' ' << p1.z() << nl;
|
str << "v " << p1.x() << ' ' << p1.y() << ' ' << p1.z() << nl;
|
||||||
vertI++;
|
vertI++;
|
||||||
str << "l " << vertI-1 << ' ' << vertI << nl;
|
str << "l " << vertI-1 << ' ' << vertI << nl;
|
||||||
@ -303,42 +317,42 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
|
|
||||||
// Some sanity checks
|
// Some sanity checks
|
||||||
|
|
||||||
if (half0Ctrs.size() != half1Ctrs.size())
|
if (thisPatchCtrs.size() != nbrPatchCtrs.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "For patch " << name()
|
<< "For patch " << name()
|
||||||
<< " there are " << half0Ctrs.size()
|
<< " there are " << thisPatchCtrs.size()
|
||||||
<< " face centres, for the neighbour patch " << neighbPatch().name()
|
<< " face centres, for the neighbour patch " << nbrPatch().name()
|
||||||
<< " there are " << half1Ctrs.size()
|
<< " there are " << nbrPatchCtrs.size()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transformType() != neighbPatch().transformType())
|
if (transformType() != nbrPatch().transformType())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Patch " << name()
|
<< "Patch " << name()
|
||||||
<< " has transform type " << transformTypeNames[transformType()]
|
<< " has transform type " << transformTypeNames[transformType()]
|
||||||
<< ", neighbour patch " << neighbPatchName()
|
<< ", neighbour patch " << nbrPatchName()
|
||||||
<< " has transform type "
|
<< " has transform type "
|
||||||
<< neighbPatch().transformTypeNames[neighbPatch().transformType()]
|
<< nbrPatch().transformTypeNames[nbrPatch().transformType()]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Calculate transformation tensors
|
// Calculate transformation tensors
|
||||||
|
|
||||||
if (half0Ctrs.size() > 0)
|
if (thisPatchCtrs.size() > 0)
|
||||||
{
|
{
|
||||||
vectorField half0Normals(half0Areas.size());
|
vectorField thisPatchNormals(thisPatchAreas.size());
|
||||||
vectorField half1Normals(half1Areas.size());
|
vectorField nbrPatchNormals(nbrPatchAreas.size());
|
||||||
|
|
||||||
scalar maxAreaDiff = -great;
|
scalar maxAreaDiff = -great;
|
||||||
label maxAreaFacei = -1;
|
label maxAreaFacei = -1;
|
||||||
|
|
||||||
forAll(half0, facei)
|
forAll(thisPatch, facei)
|
||||||
{
|
{
|
||||||
scalar magSf = mag(half0Areas[facei]);
|
scalar magSf = mag(thisPatchAreas[facei]);
|
||||||
scalar nbrMagSf = mag(half1Areas[facei]);
|
scalar nbrMagSf = mag(nbrPatchAreas[facei]);
|
||||||
scalar avSf = (magSf + nbrMagSf)/2.0;
|
scalar avSf = (magSf + nbrMagSf)/2.0;
|
||||||
|
|
||||||
if (magSf < rootVSmall && nbrMagSf < rootVSmall)
|
if (magSf < rootVSmall && nbrMagSf < rootVSmall)
|
||||||
@ -346,8 +360,8 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
// Undetermined normal. Use dummy normal to force separation
|
// Undetermined normal. Use dummy normal to force separation
|
||||||
// check. (note use of sqrt(vSmall) since that is how mag
|
// check. (note use of sqrt(vSmall) since that is how mag
|
||||||
// scales)
|
// scales)
|
||||||
half0Normals[facei] = point(1, 0, 0);
|
thisPatchNormals[facei] = point(1, 0, 0);
|
||||||
half1Normals[facei] = half0Normals[facei];
|
nbrPatchNormals[facei] = thisPatchNormals[facei];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -372,9 +386,9 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
<< " matching tolerance:" << matchTolerance()
|
<< " matching tolerance:" << matchTolerance()
|
||||||
<< endl
|
<< endl
|
||||||
<< "Mesh face:" << start()+facei
|
<< "Mesh face:" << start()+facei
|
||||||
<< " fc:" << half0Ctrs[facei]
|
<< " fc:" << thisPatchCtrs[facei]
|
||||||
<< endl
|
<< endl
|
||||||
<< "Neighbour fc:" << half1Ctrs[facei]
|
<< "Neighbour fc:" << nbrPatchCtrs[facei]
|
||||||
<< endl
|
<< endl
|
||||||
<< "If you are certain your matching is correct"
|
<< "If you are certain your matching is correct"
|
||||||
<< " you can increase the 'matchTolerance' setting"
|
<< " you can increase the 'matchTolerance' setting"
|
||||||
@ -385,8 +399,8 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
half0Normals[facei] = half0Areas[facei] / magSf;
|
thisPatchNormals[facei] = thisPatchAreas[facei] / magSf;
|
||||||
half1Normals[facei] = half1Areas[facei] / nbrMagSf;
|
nbrPatchNormals[facei] = nbrPatchAreas[facei] / nbrMagSf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -398,8 +412,8 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
Pout<< "cyclicPolyPatch::calcTransforms :"
|
Pout<< "cyclicPolyPatch::calcTransforms :"
|
||||||
<< " patch:" << name()
|
<< " patch:" << name()
|
||||||
<< " Max area error:" << 100*maxAreaDiff << "% at face:"
|
<< " Max area error:" << 100*maxAreaDiff << "% at face:"
|
||||||
<< maxAreaFacei << " at:" << half0Ctrs[maxAreaFacei]
|
<< maxAreaFacei << " at:" << thisPatchCtrs[maxAreaFacei]
|
||||||
<< " coupled face at:" << half1Ctrs[maxAreaFacei]
|
<< " coupled face at:" << nbrPatchCtrs[maxAreaFacei]
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,8 +424,8 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
{
|
{
|
||||||
// Calculate using the given rotation axis and centre. Do not
|
// Calculate using the given rotation axis and centre. Do not
|
||||||
// use calculated normals.
|
// use calculated normals.
|
||||||
vector n0 = findFaceMaxRadius(half0Ctrs);
|
vector n0 = findFaceMaxRadius(thisPatchCtrs);
|
||||||
vector n1 = -findFaceMaxRadius(half1Ctrs);
|
vector n1 = -findFaceMaxRadius(nbrPatchCtrs);
|
||||||
n0 /= mag(n0) + vSmall;
|
n0 /= mag(n0) + vSmall;
|
||||||
n1 /= mag(n1) + vSmall;
|
n1 /= mag(n1) + vSmall;
|
||||||
|
|
||||||
@ -455,31 +469,31 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
<< separation_ << endl;
|
<< separation_ << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalarField half0Tols
|
const scalarField thisPatchTols
|
||||||
(
|
(
|
||||||
matchTolerance()
|
matchTolerance()
|
||||||
*calcFaceTol
|
*calcFaceTol
|
||||||
(
|
(
|
||||||
half0,
|
thisPatch,
|
||||||
half0.points(),
|
thisPatch.points(),
|
||||||
static_cast<const pointField&>(half0Ctrs)
|
static_cast<const pointField&>(thisPatchCtrs)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check that separation vectors are same.
|
// Check that separation vectors are same.
|
||||||
const scalar avgTol = average(half0Tols);
|
const scalar avgTol = average(thisPatchTols);
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
mag(separation_ + neighbPatch().separation_) > avgTol
|
mag(separation_ + nbrPatch().separation_) > avgTol
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Specified separation vector " << separation_
|
<< "Specified separation vector " << separation_
|
||||||
<< " differs by that of neighbouring patch "
|
<< " differs by that of neighbouring patch "
|
||||||
<< neighbPatch().separation_
|
<< nbrPatch().separation_
|
||||||
<< " by more than tolerance " << avgTol << endl
|
<< " by more than tolerance " << avgTol << endl
|
||||||
<< "patch:" << name()
|
<< "patch:" << name()
|
||||||
<< " neighbour:" << neighbPatchName()
|
<< " neighbour:" << nbrPatchName()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,24 +502,24 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const scalarField half0Tols
|
const scalarField thisPatchTols
|
||||||
(
|
(
|
||||||
matchTolerance()
|
matchTolerance()
|
||||||
*calcFaceTol
|
*calcFaceTol
|
||||||
(
|
(
|
||||||
half0,
|
thisPatch,
|
||||||
half0.points(),
|
thisPatch.points(),
|
||||||
static_cast<const pointField&>(half0Ctrs)
|
static_cast<const pointField&>(thisPatchCtrs)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
calcTransformTensors
|
calcTransformTensors
|
||||||
(
|
(
|
||||||
static_cast<const pointField&>(half0Ctrs),
|
thisPatchCtrs,
|
||||||
static_cast<const pointField&>(half1Ctrs),
|
nbrPatchCtrs,
|
||||||
half0Normals,
|
thisPatchNormals,
|
||||||
half1Normals,
|
nbrPatchNormals,
|
||||||
half0Tols,
|
thisPatchTols,
|
||||||
matchTolerance(),
|
matchTolerance(),
|
||||||
ordering(),
|
ordering(),
|
||||||
transformType()
|
transformType()
|
||||||
@ -520,35 +534,35 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
|||||||
const primitivePatch& pp0,
|
const primitivePatch& pp0,
|
||||||
const primitivePatch& pp1,
|
const primitivePatch& pp1,
|
||||||
|
|
||||||
pointField& half0Ctrs,
|
pointField& thisPatchCtrs,
|
||||||
pointField& half1Ctrs,
|
pointField& nbrPatchCtrs,
|
||||||
pointField& anchors0,
|
pointField& anchors0,
|
||||||
scalarField& tols
|
scalarField& tols
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Get geometric data on both halves.
|
// Get geometric data on both halves.
|
||||||
half0Ctrs = pp0.faceCentres();
|
thisPatchCtrs = pp0.faceCentres();
|
||||||
anchors0 = getAnchorPoints(pp0, pp0.points(), ordering());
|
anchors0 = getAnchorPoints(pp0, pp0.points(), ordering());
|
||||||
half1Ctrs = pp1.faceCentres();
|
nbrPatchCtrs = pp1.faceCentres();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "cyclicPolyPatch::getCentresAndAnchors :"
|
Pout<< "cyclicPolyPatch::getCentresAndAnchors :"
|
||||||
<< " patch:" << name() << nl
|
<< " patch:" << name() << nl
|
||||||
<< "half0 untransformed faceCentres (avg) : "
|
<< "thisPatch untransformed faceCentres (avg) : "
|
||||||
<< gAverage(half0Ctrs) << nl
|
<< gAverage(thisPatchCtrs) << nl
|
||||||
<< "half1 untransformed faceCentres (avg) : "
|
<< "nbrPatch untransformed faceCentres (avg) : "
|
||||||
<< gAverage(half1Ctrs) << endl;
|
<< gAverage(nbrPatchCtrs) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (half0Ctrs.size())
|
if (thisPatchCtrs.size())
|
||||||
{
|
{
|
||||||
switch (transformType())
|
switch (transformType())
|
||||||
{
|
{
|
||||||
case ROTATIONAL:
|
case ROTATIONAL:
|
||||||
{
|
{
|
||||||
vector n0 = findFaceMaxRadius(half0Ctrs);
|
vector n0 = findFaceMaxRadius(thisPatchCtrs);
|
||||||
vector n1 = -findFaceMaxRadius(half1Ctrs);
|
vector n1 = -findFaceMaxRadius(nbrPatchCtrs);
|
||||||
n0 /= mag(n0) + vSmall;
|
n0 /= mag(n0) + vSmall;
|
||||||
n1 /= mag(n1) + vSmall;
|
n1 /= mag(n1) + vSmall;
|
||||||
|
|
||||||
@ -581,13 +595,13 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
|||||||
const tensor revT(E1.T() & E0);
|
const tensor revT(E1.T() & E0);
|
||||||
|
|
||||||
// Rotation
|
// Rotation
|
||||||
forAll(half0Ctrs, facei)
|
forAll(thisPatchCtrs, facei)
|
||||||
{
|
{
|
||||||
half0Ctrs[facei] =
|
thisPatchCtrs[facei] =
|
||||||
Foam::transform
|
Foam::transform
|
||||||
(
|
(
|
||||||
revT,
|
revT,
|
||||||
half0Ctrs[facei] - rotationCentre_
|
thisPatchCtrs[facei] - rotationCentre_
|
||||||
)
|
)
|
||||||
+ rotationCentre_;
|
+ rotationCentre_;
|
||||||
anchors0[facei] =
|
anchors0[facei] =
|
||||||
@ -616,7 +630,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
|||||||
// Note: getCentresAndAnchors gets called on the slave side
|
// Note: getCentresAndAnchors gets called on the slave side
|
||||||
// so separation is owner-slave points.
|
// so separation is owner-slave points.
|
||||||
|
|
||||||
half0Ctrs -= separation_;
|
thisPatchCtrs -= separation_;
|
||||||
anchors0 -= separation_;
|
anchors0 -= separation_;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -647,12 +661,12 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
|||||||
const tensor revT(rotationTensor(n0, -n1));
|
const tensor revT(rotationTensor(n0, -n1));
|
||||||
|
|
||||||
// Rotation
|
// Rotation
|
||||||
forAll(half0Ctrs, facei)
|
forAll(thisPatchCtrs, facei)
|
||||||
{
|
{
|
||||||
half0Ctrs[facei] = Foam::transform
|
thisPatchCtrs[facei] = Foam::transform
|
||||||
(
|
(
|
||||||
revT,
|
revT,
|
||||||
half0Ctrs[facei]
|
thisPatchCtrs[facei]
|
||||||
);
|
);
|
||||||
anchors0[facei] = Foam::transform
|
anchors0[facei] = Foam::transform
|
||||||
(
|
(
|
||||||
@ -677,7 +691,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
|||||||
<< " ctr0:" << ctr0 << " ctr1:" << ctr1 << endl;
|
<< " ctr0:" << ctr0 << " ctr1:" << ctr1 << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
half0Ctrs += ctr1 - ctr0;
|
thisPatchCtrs += ctr1 - ctr0;
|
||||||
anchors0 += ctr1 - ctr0;
|
anchors0 += ctr1 - ctr0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -686,7 +700,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate typical distance per face
|
// 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),
|
coupledPolyPatch(name, size, start, index, bm, patchType, ordering),
|
||||||
neighbPatchName_(word::null),
|
nbrPatchName_(word::null),
|
||||||
neighbPatchID_(-1),
|
nbrPatchID_(-1),
|
||||||
rotationAxis_(Zero),
|
rotationAxis_(Zero),
|
||||||
rotationCentre_(Zero),
|
rotationCentre_(Zero),
|
||||||
coupledPointsPtr_(nullptr),
|
coupledPointsPtr_(nullptr),
|
||||||
@ -750,13 +764,13 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
|||||||
const label index,
|
const label index,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const word& patchType,
|
const word& patchType,
|
||||||
const word& neighbPatchName,
|
const word& nbrPatchName,
|
||||||
const orderingType ordering
|
const orderingType ordering
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
coupledPolyPatch(name, size, start, index, bm, patchType, ordering),
|
coupledPolyPatch(name, size, start, index, bm, patchType, ordering),
|
||||||
neighbPatchName_(neighbPatchName),
|
nbrPatchName_(nbrPatchName),
|
||||||
neighbPatchID_(-1),
|
nbrPatchID_(-1),
|
||||||
rotationAxis_(Zero),
|
rotationAxis_(Zero),
|
||||||
rotationCentre_(Zero),
|
rotationCentre_(Zero),
|
||||||
coupledPointsPtr_(nullptr),
|
coupledPointsPtr_(nullptr),
|
||||||
@ -779,15 +793,15 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
|||||||
:
|
:
|
||||||
coupledPolyPatch(name, dict, index, bm, patchType, ordering),
|
coupledPolyPatch(name, dict, index, bm, patchType, ordering),
|
||||||
cyclicTransform(dict),
|
cyclicTransform(dict),
|
||||||
neighbPatchName_(dict.lookupOrDefault("neighbourPatch", word::null)),
|
nbrPatchName_(dict.lookupOrDefault("neighbourPatch", word::null)),
|
||||||
coupleGroup_(dict),
|
coupleGroup_(dict),
|
||||||
neighbPatchID_(-1),
|
nbrPatchID_(-1),
|
||||||
rotationAxis_(Zero),
|
rotationAxis_(Zero),
|
||||||
rotationCentre_(Zero),
|
rotationCentre_(Zero),
|
||||||
coupledPointsPtr_(nullptr),
|
coupledPointsPtr_(nullptr),
|
||||||
coupledEdgesPtr_(nullptr)
|
coupledEdgesPtr_(nullptr)
|
||||||
{
|
{
|
||||||
if (neighbPatchName_ == word::null && !coupleGroup_.valid())
|
if (nbrPatchName_ == word::null && !coupleGroup_.valid())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction
|
FatalIOErrorInFunction
|
||||||
(
|
(
|
||||||
@ -798,10 +812,10 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
|||||||
<< " to split cyclics." << exit(FatalIOError);
|
<< " to split cyclics." << exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (neighbPatchName_ == name)
|
if (nbrPatchName_ == name)
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
FatalIOErrorInFunction(dict)
|
||||||
<< "Neighbour patch name " << neighbPatchName_
|
<< "Neighbour patch name " << nbrPatchName_
|
||||||
<< " cannot be the same as this patch " << name
|
<< " cannot be the same as this patch " << name
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
@ -849,9 +863,9 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
|||||||
:
|
:
|
||||||
coupledPolyPatch(pp, bm),
|
coupledPolyPatch(pp, bm),
|
||||||
cyclicTransform(pp),
|
cyclicTransform(pp),
|
||||||
neighbPatchName_(pp.neighbPatchName_),
|
nbrPatchName_(pp.nbrPatchName_),
|
||||||
coupleGroup_(pp.coupleGroup_),
|
coupleGroup_(pp.coupleGroup_),
|
||||||
neighbPatchID_(-1),
|
nbrPatchID_(-1),
|
||||||
rotationAxis_(pp.rotationAxis_),
|
rotationAxis_(pp.rotationAxis_),
|
||||||
rotationCentre_(pp.rotationCentre_),
|
rotationCentre_(pp.rotationCentre_),
|
||||||
coupledPointsPtr_(nullptr),
|
coupledPointsPtr_(nullptr),
|
||||||
@ -869,23 +883,23 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
|||||||
const label index,
|
const label index,
|
||||||
const label newSize,
|
const label newSize,
|
||||||
const label newStart,
|
const label newStart,
|
||||||
const word& neighbName
|
const word& neiName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
coupledPolyPatch(pp, bm, index, newSize, newStart),
|
coupledPolyPatch(pp, bm, index, newSize, newStart),
|
||||||
cyclicTransform(pp),
|
cyclicTransform(pp),
|
||||||
neighbPatchName_(neighbName),
|
nbrPatchName_(neiName),
|
||||||
coupleGroup_(pp.coupleGroup_),
|
coupleGroup_(pp.coupleGroup_),
|
||||||
neighbPatchID_(-1),
|
nbrPatchID_(-1),
|
||||||
rotationAxis_(pp.rotationAxis_),
|
rotationAxis_(pp.rotationAxis_),
|
||||||
rotationCentre_(pp.rotationCentre_),
|
rotationCentre_(pp.rotationCentre_),
|
||||||
coupledPointsPtr_(nullptr),
|
coupledPointsPtr_(nullptr),
|
||||||
coupledEdgesPtr_(nullptr)
|
coupledEdgesPtr_(nullptr)
|
||||||
{
|
{
|
||||||
if (neighbName == name())
|
if (neiName == name())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Neighbour patch name " << neighbName
|
<< "Neighbour patch name " << neiName
|
||||||
<< " cannot be the same as this patch " << name()
|
<< " cannot be the same as this patch " << name()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -906,9 +920,9 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
|||||||
:
|
:
|
||||||
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
|
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
|
||||||
cyclicTransform(pp),
|
cyclicTransform(pp),
|
||||||
neighbPatchName_(pp.neighbPatchName_),
|
nbrPatchName_(pp.nbrPatchName_),
|
||||||
coupleGroup_(pp.coupleGroup_),
|
coupleGroup_(pp.coupleGroup_),
|
||||||
neighbPatchID_(-1),
|
nbrPatchID_(-1),
|
||||||
rotationAxis_(pp.rotationAxis_),
|
rotationAxis_(pp.rotationAxis_),
|
||||||
rotationCentre_(pp.rotationCentre_),
|
rotationCentre_(pp.rotationCentre_),
|
||||||
coupledPointsPtr_(nullptr),
|
coupledPointsPtr_(nullptr),
|
||||||
@ -927,29 +941,29 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * 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
|
// Try and use patchGroup to find samplePatch and sampleRegion
|
||||||
label patchID = coupleGroup_.findOtherPatchID(*this);
|
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
|
FatalErrorInFunction
|
||||||
<< "Illegal neighbourPatch name " << neighbPatchName()
|
<< "Illegal neighbourPatch name " << nbrPatchName()
|
||||||
<< endl << "Valid patch names are "
|
<< endl << "Valid patch names are "
|
||||||
<< this->boundaryMesh().names()
|
<< this->boundaryMesh().names()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
@ -958,20 +972,20 @@ Foam::label Foam::cyclicPolyPatch::neighbPatchID() const
|
|||||||
// Check that it is a cyclic
|
// Check that it is a cyclic
|
||||||
const cyclicPolyPatch& nbrPatch = refCast<const cyclicPolyPatch>
|
const cyclicPolyPatch& nbrPatch = refCast<const cyclicPolyPatch>
|
||||||
(
|
(
|
||||||
this->boundaryMesh()[neighbPatchID_]
|
this->boundaryMesh()[nbrPatchID_]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (nbrPatch.neighbPatchName() != name())
|
if (nbrPatch.nbrPatchName() != name())
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Patch " << name()
|
<< "Patch " << name()
|
||||||
<< " specifies neighbour patch " << neighbPatchName()
|
<< " specifies neighbour patch " << nbrPatchName()
|
||||||
<< endl << " but that in return specifies "
|
<< endl << " but that in return specifies "
|
||||||
<< nbrPatch.neighbPatchName()
|
<< nbrPatch.nbrPatchName()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return neighbPatchID_;
|
return nbrPatchID_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1066,9 +1080,9 @@ void Foam::cyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
|||||||
faceCentres(),
|
faceCentres(),
|
||||||
faceAreas(),
|
faceAreas(),
|
||||||
faceCellCentres(),
|
faceCellCentres(),
|
||||||
neighbPatch().faceCentres(),
|
nbrPatch().faceCentres(),
|
||||||
neighbPatch().faceAreas(),
|
nbrPatch().faceAreas(),
|
||||||
neighbPatch().faceCellCentres()
|
nbrPatch().faceCellCentres()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1112,8 +1126,8 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledPoints() const
|
|||||||
{
|
{
|
||||||
if (!coupledPointsPtr_)
|
if (!coupledPointsPtr_)
|
||||||
{
|
{
|
||||||
const faceList& nbrLocalFaces = neighbPatch().localFaces();
|
const faceList& nbrLocalFaces = nbrPatch().localFaces();
|
||||||
const labelList& nbrMeshPoints = neighbPatch().meshPoints();
|
const labelList& nbrMeshPoints = nbrPatch().meshPoints();
|
||||||
|
|
||||||
// Now all we know is that relative face index in *this is same
|
// Now all we know is that relative face index in *this is same
|
||||||
// as coupled face in nbrPatch and also that the 0th vertex
|
// 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.
|
// Use the edgeMap to get the edges on the B side.
|
||||||
|
|
||||||
const cyclicPolyPatch& neighbPatch = this->neighbPatch();
|
const cyclicPolyPatch& nbrPatch = this->nbrPatch();
|
||||||
const labelList& nbrMp = neighbPatch.meshPoints();
|
const labelList& nbrMp = nbrPatch.meshPoints();
|
||||||
const labelList& mp = meshPoints();
|
const labelList& mp = meshPoints();
|
||||||
|
|
||||||
|
|
||||||
@ -1243,15 +1257,15 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledEdges() const
|
|||||||
edgeList& coupledEdges = *coupledEdgesPtr_;
|
edgeList& coupledEdges = *coupledEdgesPtr_;
|
||||||
label coupleI = 0;
|
label coupleI = 0;
|
||||||
|
|
||||||
forAll(neighbPatch, patchFacei)
|
forAll(nbrPatch, patchFacei)
|
||||||
{
|
{
|
||||||
const labelList& fEdges = neighbPatch.faceEdges()[patchFacei];
|
const labelList& fEdges = nbrPatch.faceEdges()[patchFacei];
|
||||||
|
|
||||||
forAll(fEdges, i)
|
forAll(fEdges, i)
|
||||||
{
|
{
|
||||||
label edgeI = fEdges[i];
|
label edgeI = fEdges[i];
|
||||||
|
|
||||||
const edge& e = neighbPatch.edges()[edgeI];
|
const edge& e = nbrPatch.edges()[edgeI];
|
||||||
|
|
||||||
// Look up A edge from HashTable.
|
// Look up A edge from HashTable.
|
||||||
EdgeMap<label>::iterator iter = edgeMap.find(e);
|
EdgeMap<label>::iterator iter = edgeMap.find(e);
|
||||||
@ -1311,9 +1325,9 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledEdges() const
|
|||||||
const edge& e = coupledEdges[i];
|
const edge& e = coupledEdges[i];
|
||||||
|
|
||||||
const point& a = edges()[e[0]].centre(localPoints());
|
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;
|
str<< "v " << a.x() << ' ' << a.y() << ' ' << a.z() << nl;
|
||||||
@ -1362,7 +1376,7 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
{
|
{
|
||||||
Pout<< "order : of " << pp.size()
|
Pout<< "order : of " << pp.size()
|
||||||
<< " faces of patch:" << name()
|
<< " faces of patch:" << name()
|
||||||
<< " neighbour:" << neighbPatchName()
|
<< " neighbour:" << nbrPatchName()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
faceMap.setSize(pp.size());
|
faceMap.setSize(pp.size());
|
||||||
@ -1391,35 +1405,35 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Get stored geometry from initOrder invocation of owner.
|
// Get stored geometry from initOrder invocation of owner.
|
||||||
const primitivePatch& pp0 = neighbPatch().ownerPatchPtr_();
|
const primitivePatch& pp0 = nbrPatch().ownerPatchPtr_();
|
||||||
|
|
||||||
// Get geometric quantities
|
// Get geometric quantities
|
||||||
pointField half0Ctrs, half1Ctrs, anchors0;
|
pointField thisPatchCtrs, nbrPatchCtrs, anchors0;
|
||||||
scalarField tols;
|
scalarField tols;
|
||||||
getCentresAndAnchors
|
getCentresAndAnchors
|
||||||
(
|
(
|
||||||
pp0,
|
pp0,
|
||||||
pp,
|
pp,
|
||||||
|
|
||||||
half0Ctrs,
|
thisPatchCtrs,
|
||||||
half1Ctrs,
|
nbrPatchCtrs,
|
||||||
anchors0,
|
anchors0,
|
||||||
tols
|
tols
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "half0 transformed faceCentres (avg) : "
|
Pout<< "thisPatch transformed faceCentres (avg) : "
|
||||||
<< gAverage(half0Ctrs) << nl
|
<< gAverage(thisPatchCtrs) << nl
|
||||||
<< "half1 untransformed faceCentres (avg) : "
|
<< "nbrPatch untransformed faceCentres (avg) : "
|
||||||
<< gAverage(half1Ctrs) << endl;
|
<< gAverage(nbrPatchCtrs) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Geometric match of face centre vectors
|
// Geometric match of face centre vectors
|
||||||
bool matchedAll = matchPoints
|
bool matchedAll = matchPoints
|
||||||
(
|
(
|
||||||
half1Ctrs,
|
nbrPatchCtrs,
|
||||||
half0Ctrs,
|
thisPatchCtrs,
|
||||||
tols,
|
tols,
|
||||||
true,
|
true,
|
||||||
faceMap
|
faceMap
|
||||||
@ -1431,7 +1445,7 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
fileName nm0
|
fileName nm0
|
||||||
(
|
(
|
||||||
boundaryMesh().mesh().time().path()
|
boundaryMesh().mesh().time().path()
|
||||||
/neighbPatch().name()+"_faces.obj"
|
/nbrPatch().name()+"_faces.obj"
|
||||||
);
|
);
|
||||||
Pout<< "cyclicPolyPatch::order : Writing neighbour"
|
Pout<< "cyclicPolyPatch::order : Writing neighbour"
|
||||||
<< " faces to OBJ file " << nm0 << endl;
|
<< " faces to OBJ file " << nm0 << endl;
|
||||||
@ -1457,17 +1471,17 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
// Recalculate untransformed face centres
|
// Recalculate untransformed face centres
|
||||||
// pointField rawHalf0Ctrs =
|
// pointField rawthisPatchCtrs =
|
||||||
// calcFaceCentres(half0Faces, pp.points());
|
// calcFaceCentres(thisPatchFaces, pp.points());
|
||||||
label vertI = 0;
|
label vertI = 0;
|
||||||
|
|
||||||
forAll(half1Ctrs, i)
|
forAll(nbrPatchCtrs, i)
|
||||||
{
|
{
|
||||||
if (faceMap[i] != -1)
|
if (faceMap[i] != -1)
|
||||||
{
|
{
|
||||||
// Write edge between c1 and c0
|
// Write edge between c1 and c0
|
||||||
const point& c0 = half0Ctrs[faceMap[i]];
|
const point& c0 = thisPatchCtrs[faceMap[i]];
|
||||||
const point& c1 = half1Ctrs[i];
|
const point& c1 = nbrPatchCtrs[i];
|
||||||
writeOBJ(ccStr, c0, c1, vertI);
|
writeOBJ(ccStr, c0, c1, vertI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1545,9 +1559,9 @@ void Foam::cyclicPolyPatch::write(Ostream& os) const
|
|||||||
{
|
{
|
||||||
coupledPolyPatch::write(os);
|
coupledPolyPatch::write(os);
|
||||||
|
|
||||||
if (!neighbPatchName_.empty())
|
if (!nbrPatchName_.empty())
|
||||||
{
|
{
|
||||||
writeEntry(os, "neighbourPatch", neighbPatchName_);
|
writeEntry(os, "neighbourPatch", nbrPatchName_);
|
||||||
}
|
}
|
||||||
|
|
||||||
coupleGroup_.write(os);
|
coupleGroup_.write(os);
|
||||||
|
|||||||
@ -69,14 +69,14 @@ class cyclicPolyPatch
|
|||||||
{
|
{
|
||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Name of other half
|
//- Name of cyclic neighbour patch
|
||||||
mutable word neighbPatchName_;
|
mutable word nbrPatchName_;
|
||||||
|
|
||||||
//- Optional patchGroup to find neighbPatch
|
//- Optional patchGroup to find neighbour patch
|
||||||
const coupleGroupIdentifier coupleGroup_;
|
const coupleGroupIdentifier coupleGroup_;
|
||||||
|
|
||||||
//- Index of other half
|
//- Index of cyclic neighbour patch
|
||||||
mutable label neighbPatchID_;
|
mutable label nbrPatchID_;
|
||||||
|
|
||||||
// Specified transformation
|
// Specified transformation
|
||||||
|
|
||||||
@ -94,12 +94,11 @@ class cyclicPolyPatch
|
|||||||
point rotationCentre_;
|
point rotationCentre_;
|
||||||
|
|
||||||
//- List of edges formed from connected points. e[0] is the point on
|
//- 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
|
// this patch, e[1] the corresponding point on the cyclic neighbour.
|
||||||
// second half.
|
|
||||||
mutable edgeList* coupledPointsPtr_;
|
mutable edgeList* coupledPointsPtr_;
|
||||||
|
|
||||||
//- List of connected edges. e[0] is the edge on the first half of the
|
//- List of connected edges. e[0] is the edge on this patch,
|
||||||
// patch, e[1] the corresponding edge on the second half.
|
// e[1] the corresponding edge on the cyclic neigbour
|
||||||
mutable edgeList* coupledEdgesPtr_;
|
mutable edgeList* coupledEdgesPtr_;
|
||||||
|
|
||||||
//- Temporary storage of owner side patch during ordering.
|
//- Temporary storage of owner side patch during ordering.
|
||||||
@ -115,10 +114,10 @@ class cyclicPolyPatch
|
|||||||
// translational transform
|
// translational transform
|
||||||
void calcTransformTensors
|
void calcTransformTensors
|
||||||
(
|
(
|
||||||
const vectorField& Cf,
|
const vectorField& thisPatchCtrs,
|
||||||
const vectorField& Cr,
|
const vectorField& nbrPatchCtrs,
|
||||||
const vectorField& nf,
|
const vectorField& thisPatchNormals,
|
||||||
const vectorField& nr,
|
const vectorField& nbrPatchNormals,
|
||||||
const scalarField& smallDist,
|
const scalarField& smallDist,
|
||||||
const scalar absTol,
|
const scalar absTol,
|
||||||
const orderingType = UNKNOWN,
|
const orderingType = UNKNOWN,
|
||||||
@ -130,26 +129,24 @@ class cyclicPolyPatch
|
|||||||
|
|
||||||
void calcTransforms
|
void calcTransforms
|
||||||
(
|
(
|
||||||
const primitivePatch& half0,
|
const primitivePatch& thisPatch,
|
||||||
const pointField& half0Ctrs,
|
const pointField& thisPatchCtrs,
|
||||||
const vectorField& half0Areas,
|
const vectorField& thisPatchAreas,
|
||||||
const pointField& half1Ctrs,
|
const pointField& nbrPatchCtrs,
|
||||||
const vectorField& half1Areas
|
const vectorField& nbrPatchAreas
|
||||||
);
|
);
|
||||||
|
|
||||||
// Face ordering
|
// Face ordering
|
||||||
|
|
||||||
// Given a split of faces into left and right half calculate the
|
// Transform the points of this patch so they align with those of
|
||||||
// centres and anchor points. Transform the left points so they
|
// the cyclic neighbour
|
||||||
// align with the right ones
|
|
||||||
void getCentresAndAnchors
|
void getCentresAndAnchors
|
||||||
(
|
(
|
||||||
const primitivePatch& pp0,
|
const primitivePatch& thisPatch,
|
||||||
const primitivePatch& pp1,
|
const primitivePatch& nbrPatch,
|
||||||
|
pointField& thisPatchCtrs,
|
||||||
pointField& half0Ctrs,
|
pointField& nbrPatchCtrs,
|
||||||
pointField& half1Ctrs,
|
pointField& anchors,
|
||||||
pointField& anchors0,
|
|
||||||
scalarField& tols
|
scalarField& tols
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -236,7 +233,7 @@ public:
|
|||||||
const label index,
|
const label index,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const word& patchType,
|
const word& patchType,
|
||||||
const word& neighbPatchName,
|
const word& nbrPatchName,
|
||||||
const orderingType ordering
|
const orderingType ordering
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -263,7 +260,7 @@ public:
|
|||||||
const label index,
|
const label index,
|
||||||
const label newSize,
|
const label newSize,
|
||||||
const label newStart,
|
const label newStart,
|
||||||
const word& neighbPatchName
|
const word& nbrPatchName
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct given the original patch and a map
|
//- Construct given the original patch and a map
|
||||||
@ -301,7 +298,7 @@ public:
|
|||||||
index,
|
index,
|
||||||
newSize,
|
newSize,
|
||||||
newStart,
|
newStart,
|
||||||
neighbPatchName_
|
nbrPatchName_
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -330,14 +327,14 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Neighbour patch name
|
//- Neighbour patch name
|
||||||
const word& neighbPatchName() const;
|
const word& nbrPatchName() const;
|
||||||
|
|
||||||
//- Neighbour patchID
|
//- Neighbour patchID
|
||||||
virtual label neighbPatchID() const;
|
virtual label nbrPatchID() const;
|
||||||
|
|
||||||
virtual bool owner() const
|
virtual bool owner() const
|
||||||
{
|
{
|
||||||
return index() < neighbPatchID();
|
return index() < nbrPatchID();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool neighbour() const
|
virtual bool neighbour() const
|
||||||
@ -345,9 +342,9 @@ public:
|
|||||||
return !owner();
|
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);
|
return refCast<const cyclicPolyPatch>(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,11 +376,11 @@ public:
|
|||||||
label transformGlobalFace(const label facei) const
|
label transformGlobalFace(const label facei) const
|
||||||
{
|
{
|
||||||
label offset = facei-start();
|
label offset = facei-start();
|
||||||
label neighbStart = neighbPatch().start();
|
label neiStart = nbrPatch().start();
|
||||||
|
|
||||||
if (offset >= 0 && offset < size())
|
if (offset >= 0 && offset < size())
|
||||||
{
|
{
|
||||||
return neighbStart+offset;
|
return neiStart+offset;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -107,10 +107,10 @@ public:
|
|||||||
const label index,
|
const label index,
|
||||||
const label newSize,
|
const label newSize,
|
||||||
const label newStart,
|
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,
|
index,
|
||||||
newSize,
|
newSize,
|
||||||
newStart,
|
newStart,
|
||||||
neighbPatchName()
|
nbrPatchName()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -172,8 +172,8 @@ Foam::processorPolyPatch::processorPolyPatch
|
|||||||
|
|
||||||
Foam::processorPolyPatch::~processorPolyPatch()
|
Foam::processorPolyPatch::~processorPolyPatch()
|
||||||
{
|
{
|
||||||
neighbPointsPtr_.clear();
|
nbrPointsPtr_.clear();
|
||||||
neighbEdgesPtr_.clear();
|
nbrEdgesPtr_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -385,8 +385,8 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
|||||||
// For completeness
|
// For completeness
|
||||||
polyPatch::updateMesh(pBufs);
|
polyPatch::updateMesh(pBufs);
|
||||||
|
|
||||||
neighbPointsPtr_.clear();
|
nbrPointsPtr_.clear();
|
||||||
neighbEdgesPtr_.clear();
|
nbrEdgesPtr_.clear();
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
@ -419,8 +419,8 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
|||||||
// Convert points.
|
// Convert points.
|
||||||
// ~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
neighbPointsPtr_.reset(new labelList(nPoints(), -1));
|
nbrPointsPtr_.reset(new labelList(nPoints(), -1));
|
||||||
labelList& neighbPoints = neighbPointsPtr_();
|
labelList& nbrPoints = nbrPointsPtr_();
|
||||||
|
|
||||||
forAll(nbrPointFace, nbrPointi)
|
forAll(nbrPointFace, nbrPointi)
|
||||||
{
|
{
|
||||||
@ -430,32 +430,32 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
|||||||
label index = (f.size() - nbrPointIndex[nbrPointi]) % f.size();
|
label index = (f.size() - nbrPointIndex[nbrPointi]) % f.size();
|
||||||
label patchPointi = f[index];
|
label patchPointi = f[index];
|
||||||
|
|
||||||
if (neighbPoints[patchPointi] == -1)
|
if (nbrPoints[patchPointi] == -1)
|
||||||
{
|
{
|
||||||
// First reference of point
|
// 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.
|
// Point already visited. Mark as duplicate.
|
||||||
neighbPoints[patchPointi] = -2;
|
nbrPoints[patchPointi] = -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset all duplicate entries to -1.
|
// 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.
|
// Convert edges.
|
||||||
// ~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
neighbEdgesPtr_.reset(new labelList(nEdges(), -1));
|
nbrEdgesPtr_.reset(new labelList(nEdges(), -1));
|
||||||
labelList& neighbEdges = neighbEdgesPtr_();
|
labelList& nbrEdges = nbrEdgesPtr_();
|
||||||
|
|
||||||
forAll(nbrEdgeFace, nbrEdgeI)
|
forAll(nbrEdgeFace, nbrEdgeI)
|
||||||
{
|
{
|
||||||
@ -464,24 +464,24 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
|||||||
label index = (f.size() - nbrEdgeIndex[nbrEdgeI] - 1) % f.size();
|
label index = (f.size() - nbrEdgeIndex[nbrEdgeI] - 1) % f.size();
|
||||||
label patchEdgeI = f[index];
|
label patchEdgeI = f[index];
|
||||||
|
|
||||||
if (neighbEdges[patchEdgeI] == -1)
|
if (nbrEdges[patchEdgeI] == -1)
|
||||||
{
|
{
|
||||||
// First reference of edge
|
// 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.
|
// Edge already visited. Mark as duplicate.
|
||||||
neighbEdges[patchEdgeI] = -2;
|
nbrEdges[patchEdgeI] = -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset all duplicate entries to -1.
|
// 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
|
FatalErrorInFunction
|
||||||
<< "No extended addressing calculated for patch " << name()
|
<< "No extended addressing calculated for patch " << name()
|
||||||
<< abort(FatalError);
|
<< 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
|
FatalErrorInFunction
|
||||||
<< "No extended addressing calculated for patch " << name()
|
<< "No extended addressing calculated for patch " << name()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
return neighbEdgesPtr_();
|
return nbrEdgesPtr_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -72,12 +72,12 @@ class processorPolyPatch
|
|||||||
vectorField neighbFaceCellCentres_;
|
vectorField neighbFaceCellCentres_;
|
||||||
|
|
||||||
//- Corresponding neighbouring local point label for every local point
|
//- Corresponding neighbouring local point label for every local point
|
||||||
// (so localPoints()[i] == neighb.localPoints()[neighbPoints_[i]])
|
// (so localPoints()[i] == neighb.localPoints()[nbrPoints_[i]])
|
||||||
mutable autoPtr<labelList> neighbPointsPtr_;
|
mutable autoPtr<labelList> nbrPointsPtr_;
|
||||||
|
|
||||||
//- Corresponding neighbouring local edge label for every local edge
|
//- Corresponding neighbouring local edge label for every local edge
|
||||||
// (so edges()[i] == neighb.edges()[neighbEdges_[i]])
|
// (so edges()[i] == neighb.edges()[nbrEdges_[i]])
|
||||||
mutable autoPtr<labelList> neighbEdgesPtr_;
|
mutable autoPtr<labelList> nbrEdgesPtr_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -313,10 +313,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return neighbour point labels. WIP.
|
//- Return neighbour point labels. WIP.
|
||||||
const labelList& neighbPoints() const;
|
const labelList& nbrPoints() const;
|
||||||
|
|
||||||
//- Return neighbour edge labels. WIP.
|
//- Return neighbour edge labels. WIP.
|
||||||
const labelList& neighbEdges() const;
|
const labelList& nbrEdges() const;
|
||||||
|
|
||||||
//- Return message tag to use for communication
|
//- Return message tag to use for communication
|
||||||
virtual int tag() const
|
virtual int tag() const
|
||||||
|
|||||||
@ -200,7 +200,7 @@ int Foam::processorCyclicPolyPatch::tag() const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tag_ = Hash<word>()(cycPatch.neighbPatch().name()) % 32768u;
|
tag_ = Hash<word>()(cycPatch.nbrPatch().name()) % 32768u;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag_ == Pstream::msgType() || tag_ == -1)
|
if (tag_ == Pstream::msgType() || tag_ == -1)
|
||||||
@ -271,7 +271,7 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
|||||||
neighbFaceCellCentres()
|
neighbFaceCellCentres()
|
||||||
);
|
);
|
||||||
|
|
||||||
const_cast<cyclicPolyPatch&>(pp.neighbPatch()).calcGeometry
|
const_cast<cyclicPolyPatch&>(pp.nbrPatch()).calcGeometry
|
||||||
(
|
(
|
||||||
*this,
|
*this,
|
||||||
neighbFaceCentres(),
|
neighbFaceCentres(),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -147,7 +147,7 @@ void Foam::syncTools::syncPointMap
|
|||||||
// Get data per patchPoint in neighbouring point numbers.
|
// Get data per patchPoint in neighbouring point numbers.
|
||||||
|
|
||||||
const labelList& meshPts = procPatch.meshPoints();
|
const labelList& meshPts = procPatch.meshPoints();
|
||||||
const labelList& nbrPts = procPatch.neighbPoints();
|
const labelList& nbrPts = procPatch.nbrPoints();
|
||||||
|
|
||||||
// Extract local values. Create map from nbrPoint to value.
|
// Extract local values. Create map from nbrPoint to value.
|
||||||
// Note: how small initial size?
|
// Note: how small initial size?
|
||||||
@ -219,7 +219,7 @@ void Foam::syncTools::syncPointMap
|
|||||||
{
|
{
|
||||||
// Owner does all.
|
// Owner does all.
|
||||||
|
|
||||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||||
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
||||||
const labelList& meshPtsA = cycPatch.meshPoints();
|
const labelList& meshPtsA = cycPatch.meshPoints();
|
||||||
const labelList& meshPtsB = nbrPatch.meshPoints();
|
const labelList& meshPtsB = nbrPatch.meshPoints();
|
||||||
@ -429,7 +429,7 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
|
|
||||||
const edgeList& edges = procPatch.edges();
|
const edgeList& edges = procPatch.edges();
|
||||||
const labelList& meshPts = procPatch.meshPoints();
|
const labelList& meshPts = procPatch.meshPoints();
|
||||||
const labelList& nbrPts = procPatch.neighbPoints();
|
const labelList& nbrPts = procPatch.nbrPoints();
|
||||||
|
|
||||||
EdgeMap<T> patchInfo(edges.size() / 20);
|
EdgeMap<T> patchInfo(edges.size() / 20);
|
||||||
|
|
||||||
@ -516,7 +516,7 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
const edgeList& coupledEdges = cycPatch.coupledEdges();
|
const edgeList& coupledEdges = cycPatch.coupledEdges();
|
||||||
const labelList& meshPtsA = cycPatch.meshPoints();
|
const labelList& meshPtsA = cycPatch.meshPoints();
|
||||||
const edgeList& edgesA = cycPatch.edges();
|
const edgeList& edgesA = cycPatch.edges();
|
||||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||||
const labelList& meshPtsB = nbrPatch.meshPoints();
|
const labelList& meshPtsB = nbrPatch.meshPoints();
|
||||||
const edgeList& edgesB = nbrPatch.edges();
|
const edgeList& edgesB = nbrPatch.edges();
|
||||||
|
|
||||||
@ -830,7 +830,7 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
// Field<T> patchInfo(procPatch.nPoints());
|
// Field<T> patchInfo(procPatch.nPoints());
|
||||||
//
|
//
|
||||||
// const labelList& meshPts = procPatch.meshPoints();
|
// const labelList& meshPts = procPatch.meshPoints();
|
||||||
// const labelList& nbrPts = procPatch.neighbPoints();
|
// const labelList& nbrPts = procPatch.nbrPoints();
|
||||||
//
|
//
|
||||||
// forAll(nbrPts, pointi)
|
// forAll(nbrPts, pointi)
|
||||||
// {
|
// {
|
||||||
@ -892,7 +892,7 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
//
|
//
|
||||||
// const edgeList& coupledPoints = cycPatch.coupledPoints();
|
// const edgeList& coupledPoints = cycPatch.coupledPoints();
|
||||||
// const labelList& meshPts = cycPatch.meshPoints();
|
// const labelList& meshPts = cycPatch.meshPoints();
|
||||||
// const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
// const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||||
// const labelList& nbrMeshPoints = nbrPatch.meshPoints();
|
// const labelList& nbrMeshPoints = nbrPatch.meshPoints();
|
||||||
//
|
//
|
||||||
// Field<T> half0Values(coupledPoints.size());
|
// Field<T> half0Values(coupledPoints.size());
|
||||||
@ -1381,7 +1381,7 @@ void Foam::syncTools::syncBoundaryFaceList
|
|||||||
if (cycPatch.owner())
|
if (cycPatch.owner())
|
||||||
{
|
{
|
||||||
// Owner does all.
|
// Owner does all.
|
||||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||||
label ownStart = cycPatch.start()-mesh.nInternalFaces();
|
label ownStart = cycPatch.start()-mesh.nInternalFaces();
|
||||||
label nbrStart = nbrPatch.start()-mesh.nInternalFaces();
|
label nbrStart = nbrPatch.start()-mesh.nInternalFaces();
|
||||||
|
|
||||||
@ -1506,7 +1506,7 @@ void Foam::syncTools::syncFaceList
|
|||||||
if (cycPatch.owner())
|
if (cycPatch.owner())
|
||||||
{
|
{
|
||||||
// Owner does all.
|
// Owner does all.
|
||||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||||
|
|
||||||
for (label i = 0; i < cycPatch.size(); i++)
|
for (label i = 0; i < cycPatch.size(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -126,7 +126,7 @@ Foam::cyclicFvPatchField<Type>::patchNeighbourField() const
|
|||||||
{
|
{
|
||||||
const Field<Type>& iField = this->primitiveField();
|
const Field<Type>& iField = this->primitiveField();
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
cyclicPatch().cyclicPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
tmp<Field<Type>> tpnf(new Field<Type>(this->size()));
|
tmp<Field<Type>> tpnf(new Field<Type>(this->size()));
|
||||||
Field<Type>& pnf = tpnf.ref();
|
Field<Type>& pnf = tpnf.ref();
|
||||||
@ -143,7 +143,7 @@ Foam::cyclicFvPatchField<Type>::patchNeighbourField() const
|
|||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const Foam::cyclicFvPatchField<Type>&
|
const Foam::cyclicFvPatchField<Type>&
|
||||||
Foam::cyclicFvPatchField<Type>::neighbourPatchField() const
|
Foam::cyclicFvPatchField<Type>::nbrPatchField() const
|
||||||
{
|
{
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& fld =
|
const GeometricField<Type, fvPatchField, volMesh>& fld =
|
||||||
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
||||||
@ -153,7 +153,7 @@ Foam::cyclicFvPatchField<Type>::neighbourPatchField() const
|
|||||||
|
|
||||||
return refCast<const cyclicFvPatchField<Type>>
|
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
|
||||||
{
|
{
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
cyclicPatch().cyclicPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
scalarField pnf(psiInternal, nbrFaceCells);
|
scalarField pnf(psiInternal, nbrFaceCells);
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ void Foam::cyclicFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
cyclicPatch().cyclicPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||||
|
|
||||||
|
|||||||
@ -159,7 +159,7 @@ public:
|
|||||||
tmp<Field<Type>> patchNeighbourField() const;
|
tmp<Field<Type>> patchNeighbourField() const;
|
||||||
|
|
||||||
//- Return reference to neighbour patchField
|
//- Return reference to neighbour patchField
|
||||||
const cyclicFvPatchField<Type>& neighbourPatchField() const;
|
const cyclicFvPatchField<Type>& nbrPatchField() const;
|
||||||
|
|
||||||
//- Update result field based on interface functionality
|
//- Update result field based on interface functionality
|
||||||
virtual void updateInterfaceMatrix
|
virtual void updateInterfaceMatrix
|
||||||
|
|||||||
@ -142,7 +142,7 @@ Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
|||||||
{
|
{
|
||||||
const Field<Type>& iField = this->primitiveField();
|
const Field<Type>& iField = this->primitiveField();
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
Field<Type> pnf(iField, nbrFaceCells);
|
Field<Type> pnf(iField, nbrFaceCells);
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
|||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const Foam::cyclicAMIFvPatchField<Type>&
|
const Foam::cyclicAMIFvPatchField<Type>&
|
||||||
Foam::cyclicAMIFvPatchField<Type>::neighbourPatchField() const
|
Foam::cyclicAMIFvPatchField<Type>::nbrPatchField() const
|
||||||
{
|
{
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& fld =
|
const GeometricField<Type, fvPatchField, volMesh>& fld =
|
||||||
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
||||||
@ -174,7 +174,7 @@ Foam::cyclicAMIFvPatchField<Type>::neighbourPatchField() const
|
|||||||
|
|
||||||
return refCast<const cyclicAMIFvPatchField<Type>>
|
return refCast<const cyclicAMIFvPatchField<Type>>
|
||||||
(
|
(
|
||||||
fld.boundaryField()[cyclicAMIPatch_.neighbPatchID()]
|
fld.boundaryField()[cyclicAMIPatch_.nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
scalarField pnf(psiInternal, nbrFaceCells);
|
scalarField pnf(psiInternal, nbrFaceCells);
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||||
|
|
||||||
|
|||||||
@ -164,7 +164,7 @@ public:
|
|||||||
virtual tmp<Field<Type>> patchNeighbourField() const;
|
virtual tmp<Field<Type>> patchNeighbourField() const;
|
||||||
|
|
||||||
//- Return reference to neighbour patchField
|
//- Return reference to neighbour patchField
|
||||||
const cyclicAMIFvPatchField<Type>& neighbourPatchField() const;
|
const cyclicAMIFvPatchField<Type>& nbrPatchField() const;
|
||||||
|
|
||||||
//- Update result field based on interface functionality
|
//- Update result field based on interface functionality
|
||||||
virtual void updateInterfaceMatrix
|
virtual void updateInterfaceMatrix
|
||||||
|
|||||||
@ -96,7 +96,7 @@ Foam::jumpCyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
|||||||
{
|
{
|
||||||
const Field<Type>& iField = this->primitiveField();
|
const Field<Type>& iField = this->primitiveField();
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
this->cyclicAMIPatch().cyclicAMIPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
Field<Type> pnf(iField, nbrFaceCells);
|
Field<Type> pnf(iField, nbrFaceCells);
|
||||||
tmp<Field<Type>> tpnf;
|
tmp<Field<Type>> tpnf;
|
||||||
@ -151,7 +151,7 @@ void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
this->cyclicAMIPatch().cyclicAMIPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -49,7 +49,7 @@ void Foam::jumpCyclicAMIFvPatchField<scalar>::updateInterfaceMatrix
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const labelUList& nbrFaceCells =
|
const labelUList& nbrFaceCells =
|
||||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
this->cyclicAMIPatch().cyclicAMIPatch().nbrPatch().faceCells();
|
||||||
|
|
||||||
scalarField pnf(psiInternal, nbrFaceCells);
|
scalarField pnf(psiInternal, nbrFaceCells);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -119,7 +119,7 @@ Foam::tmp<Foam::Field<Type>> Foam::fixedJumpFvPatchField<Type>::jump() const
|
|||||||
{
|
{
|
||||||
return refCast<const fixedJumpFvPatchField<Type>>
|
return refCast<const fixedJumpFvPatchField<Type>>
|
||||||
(
|
(
|
||||||
this->neighbourPatchField()
|
this->nbrPatchField()
|
||||||
).jump();
|
).jump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -120,7 +120,7 @@ Foam::tmp<Foam::Field<Type>> Foam::fixedJumpAMIFvPatchField<Type>::jump() const
|
|||||||
const fixedJumpAMIFvPatchField& nbrPatch =
|
const fixedJumpAMIFvPatchField& nbrPatch =
|
||||||
refCast<const fixedJumpAMIFvPatchField<Type>>
|
refCast<const fixedJumpAMIFvPatchField<Type>>
|
||||||
(
|
(
|
||||||
this->neighbourPatchField()
|
this->nbrPatchField()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this->cyclicAMIPatch().applyLowWeightCorrection())
|
if (this->cyclicAMIPatch().applyLowWeightCorrection())
|
||||||
|
|||||||
@ -94,9 +94,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return neighbour
|
//- Return neighbour
|
||||||
virtual label neighbPatchID() const
|
virtual label nbrPatchID() const
|
||||||
{
|
{
|
||||||
return cyclicPolyPatch_.neighbPatchID();
|
return cyclicPolyPatch_.nbrPatchID();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool owner() const
|
virtual bool owner() const
|
||||||
@ -105,11 +105,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return processor number
|
//- Return processor number
|
||||||
virtual const cyclicFvPatch& neighbPatch() const
|
virtual const cyclicFvPatch& nbrPatch() const
|
||||||
{
|
{
|
||||||
return refCast<const cyclicFvPatch>
|
return refCast<const cyclicFvPatch>
|
||||||
(
|
(
|
||||||
this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
|
this->boundaryMesh()[cyclicPolyPatch_.nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ public:
|
|||||||
{
|
{
|
||||||
return refCast<const cyclicFvPatch>
|
return refCast<const cyclicFvPatch>
|
||||||
(
|
(
|
||||||
this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
|
this->boundaryMesh()[cyclicPolyPatch_.nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -117,7 +117,7 @@ public:
|
|||||||
{
|
{
|
||||||
return refCast<const cyclicACMIFvPatch>
|
return refCast<const cyclicACMIFvPatch>
|
||||||
(
|
(
|
||||||
this->boundaryMesh()[this->cyclicAMIPatch().neighbPatchID()]
|
this->boundaryMesh()[this->cyclicAMIPatch().nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -101,9 +101,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return the neighbour patch ID
|
//- Return the neighbour patch ID
|
||||||
virtual label neighbPatchID() const
|
virtual label nbrPatchID() const
|
||||||
{
|
{
|
||||||
return cyclicAMIPolyPatch_.neighbPatchID();
|
return cyclicAMIPolyPatch_.nbrPatchID();
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Is this side the owner?
|
//- Is this side the owner?
|
||||||
@ -113,11 +113,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return the neighbour patch
|
//- Return the neighbour patch
|
||||||
virtual const cyclicAMIFvPatch& neighbPatch() const
|
virtual const cyclicAMIFvPatch& nbrPatch() const
|
||||||
{
|
{
|
||||||
return refCast<const cyclicAMIFvPatch>
|
return refCast<const cyclicAMIFvPatch>
|
||||||
(
|
(
|
||||||
this->boundaryMesh()[cyclicAMIPolyPatch_.neighbPatchID()]
|
this->boundaryMesh()[cyclicAMIPolyPatch_.nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ public:
|
|||||||
{
|
{
|
||||||
return refCast<const cyclicAMIFvPatch>
|
return refCast<const cyclicAMIFvPatch>
|
||||||
(
|
(
|
||||||
this->boundaryMesh()[cyclicAMIPolyPatch_.neighbPatchID()]
|
this->boundaryMesh()[cyclicAMIPolyPatch_.nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -115,9 +115,9 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return neighbour
|
//- Return neighbour
|
||||||
virtual label neighbPatchID() const
|
virtual label nbrPatchID() const
|
||||||
{
|
{
|
||||||
return regionCoupledBase_.neighbPatchID();
|
return regionCoupledBase_.nbrPatchID();
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Is it the owner?
|
//- Is it the owner?
|
||||||
@ -127,13 +127,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return regionCoupledBase neighb Patch
|
//- Return regionCoupledBase neighb Patch
|
||||||
virtual const regionCoupledBaseFvPatch& neighbPatch() const
|
virtual const regionCoupledBaseFvPatch& nbrPatch() const
|
||||||
{
|
{
|
||||||
return refCast<const regionCoupledBaseFvPatch>
|
return refCast<const regionCoupledBaseFvPatch>
|
||||||
(
|
(
|
||||||
nbrFvMesh().boundary()
|
nbrFvMesh().boundary()
|
||||||
[
|
[
|
||||||
regionCoupledBase_.neighbPatchID()
|
regionCoupledBase_.nbrPatchID()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ public:
|
|||||||
(
|
(
|
||||||
nbrFvMesh().boundary()
|
nbrFvMesh().boundary()
|
||||||
[
|
[
|
||||||
regionCoupledBase_.neighbPatchID()
|
regionCoupledBase_.nbrPatchID()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -70,7 +70,7 @@ class regionCoupledFvPatch
|
|||||||
(
|
(
|
||||||
nbrFvMesh().boundary()
|
nbrFvMesh().boundary()
|
||||||
[
|
[
|
||||||
neighbPatchID()
|
nbrPatchID()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -70,7 +70,7 @@ class regionCoupledWallFvPatch
|
|||||||
{
|
{
|
||||||
return refCast<const regionCoupledWallFvPatch>
|
return refCast<const regionCoupledWallFvPatch>
|
||||||
(
|
(
|
||||||
nbrFvMesh().boundary()[neighbPatchID()]
|
nbrFvMesh().boundary()[nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -265,7 +265,7 @@ void Foam::particle::hitCyclicPatch(TrackCloudType&, trackingData&)
|
|||||||
{
|
{
|
||||||
const cyclicPolyPatch& cpp =
|
const cyclicPolyPatch& cpp =
|
||||||
static_cast<const cyclicPolyPatch&>(mesh_.boundaryMesh()[patch()]);
|
static_cast<const cyclicPolyPatch&>(mesh_.boundaryMesh()[patch()]);
|
||||||
const cyclicPolyPatch& receiveCpp = cpp.neighbPatch();
|
const cyclicPolyPatch& receiveCpp = cpp.nbrPatch();
|
||||||
|
|
||||||
// Set the topology
|
// Set the topology
|
||||||
facei_ = tetFacei_ = cpp.transformGlobalFace(facei_);
|
facei_ = tetFacei_ = cpp.transformGlobalFace(facei_);
|
||||||
@ -299,7 +299,7 @@ void Foam::particle::hitCyclicAMIPatch
|
|||||||
{
|
{
|
||||||
const cyclicAMIPolyPatch& cpp =
|
const cyclicAMIPolyPatch& cpp =
|
||||||
static_cast<const cyclicAMIPolyPatch&>(mesh_.boundaryMesh()[patch()]);
|
static_cast<const cyclicAMIPolyPatch&>(mesh_.boundaryMesh()[patch()]);
|
||||||
const cyclicAMIPolyPatch& receiveCpp = cpp.neighbPatch();
|
const cyclicAMIPolyPatch& receiveCpp = cpp.nbrPatch();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -371,7 +371,7 @@ private:
|
|||||||
const labelList& neiLevel,
|
const labelList& neiLevel,
|
||||||
const pointField& neiCc,
|
const pointField& neiCc,
|
||||||
labelList& ownPatch,
|
labelList& ownPatch,
|
||||||
labelList& neiPatch
|
labelList& nbrPatch
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Repatches external face or creates baffle for internal face
|
//- Repatches external face or creates baffle for internal face
|
||||||
@ -381,7 +381,7 @@ private:
|
|||||||
(
|
(
|
||||||
const label facei,
|
const label facei,
|
||||||
const label ownPatch,
|
const label ownPatch,
|
||||||
const label neiPatch,
|
const label nbrPatch,
|
||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -854,12 +854,12 @@ public:
|
|||||||
autoPtr<mapPolyMesh> dupNonManifoldPoints();
|
autoPtr<mapPolyMesh> dupNonManifoldPoints();
|
||||||
|
|
||||||
//- Create baffle for every internal face where ownPatch != -1.
|
//- 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)
|
// should be -1 for these)
|
||||||
autoPtr<mapPolyMesh> createBaffles
|
autoPtr<mapPolyMesh> createBaffles
|
||||||
(
|
(
|
||||||
const labelList& ownPatch,
|
const labelList& ownPatch,
|
||||||
const labelList& neiPatch
|
const labelList& nbrPatch
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Debug helper: check faceZones are not on processor patches
|
//- Debug helper: check faceZones are not on processor patches
|
||||||
|
|||||||
@ -55,7 +55,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
(
|
(
|
||||||
const label facei,
|
const label facei,
|
||||||
const label ownPatch,
|
const label ownPatch,
|
||||||
const label neiPatch,
|
const label nbrPatch,
|
||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
|
|
||||||
if (mesh_.isInternalFace(facei))
|
if (mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
if (neiPatch == -1)
|
if (nbrPatch == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "No neighbour patch for internal face " << facei
|
<< "No neighbour patch for internal face " << facei
|
||||||
@ -115,7 +115,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
facei, // masterFaceID,
|
facei, // masterFaceID,
|
||||||
true, // face flip
|
true, // face flip
|
||||||
neiPatch, // patch for face
|
nbrPatch, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
reverseFlip // face flip in zone
|
reverseFlip // face flip in zone
|
||||||
)
|
)
|
||||||
@ -131,7 +131,7 @@ void Foam::meshRefinement::getBafflePatches
|
|||||||
const labelList& neiLevel,
|
const labelList& neiLevel,
|
||||||
const pointField& neiCc,
|
const pointField& neiCc,
|
||||||
labelList& ownPatch,
|
labelList& ownPatch,
|
||||||
labelList& neiPatch
|
labelList& nbrPatch
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
autoPtr<OFstream> str;
|
autoPtr<OFstream> str;
|
||||||
@ -161,8 +161,8 @@ void Foam::meshRefinement::getBafflePatches
|
|||||||
|
|
||||||
ownPatch.setSize(mesh_.nFaces());
|
ownPatch.setSize(mesh_.nFaces());
|
||||||
ownPatch = -1;
|
ownPatch = -1;
|
||||||
neiPatch.setSize(mesh_.nFaces());
|
nbrPatch.setSize(mesh_.nFaces());
|
||||||
neiPatch = -1;
|
nbrPatch = -1;
|
||||||
|
|
||||||
|
|
||||||
// Collect candidate faces
|
// Collect candidate faces
|
||||||
@ -251,12 +251,12 @@ void Foam::meshRefinement::getBafflePatches
|
|||||||
[
|
[
|
||||||
surfaces_.globalRegion(surface1[i], region1[i])
|
surfaces_.globalRegion(surface1[i], region1[i])
|
||||||
];
|
];
|
||||||
neiPatch[facei] = globalToMasterPatch
|
nbrPatch[facei] = globalToMasterPatch
|
||||||
[
|
[
|
||||||
surfaces_.globalRegion(surface2[i], region2[i])
|
surfaces_.globalRegion(surface2[i], region2[i])
|
||||||
];
|
];
|
||||||
|
|
||||||
if (ownPatch[facei] == -1 || neiPatch[facei] == -1)
|
if (ownPatch[facei] == -1 || nbrPatch[facei] == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "problem." << abort(FatalError);
|
<< "problem." << abort(FatalError);
|
||||||
@ -273,7 +273,7 @@ void Foam::meshRefinement::getBafflePatches
|
|||||||
// not used when creating baffles from proc faces.
|
// not used when creating baffles from proc faces.
|
||||||
// - tolerances issues occasionally crop up.
|
// - tolerances issues occasionally crop up.
|
||||||
syncTools::syncFaceList(mesh_, ownPatch, maxEqOp<label>());
|
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
|
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
||||||
(
|
(
|
||||||
const labelList& ownPatch,
|
const labelList& ownPatch,
|
||||||
const labelList& neiPatch
|
const labelList& nbrPatch
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
ownPatch.size() != mesh_.nFaces()
|
ownPatch.size() != mesh_.nFaces()
|
||||||
|| neiPatch.size() != mesh_.nFaces()
|
|| nbrPatch.size() != mesh_.nFaces()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Illegal size :"
|
<< "Illegal size :"
|
||||||
<< " ownPatch:" << ownPatch.size()
|
<< " ownPatch:" << ownPatch.size()
|
||||||
<< " neiPatch:" << neiPatch.size()
|
<< " nbrPatch:" << nbrPatch.size()
|
||||||
<< ". Should be number of faces:" << mesh_.nFaces()
|
<< ". Should be number of faces:" << mesh_.nFaces()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -366,7 +366,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
|||||||
{
|
{
|
||||||
labelList syncedOwnPatch(ownPatch);
|
labelList syncedOwnPatch(ownPatch);
|
||||||
syncTools::syncFaceList(mesh_, syncedOwnPatch, maxEqOp<label>());
|
syncTools::syncFaceList(mesh_, syncedOwnPatch, maxEqOp<label>());
|
||||||
labelList syncedNeiPatch(neiPatch);
|
labelList syncedNeiPatch(nbrPatch);
|
||||||
syncTools::syncFaceList(mesh_, syncedNeiPatch, maxEqOp<label>());
|
syncTools::syncFaceList(mesh_, syncedNeiPatch, maxEqOp<label>());
|
||||||
|
|
||||||
forAll(syncedOwnPatch, facei)
|
forAll(syncedOwnPatch, facei)
|
||||||
@ -374,7 +374,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
(ownPatch[facei] == -1 && syncedOwnPatch[facei] != -1)
|
(ownPatch[facei] == -1 && syncedOwnPatch[facei] != -1)
|
||||||
|| (neiPatch[facei] == -1 && syncedNeiPatch[facei] != -1)
|
|| (nbrPatch[facei] == -1 && syncedNeiPatch[facei] != -1)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -383,7 +383,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
|||||||
<< " fc:" << mesh_.faceCentres()[facei] << endl
|
<< " fc:" << mesh_.faceCentres()[facei] << endl
|
||||||
<< "ownPatch:" << ownPatch[facei]
|
<< "ownPatch:" << ownPatch[facei]
|
||||||
<< " syncedOwnPatch:" << syncedOwnPatch[facei]
|
<< " syncedOwnPatch:" << syncedOwnPatch[facei]
|
||||||
<< " neiPatch:" << neiPatch[facei]
|
<< " nbrPatch:" << nbrPatch[facei]
|
||||||
<< " syncedNeiPatch:" << syncedNeiPatch[facei]
|
<< " syncedNeiPatch:" << syncedNeiPatch[facei]
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -405,7 +405,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
|
|||||||
(
|
(
|
||||||
facei,
|
facei,
|
||||||
ownPatch[facei], // owner side patch
|
ownPatch[facei], // owner side patch
|
||||||
neiPatch[facei], // neighbour side patch
|
nbrPatch[facei], // neighbour side patch
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
nBaffles++;
|
nBaffles++;
|
||||||
@ -547,15 +547,15 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
|
|||||||
{
|
{
|
||||||
// Convert into labelLists
|
// Convert into labelLists
|
||||||
labelList ownPatch(mesh_.nFaces(), -1);
|
labelList ownPatch(mesh_.nFaces(), -1);
|
||||||
labelList neiPatch(mesh_.nFaces(), -1);
|
labelList nbrPatch(mesh_.nFaces(), -1);
|
||||||
forAllConstIter(Map<labelPair>, faceToPatch, iter)
|
forAllConstIter(Map<labelPair>, faceToPatch, iter)
|
||||||
{
|
{
|
||||||
ownPatch[iter.key()] = iter().first();
|
ownPatch[iter.key()] = iter().first();
|
||||||
neiPatch[iter.key()] = iter().second();
|
nbrPatch[iter.key()] = iter().second();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create baffles. both sides same patch.
|
// Create baffles. both sides same patch.
|
||||||
map = createBaffles(ownPatch, neiPatch);
|
map = createBaffles(ownPatch, nbrPatch);
|
||||||
|
|
||||||
// Get pairs of faces created.
|
// Get pairs of faces created.
|
||||||
// Just loop over faceMap and store baffle if we encounter a slave
|
// 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());
|
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||||
calcNeighbourData(neiLevel, neiCc);
|
calcNeighbourData(neiLevel, neiCc);
|
||||||
|
|
||||||
labelList ownPatch, neiPatch;
|
labelList ownPatch, nbrPatch;
|
||||||
getBafflePatches
|
getBafflePatches
|
||||||
(
|
(
|
||||||
globalToMasterPatch,
|
globalToMasterPatch,
|
||||||
@ -2310,10 +2310,10 @@ void Foam::meshRefinement::baffleAndSplitMesh
|
|||||||
neiCc,
|
neiCc,
|
||||||
|
|
||||||
ownPatch,
|
ownPatch,
|
||||||
neiPatch
|
nbrPatch
|
||||||
);
|
);
|
||||||
|
|
||||||
createBaffles(ownPatch, neiPatch);
|
createBaffles(ownPatch, nbrPatch);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -2477,7 +2477,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
|||||||
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
|
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||||
calcNeighbourData(neiLevel, neiCc);
|
calcNeighbourData(neiLevel, neiCc);
|
||||||
|
|
||||||
labelList ownPatch, neiPatch;
|
labelList ownPatch, nbrPatch;
|
||||||
getBafflePatches
|
getBafflePatches
|
||||||
(
|
(
|
||||||
globalToMasterPatch,
|
globalToMasterPatch,
|
||||||
@ -2485,7 +2485,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
|||||||
neiCc,
|
neiCc,
|
||||||
|
|
||||||
ownPatch,
|
ownPatch,
|
||||||
neiPatch
|
nbrPatch
|
||||||
);
|
);
|
||||||
|
|
||||||
// Analyse regions. Reuse regionsplit
|
// Analyse regions. Reuse regionsplit
|
||||||
@ -2493,7 +2493,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
|||||||
|
|
||||||
forAll(ownPatch, facei)
|
forAll(ownPatch, facei)
|
||||||
{
|
{
|
||||||
if (ownPatch[facei] != -1 || neiPatch[facei] != -1)
|
if (ownPatch[facei] != -1 || nbrPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
blockedFace[facei] = true;
|
blockedFace[facei] = true;
|
||||||
}
|
}
|
||||||
@ -2568,7 +2568,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
|
|||||||
}
|
}
|
||||||
else if (ownRegion != keepRegionI && neiRegion == keepRegionI)
|
else if (ownRegion != keepRegionI && neiRegion == keepRegionI)
|
||||||
{
|
{
|
||||||
label newPatchi = neiPatch[facei];
|
label newPatchi = nbrPatch[facei];
|
||||||
if (newPatchi == -1)
|
if (newPatchi == -1)
|
||||||
{
|
{
|
||||||
newPatchi = max(defaultPatch, ownPatch[facei]);
|
newPatchi = max(defaultPatch, ownPatch[facei]);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -1961,7 +1961,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
|||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
labelList ownPatch(mesh.nFaces(), -1);
|
labelList ownPatch(mesh.nFaces(), -1);
|
||||||
labelList neiPatch(mesh.nFaces(), -1);
|
labelList nbrPatch(mesh.nFaces(), -1);
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
@ -1972,7 +1972,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
|||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
ownPatch[pp.start()+i] = patchi;
|
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])
|
if (closestPatch[i] != -1 && closestPatch[i] != ownPatch[facei])
|
||||||
{
|
{
|
||||||
ownPatch[facei] = closestPatch[i];
|
ownPatch[facei] = closestPatch[i];
|
||||||
neiPatch[facei] = closestPatch[i];
|
nbrPatch[facei] = closestPatch[i];
|
||||||
nChanged++;
|
nChanged++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1993,7 +1993,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
|||||||
<< " faces in = " << mesh.time().cpuTimeIncrement() << " s\n" << nl
|
<< " faces in = " << mesh.time().cpuTimeIncrement() << " s\n" << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
return meshRefiner_.createBaffles(ownPatch, neiPatch);
|
return meshRefiner_.createBaffles(ownPatch, nbrPatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ void Foam::cyclicAMIGAMGInterfaceField::updateInterfaceMatrix
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const cyclicAMIGAMGInterface& thisInterface = cyclicAMIInterface_;
|
const cyclicAMIGAMGInterface& thisInterface = cyclicAMIInterface_;
|
||||||
const cyclicAMIGAMGInterface& neiInterface = thisInterface.neighbPatch();
|
const cyclicAMIGAMGInterface& neiInterface = thisInterface.nbrPatch();
|
||||||
|
|
||||||
// Get neighbouring field
|
// Get neighbouring field
|
||||||
scalarField pnf(neiInterface.interfaceInternalField(psiInternal));
|
scalarField pnf(neiInterface.interfaceInternalField(psiInternal));
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -190,7 +190,7 @@ Foam::tmp<Foam::labelField> Foam::cyclicAMIGAMGInterface::internalFieldTransfer
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const cyclicAMIGAMGInterface& nbr =
|
const cyclicAMIGAMGInterface& nbr =
|
||||||
dynamic_cast<const cyclicAMIGAMGInterface&>(neighbPatch());
|
dynamic_cast<const cyclicAMIGAMGInterface&>(nbrPatch());
|
||||||
|
|
||||||
const labelUList& nbrFaceCells = nbr.faceCells();
|
const labelUList& nbrFaceCells = nbr.faceCells();
|
||||||
|
|
||||||
|
|||||||
@ -109,9 +109,9 @@ public:
|
|||||||
//- Cyclic interface functions
|
//- Cyclic interface functions
|
||||||
|
|
||||||
//- Return neighbour processor number
|
//- Return neighbour processor number
|
||||||
virtual label neighbPatchID() const
|
virtual label nbrPatchID() const
|
||||||
{
|
{
|
||||||
return fineCyclicAMIInterface_.neighbPatchID();
|
return fineCyclicAMIInterface_.nbrPatchID();
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Does this side own the interface?
|
//- Does this side own the interface?
|
||||||
@ -121,11 +121,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return neighbour patch
|
//- Return neighbour patch
|
||||||
virtual const cyclicAMIGAMGInterface& neighbPatch() const
|
virtual const cyclicAMIGAMGInterface& nbrPatch() const
|
||||||
{
|
{
|
||||||
return dynamic_cast<const cyclicAMIGAMGInterface&>
|
return dynamic_cast<const cyclicAMIGAMGInterface&>
|
||||||
(
|
(
|
||||||
coarseInterfaces_[neighbPatchID()]
|
coarseInterfaces_[nbrPatchID()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -104,7 +104,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI() const
|
|||||||
if (tgtMask_.size())
|
if (tgtMask_.size())
|
||||||
{
|
{
|
||||||
const cyclicACMIPolyPatch& cp =
|
const cyclicACMIPolyPatch& cp =
|
||||||
refCast<const cyclicACMIPolyPatch>(this->neighbPatch());
|
refCast<const cyclicACMIPolyPatch>(this->nbrPatch());
|
||||||
const polyPatch& pp = cp.nonOverlapPatch();
|
const polyPatch& pp = cp.nonOverlapPatch();
|
||||||
|
|
||||||
vectorField::subField Sf = cp.faceAreas();
|
vectorField::subField Sf = cp.faceAreas();
|
||||||
@ -349,9 +349,9 @@ Foam::cyclicACMIPolyPatch::~cyclicACMIPolyPatch()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * 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);
|
return refCast<const cyclicACMIPolyPatch>(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -179,7 +179,7 @@ public:
|
|||||||
index,
|
index,
|
||||||
newSize,
|
newSize,
|
||||||
newStart,
|
newStart,
|
||||||
neighbPatchName(),
|
nbrPatchName(),
|
||||||
nonOverlapPatchName_
|
nonOverlapPatchName_
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -224,7 +224,7 @@ public:
|
|||||||
inline bool updated() const;
|
inline bool updated() const;
|
||||||
|
|
||||||
//- Return a reference to the neighbour patch
|
//- Return a reference to the neighbour patch
|
||||||
virtual const cyclicACMIPolyPatch& neighbPatch() const;
|
virtual const cyclicACMIPolyPatch& nbrPatch() const;
|
||||||
|
|
||||||
//- Non-overlapping patch name
|
//- Non-overlapping patch name
|
||||||
inline const word& nonOverlapPatchName() const;
|
inline const word& nonOverlapPatchName() const;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,7 +69,7 @@ inline const Foam::scalarField& Foam::cyclicACMIPolyPatch::mask() const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return neighbPatch().tgtMask();
|
return nbrPatch().tgtMask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,13 +72,13 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return neighbour
|
//- Return neighbour
|
||||||
virtual label neighbPatchID() const = 0;
|
virtual label nbrPatchID() const = 0;
|
||||||
|
|
||||||
//- Does this side own the interface?
|
//- Does this side own the interface?
|
||||||
virtual bool owner() const = 0;
|
virtual bool owner() const = 0;
|
||||||
|
|
||||||
//- Return processor number
|
//- Return processor number
|
||||||
virtual const cyclicAMILduInterface& neighbPatch() const = 0;
|
virtual const cyclicAMILduInterface& nbrPatch() const = 0;
|
||||||
|
|
||||||
//- Return a reference to the AMI interpolators
|
//- Return a reference to the AMI interpolators
|
||||||
virtual const PtrList<AMIInterpolation>& AMIs() const = 0;
|
virtual const PtrList<AMIInterpolation>& AMIs() const = 0;
|
||||||
|
|||||||
@ -122,9 +122,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return neighbour point patch
|
//- 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];
|
const pointPatch& pp = this->boundaryMesh()[patchi];
|
||||||
return refCast<const cyclicAMIPointPatch>(pp);
|
return refCast<const cyclicAMIPointPatch>(pp);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,7 +132,7 @@ void Foam::cyclicAMIPointPatchField<Type>::swapAddSeparated
|
|||||||
// all swaps on the side that gets evaluated first.
|
// all swaps on the side that gets evaluated first.
|
||||||
|
|
||||||
// Get neighbouring pointPatch
|
// Get neighbouring pointPatch
|
||||||
const cyclicAMIPointPatch& nbrPatch = cyclicAMIPatch_.neighbPatch();
|
const cyclicAMIPointPatch& nbrPatch = cyclicAMIPatch_.nbrPatch();
|
||||||
|
|
||||||
// Get neighbouring pointPatchField
|
// Get neighbouring pointPatchField
|
||||||
const GeometricField<Type, pointPatchField, pointMesh>& fld =
|
const GeometricField<Type, pointPatchField, pointMesh>& fld =
|
||||||
@ -196,7 +196,7 @@ void Foam::cyclicAMIPointPatchField<Type>::swapAddSeparated
|
|||||||
Field<Type> nbrFcFld(nbrPpi().pointToFaceInterpolate(nbrPtFld));
|
Field<Type> nbrFcFld(nbrPpi().pointToFaceInterpolate(nbrPtFld));
|
||||||
|
|
||||||
fcFld =
|
fcFld =
|
||||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().interpolate
|
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().interpolate
|
||||||
(
|
(
|
||||||
fcFld,
|
fcFld,
|
||||||
nbrFcFld
|
nbrFcFld
|
||||||
@ -205,7 +205,7 @@ void Foam::cyclicAMIPointPatchField<Type>::swapAddSeparated
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
fcFld =
|
fcFld =
|
||||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().interpolate
|
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch().interpolate
|
||||||
(
|
(
|
||||||
fcFld
|
fcFld
|
||||||
);
|
);
|
||||||
|
|||||||
@ -94,7 +94,7 @@ class cyclicAMIPointPatchField
|
|||||||
(
|
(
|
||||||
new PrimitivePatchInterpolation<primitivePatch>
|
new PrimitivePatchInterpolation<primitivePatch>
|
||||||
(
|
(
|
||||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch()
|
cyclicAMIPatch_.cyclicAMIPatch().nbrPatch()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,21 +70,21 @@ Foam::vector Foam::cyclicAMIPolyPatch::findFaceNormalMaxRadius
|
|||||||
|
|
||||||
void Foam::cyclicAMIPolyPatch::calcTransforms
|
void Foam::cyclicAMIPolyPatch::calcTransforms
|
||||||
(
|
(
|
||||||
const primitivePatch& half0,
|
const primitivePatch& thisPatch,
|
||||||
const pointField& half0Ctrs,
|
const pointField& thisPatchCtrs,
|
||||||
const vectorField& half0Areas,
|
const vectorField& thisPatchAreas,
|
||||||
const pointField& half1Ctrs,
|
const pointField& nbrPatchCtrs,
|
||||||
const vectorField& half1Areas
|
const vectorField& nbrPatchAreas
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (transformType() != neighbPatch().transformType())
|
if (transformType() != nbrPatch().transformType())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Patch " << name()
|
<< "Patch " << name()
|
||||||
<< " has transform type " << transformTypeNames[transformType()]
|
<< " has transform type " << transformTypeNames[transformType()]
|
||||||
<< ", neighbour patch " << neighbPatchName()
|
<< ", neighbour patch " << nbrPatchName()
|
||||||
<< " has transform type "
|
<< " has transform type "
|
||||||
<< neighbPatch().transformTypeNames[neighbPatch().transformType()]
|
<< nbrPatch().transformTypeNames[nbrPatch().transformType()]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,9 +124,9 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
|
|||||||
|
|
||||||
// Check - assume correct angle when difference in face areas
|
// Check - assume correct angle when difference in face areas
|
||||||
// is the smallest
|
// is the smallest
|
||||||
const vector transformedAreaPos = gSum(half1Areas & revTPos);
|
const vector transformedAreaPos = gSum(nbrPatchAreas & revTPos);
|
||||||
const vector transformedAreaNeg = gSum(half1Areas & revTNeg);
|
const vector transformedAreaNeg = gSum(nbrPatchAreas & revTNeg);
|
||||||
const vector area0 = gSum(half0Areas);
|
const vector area0 = gSum(thisPatchAreas);
|
||||||
const scalar magArea0 = mag(area0) + rootVSmall;
|
const scalar magArea0 = mag(area0) + rootVSmall;
|
||||||
|
|
||||||
// Areas have opposite sign, so sum should be zero when correct
|
// 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 "
|
<< " % indicating a possible error in the specified "
|
||||||
<< "angle of rotation" << nl
|
<< "angle of rotation" << nl
|
||||||
<< " owner patch : " << name() << nl
|
<< " owner patch : " << name() << nl
|
||||||
<< " neighbour patch : " << neighbPatch().name()
|
<< " neighbour patch : " << nbrPatch().name()
|
||||||
<< nl
|
<< nl
|
||||||
<< " angle : "
|
<< " angle : "
|
||||||
<< radToDeg(rotationAngle_) << " deg" << nl
|
<< radToDeg(rotationAngle_) << " deg" << nl
|
||||||
@ -182,13 +182,13 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
|
|||||||
{
|
{
|
||||||
point n0 = Zero;
|
point n0 = Zero;
|
||||||
point n1 = 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>());
|
reduce(n0, maxMagSqrOp<point>());
|
||||||
@ -276,18 +276,18 @@ void Foam::cyclicAMIPolyPatch::resetAMI() const
|
|||||||
{
|
{
|
||||||
if (owner())
|
if (owner())
|
||||||
{
|
{
|
||||||
const polyPatch& nbr = neighbPatch();
|
const polyPatch& nbr = nbrPatch();
|
||||||
pointField nbrPoints
|
pointField nbrPoints
|
||||||
(
|
(
|
||||||
neighbPatch().boundaryMesh().mesh().points(),
|
nbrPatch().boundaryMesh().mesh().points(),
|
||||||
neighbPatch().meshPoints()
|
nbrPatch().meshPoints()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
const Time& t = boundaryMesh().mesh().time();
|
const Time& t = boundaryMesh().mesh().time();
|
||||||
OFstream os(t.path()/name() + "_neighbourPatch-org.obj");
|
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
|
// Transform neighbour patch to local system
|
||||||
@ -347,27 +347,27 @@ void Foam::cyclicAMIPolyPatch::resetAMI() const
|
|||||||
|
|
||||||
void Foam::cyclicAMIPolyPatch::calcTransforms()
|
void Foam::cyclicAMIPolyPatch::calcTransforms()
|
||||||
{
|
{
|
||||||
const cyclicAMIPolyPatch& half0 = *this;
|
const cyclicAMIPolyPatch& thisPatch = *this;
|
||||||
vectorField half0Areas(half0.size());
|
vectorField thisPatchAreas(thisPatch.size());
|
||||||
forAll(half0, facei)
|
forAll(thisPatch, facei)
|
||||||
{
|
{
|
||||||
half0Areas[facei] = half0[facei].area(half0.points());
|
thisPatchAreas[facei] = thisPatch[facei].area(thisPatch.points());
|
||||||
}
|
}
|
||||||
|
|
||||||
const cyclicAMIPolyPatch& half1 = neighbPatch();
|
const cyclicAMIPolyPatch& nbrPatch = this->nbrPatch();
|
||||||
vectorField half1Areas(half1.size());
|
vectorField nbrPatchAreas(nbrPatch.size());
|
||||||
forAll(half1, facei)
|
forAll(nbrPatch, facei)
|
||||||
{
|
{
|
||||||
half1Areas[facei] = half1[facei].area(half1.points());
|
nbrPatchAreas[facei] = nbrPatch[facei].area(nbrPatch.points());
|
||||||
}
|
}
|
||||||
|
|
||||||
calcTransforms
|
calcTransforms
|
||||||
(
|
(
|
||||||
half0,
|
thisPatch,
|
||||||
half0.faceCentres(),
|
thisPatch.faceCentres(),
|
||||||
half0Areas,
|
thisPatchAreas,
|
||||||
half1.faceCentres(),
|
nbrPatch.faceCentres(),
|
||||||
half1Areas
|
nbrPatchAreas
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -396,9 +396,9 @@ void Foam::cyclicAMIPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
|||||||
faceCentres(),
|
faceCentres(),
|
||||||
faceAreas(),
|
faceAreas(),
|
||||||
faceCellCentres(),
|
faceCellCentres(),
|
||||||
neighbPatch().faceCentres(),
|
nbrPatch().faceCentres(),
|
||||||
neighbPatch().faceAreas(),
|
nbrPatch().faceAreas(),
|
||||||
neighbPatch().faceCellCentres()
|
nbrPatch().faceCellCentres()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,16 +704,16 @@ Foam::cyclicAMIPolyPatch::~cyclicAMIPolyPatch()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
|
Foam::label Foam::cyclicAMIPolyPatch::nbrPatchID() const
|
||||||
{
|
{
|
||||||
if (nbrPatchID_ == -1)
|
if (nbrPatchID_ == -1)
|
||||||
{
|
{
|
||||||
nbrPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName());
|
nbrPatchID_ = this->boundaryMesh().findPatchID(nbrPatchName());
|
||||||
|
|
||||||
if (nbrPatchID_ == -1)
|
if (nbrPatchID_ == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Illegal neighbourPatch name " << neighbPatchName()
|
<< "Illegal neighbourPatch name " << nbrPatchName()
|
||||||
<< nl << "Valid patch names are "
|
<< nl << "Valid patch names are "
|
||||||
<< this->boundaryMesh().names()
|
<< this->boundaryMesh().names()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
@ -726,13 +726,13 @@ Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
|
|||||||
this->boundaryMesh()[nbrPatchID_]
|
this->boundaryMesh()[nbrPatchID_]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (nbrPatch.neighbPatchName() != name())
|
if (nbrPatch.nbrPatchName() != name())
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Patch " << name()
|
<< "Patch " << name()
|
||||||
<< " specifies neighbour patch " << neighbPatchName()
|
<< " specifies neighbour patch " << nbrPatchName()
|
||||||
<< nl << " but that in return specifies "
|
<< 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
|
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);
|
return refCast<const cyclicAMIPolyPatch>(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,7 +831,7 @@ bool Foam::cyclicAMIPolyPatch::applyLowWeightCorrection() const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return neighbPatch().AMILowWeightCorrection_ > 0;
|
return nbrPatch().AMILowWeightCorrection_ > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,12 +844,12 @@ const Foam::scalarField& Foam::cyclicAMIPolyPatch::weightsSum() const
|
|||||||
}
|
}
|
||||||
else
|
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())
|
if (owner())
|
||||||
{
|
{
|
||||||
@ -857,7 +857,7 @@ const Foam::scalarField& Foam::cyclicAMIPolyPatch::neighbWeightsSum() const
|
|||||||
}
|
}
|
||||||
else
|
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 scalarUList& defaultValues
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const cyclicAMIPolyPatch& nei = neighbPatch();
|
const cyclicAMIPolyPatch& nei = nbrPatch();
|
||||||
|
|
||||||
tmp<scalarField> result(new scalarField(size(), Zero));
|
tmp<scalarField> result(new scalarField(size(), Zero));
|
||||||
|
|
||||||
@ -1069,7 +1069,7 @@ Foam::labelPair Foam::cyclicAMIPolyPatch::pointAMIAndFace
|
|||||||
const vector ntt = AMITransforms()[i].transform(nt);
|
const vector ntt = AMITransforms()[i].transform(nt);
|
||||||
|
|
||||||
const label nbrFacei =
|
const label nbrFacei =
|
||||||
AMIs()[i].tgtPointFace(*this, neighbPatch(), ntt, facei, ptt);
|
AMIs()[i].tgtPointFace(*this, nbrPatch(), ntt, facei, ptt);
|
||||||
|
|
||||||
if (nbrFacei >= 0)
|
if (nbrFacei >= 0)
|
||||||
{
|
{
|
||||||
@ -1080,17 +1080,17 @@ Foam::labelPair Foam::cyclicAMIPolyPatch::pointAMIAndFace
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
forAll(neighbPatch().AMIs(), i)
|
forAll(nbrPatch().AMIs(), i)
|
||||||
{
|
{
|
||||||
point ptt =
|
point ptt =
|
||||||
neighbPatch().AMITransforms()[i].invTransformPosition(pt);
|
nbrPatch().AMITransforms()[i].invTransformPosition(pt);
|
||||||
const vector ntt =
|
const vector ntt =
|
||||||
neighbPatch().AMITransforms()[i].invTransform(nt);
|
nbrPatch().AMITransforms()[i].invTransform(nt);
|
||||||
|
|
||||||
const label nbrFacei =
|
const label nbrFacei =
|
||||||
neighbPatch().AMIs()[i].srcPointFace
|
nbrPatch().AMIs()[i].srcPointFace
|
||||||
(
|
(
|
||||||
neighbPatch(),
|
nbrPatch(),
|
||||||
*this,
|
*this,
|
||||||
ntt,
|
ntt,
|
||||||
facei,
|
facei,
|
||||||
@ -1111,7 +1111,7 @@ Foam::labelPair Foam::cyclicAMIPolyPatch::pointAMIAndFace
|
|||||||
|
|
||||||
Foam::label Foam::cyclicAMIPolyPatch::singlePatchProc() const
|
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();
|
const label proc = patch.AMIs()[0].singlePatchProc();
|
||||||
|
|
||||||
|
|||||||
@ -62,11 +62,11 @@ class cyclicAMIPolyPatch
|
|||||||
|
|
||||||
void calcTransforms
|
void calcTransforms
|
||||||
(
|
(
|
||||||
const primitivePatch& half0,
|
const primitivePatch& thisPatch,
|
||||||
const pointField& half0Ctrs,
|
const pointField& thisPatchCtrs,
|
||||||
const vectorField& half0Areas,
|
const vectorField& thisPatchAreas,
|
||||||
const pointField& half1Ctrs,
|
const pointField& neiPatchCtrs,
|
||||||
const vectorField& half1Areas
|
const vectorField& neiPatchAreas
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -74,13 +74,13 @@ protected:
|
|||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Name of other half
|
//- Name of cyclic neighbour patch
|
||||||
mutable word nbrPatchName_;
|
mutable word nbrPatchName_;
|
||||||
|
|
||||||
//- Optional patchGroup to find neighbPatch
|
//- Optional patchGroup to find nbrPatch
|
||||||
const coupleGroupIdentifier coupleGroup_;
|
const coupleGroupIdentifier coupleGroup_;
|
||||||
|
|
||||||
//- Index of other half
|
//- Index of cyclic neighbour patch
|
||||||
mutable label nbrPatchID_;
|
mutable label nbrPatchID_;
|
||||||
|
|
||||||
// Specified transformation
|
// Specified transformation
|
||||||
@ -291,16 +291,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Neighbour patch name
|
//- Neighbour patch name
|
||||||
inline const word& neighbPatchName() const;
|
inline const word& nbrPatchName() const;
|
||||||
|
|
||||||
//- Neighbour patch ID
|
//- Neighbour patch ID
|
||||||
virtual label neighbPatchID() const;
|
virtual label nbrPatchID() const;
|
||||||
|
|
||||||
//- Does this side own the patch?
|
//- Does this side own the patch?
|
||||||
virtual bool owner() const;
|
virtual bool owner() const;
|
||||||
|
|
||||||
//- Return a reference to the neighbour patch
|
//- Return a reference to the neighbour patch
|
||||||
virtual const cyclicAMIPolyPatch& neighbPatch() const;
|
virtual const cyclicAMIPolyPatch& nbrPatch() const;
|
||||||
|
|
||||||
//- Return a reference to the projection surface
|
//- Return a reference to the projection surface
|
||||||
const autoPtr<searchableSurface>& surfPtr() const;
|
const autoPtr<searchableSurface>& surfPtr() const;
|
||||||
@ -318,7 +318,7 @@ public:
|
|||||||
virtual const scalarField& weightsSum() const;
|
virtual const scalarField& weightsSum() const;
|
||||||
|
|
||||||
//- Return the weights sum for the neighbour patch
|
//- Return the weights sum for the neighbour patch
|
||||||
virtual const scalarField& neighbWeightsSum() const;
|
virtual const scalarField& nbrWeightsSum() const;
|
||||||
|
|
||||||
|
|
||||||
// Transformations
|
// Transformations
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
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())
|
if (nbrPatchName_.empty())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,7 +32,7 @@ Foam::tmp<Foam::Field<Type>> Foam::cyclicAMIPolyPatch::interpolate
|
|||||||
const UList<Type>& defaultValues
|
const UList<Type>& defaultValues
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const cyclicAMIPolyPatch& nei = neighbPatch();
|
const cyclicAMIPolyPatch& nei = nbrPatch();
|
||||||
|
|
||||||
tmp<Field<Type>> result(new Field<Type>(size(), Zero));
|
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 "
|
Info<< indent << typeName <<" : Creating addressing and weights between "
|
||||||
<< returnReduce(this->size(), sumOp<label>()) << " source faces and "
|
<< returnReduce(this->size(), sumOp<label>()) << " source faces and "
|
||||||
<< returnReduce(neighbPatch().size(), sumOp<label>()) << " target faces"
|
<< returnReduce(nbrPatch().size(), sumOp<label>()) << " target faces"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
// Get the transform associated with the transform patch
|
// Get the transform associated with the transform patch
|
||||||
@ -91,12 +91,12 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
|||||||
{
|
{
|
||||||
const coupledPolyPatch& transformPatch = this->transformPatch();
|
const coupledPolyPatch& transformPatch = this->transformPatch();
|
||||||
|
|
||||||
if (transformPatch.name() != neighbPatch().transformPatch().name())
|
if (transformPatch.name() != nbrPatch().transformPatch().name())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Transform patch " << transformPatch.name() << " for "
|
<< "Transform patch " << transformPatch.name() << " for "
|
||||||
<< typeName << " patch " << name() << " is not the same as 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);
|
<< "This is not allowed." << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,12 +128,12 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
|||||||
label n = 0;
|
label n = 0;
|
||||||
{
|
{
|
||||||
const scalarField thisMagAreas(mag(this->faceAreas()));
|
const scalarField thisMagAreas(mag(this->faceAreas()));
|
||||||
const scalarField nbrMagAreas(mag(neighbPatch().faceAreas()));
|
const scalarField nbrMagAreas(mag(nbrPatch().faceAreas()));
|
||||||
|
|
||||||
vector thisCentre =
|
vector thisCentre =
|
||||||
gSum(this->faceCentres()*thisMagAreas)/gSum(thisMagAreas);
|
gSum(this->faceCentres()*thisMagAreas)/gSum(thisMagAreas);
|
||||||
vector nbrCentre =
|
vector nbrCentre =
|
||||||
gSum(neighbPatch().faceCentres()*nbrMagAreas)/gSum(nbrMagAreas);
|
gSum(nbrPatch().faceCentres()*nbrMagAreas)/gSum(nbrMagAreas);
|
||||||
|
|
||||||
scalar dLeft = mag(t.transformPosition(thisCentre) - nbrCentre);
|
scalar dLeft = mag(t.transformPosition(thisCentre) - nbrCentre);
|
||||||
scalar d = mag(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
|
// Create copies of this patch and the neighbour patch's points
|
||||||
pointField thisPoints(localPoints());
|
pointField thisPoints(localPoints());
|
||||||
const pointField nbrPoints(neighbPatch().localPoints());
|
const pointField nbrPoints(nbrPatch().localPoints());
|
||||||
|
|
||||||
// Create primitive patches
|
// Create primitive patches
|
||||||
primitivePatch thisPatch
|
primitivePatch thisPatch
|
||||||
@ -199,7 +199,7 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
|
|||||||
);
|
);
|
||||||
primitivePatch nbrPatch
|
primitivePatch nbrPatch
|
||||||
(
|
(
|
||||||
SubList<face>(neighbPatch().localFaces(), neighbPatch().size()),
|
SubList<face>(this->nbrPatch().localFaces(), this->nbrPatch().size()),
|
||||||
nbrPoints
|
nbrPoints
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -406,9 +406,9 @@ Foam::cyclicRepeatAMIPolyPatch::~cyclicRepeatAMIPolyPatch()
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::cyclicRepeatAMIPolyPatch&
|
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);
|
return refCast<const cyclicRepeatAMIPolyPatch>(pp);
|
||||||
}
|
}
|
||||||
@ -455,11 +455,11 @@ const Foam::scalarField& Foam::cyclicRepeatAMIPolyPatch::weightsSum() const
|
|||||||
|
|
||||||
|
|
||||||
const Foam::scalarField&
|
const Foam::scalarField&
|
||||||
Foam::cyclicRepeatAMIPolyPatch::neighbWeightsSum() const
|
Foam::cyclicRepeatAMIPolyPatch::nbrWeightsSum() const
|
||||||
{
|
{
|
||||||
// See above.
|
// See above.
|
||||||
|
|
||||||
return cyclicAMIPolyPatch::neighbWeightsSum();
|
return cyclicAMIPolyPatch::nbrWeightsSum();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -192,7 +192,7 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return a reference to the neighbour patch
|
//- Return a reference to the neighbour patch
|
||||||
virtual const cyclicRepeatAMIPolyPatch& neighbPatch() const;
|
virtual const cyclicRepeatAMIPolyPatch& nbrPatch() const;
|
||||||
|
|
||||||
//- Neighbour patch name
|
//- Neighbour patch name
|
||||||
inline const word& transformPatchName() const;
|
inline const word& transformPatchName() const;
|
||||||
@ -207,7 +207,7 @@ public:
|
|||||||
virtual const scalarField& weightsSum() const;
|
virtual const scalarField& weightsSum() const;
|
||||||
|
|
||||||
//- Return the weights sum for the neighbour patch
|
//- 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
|
//- Write the polyPatch data as a dictionary
|
||||||
|
|||||||
@ -88,7 +88,7 @@ namespace Foam
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meshFacei = patch_.neighbPatch().start() + facei;
|
meshFacei = patch_.nbrPatch().start() + facei;
|
||||||
}
|
}
|
||||||
x.updateFace
|
x.updateFace
|
||||||
(
|
(
|
||||||
@ -260,7 +260,7 @@ void Foam::FaceCellWave<Type, TrackingData>::checkCyclic
|
|||||||
// For debugging: check status on both sides of cyclic
|
// For debugging: check status on both sides of cyclic
|
||||||
|
|
||||||
const cyclicPolyPatch& nbrPatch =
|
const cyclicPolyPatch& nbrPatch =
|
||||||
refCast<const cyclicPolyPatch>(patch).neighbPatch();
|
refCast<const cyclicPolyPatch>(patch).nbrPatch();
|
||||||
|
|
||||||
forAll(patch, patchFacei)
|
forAll(patch, patchFacei)
|
||||||
{
|
{
|
||||||
@ -640,7 +640,7 @@ void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
|
|||||||
if (isA<cyclicPolyPatch>(patch))
|
if (isA<cyclicPolyPatch>(patch))
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& nbrPatch =
|
const cyclicPolyPatch& nbrPatch =
|
||||||
refCast<const cyclicPolyPatch>(patch).neighbPatch();
|
refCast<const cyclicPolyPatch>(patch).nbrPatch();
|
||||||
|
|
||||||
// Allocate buffers
|
// Allocate buffers
|
||||||
label nReceiveFaces;
|
label nReceiveFaces;
|
||||||
@ -732,7 +732,7 @@ void Foam::FaceCellWave<Type, TrackingData>::handleAMICyclicPatches()
|
|||||||
|
|
||||||
{
|
{
|
||||||
const cyclicAMIPolyPatch& nbrPatch =
|
const cyclicAMIPolyPatch& nbrPatch =
|
||||||
refCast<const cyclicAMIPolyPatch>(patch).neighbPatch();
|
refCast<const cyclicAMIPolyPatch>(patch).nbrPatch();
|
||||||
|
|
||||||
// Get nbrPatch data (so not just changed faces)
|
// Get nbrPatch data (so not just changed faces)
|
||||||
typename List<Type>::subList sendInfo
|
typename List<Type>::subList sendInfo
|
||||||
@ -784,16 +784,16 @@ void Foam::FaceCellWave<Type, TrackingData>::handleAMICyclicPatches()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
forAll(cycPatch.neighbPatch().AMIs(), i)
|
forAll(cycPatch.nbrPatch().AMIs(), i)
|
||||||
{
|
{
|
||||||
List<Type> sendInfoT(sendInfo);
|
List<Type> sendInfoT(sendInfo);
|
||||||
transform
|
transform
|
||||||
(
|
(
|
||||||
cycPatch.neighbPatch().AMITransforms()[i],
|
cycPatch.nbrPatch().AMITransforms()[i],
|
||||||
sendInfoT.size(),
|
sendInfoT.size(),
|
||||||
sendInfoT
|
sendInfoT
|
||||||
);
|
);
|
||||||
cycPatch.neighbPatch().AMIs()[i].interpolateToTarget
|
cycPatch.nbrPatch().AMIs()[i].interpolateToTarget
|
||||||
(
|
(
|
||||||
sendInfoT,
|
sendInfoT,
|
||||||
cmb,
|
cmb,
|
||||||
|
|||||||
@ -313,7 +313,7 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleProcPatches()
|
|||||||
nbrPoints.reserve(procPatch.nPoints());
|
nbrPoints.reserve(procPatch.nPoints());
|
||||||
|
|
||||||
// Get all changed points in reverse order
|
// Get all changed points in reverse order
|
||||||
const labelList& neighbPoints = procPatch.neighbPoints();
|
const labelList& neighbPoints = procPatch.nbrPoints();
|
||||||
forAll(neighbPoints, thisPointi)
|
forAll(neighbPoints, thisPointi)
|
||||||
{
|
{
|
||||||
label meshPointi = procPatch.meshPoints()[thisPointi];
|
label meshPointi = procPatch.meshPoints()[thisPointi];
|
||||||
@ -428,7 +428,7 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleCyclicPatches()
|
|||||||
|
|
||||||
// Collect nbrPatch points that have changed
|
// Collect nbrPatch points that have changed
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
const cyclicPolyPatch& nbrPatch = cycPatch.nbrPatch();
|
||||||
const edgeList& pairs = cycPatch.coupledPoints();
|
const edgeList& pairs = cycPatch.coupledPoints();
|
||||||
const labelList& meshPoints = nbrPatch.meshPoints();
|
const labelList& meshPoints = nbrPatch.meshPoints();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,7 +29,7 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(PointEdgeWaveName, 0);
|
defineTypeNameAndDebug(PointEdgeWaveName, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -130,7 +130,7 @@ Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface
|
|||||||
nbrLduInterface
|
nbrLduInterface
|
||||||
(
|
(
|
||||||
nbrLevel,
|
nbrLevel,
|
||||||
neighbPatchID()
|
nbrPatchID()
|
||||||
).faceCells();
|
).faceCells();
|
||||||
|
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ internalFieldTransfer
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
// const labelUList& nbrFaceCells = neighbPatch().faceCells();
|
// const labelUList& nbrFaceCells = nbrPatch().faceCells();
|
||||||
|
|
||||||
const labelUList& nbrFaceCells = nbrLduInterface().faceCells();
|
const labelUList& nbrFaceCells = nbrLduInterface().faceCells();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -104,9 +104,9 @@ public:
|
|||||||
//- Cyclic interface functions
|
//- Cyclic interface functions
|
||||||
|
|
||||||
//- Return neighbour processor number
|
//- Return neighbour processor number
|
||||||
virtual label neighbPatchID() const
|
virtual label nbrPatchID() const
|
||||||
{
|
{
|
||||||
return fineRegionCoupledLduInterface_.neighbPatchID();
|
return fineRegionCoupledLduInterface_.nbrPatchID();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool owner() const
|
virtual bool owner() const
|
||||||
@ -114,11 +114,11 @@ public:
|
|||||||
return fineRegionCoupledLduInterface_.owner();
|
return fineRegionCoupledLduInterface_.owner();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const regionCoupledBaseGAMGInterface& neighbPatch() const
|
virtual const regionCoupledBaseGAMGInterface& nbrPatch() const
|
||||||
{
|
{
|
||||||
return dynamic_cast<const regionCoupledBaseGAMGInterface&>
|
return dynamic_cast<const regionCoupledBaseGAMGInterface&>
|
||||||
(
|
(
|
||||||
fineRegionCoupledLduInterface_.neighbPatch()
|
fineRegionCoupledLduInterface_.nbrPatch()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -74,13 +74,13 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return neighbour
|
//- Return neighbour
|
||||||
virtual label neighbPatchID() const = 0;
|
virtual label nbrPatchID() const = 0;
|
||||||
|
|
||||||
//- Is it owner?
|
//- Is it owner?
|
||||||
virtual bool owner() const = 0;
|
virtual bool owner() const = 0;
|
||||||
|
|
||||||
//- Return neighb regionCoupledLduInterface
|
//- Return neighb regionCoupledLduInterface
|
||||||
virtual const regionCoupledLduInterface& neighbPatch() const = 0;
|
virtual const regionCoupledLduInterface& nbrPatch() const = 0;
|
||||||
|
|
||||||
//- Return AMI
|
//- Return AMI
|
||||||
// virtual const AMIInterpolation& AMI() const = 0;
|
// virtual const AMIInterpolation& AMI() const = 0;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,7 +45,7 @@ void Foam::regionCoupledBase::resetAMI() const
|
|||||||
{
|
{
|
||||||
AMIPtr_.clear();
|
AMIPtr_.clear();
|
||||||
|
|
||||||
const polyPatch& nbr = refCast<const polyPatch>(neighbPatch());
|
const polyPatch& nbr = refCast<const polyPatch>(nbrPatch());
|
||||||
pointField nbrPoints = nbr.localPoints();
|
pointField nbrPoints = nbr.localPoints();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -183,7 +183,7 @@ Foam::regionCoupledBase::~regionCoupledBase()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::label Foam::regionCoupledBase::neighbPatchID() const
|
Foam::label Foam::regionCoupledBase::nbrPatchID() const
|
||||||
{
|
{
|
||||||
if (nbrPatchID_ == -1)
|
if (nbrPatchID_ == -1)
|
||||||
{
|
{
|
||||||
@ -238,7 +238,7 @@ bool Foam::regionCoupledBase::owner() const
|
|||||||
{
|
{
|
||||||
if (nbrRegionName_ == patch_.boundaryMesh().mesh().name())
|
if (nbrRegionName_ == patch_.boundaryMesh().mesh().name())
|
||||||
{
|
{
|
||||||
return patch_.index() < neighbPatchID();
|
return patch_.index() < nbrPatchID();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -298,7 +298,7 @@ const Foam::AMIInterpolation& Foam::regionCoupledBase::AMI() const
|
|||||||
|
|
||||||
|
|
||||||
const Foam::regionCoupledBase&
|
const Foam::regionCoupledBase&
|
||||||
Foam::regionCoupledBase::neighbPatch() const
|
Foam::regionCoupledBase::nbrPatch() const
|
||||||
{
|
{
|
||||||
const polyMesh& mesh =
|
const polyMesh& mesh =
|
||||||
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
|
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
|
||||||
@ -306,7 +306,7 @@ Foam::regionCoupledBase::neighbPatch() const
|
|||||||
nbrRegionName_
|
nbrRegionName_
|
||||||
);
|
);
|
||||||
|
|
||||||
const polyPatch& pp = mesh.boundaryMesh()[neighbPatchID()];
|
const polyPatch& pp = mesh.boundaryMesh()[nbrPatchID()];
|
||||||
return refCast<const regionCoupledBase>(pp);
|
return refCast<const regionCoupledBase>(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -140,13 +140,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Neighbour patch ID
|
//- Neighbour patch ID
|
||||||
label neighbPatchID() const;
|
label nbrPatchID() const;
|
||||||
|
|
||||||
//- Does this side own the patch?
|
//- Does this side own the patch?
|
||||||
bool owner() const;
|
bool owner() const;
|
||||||
|
|
||||||
//- Return a reference to the neighbour patch
|
//- Return a reference to the neighbour patch
|
||||||
const regionCoupledBase& neighbPatch() const;
|
const regionCoupledBase& nbrPatch() const;
|
||||||
|
|
||||||
//- Return a reference to the projection surface
|
//- Return a reference to the projection surface
|
||||||
const autoPtr<searchableSurface>& surfPtr() const;
|
const autoPtr<searchableSurface>& surfPtr() const;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -37,7 +37,7 @@ Foam::tmp<Foam::Field<Type>> Foam::regionCoupledBase::interpolate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return neighbPatch().AMI().interpolateToTarget(fld);
|
return nbrPatch().AMI().interpolateToTarget(fld);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ Foam::tmp<Foam::Field<Type>> Foam::regionCoupledBase::interpolate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return neighbPatch().AMI().interpolateToTarget(tFld);
|
return nbrPatch().AMI().interpolateToTarget(tFld);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ void Foam::regionCoupledBase::interpolate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
neighbPatch().AMI().interpolateToTarget(fld, bop, result);
|
nbrPatch().AMI().interpolateToTarget(fld, bop, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user