+++
title = "Dense cylinders"
weight = 55
+++

## Dense cylinders

By default, layers containing embedded particles of different materials are
regarded as composed by a single material using material averaging. This
behavior is enabled by default and does not require explicit configuration.

{{< figscg src="/img/auto/scatter2d/CylindersInAverageLayer.png" width="500px" class="center" caption="The figure shows the intensity map produced by the script below." >}}

The script below shows how to average materials when simulating scattering from a square lattice of cylinders inside a finite layer.

{{< show-ex file="scatter2d/CylindersInAverageLayer.py" >}}
