3 research outputs found
SKIRT: the design of a suite of input models for Monte Carlo radiative transfer simulations
The Monte Carlo method is the most popular technique to perform radiative
transfer simulations in a general 3D geometry. The algorithms behind and
acceleration techniques for Monte Carlo radiative transfer are discussed
extensively in the literature, and many different Monte Carlo codes are
publicly available. On the contrary, the design of a suite of components that
can be used for the distribution of sources and sinks in radiative transfer
codes has received very little attention. The availability of such models, with
different degrees of complexity, has many benefits. For example, they can serve
as toy models to test new physical ingredients, or as parameterised models for
inverse radiative transfer fitting. For 3D Monte Carlo codes, this requires
algorithms to efficiently generate random positions from 3D density
distributions. We describe the design of a flexible suite of components for the
Monte Carlo radiative transfer code SKIRT. The design is based on a combination
of basic building blocks (which can be either analytical toy models or
numerical models defined on grids or a set of particles) and the extensive use
of decorators that combine and alter these building blocks to more complex
structures. For a number of decorators, e.g. those that add spiral structure or
clumpiness, we provide a detailed description of the algorithms that can be
used to generate random positions. Advantages of this decorator-based design
include code transparency, the avoidance of code duplication, and an increase
in code maintainability. Moreover, since decorators can be chained without
problems, very complex models can easily be constructed out of simple building
blocks. Finally, based on a number of test simulations, we demonstrate that our
design using customised random position generators is superior to a simpler
design based on a generic black-box random position generator.Comment: 15 pages, 4 figures, accepted for publication in Astronomy and
Computin
Universal nonuniform random vector generator based on acceptance-rejection
The acceptance/rejection approach is widely used in universal nonuniform random number generators. Its key part is an accurate approximation of a given probability density from above by a hat function. This article uses a piecewise constant hat function, whose values are overestimates of the density on the elements of the partition of the domain. It uses a sawtooth overestimate of Lipschitz continuous densities, and then examines all local maximizers of such an overestimate. The method is applicable to multivariate multimodal distributions. It exhibits relatively short preprocessing time and fast generation of random variates from a very large class of distributions<br /