From 7eb40198779ee0f5be79e5a889f65e9ad66a05cf Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 25 Aug 2009 17:57:06 +0100 Subject: [PATCH] improved pdfPlot utility --- .../miscellaneous/pdfPlot/Make/options | 8 ++-- .../miscellaneous/pdfPlot/createFields.H | 19 ++------ .../miscellaneous/pdfPlot/pdfDict | 35 ++++++++++++++ .../miscellaneous/pdfPlot/pdfPlot.C | 46 +++++++++++-------- 4 files changed, 72 insertions(+), 36 deletions(-) create mode 100644 applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfDict diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options b/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options index f248721341..a140053895 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options @@ -1,6 +1,8 @@ EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ - -lpdf + -lpdf \ + -lsampling diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H index c9255fc4cf..2dc6e7af70 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H @@ -2,7 +2,7 @@ ( IOobject ( - "pdfDictionary", + "pdfDict", runTime.constant(), runTime, IOobject::MUST_READ, @@ -10,20 +10,9 @@ ) ); - label nIntervals - ( - readLabel(pdfDictionary.lookup("nIntervals")) - ); + label nIntervals(readLabel(pdfDictionary.lookup("nIntervals"))); - label nSamples - ( - readLabel(pdfDictionary.lookup("nSamples")) - ); + label nSamples(readLabel(pdfDictionary.lookup("nSamples"))); - label samples[nIntervals]; - - for(label i=0;i p - ( - pdf::New(pdfDictionary, rndGen) - ); + autoPtr p(pdf::New(pdfDictionary, rndGen)); scalar xMin = p->minValue(); - scalar xMax = p->maxValue(); - for(label i=0;isample(); - label n = label((ps-xMin)*nIntervals/(xMax-xMin)); - //Info << "p[" << i << "] = " << ps << ", n = " << n << endl; + label n = label((ps - xMin)*nIntervals/(xMax - xMin)); samples[n]++; + + if (i % iCheck == 0) + { + Info<< " processed " << i << " samples" << endl; + + if (i == 10*iCheck) + { + iCheck *= 10; + } + } } - for(label i=0;itype(), pdfPath, runTime.graphFormat()); + Info << "End\n" << endl; return 0;