diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/Make/files b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/Make/files index 739c971551..63e9998478 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/Make/files +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/Make/files @@ -1,3 +1,4 @@ +ensightOutputSerialCloud.C foamToEnsightParts.C EXE = $(FOAM_APPBIN)/foamToEnsightParts diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkHasMovingMesh.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkMeshMoving.H similarity index 88% rename from applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkHasMovingMesh.H rename to applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkMeshMoving.H index 15a4756949..51c7a11e73 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkHasMovingMesh.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkMeshMoving.H @@ -1,7 +1,7 @@ // check for "points" in all of the result directories // - could restrict to the selected times -bool hasMovingMesh = false; +bool meshMoving = false; if (timeDirs.size() > 1 && Pstream::master()) { @@ -13,7 +13,7 @@ if (timeDirs.size() > 1 && Pstream::master()) Info<< "Search for moving mesh ... " << flush; forAll(timeDirs, timeI) { - hasMovingMesh = + meshMoving = ( isDir(baseDir/timeDirs[timeI].name()/polyMesh::meshSubDir) && IOobject @@ -28,13 +28,13 @@ if (timeDirs.size() > 1 && Pstream::master()) ).typeHeaderOk(true) ); - if (hasMovingMesh) + if (meshMoving) { break; } } - if (hasMovingMesh) + if (meshMoving) { Info<< "found." << nl << " Writing meshes for every timestep." << endl; @@ -45,4 +45,4 @@ if (timeDirs.size() > 1 && Pstream::master()) } } -reduce(hasMovingMesh, orOp()); +reduce(meshMoving, orOp()); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/ensightOutputCase.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/ensightOutputCase.H deleted file mode 100644 index b0c3af822b..0000000000 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/ensightOutputCase.H +++ /dev/null @@ -1,270 +0,0 @@ -// write time values to case file - -scalar timeCorrection = 0; -if (timeDirs[0].value() < 0) -{ - timeCorrection = - timeDirs[0].value(); - Info<< "Correcting time values. Adding " << timeCorrection << endl; -} - -// the case file is always ASCII -Info<< "write case: " << caseFileName.c_str() << endl; - -OFstream caseFile(ensightDir/caseFileName, IOstream::ASCII); -caseFile.setf(ios_base::left); - -caseFile.setf(ios_base::scientific, ios_base::floatfield); -caseFile.precision(5); - -caseFile - << "FORMAT" << nl - << setw(16) << "type:" << "ensight gold" << nl << nl; - -// time-set for geometries -// TODO: split off into separate time-set, but need to verify ensight spec -if (geometryTimesUsed.size()) -{ - caseFile - << "GEOMETRY" << nl - << setw(16) << "model: 1" << (dataMask/geometryName).c_str() << nl; -} -else -{ - caseFile - << "GEOMETRY" << nl - << setw(16) << "model:" << geometryName << nl; -} - - -// add information for clouds -// multiple clouds currently require the same time index -forAllConstIter(HashTable>, cloudFields, cloudIter) -{ - const word& cloudName = cloudIter.key(); - - caseFile - << setw(16) << "measured: 2" - << fileName(dataMask/cloud::prefix/cloudName/"positions").c_str() - << nl; -} -caseFile - << nl << "VARIABLE" << nl; - -forAllConstIter(HashTable, volumeFields, fieldIter) -{ - const word& fieldName = fieldIter.key(); - const word& fieldType = fieldIter(); - string ensightType; - - if (fieldType == volScalarField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else if (fieldType == volVectorField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else if (fieldType == volSphericalTensorField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else if (fieldType == volSymmTensorField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else if (fieldType == volTensorField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else - { - continue; - } - - ensightCaseEntry - ( - caseFile, - ensightType, - fieldName, - dataMask - ); -} - - -// TODO: allow similar/different time-steps for each cloud -label cloudNo = 0; -forAllConstIter(HashTable>, cloudFields, cloudIter) -{ - const word& cloudName = cloudIter.key(); - - forAllConstIter(HashTable, cloudIter(), fieldIter) - { - const word& fieldName = fieldIter.key(); - const word& fieldType = fieldIter(); - string ensightType; - - if (fieldType == scalarIOField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else if (fieldType == vectorIOField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else if (fieldType == tensorIOField::typeName) - { - ensightType = ensightPTraits::typeName; - } - else - { - continue; - } - - ensightCaseEntry - ( - caseFile, - ensightType, - fieldName, - dataMask, - cloud::prefix/cloudName, - cloudNo, - 2 - ); - } - cloudNo++; -} - - -// add time values -caseFile << nl << "TIME" << nl; - -// time set 1 - volume fields -if (fieldTimesUsed.size()) -{ - caseFile - << "time set: " << 1 << nl - << "number of steps: " << fieldTimesUsed.size() << nl - << "filename numbers:" << nl; - - label count = 0; - forAll(fieldTimesUsed, i) - { - caseFile - << " " << setw(12) << fieldTimesUsed[i]; - - if (++count % 6 == 0) - { - caseFile << nl; - } - } - - caseFile - << nl << "time values:" << nl; - - count = 0; - forAll(fieldTimesUsed, i) - { - const label index = fieldTimesUsed[i]; - caseFile - << " " << setw(12) << timeIndices[index] + timeCorrection; - - if (++count % 6 == 0) - { - caseFile << nl; - } - } - caseFile << nl << nl; -} - - -// time set 2 - geometry -// THIS NEEDS MORE CHECKING -#if 0 -if (geometryTimesUsed.size()) -{ - caseFile - << "time set: " << 2 << nl - << "number of steps: " << geometryTimesUsed.size() << nl - << "filename numbers:" << nl; - - label count = 0; - forAll(geometryTimesUsed, i) - { - caseFile - << " " << setw(12) << geometryTimesUsed[i]; - - if (++count % 6 == 0) - { - caseFile << nl; - } - } - - caseFile - << nl << "time values:" << nl; - - count = 0; - forAll(geometryTimesUsed, i) - { - const label index = geometryTimesUsed[i]; - caseFile - << " " << setw(12) << timeIndices[index] + timeCorrection; - - if (++count % 6 == 0) - { - caseFile << nl; - } - } - caseFile << nl << nl; -} -#endif - -// time set - clouds -// TODO: allow similar/different time-steps for each cloud -cloudNo = 0; -forAllConstIter(HashTable>, cloudTimesUsed, cloudIter) -{ - // const word& cloudName = cloudIter.key(); - const DynamicList