BUG: incorrect statistics in parallel. Also removed sign of magSf.

This commit is contained in:
mattijs
2010-04-14 15:47:39 +01:00
parent 6c3c14ab20
commit 93a0172f03
6 changed files with 73 additions and 33 deletions

View File

@ -80,10 +80,11 @@ void Foam::fieldValues::cellSource::setCellZoneCells()
}
cellId_.setSize(count);
nCells_ = returnReduce(cellId_.size(), sumOp<label>());
if (debug)
{
Info<< "Original cell zone size = " << cZone.size()
Pout<< "Original cell zone size = " << cZone.size()
<< ", new size = " << count << endl;
}
}
@ -109,8 +110,8 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict)
}
Info<< type() << " " << name_ << ":" << nl
<< " total cells = " << cellId_.size() << nl
<< " total volume = " << sum(filterField(mesh().V()))
<< " total cells = " << nCells_ << nl
<< " total volume = " << gSum(filterField(mesh().V()))
<< nl << endl;
if (operation_ == opWeightedAverage)
@ -144,7 +145,7 @@ void Foam::fieldValues::cellSource::writeFileHeader()
{
outputFilePtr_()
<< "# Source : " << sourceTypeNames_[source_] << " "
<< sourceName_ << nl << "# Cells : " << cellId_.size() << nl
<< sourceName_ << nl << "# Cells : " << nCells_ << nl
<< "# Time" << tab << "sum(V)";
forAll(fields_, i)
@ -172,6 +173,7 @@ Foam::fieldValues::cellSource::cellSource
fieldValue(name, obr, dict, loadFromFiles),
source_(sourceTypeNames_.read(dict.lookup("source"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
nCells_(0),
cellId_()
{
read(dict);

View File

@ -133,6 +133,9 @@ protected:
//- Operation to apply to values
operationType operation_;
//- Global number of cells
label nCells_;
//- Local list of cell IDs
labelList cellId_;