diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 896026c35677690b52a49d28b29ea59337e11efd..31b96f7e98fd7bd6abcd2eb747ee2789b8555642 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,22 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict) { setCellZoneCells(); - Info<< type() << " " << name_ << ":" << nl + if (nCells_ == 0) + { + WarningIn + ( + "Foam::fieldValues::cellSource::initialise(const dictionary&)" + ) + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl + << " Source has no cells - deactivating" << endl; + + active_ = false; + return; + } + + Info<< type() << " " << name_ << ":" + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl << " total cells = " << nCells_ << nl << " total volume = " << gSum(filterField(mesh().V())) << nl << endl; diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 838658d1a26b723cf5ad363551d37f2b1888bdc6..259692c5f99517fb091b6dcc01c8303f0f4a81c6 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,6 +249,20 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict) } } + if (nFaces_ == 0) + { + WarningIn + ( + "Foam::fieldValues::faceSource::initialise(const dictionary&)" + ) + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl + << " Source has no faces - deactivating" << endl; + + active_ = false; + return; + } + scalar totalArea; if (surfacePtr_.valid())