mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Documentation updates
This commit is contained in:
parent
6bea6fe081
commit
8e8d5e0478
3 changed files with 25 additions and 19 deletions
|
|
@ -460,13 +460,13 @@ attributes/sub-elements:
|
|||
*Default*: None
|
||||
|
||||
:library:
|
||||
If this attribute is given, it indicates that the source is to be instanciated
|
||||
from an externally compiled source function. This source can be as complex as
|
||||
is required to define the source for your problem. The only requirement that
|
||||
is made upon this source, is that there is a function called sample_source()
|
||||
more documentation on how to build sources can be found in :ref:`custom_source`
|
||||
If this attribute is given, it indicates that the source is to be
|
||||
instantiated from an externally compiled source function. This source can be
|
||||
as complex as is required to define the source for your problem. The only
|
||||
requirement is that there is a function called ``sample_source()``. More
|
||||
documentation on how to build sources can be found in :ref:`custom_source`.
|
||||
|
||||
*Deafult*: None
|
||||
*Default*: None
|
||||
|
||||
:space:
|
||||
An element specifying the spatial distribution of source sites. This element
|
||||
|
|
@ -645,8 +645,8 @@ more complicated sources.
|
|||
|
||||
.. note:: You should only use the openmc::prn() random number generator
|
||||
|
||||
In order to build your external source you need the following CMakeLists.txt
|
||||
file
|
||||
In order to build your external source, you will need to link it against the
|
||||
OpenMC shared library. This can be done by writing a CMakeLists.txt file:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
|
|
@ -656,9 +656,10 @@ file
|
|||
find_package(OpenMC REQUIRED HINTS <path to openmc>)
|
||||
target_link_libraries(source OpenMC::libopenmc)
|
||||
|
||||
You will now have a libsource.so (or .dylib) file in this directory, now point
|
||||
the library attribute of the source XML element to this file and you will be
|
||||
able to sample particles.
|
||||
After running ``cmake`` and ``make``, you will have a libsource.so (or .dylib)
|
||||
file in your build directory. Setting the :attr:`openmc.Source.library`
|
||||
attribute to the path of this shared library will indicate that it should be
|
||||
used for sampling source particles at runtime.
|
||||
|
||||
.. _univariate:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include <iostream>
|
||||
#include <cmath> // for M_PI
|
||||
|
||||
#include "openmc/random_lcg.h"
|
||||
#include "openmc/source.h"
|
||||
#include "openmc/particle.h"
|
||||
|
|
|
|||
|
|
@ -8,20 +8,22 @@ from openmc.stats.multivariate import UnitSphere, Spatial
|
|||
import openmc.checkvalue as cv
|
||||
|
||||
|
||||
class Source(object):
|
||||
class Source:
|
||||
"""Distribution of phase space coordinates for source sites.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
space : openmc.stats.Spatial, optional
|
||||
space : openmc.stats.Spatial
|
||||
Spatial distribution of source sites
|
||||
angle : openmc.stats.UnitSphere, optional
|
||||
angle : openmc.stats.UnitSphere
|
||||
Angular distribution of source sites
|
||||
energy : openmc.stats.Univariate, optional
|
||||
energy : openmc.stats.Univariate
|
||||
Energy distribution of source sites
|
||||
filename : str, optional
|
||||
filename : str
|
||||
Source file from which sites should be sampled
|
||||
strength : Real
|
||||
library : str
|
||||
Path to a custom source library
|
||||
strength : float
|
||||
Strength of the source
|
||||
particle : {'neutron', 'photon'}
|
||||
Source particle type
|
||||
|
|
@ -36,7 +38,9 @@ class Source(object):
|
|||
Energy distribution of source sites
|
||||
file : str or None
|
||||
Source file from which sites should be sampled
|
||||
strength : Real
|
||||
library : str or None
|
||||
Path to a custom source library
|
||||
strength : float
|
||||
Strength of the source
|
||||
particle : {'neutron', 'photon'}
|
||||
Source particle type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue