Skip to content
Snippets Groups Projects
Commit 417a2f6a authored by mattijs's avatar mattijs
Browse files

BUG: reference FO: allocate interpolator on all processors. Fixes #823.

parent cb1cd96b
Branches
Tags
No related merge requests found
...@@ -53,13 +53,15 @@ bool Foam::functionObjects::reference::calcType() ...@@ -53,13 +53,15 @@ bool Foam::functionObjects::reference::calcType()
{ {
cellValue.value() = -pTraits<Type>::one*GREAT; cellValue.value() = -pTraits<Type>::one*GREAT;
// Might trigger parallel comms (e.g. volPointInterpolation, if
// result is not yet cached) so have all processors do it
autoPtr<interpolation<Type>> interpolator
(
interpolation<Type>::New(interpolationScheme_, vf)
);
if (celli_ != -1) if (celli_ != -1)
{ {
autoPtr<interpolation<Type>> interpolator
(
interpolation<Type>::New(interpolationScheme_, vf)
);
cellValue.value() = cellValue.value() =
interpolator().interpolate(position_, celli_, -1); interpolator().interpolate(position_, celli_, -1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment