From f0d40fc7fe999a7dcfd0c65cdad46481e0f73717 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 1 Feb 2012 15:14:34 +0000 Subject: [PATCH 1/2] STYLE: streamLine/controlDict: updated comment --- src/postProcessing/functionObjects/field/streamLine/controlDict | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postProcessing/functionObjects/field/streamLine/controlDict b/src/postProcessing/functionObjects/field/streamLine/controlDict index 4d51dd82e1..63b6d1d1d2 100644 --- a/src/postProcessing/functionObjects/field/streamLine/controlDict +++ b/src/postProcessing/functionObjects/field/streamLine/controlDict @@ -57,7 +57,7 @@ functions outputControl outputTime; // outputInterval 10; - setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; + setFormat vtk; //gnuplot, raw etc. See sampleDict. // Velocity field to use for tracking. UName U; From 68093ce564608ba70b301bf34830fbad02ae0d7b Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 1 Feb 2012 15:15:32 +0000 Subject: [PATCH 2/2] BUG: fvMesh::movePoints: re-create demand-driven geometry data as early as possible --- src/finiteVolume/fvMesh/fvMesh.C | 50 ++++++++++++++++++++++++++++---- src/finiteVolume/fvMesh/fvMesh.H | 6 +++- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index e90919877d..98346e4c77 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,6 +82,40 @@ void Foam::fvMesh::clearGeomNotOldVol() } +void Foam::fvMesh::updateGeomNotOldVol() +{ + bool haveV = (VPtr_ != NULL); + bool haveSf = (SfPtr_ != NULL); + bool haveMagSf = (magSfPtr_ != NULL); + bool haveCP = (CPtr_ != NULL); + bool haveCf = (CfPtr_ != NULL); + + clearGeomNotOldVol(); + + // Now recreate the fields + if (haveV) + { + (void)V(); + } + if (haveSf) + { + (void)Sf(); + } + if (haveMagSf) + { + (void)magSf(); + } + if (haveCP) + { + (void)C(); + } + if (haveCf) + { + (void)Cf(); + } +} + + void Foam::fvMesh::clearGeom() { clearGeomNotOldVol(); @@ -562,10 +596,6 @@ Foam::tmp Foam::fvMesh::movePoints(const pointField& p) } - // delete out of date geometrical information - clearGeomNotOldVol(); - - if (!phiPtr_) { // Create mesh motion flux @@ -612,6 +642,16 @@ Foam::tmp Foam::fvMesh::movePoints(const pointField& p) phi.boundaryField()[patchI] *= rDeltaT; } + // Update or delete the local geometric properties as early as possible so + // they can be used if necessary. These get recreated here instead of + // demand driven since they might do parallel transfers which can conflict + // with when they're actually being used. + // Note that between above "polyMesh::movePoints(p)" and here nothing + // should use the local geometric properties. + updateGeomNotOldVol(); + + + // Update other local data boundary_.movePoints(); surfaceInterpolation::movePoints(); diff --git a/src/finiteVolume/fvMesh/fvMesh.H b/src/finiteVolume/fvMesh/fvMesh.H index c2d414dcea..907cc418fd 100644 --- a/src/finiteVolume/fvMesh/fvMesh.H +++ b/src/finiteVolume/fvMesh/fvMesh.H @@ -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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,6 +133,10 @@ class fvMesh //- Clear geometry but not the old-time cell volumes void clearGeomNotOldVol(); + //- Clear geometry like clearGeomNotOldVol but recreate any + // geometric demand-driven data that was set + void updateGeomNotOldVol(); + //- Clear geometry void clearGeom();