# Options on BornAgain

file:///usr/share/doc/bornagain/html/ref/sim/setup/options/index.html Recent content in Options on BornAgain Hugo en-us

# Monte-Carlo

file:///usr/share/doc/bornagain/html/ref/sim/setup/options/mc.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/sim/setup/options/mc.html <h2 id="option-monte-carlo-integration">Option: Monte-Carlo integration</h2> <p>If for some reason the midpoint of a detector pixel is not representative for the average scattering intensity of the entire pixel it is possible to resort to Monte-Carlo integration.</p> <p>To request Monte-Carlo integration over detector pixels, use</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">simulation</span><span class="o">.</span><span class="n">options</span><span class="p">()</span><span class="o">.</span><span class="n">setMonteCarloIntegration</span><span class="p">(</span><span class="kc">True</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span> </span></span></code></pre></div><p>where <code>n</code> is the number of scattering intensity evaluations per pixel.</p> <p>Example: <a href="file:///usr/share/doc/bornagain/html/ref/sim/class/scattering/ex/mc">Monte-Carlo</a>.</p>

# # threads

file:///usr/share/doc/bornagain/html/ref/sim/setup/options/threads.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/sim/setup/options/threads.html <h2 id="option-number-of-threads">Option: number of threads</h2> <p>Multithreading can be controlled through</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">simulation</span><span class="o">.</span><span class="n">options</span><span class="p">()</span><span class="o">.</span><span class="n">setNumberOfThreads</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> </span></span></code></pre></div><p>where <code>n</code> is the number of threads to be used during the simulation.</p> <p>If this option is not set, or set to <code>n=0</code>, then the default value will be taken from the hardware.</p>

# Average materials

file:///usr/share/doc/bornagain/html/ref/sim/setup/options/avgmat.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/sim/setup/options/avgmat.html <h2 id="option-use-average-materials">Option: use average materials</h2> <p>With the setting</p> <pre tabindex="0"><code>simulation.options().setUseAvgMaterials(True) </code></pre><p>the refractive properties of material layers are computed by taking the average of the matrix material and the embedded particles.</p>

# Include specular

file:///usr/share/doc/bornagain/html/ref/sim/setup/options/specular.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/sim/setup/options/specular.html <h2 id="option-include-specular-reflection">Option: include specular reflection</h2> <p>To include the specular reflected beam intensity along with the scattered intensity in a GISAS simulation, use</p> <pre tabindex="0"><code>simulation.options().setIncludeSpecular(True) </code></pre><p>Example: <a href="file:///usr/share/doc/bornagain/html/ref/sim/class/specular/ex">GISAS with specular peak</a>.</p>