Scattering on mesocrystal can be computed in two ways.
The first and the default way is to find all the lattice position inside the mesocrystal shape and coherently sum the scattering from all the unit cells. This gives the exact result, equal to the composition of all these particles. The computation time depends on the number of particles in mesocrystal.
The second way is to wrap form-factor of the mesocrystal outer shape with summation over the reciprocal lattice nodes within a certain reasonable radius. The result is approximate; the artifacts are stronger for small outer shapes. The computation time does not depend on the number of particles in mesocrystal.
simulation.options().setMesoReciprocalSum(True, 2.1)
The default state is False which corresponds to the first approach.
The second argument is the factor determining the summation radius of reciprocal lattice. The computation time grows as cube of this factor.
SimpleSelectionRule(a, b, c, modulus) keeps reciprocal-lattice indices
(h,k,l) satisfying (a*h + b*k + c*l) % modulus == 0, with modulus > 0.
It filters terms in the scattering sum; particle positions and material volume
remain those of the supplied structure.
Rules require approximate reciprocal-space summation:
simulation.options().setMesoReciprocalSum(True, 2.1)
Direct real-space summation rejects an explicit rule. With a correctly defined structure, it produces physical interference without one.
Build an 8 nm cubic cell with two copies of an existing particle:
basis = ba.Compound()
basis.addComponent(particle, ba.R3(0, 0, 0))
basis.addComponent(particle, ba.R3(4, 4, 4))
lattice = ba.CubicLattice(8)
lattice.setSelectionRule(ba.SimpleSelectionRule(1, 1, 1, 2))
crystal = ba.Crystal(basis, lattice)
Attach the rule before constructing the Crystal, which copies the lattice.
This keeps even h+k+l. A physical body-centred cubic cell still needs two
identical particles at fractional positions (0,0,0) and (1/2,1/2,1/2).
Their amplitudes cancel for odd h+k+l and add for even h+k+l.
Using one particle plus the rule gives half the allowed-reflection amplitude
and one quarter of the intensity of the two-particle cell.
FCCLattice.