wiki:PdfObjects

Version 4 (modified by Baowei Liu, 12 years ago) ( diff )

Back

PDF Objects

PDF Objects can be created within the ProblemModuleInit routine in problem.f90. To create pdfs you first need to add two USE statements to your problem.f90

  USE PDFs
  USE Fields

Then in ProblemModuleInit declare a variable pointer of type !PDFDef

  TYPE(PDFDef), POINTER :: PDF

Then create the PDF and set the various parameters as in the following example

    CALL CreatePDF(PDF)
    PDF%Field(:)%id=(/Mass_Field,P_Field/)
    PDF%Field(:)%component=(/GASCOMP,GASCOMP/) !These have to be the same
    PDF%Field(:)%name=(/'density','pressure'/)
    PDF%minvalue=(/.01,100/)
    PDF%maxvalue=(/1e7,1e6/)
    PDF%nbins=(/400,400/)
    PDF%scale=(/LOGSCALE, LOGSCALE/)
    PDF%WeightField=BINBYVOLUME

  • For more information on the Field sub-object's properties see ProcessingFields
  • If you are making several pdfs, you can reuse the PDF Pointer (with or without Nullifying it) by calling CreatePDF(PDF) for each new pdf.

Here is a full list of the various PDF parameters with the default values in brackets: These are identical to those for Histograms except that Scale, minvalue, maxvalue, and nBins are 2 element arrays (as well as Field being a two element array)

      INTEGER :: Scale(2)=[LINEARSCALE], LOGSCALE
      REAL(KIND=qPREC) :: minvalue(2)=[MINOVERALL], or any real number
      REAL(KIND=qPREC) :: maxvalue(2)=[MAXOVERALL], or any real number
      INTEGER :: nBins(2)=[100], or any integer
      INTEGER :: WeightField=[BINBYVOLUME], BINBYMASS, or any valid FieldID

At each process event (currently each frame) a bov/dat file pair will be generated in the out directory ie. out/volume_weighted_density_vs_pressure_00021.bov and out/volume_weighted_density_vs_pressure_00021.dat. The .bov file contains information about the data as well as the location of the actual data file .dat which contains the raw unformatted binary data. Visit will only recognize the .bov files. After opening the file, there will be a 2D dataset with a single variable pdf that contains the distribution function.

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.