openfoam/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H
Mark Olesen 88ca081c8c ENH: reduce startup time for ensight conversion (issue #240).
- Less looping when detecting lagrangian clouds and their fields.

- Avoid using Time::setTime() and IOobjectList in tight loops.
  They both kill performance immensely.

ENH: provide a -noLagrangian option to foamToEnsight and foamToEnsightParts
for even more control.
2016-09-23 17:45:47 +02:00

34 lines
775 B
C

// ignore special fields (_0 fields),
// ignore fields we don't handle,
// ignore fields that are not available for all time-steps
// hash by field-name in fieldsToUse
if (!fieldsToUse.found(fieldName))
{
bool variableGood = false;
forAll(timeDirs, n1)
{
variableGood =
(
fieldName.size() > 2 && fieldName(fieldName.size()-2, 2) == "_0"
? false
: IOobject
(
fieldName,
timeDirs[n1].name(),
mesh,
IOobject::NO_READ
).typeHeaderOk<volScalarField>(false)
);
if (variableGood)
{
break;
}
}
reduce(variableGood, andOp<bool>());
fieldsToUse.set(fieldName, variableGood);
}