From 8c09620771cbb31b23ab1fa2f77ab26cdbbd5a65 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Mar 2011 12:51:10 +0000 Subject: [PATCH] ENH: Initialise mesh demand-driven data in cloud constructor --- src/OpenFOAM/fields/cloud/cloud.C | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/fields/cloud/cloud.C b/src/OpenFOAM/fields/cloud/cloud.C index 40eb070bcd..2bf9a518a4 100644 --- a/src/OpenFOAM/fields/cloud/cloud.C +++ b/src/OpenFOAM/fields/cloud/cloud.C @@ -49,7 +49,20 @@ Foam::cloud::cloud(const objectRegistry& obr, const word& cloudName) IOobject::AUTO_WRITE ) ) -{} +{ + if (isA(obr)) + { + if (debug) + { + Pout<< "cloud: Initialising polyMesh nGeometricD" << endl; + } + + // initialise mesh dimensions - needed for parallel runs + // due to lazy evaluation of valid mesh dimensions + const polyMesh& mesh = dynamic_cast(obr); + const_cast(mesh).nGeometricD(); + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //