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

Aperta Adatta ai principianti
#171 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

Inizia in addRadii() in DFNGen/fractureEstimating.cpp e affianca il suo ciclo di reiezione lognormale a quello in generatePoly() in DFNGen/insertShape.cpp, che testa già shapeFam.logMin e shapeFam.logMax. Decidi se il limite inferiore 3 * h e il limite inferiore h devono coincidere, poi riesegui il caso di riproduzione (ellisse lognormale, stopCondition = 0, nPoly = 120, min 1.0 / max 10.0) e verifica che il valore più piccolo in dfnGen_output/radii.dat sia almeno min_radius. Fatto significa che i raggi elencati rispettano entrambi i limiti e che le baseline di regressione lognormale sono state rigenerate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Python
Stelle
101
Fork
56
Merge medio
1m
PR unite (30g)
9

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/dfnWorks

Tutte le issue di lanl/dfnWorks

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.