mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: mappedPatchBase: reverseDistribute using local, not remote size
This commit is contained in:
@ -244,6 +244,7 @@ protected:
|
||||
const label size
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -319,6 +320,9 @@ public:
|
||||
//- Patch (only if NEARESTPATCHFACE)
|
||||
inline const word& samplePatch() const;
|
||||
|
||||
//- Return size of mapped mesh/patch/boundary
|
||||
inline label sampleSize() const;
|
||||
|
||||
//- Offset vector (from patch faces to destination mesh objects)
|
||||
inline const vector& offset() const;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,6 +42,37 @@ inline const Foam::word& Foam::mappedPatchBase::samplePatch() const
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::mappedPatchBase::sampleSize() const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
return samplePolyPatch().size();
|
||||
}
|
||||
case NEARESTCELL:
|
||||
{
|
||||
return sampleMesh().nCells();
|
||||
}
|
||||
case NEARESTPATCHFACE:
|
||||
{
|
||||
return samplePolyPatch().size();
|
||||
}
|
||||
case NEARESTFACE:
|
||||
{
|
||||
const polyMesh& mesh = sampleMesh();
|
||||
return mesh.nFaces() - mesh.nInternalFaces();
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorIn("mappedPatchBase::sampleSize()")
|
||||
<< "problem." << abort(FatalError);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vector& Foam::mappedPatchBase::offset() const
|
||||
{
|
||||
return offset_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -89,8 +89,8 @@ void Foam::mappedPatchBase::reverseDistribute(List<Type>& lst) const
|
||||
}
|
||||
default:
|
||||
{
|
||||
label cSize = patch_.size();
|
||||
map().reverseDistribute(cSize, lst);
|
||||
map().reverseDistribute(sampleSize(), lst);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,7 @@ void Foam::mappedPatchBase::reverseDistribute
|
||||
}
|
||||
default:
|
||||
{
|
||||
label cSize = patch_.size();
|
||||
label cSize = sampleSize();
|
||||
map().distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
@ -128,6 +128,7 @@ void Foam::mappedPatchBase::reverseDistribute
|
||||
bop,
|
||||
pTraits<Type>::zero
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user