openfoam/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkHasValidField.H
Mark Olesen c7a7dc443c extended the conversion library and utilities
library:
  * routines for managing cellTable and boundaryRegion
  * writing ensight files and parts
  * mesh reader/writer for STARCD

utils:
  * star4ToFoam
  * foamToStarMesh
  * foamToEnsightParts
2008-07-04 16:26:22 +02:00

24 lines
512 B
C

// 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();
}
}