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())
|
||||
{
|
||||
// Get internal field into my point order
|
||||
Field<Type> pf(this->patchInternalField(pField));
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::blocking,
|
||||
procPatch_.neighbProcNo(),
|
||||
reinterpret_cast<const char*>(pf.begin()),
|
||||
pf.byteSize()
|
||||
);
|
||||
// Normally points will be ordered same on both sides due to
|
||||
// the point numbering by decomposePar. However this will not be
|
||||
// the case for meshes changed in parallel.
|
||||
|
||||
// Reorder into neighbour point order. Note that one side can have
|
||||
// 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())
|
||||
{
|
||||
Field<Type> pnf(this->size());
|
||||
{
|
||||
// We do not know the number of points on the other side
|
||||
// so cannot use Pstream::read.
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::blocking,
|
||||
procPatch_.neighbProcNo()
|
||||
);
|
||||
fromNbr >> pnf;
|
||||
}
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::blocking,
|
||||
procPatch_.neighbProcNo(),
|
||||
reinterpret_cast<char*>(pnf.begin()),
|
||||
pnf.byteSize()
|
||||
);
|
||||
pnf.setSize(this->size(), pTraits<Type>::zero);
|
||||
|
||||
if (doTransform())
|
||||
{
|
||||
const processorPolyPatch& ppp = procPatch_.procPolyPatch();
|
||||
const tensorField& forwardT = ppp.forwardT();
|
||||
const labelList& nonGlobalPatchPoints =
|
||||
procPatch_.nonGlobalPatchPoints();
|
||||
|
||||
const processorPolyPatch& ppp = procPatch_.procPolyPatch();
|
||||
const labelListList& pointFaces = ppp.pointFaces();
|
||||
const tensorField& forwardT = ppp.forwardT();
|
||||
|
||||
if (forwardT.size() == 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user