This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkHasValidField.H

24 lines
512 B
C
Raw Normal View History

// check that the variable is present for all times
//
bool hasValidField = true;
{
for (label i=0; i < timeDirs.size() && hasValidField; ++i)
{
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) == "_0")
{
hasValidField = false;
break;
}
IOobject ioHeader
(
fieldName,
timeDirs[i].name(),
mesh,
IOobject::NO_READ
);
hasValidField = ioHeader.headerOk();
}
}