Lognormal radii from the pre-drawn radii list ignore the family's min and max radius

Open Beginner friendly
#171 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Start in addRadii() in DFNGen/fractureEstimating.cpp and put its lognormal rejection loop side by side with the one in generatePoly() in DFNGen/insertShape.cpp, which already tests shapeFam.logMin and shapeFam.logMax. Decide whether the 3 * h floor and the h floor should match, then rerun the reproduction case (lognormal ellipse, stopCondition = 0, nPoly = 120, min 1.0 / max 10.0) and check the smallest value in dfnGen_output/radii.dat is at least min_radius. Done means the listed radii respect both bounds and the lognormal regression baselines have been regenerated.

Written by the indexing model from the issue text.

Description

Summary

For lognormal families, radii drawn into the pre-sampled radii list are not limited to the family's min_radius / max_radius. Accepted fractures can therefore be smaller than the prescribed minimum (or larger than the prescribed maximum).

Where

DFNGen/fractureEstimating.cpp, addRadii(), lognormal case:

double minRadius = 3 * h;
...
do {
    radius = logDistribution(generator);
    ...
} while (radius < minRadius);

The only bound is 3 * h. shapeFam.logMin and shapeFam.logMax are never checked.

The on-demand sampler in DFNGen/insertShape.cpp (generatePoly()), used once the list is exhausted, does apply both bounds:

} while (radius < h || radius < shapeFam.logMin || radius > shapeFam.logMax);

The truncated power-law and exponential cases in addRadii() are not affected, because their bounds are passed to the sampler itself.

Which runs are affected
  • stopCondition = 0 (nPoly): the whole radii list is built by addRadii() through generateRadiiLists_nPolyOption(), so every listed radius is unbounded.
  • stopCondition = 1 (P32): the extra radii added by addRadiiToLists() (radiiListIncrease) are unbounded.
How to reproduce

One lognormal ellipse family, stopCondition = 0, nPoly = 120, radiiListIncrease = 0:

  • domain 15 x 15 x 15, h = 0.1
  • log_mean = ln(2), log_std = 0.5, min_radius = 1.0, max_radius = 10.0

Averaged over 20 seeds, the smallest accepted radius in dfnGen_output/radii.dat was 0.55, below the prescribed minimum of 1.0. The Kolmogorov-Smirnov distance between accepted radii and the truncated lognormal was 0.098, compared with 0.017 for a truncated power-law family run the same way.

Expected

Radii in the pre-drawn list respect logMin and logMax, as the on-demand sampler does.

Suggested fix

Use the same rejection condition in addRadii() as in generatePoly():

} while (radius < minRadius || radius < shapeFam.logMin || radius > shapeFam.logMax);

Two things to decide while fixing:

  • addRadii() uses a floor of 3 * h and generatePoly() uses h; these could be made consistent.
  • Fixing this changes the radii drawn for a given seed, so regression baselines for lognormal cases will need updating.
Dominant language
Python
Stars
101
Forks
56
Avg merge
1m
Merged PRs (30d)
9

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lanl/dfnWorks

All issues in lanl/dfnWorks

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.