Re: Function behind the Log-normal distribution in StatsGenerator

121 views
Skip to first unread message

Michael Jackson

unread,
Jun 13, 2017, 1:08:34 PM6/13/17
to Suraj Gurav, dream3d-users
Dean Suraj,

When creating 2 phases with an 80/20 % split I would highly
recommend creating 2 "Primary Phases" which is non-intuitive. The
"Insert Precipitate" codes do not scale well past a few percentage.

The latest version of DREAM.3D 6.4.0 has many improvements, among them
some more documentation on the equations that are used in
StatsGenerator. After downloading and reviewing those documents let us
know if you still need some clarifications.

Also, We have placed a short Synthetic Tutorial video on the BlueQuartz
YouTube channel that may help you create your synthetic structure.
(https://www.youtube.com/channel/UCjeF8pFMzET5ZN3vsBHATpg)

I have attached a pipeline that should generate some grains in a 2 phase
80/20 split structure.
--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.j...@bluequartz.net


Suraj Gurav wrote:
> Hello Mike,
>
> I am Suraj Gurav, a Masters student at RWTH Aachen University,
> Germany. As a part of my thesis, I am focusing on generating a
> synthetic micro-structure using DREAM.3D.
>
> I am generating microstructure for DP600 Steel which has two phases,
> Ferrite and Martensite with phase fractions 80% and 20 %. I am also
> sending you the Pipeline which I am suing. While creating
> microstructure I am facing following problems.
>
> 1. I am getting the warning for 'Insert Precipitate Phase'filter as
> -There are no feature boundaries on which to place precipitate and
> Target statistics precipitate fraction is greater than zero, This
> filter will run without trying to match precipitate fraction. Also,
> when I open the file in ParaView, I am unable to see any boundary
> cells on the surface.
>
> 2. In order to validate my results, I need to know the function
> behind the Log-normal distribution in Size Distribution tab.
>
> 3. I also would like to know the description of the X-axis and Y-axis
> of the Log-normal distribution as I am unable to interpret in right
> way
>
> Kindly advice
>
> Regards,
>
> -- *Suraj Gurav*
Suraj_Pipeline.json

Sean Donegan

unread,
Jun 16, 2017, 9:31:27 AM6/16/17
to dream3d-users
Hi Suraj,

Here is the exact code used to generate the lognormal distribution in StatsGenerator:

template <typename Vector>  

static int GenLogNormalPlotData(float mu, float sigma, Vector& x, Vector& y, int size, float minCutOff = 5.0f, float maxCutOff = 5.0f)

  {

    int err = 0;

    float max, min;

    float stdDevSqr2 = sigma * sigma * 2.0f;

    float root2pi = powf((float)(M_2PI), 0.5);

    x.resize(size);

    y.resize(size);

    min = exp(mu - (minCutOff * sigma));

    max = exp(mu + (maxCutOff * sigma));


    float mmSize = (max - min) / static_cast<float>(size);

    float mmSizeOver2 = mmSize * 0.5;

    for(int i = 0; i < size; i++)

    {

      float logNormIn = (i * mmSize) + mmSizeOver2 + min;

      float expTerm = log(logNormIn) - mu;

      expTerm = expTerm * expTerm;

      float logNormOut = (1.0 / (logNormIn * sigma * root2pi)) * exp(-(expTerm / stdDevSqr2));

      x[i] = logNormIn;

      y[i] = logNormOut * mmSize;

      if(logNormOut < 0)

      {

        err = 1;

      }

    }

    return err;

  }  


In the above code, "size" refers to the number of bins being used to discretize the distribution, as it appears on the StatsGenerator GUI.  The computation of the y value for each bin is just application of the probability density function for the lognormal distribution.  The above code properly takes account of the min/max cutoffs used by StatsGenerator to simulate the heavy tails of real grain size distributions.

hope that helps,

-Sean
Reply all
Reply to author
Forward
0 new messages