Update documentation

This commit is contained in:
Paul Romano 2017-07-31 08:18:55 -05:00
parent dae2a169e6
commit d0faebe11d
9 changed files with 284 additions and 57 deletions

View file

@ -8,17 +8,28 @@ C API
Run a stochastic volume calculation
.. c:function:: int openmc_cell_set_temperature(int id, double T, int* instance)
.. c:function:: int openmc_cell_get_id(int32_t index, int32_t* id)
Get the ID of a cell
:param index: Index in the cells array
:type index: int32_t
:param id: ID of the cell
:type id: int32_t*
:return: Return status (negative if an error occurred)
:rtype: int
.. c:function:: int openmc_cell_set_temperature(index index, double T, int32_t* instance)
Set the temperature of a cell.
:param id: ID of the cell
:type id: int
:param index: Index in the cells array
:type index: int32_t
:param T: Temperature in Kelvin
:type T: double
:param instance: Which instance of the cell. To set the temperature for all
instances, pass a null pointer.
:type instance: int*
:type instance: int32_t*
:return: Return status (negative if an error occurred)
:rtype: int
@ -26,7 +37,7 @@ C API
Finalize a simulation
.. c:function:: void openmc_find(double* xyz, int rtype, int* id, int* instance)
.. c:function:: void openmc_find(double* xyz, int rtype, int32_t* id, int32_t* instance)
Determine the ID of the cell/material containing a given point
@ -36,10 +47,65 @@ C API
:type rtype: int
:param id: ID of the cell/material found. If a material is requested and the
point is in a void, the ID is 0. If an error occurs, the ID is -1.
:type id: int
:type id: int32_t*
:param instance: If a cell is repetaed in the geometry, the instance of the
cell that was found and zero otherwise.
:type instance: int
:type instance: int32_t*
.. c:function:: int openmc_get_cell(int32_t id, int32_t* index)
Get the index in the cells array for a cell with a given ID
:param id: ID of the cell
:type id: int32_t
:param index: Index in the cells array
:type index: int32_t*
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_get_keff(double k_combined[])
:param k_combined: Combined estimate of k-effective
:type k_combined: double[2]
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_get_nuclide(char name[], int* index)
Get the index in the nuclides array for a nuclide with a given name
:param name: Name of the nuclide
:type name: char[]
:param index: Index in the nuclides array
:type index: int*
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_get_tally(int32_t id, int32_t* index)
Get the index in the tallies array for a tally with a given ID
:param id: ID of the tally
:type id: int32_t
:param index: Index in the tallies array
:type index: int32_t*
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_get_material(int32_t id, int32_t* index)
Get the index in the materials array for a material with a given ID
:param id: ID of the material
:type id: int32_t
:param index: Index in the materials array
:type index: int32_t*
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: void openmc_hard_reset()
Reset tallies, timers, and pseudo-random number generator state
.. c:function:: void openmc_init(int intracomm)
@ -57,13 +123,13 @@ C API
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_material_add_nuclide(int id, char name[], double density)
.. c:function:: int openmc_material_add_nuclide(int32_t index, char name[], double density)
Add a nuclide to an existing material. If the nuclide already exists, the
density is overwritten.
:param id: ID of the material
:type id: int
:param index: Index in the materials array
:type index: int32_t
:param name: Name of the nuclide
:type name: char[]
:param density: Density in atom/b-cm
@ -71,28 +137,67 @@ C API
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_material_get_densities(int id, double* ptr)
.. c:function:: int openmc_material_get_densities(int32_t index, int* nuclides[], double* densities[])
Get an array of nuclide densities for a material.
Get density for each nuclide in a material.
:param id: ID of the material
:type id: int
:param ptr: Pointer to the array of densities
:type ptr: double*
:return: Length of the array
:param index: Index in the materials array
:type index: int32_t
:param nuclides: Pointer to array of nuclide indices
:type nuclides: int**
:param densities: Pointer to the array of densities
:type densities: double**
:param n: Length of the array
:type n: int
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_material_set_density(int id, double density)
.. c:function:: int openmc_material_get_id(int32_t index, int32_t* id)
Get the ID of a material
:param index: Index in the materials array
:type index: int32_t
:param id: ID of the material
:type id: int32_t*
:return: Return status (negative if an error occurred)
:rtype: int
.. c:function:: int openmc_material_set_density(int32_t index, double density)
Set the density of a material.
:param id: ID of the material
:type id: int
:param index: Index in the materials array
:type index: int32_t
:param density: Density of the material in atom/b-cm
:type density: double
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_material_set_densities(int32_t, n, char* name[], double density[])
:param index: Index in the materials array
:type index: int32_t
:param n: Length of name/density
:type n: int
:param name: Array of nuclide names
:type name: char**
:param density: Array of densities
:type density: double[]
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: int openmc_nuclide_name(int index, char* name[])
Get name of a nuclide
:param index: Index in the nuclides array
:type index: int
:param name: Name of the nuclide
:type name: char**
:return: Return status (negative if an error occurs)
:rtype: int
.. c:function:: void openmc_plot_geometry()
Run plotting mode.
@ -105,13 +210,52 @@ C API
Run a simulation
.. c:function:: void openmc_tally_results(int id, double** ptr, int shape_[3])
.. c:function:: int openmc_tally_get_id(int32_t index, int32_t* id)
Get the ID of a tally
:param index: Index in the tallies array
:type index: int32_t
:param id: ID of the tally
:type id: int32_t*
:return: Return status (negative if an error occurred)
:rtype: int
.. c:function:: int openmc_tally_get_nuclides(int32_t index, int* nuclides[], int* n)
Get nuclides specified in a tally
:param index: Index in the tallies array
:type index: int32_t
:param nuclides: Array of nuclide indices
:type nuclides: int**
:param n: Number of nuclides
:type n: int*
:return: Return status (negative if an error occurred)
:rtype: int
.. c:function:: int openmc_tally_results(int32_t index, double** ptr, int shape_[3])
Get a pointer to tally results array.
:param id: ID of the tally
:type id: int
:param index: Index in the tallies array
:type index: int32_t
:param ptr: Pointer to the results array
:type ptr: double**
:param shape_: Shape of the results array
:type shape_: int[3]
:return: Return status (negative if an error occurred)
:rtype: int
.. c:function:: int openmc_tally_set_nuclides(int32_t index, int n, char* nuclides[])
Set the nuclides for a tally
:param index: Index in the tallies array
:type index: int32_t
:param n: Number of nuclides
:type n: int
:param nuclides: Array of nuclide names
:type nuclides: char**
:return: Return status (negative if an error occurred)
:rtype: int

View file

@ -2,16 +2,37 @@
:data:`openmc.capi` -- Python bindings to the C API
---------------------------------------------------
.. automodule:: openmc.capi
Functions
---------
.. autosummary::
:toctree: generated
:nosignatures:
:template: myfunction.rst
openmc.capi.lib_context
openmc.capi.calculate_volumes
openmc.capi.finalize
openmc.capi.find
openmc.capi.hard_reset
openmc.capi.init
openmc.capi.keff
openmc.capi.load_nuclide
openmc.capi.plot_geometry
openmc.capi.reset
openmc.capi.run
openmc.capi.run_in_memory
Classes
-------
.. autosummary::
:toctree: generated
:nosignatures:
:template: myclass.rst
openmc.capi.OpenMCLibrary
openmc.capi.CellView
openmc.capi.MaterialView
openmc.capi.NuclideView
openmc.capi.TallyView