diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurfaceTemplates.C b/src/sampling/sampledSurface/distanceSurface/distanceSurfaceTemplates.C index a2491f1ab4..1a66028f95 100644 --- a/src/sampling/sampledSurface/distanceSurface/distanceSurfaceTemplates.C +++ b/src/sampling/sampledSurface/distanceSurface/distanceSurfaceTemplates.C @@ -62,13 +62,7 @@ Foam::distanceSurface::interpolateField ); // Sample. - return surface().interpolate - ( - cellDistancePtr_(), - pointDistance_, - volFld, - pointFld() - ); + return surface().interpolate(volFld, pointFld()); } diff --git a/src/sampling/sampledSurface/isoSurface/isoSurface.C b/src/sampling/sampledSurface/isoSurface/isoSurface.C index 78081050ab..35c1bec77d 100644 --- a/src/sampling/sampledSurface/isoSurface/isoSurface.C +++ b/src/sampling/sampledSurface/isoSurface/isoSurface.C @@ -30,6 +30,7 @@ License #include "syncTools.H" #include "addToRunTimeSelectionTable.H" #include "slicedVolFields.H" +#include "volFields.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -41,6 +42,243 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +bool Foam::isoSurface::noTransform(const tensor& tt) const +{ + return + (mag(tt.xx()-1) < mergeDistance_) + && (mag(tt.yy()-1) < mergeDistance_) + && (mag(tt.zz()-1) < mergeDistance_) + && (mag(tt.xy()) < mergeDistance_) + && (mag(tt.xz()) < mergeDistance_) + && (mag(tt.yx()) < mergeDistance_) + && (mag(tt.yz()) < mergeDistance_) + && (mag(tt.zx()) < mergeDistance_) + && (mag(tt.zy()) < mergeDistance_); +} + + +bool Foam::isoSurface::collocatedPatch(const polyPatch& pp) +{ + const coupledPolyPatch& cpp = refCast(pp); + + return cpp.parallel() && !cpp.separated(); +} + + +// Calculates per face whether couple is collocated. +Foam::PackedBoolList Foam::isoSurface::collocatedFaces +( + const coupledPolyPatch& pp +) const +{ + // Initialise to false + PackedBoolList collocated(pp.size()); + + const vectorField& separation = pp.separation(); + const tensorField& forwardT = pp.forwardT(); + + if (forwardT.size() == 0) + { + // Parallel. + if (separation.size() == 0) + { + collocated = 1u; + } + else if (separation.size() == 1) + { + // Fully separate. Do not synchronise. + } + else + { + // Per face separation. + forAll(pp, faceI) + { + if (mag(separation[faceI]) < mergeDistance_) + { + collocated[faceI] = 1u; + } + } + } + } + else if (forwardT.size() == 1) + { + // Fully transformed. + } + else + { + // Per face transformation. + forAll(pp, faceI) + { + if (noTransform(forwardT[faceI])) + { + collocated[faceI] = 1u; + } + } + } + return collocated; +} + + +// Insert the data for local point patchPointI into patch local values +// and/or into the shared values field. +void Foam::isoSurface::insertPointData +( + const processorPolyPatch& pp, + const Map