From 7c0386fcf560d7f06fcb95753837e8bfa7e9a48b Mon Sep 17 00:00:00 2001 From: andy <a.heather@opencfd.co.uk> Date: Thu, 4 Feb 2010 13:50:05 +0000 Subject: [PATCH] ENH: Field sources - added warning msg if seed point is not found - also minor code style tweaks --- .../TimeActivatedExplicitSource.C | 13 ++++++++++++- .../TimeActivatedExplicitSource.H | 2 +- .../TimeActivatedExplicitSourceIO.C | 6 +++--- .../TimeActivatedExplicitSourceList.C | 4 ++-- .../TimeActivatedExplicitSourceList.H | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.C index 351d49594cf..1552b8f8ab1 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.C @@ -220,6 +220,8 @@ void Foam::TimeActivatedExplicitSource<Type>::setCellSet() { case smPoints: { + Info<< indent << "- selecting cells using points" << endl; + labelHashSet cellOwners; forAll(points_, i) { @@ -228,7 +230,16 @@ void Foam::TimeActivatedExplicitSource<Type>::setCellSet() { cellOwners.insert(cellI); } + + label globalCellI = returnReduce(cellI, maxOp<label>()); + if (globalCellI < 0) + { + WarningIn("TimeActivatedExplicitSource<Type>::setCellIds()") + << "Unable to find owner cell for point " << points_[i] + << endl; + } } + cellsPtr_.reset(new cellSet(mesh_, "points", cellOwners)); break; @@ -243,7 +254,7 @@ void Foam::TimeActivatedExplicitSource<Type>::setCellSet() } default: { - FatalErrorIn("TimeActivatedExplicitSource::setCellIds()") + FatalErrorIn("TimeActivatedExplicitSource<Type>::setCellIds()") << "Unknown selectionMode " << selectionModeTypeNames_[selectionMode_] << ". Valid selectionMode types are" << selectionModeTypeNames_ diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.H index e079122edd3..9b1bfa69745 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.H @@ -365,7 +365,7 @@ public: friend Ostream& operator<< <Type> ( Ostream& os, - const TimeActivatedExplicitSource& sp + const TimeActivatedExplicitSource& source ); }; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceIO.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceIO.C index 98d099e4327..f9ae9120e89 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceIO.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceIO.C @@ -70,7 +70,7 @@ void Foam::TimeActivatedExplicitSource<Type>::writeData(Ostream& os) const { FatalErrorIn ( - "TimeActivatedExplicitSource<Type>::writeDict" + "TimeActivatedExplicitSource<Type>::writeData" "(" "Ostream&, " "bool" @@ -91,10 +91,10 @@ template<class Type> Foam::Ostream& Foam::operator<< ( Ostream& os, - const TimeActivatedExplicitSource<Type>& sp + const TimeActivatedExplicitSource<Type>& source ) { - sp.writeData(os); + source.writeData(os); return os; } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C index bb565dc32e4..64ff584d280 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C @@ -212,10 +212,10 @@ template<class Type> Foam::Ostream& Foam::operator<< ( Ostream& os, - const TimeActivatedExplicitSourceList<Type>& spl + const TimeActivatedExplicitSourceList<Type>& sources ) { - spl.writeData(os); + sources.writeData(os); return os; } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.H index 6309771b6a4..502dfb01eea 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.H @@ -150,7 +150,7 @@ public: friend Ostream& operator<< <Type> ( Ostream& os, - const TimeActivatedExplicitSourceList& sp + const TimeActivatedExplicitSourceList& sources ); }; -- GitLab