From 043bf18d984519c866705e1830a9c8b71bf7fc43 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 24 Nov 2016 23:04:01 +0000 Subject: [PATCH] functionObjects::grad: Avoid cache conflict with 'postProcess' utility Resolves bug-report http://bugs.openfoam.org/view.php?id=2350 --- .../regionFunctionObject/regionFunctionObjectTemplates.C | 2 +- src/functionObjects/field/grad/gradTemplates.C | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C index 89223ebb73..1e23871210 100644 --- a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C +++ b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C @@ -59,7 +59,7 @@ bool Foam::functionObjects::regionFunctionObject::store if (cacheable && fieldName == tfield().name()) { WarningInFunction - << "Cannot store cache-able field with the named used in the cache." + << "Cannot store cache-able field with the name used in the cache." << nl << " Either choose a different name or cache the field" << " and use the 'writeObjects' functionObject." diff --git a/src/functionObjects/field/grad/gradTemplates.C b/src/functionObjects/field/grad/gradTemplates.C index fb505bb8b6..d1ad033526 100644 --- a/src/functionObjects/field/grad/gradTemplates.C +++ b/src/functionObjects/field/grad/gradTemplates.C @@ -39,7 +39,7 @@ bool Foam::functionObjects::grad::calcGrad() ( resultName_, fvc::grad(lookupObject(fieldName_)), - true + mesh_.changing() && mesh_.cache(resultName_) ); } else if (foundObject(fieldName_)) @@ -48,7 +48,7 @@ bool Foam::functionObjects::grad::calcGrad() ( resultName_, fvc::grad(lookupObject(fieldName_)), - true + mesh_.changing() && mesh_.cache(resultName_) ); } else