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

This commit is contained in:
mattijs
2018-10-30 12:10:28 +00:00
parent f2ef995113
commit f87496b35d

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -1206,9 +1206,13 @@ void Foam::mappedPatchBase::clearOut()
const Foam::polyMesh& Foam::mappedPatchBase::sampleMesh() const 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())
); );
} }