mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
decomposed cyclics handling
This commit is contained in:
@ -100,15 +100,32 @@ void processorPointPatchField<Type>::initSwapAdd(Field<Type>& pField) const
|
|||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
// Get internal field into my point order
|
||||||
Field<Type> pf(this->patchInternalField(pField));
|
Field<Type> pf(this->patchInternalField(pField));
|
||||||
|
|
||||||
OPstream::write
|
// Normally points will be ordered same on both sides due to
|
||||||
(
|
// the point numbering by decomposePar. However this will not be
|
||||||
Pstream::blocking,
|
// the case for meshes changed in parallel.
|
||||||
procPatch_.neighbProcNo(),
|
|
||||||
reinterpret_cast<const char*>(pf.begin()),
|
// Reorder into neighbour point order. Note that one side can have
|
||||||
pf.byteSize()
|
// more or less points than other side if partically decomposed
|
||||||
);
|
// cyclics are present.
|
||||||
|
|
||||||
|
const labelList& nbrPts = procPatch_.procPolyPatch().neighbPoints();
|
||||||
|
|
||||||
|
Field<Type> nbrf(this->size(), pTraits<Type>::zero);
|
||||||
|
|
||||||
|
forAll(nbrPts, i)
|
||||||
|
{
|
||||||
|
label nbrPointI = nbrPts[i];
|
||||||
|
if (nbrPointI >= 0 && nbrPointI < nbrf.size())
|
||||||
|
{
|
||||||
|
nbrf[nbrPointI] = pf[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OPstream toNbr(Pstream::blocking, procPatch_.neighbProcNo());
|
||||||
|
toNbr << nbrf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,23 +136,26 @@ void processorPointPatchField<Type>::swapAdd(Field<Type>& pField) const
|
|||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
Field<Type> pnf(this->size());
|
Field<Type> pnf(this->size());
|
||||||
|
{
|
||||||
IPstream::read
|
// We do not know the number of points on the other side
|
||||||
|
// so cannot use Pstream::read.
|
||||||
|
IPstream fromNbr
|
||||||
(
|
(
|
||||||
Pstream::blocking,
|
Pstream::blocking,
|
||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo()
|
||||||
reinterpret_cast<char*>(pnf.begin()),
|
|
||||||
pnf.byteSize()
|
|
||||||
);
|
);
|
||||||
|
fromNbr >> pnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
pnf.setSize(this->size(), pTraits<Type>::zero);
|
||||||
|
|
||||||
if (doTransform())
|
if (doTransform())
|
||||||
{
|
{
|
||||||
|
const processorPolyPatch& ppp = procPatch_.procPolyPatch();
|
||||||
|
const tensorField& forwardT = ppp.forwardT();
|
||||||
const labelList& nonGlobalPatchPoints =
|
const labelList& nonGlobalPatchPoints =
|
||||||
procPatch_.nonGlobalPatchPoints();
|
procPatch_.nonGlobalPatchPoints();
|
||||||
|
|
||||||
const processorPolyPatch& ppp = procPatch_.procPolyPatch();
|
|
||||||
const labelListList& pointFaces = ppp.pointFaces();
|
const labelListList& pointFaces = ppp.pointFaces();
|
||||||
const tensorField& forwardT = ppp.forwardT();
|
|
||||||
|
|
||||||
if (forwardT.size() == 1)
|
if (forwardT.size() == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user