mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: binField: remove an unused field
- skip the reduce operation for serial mode - fix typos
This commit is contained in:
@ -197,7 +197,7 @@ void Foam::binModels::singleDirectionUniformBin::apply()
|
|||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Unable to find field " << fieldNames_[i]
|
<< "Unable to find field " << fieldNames_[i]
|
||||||
<< ". Avaliable objects are "
|
<< ". Available objects are "
|
||||||
<< mesh_.objectRegistry::sortedToc()
|
<< mesh_.objectRegistry::sortedToc()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ void Foam::binModels::singleDirectionUniformBin::writeFileHeader
|
|||||||
if (decomposePatchValues_)
|
if (decomposePatchValues_)
|
||||||
{
|
{
|
||||||
writeTabbed(os, writeComponents<Type>("normal" + ibin));
|
writeTabbed(os, writeComponents<Type>("normal" + ibin));
|
||||||
writeTabbed(os, writeComponents<Type>("tangenial" + ibin));
|
writeTabbed(os, writeComponents<Type>("tangential" + ibin));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -171,8 +171,6 @@ bool Foam::binModels::singleDirectionUniformBin::processField
|
|||||||
|
|
||||||
const auto& pts = pp.faceCentres();
|
const auto& pts = pp.faceCentres();
|
||||||
|
|
||||||
const scalarField dd(pp.faceCentres() & binDir_);
|
|
||||||
|
|
||||||
forAll(pts, facei)
|
forAll(pts, facei)
|
||||||
{
|
{
|
||||||
const label bini = whichBin(pts[facei] & binDir_);
|
const label bini = whichBin(pts[facei] & binDir_);
|
||||||
@ -189,9 +187,12 @@ bool Foam::binModels::singleDirectionUniformBin::processField
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& binList : data)
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
reduce(binList, sumOp<List<Type>>());
|
for (auto& binList : data)
|
||||||
|
{
|
||||||
|
reduce(binList, sumOp<List<Type>>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (writeToFile())
|
if (writeToFile())
|
||||||
|
|||||||
@ -121,11 +121,7 @@ bool Foam::binModels::uniformBin::processField(const label fieldi)
|
|||||||
nField += 1;
|
nField += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<List<Type>> data(nField);
|
List<List<Type>> data(nField, List<Type>(nBin_, Zero));
|
||||||
for (auto& binList : data)
|
|
||||||
{
|
|
||||||
binList.resize(nBin_, Zero);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const label zonei : cellZoneIDs_)
|
for (const label zonei : cellZoneIDs_)
|
||||||
{
|
{
|
||||||
@ -165,9 +161,12 @@ bool Foam::binModels::uniformBin::processField(const label fieldi)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& binList : data)
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
reduce(binList, sumOp<List<Type>>());
|
for (auto& binList : data)
|
||||||
|
{
|
||||||
|
reduce(binList, sumOp<List<Type>>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (writeToFile())
|
if (writeToFile())
|
||||||
|
|||||||
Reference in New Issue
Block a user