diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files index d4c28fa64c..78e39e9df6 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files @@ -5,4 +5,3 @@ foamToEnsight.C ensightWriteBinary.C EXE = $(FOAM_APPBIN)/foamToEnsight -//EXE = $(FOAM_USER_APPBIN)/foamToEnsight diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options index 1adeeefa12..c7d4d25e8b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ + -DFULLDEBUG -g -O0 \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude EXE_LIBS = \ -lfiniteVolume \ - -llagrangian + -llagrangian \ + diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkSprayData.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkSprayData.H deleted file mode 100644 index 6a581184dc..0000000000 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkSprayData.H +++ /dev/null @@ -1,13 +0,0 @@ -forAll(Times, n1) -{ - IOobject fieldObjectHeader - ( - fieldName, - Times[n1].name(), - "lagrangian", - mesh, - IOobject::NO_READ - ); - - variableGood = variableGood && fieldObjectHeader.headerOk(); -} diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightSprayField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloudField.C similarity index 63% rename from applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightSprayField.C rename to applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloudField.C index 1b13698d68..d213b00582 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightSprayField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloudField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "ensightSprayField.H" +#include "ensightCloudField.H" #include "Time.H" #include "IOField.H" #include "OFstream.H" @@ -35,39 +35,48 @@ using namespace Foam; // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // template -void ensightSprayField +void ensightCloudField ( const Foam::IOobject& fieldObject, const Foam::fileName& postProcPath, const Foam::word& prepend, const Foam::label timeIndex, - const Foam::word& sprayName, - Foam::Ostream& ensightCaseFile + const Foam::word& cloudName, + Foam::Ostream& ensightCaseFile, + const bool dataExists ) { - Info<< "Converting spray field " << fieldObject.name() << endl; + if (dataExists) + { + Info<< "Converting cloud " << cloudName + << " field " << fieldObject.name() << endl; + } + else + { + Info<< "Creating empty cloud " << cloudName + << " field " << fieldObject.name() << endl; + } word timeFile = prepend + itoa(timeIndex); const Time& runTime = fieldObject.time(); - if (timeIndex == 0) + if (timeIndex == 0 && Pstream::master()) { ensightCaseFile << pTraits::typeName << " per measured node: 1 "; ensightCaseFile.width(15); ensightCaseFile.setf(ios_base::left); ensightCaseFile - << ("s" + fieldObject.name()).c_str() - << (' ' + prepend + "***." + sprayName + << ("c" + fieldObject.name()).c_str() + << (' ' + prepend + "***." + cloudName + "." + fieldObject.name()).c_str() << nl; } - // set the filename of the ensight file fileName ensightFileName ( - timeFile + "." + sprayName +"." + fieldObject.name() + timeFile + "." + cloudName +"." + fieldObject.name() ); OFstream ensightFile @@ -78,36 +87,39 @@ void ensightSprayField runTime.writeCompression() ); - ensightFile << pTraits::typeName << " values" << nl; + ensightFile<< pTraits::typeName << " values" << nl; - IOField vf(fieldObject); - - ensightFile.setf(ios_base::scientific, ios_base::floatfield); - ensightFile.precision(5); - - label count = 0; - forAll(vf, i) + if (dataExists) { - Type v = vf[i]; + IOField vf(fieldObject); - if (mag(v) < 1.0e-90) - { - v = pTraits::zero; - } + ensightFile.setf(ios_base::scientific, ios_base::floatfield); + ensightFile.precision(5); - for (direction cmpt=0; cmpt::nComponents; cmpt++) + label count = 0; + forAll(vf, i) { - ensightFile << setw(12) << component(v, cmpt); - if (++count % 6 == 0) + Type v = vf[i]; + + if (mag(v) < 1.0e-90) { - ensightFile << nl; + v = pTraits::zero; + } + + for (direction cmpt=0; cmpt::nComponents; cmpt++) + { + ensightFile << setw(12) << component(v, cmpt); + if (++count % 6 == 0) + { + ensightFile << nl; + } } } - } - if ( (count % 6 != 0) || (count==0) ) - { - ensightFile << nl; + if ((count % 6 != 0) || (count==0)) + { + ensightFile << nl; + } } } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightSprayField.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloudField.H similarity index 88% rename from applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightSprayField.H rename to applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloudField.H index 1c6c682055..e417ebbbd8 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightSprayField.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloudField.H @@ -28,33 +28,34 @@ InApplication Description SourceFiles - ensightSprayField.C + ensightCloudField.C \*---------------------------------------------------------------------------*/ -#ifndef ensightSprayField_H -#define ensightSprayField_H +#ifndef ensightCloudField_H +#define ensightCloudField_H #include "IOobject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -void ensightSprayField +void ensightCloudField ( const Foam::IOobject& fieldObject, const Foam::fileName& postProcPath, const Foam::word& prepend, const Foam::label timeIndex, const Foam::word& timeFile, - const Foam::word& sprayName, - Foam::Ostream& ensightCaseFile + const Foam::word& cloudName, + Foam::Ostream& ensightCaseFile, + const bool dataExists ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "ensightSprayField.C" +# include "ensightCloudField.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C index 4561a0b077..06bb3f3d9e 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C @@ -278,7 +278,7 @@ bool writePatchField const Foam::label patchi, const Foam::label ensightPatchi, const Foam::faceSets& boundaryFaceSet, - const Foam::ensightMesh::nFacePrims& nfp, + const Foam::ensightMesh::nFacePrimitives& nfp, const Foam::labelList& patchProcessors, Foam::OFstream& ensightFile ) @@ -338,7 +338,7 @@ bool writePatchFieldBinary const Foam::label patchi, const Foam::label ensightPatchi, const Foam::faceSets& boundaryFaceSet, - const Foam::ensightMesh::nFacePrims& nfp, + const Foam::ensightMesh::nFacePrimitives& nfp, const Foam::labelList& patchProcessors, std::ofstream& ensightFile ) @@ -403,12 +403,13 @@ void writePatchField Foam::Ostream& ensightCaseFile ) { - const Time& runTime = eMesh.mesh.time(); + const Time& runTime = eMesh.mesh().time(); const List& boundaryFaceSets = eMesh.boundaryFaceSets; const HashTable& allPatchNames = eMesh.allPatchNames; const HashTable