Commit f87496b3 authored by mattijs's avatar mattijs
Browse files

ENH: mappedPatchBase: short circuit when sampling own mesh. Fixed when doing #1046.

parent f2ef9951
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -1206,9 +1206,13 @@ void Foam::mappedPatchBase::clearOut()
const Foam::polyMesh& Foam::mappedPatchBase::sampleMesh() const
{
return patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
const polyMesh& thisMesh = patch_.boundaryMesh().mesh();
return
(
sampleRegion()
sameRegion_
? thisMesh
: thisMesh.time().lookupObject<polyMesh>(sampleRegion())
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment