mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Remove openmc_set_density and openmc_set_temperature
This commit is contained in:
parent
a4d02fa8a7
commit
23cd067bda
3 changed files with 0 additions and 122 deletions
|
|
@ -105,28 +105,6 @@ C API
|
|||
|
||||
Run a simulation
|
||||
|
||||
.. c:function:: int openmc_set_density(double xyz[3], double density)
|
||||
|
||||
Set the density of a material at a given point.
|
||||
|
||||
:param xyz: Cartesian coordinates
|
||||
:type xyz: double[3]
|
||||
:param density: Density of the material to set in atom/b-cm
|
||||
:type density: double
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_set_temperature(double xyz[3], double T)
|
||||
|
||||
Set the density of a cell at a given point.
|
||||
|
||||
:param xyz: Cartesian coordinates
|
||||
:type xyz: double[3]
|
||||
:param T: Temperature of the cell to set in Kelvin
|
||||
:type T: double
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: void openmc_tally_results(int id, double** ptr, int shape_[3])
|
||||
|
||||
Get a pointer to tally results array.
|
||||
|
|
|
|||
|
|
@ -53,11 +53,6 @@ class OpenMCLibrary(object):
|
|||
self._dll.openmc_plot_geometry.restype = None
|
||||
self._dll.openmc_run.restype = None
|
||||
self._dll.openmc_reset.restype = None
|
||||
self._dll.openmc_set_density.argtypes = [POINTER(_double3), c_double]
|
||||
self._dll.openmc_set_density.restype = c_int
|
||||
self._dll.openmc_set_temperature.argtypes = [
|
||||
POINTER(_double3), c_double]
|
||||
self._dll.openmc_set_temperature.restype = c_int
|
||||
self._dll.openmc_tally_results.argtypes = [
|
||||
c_int32, _double_array, POINTER(_int3)]
|
||||
self._dll.openmc_tally_results.restype = None
|
||||
|
|
@ -232,42 +227,6 @@ class OpenMCLibrary(object):
|
|||
"""Run simulation"""
|
||||
return self._dll.openmc_run()
|
||||
|
||||
def set_density(self, xyz, density):
|
||||
"""Set density at a given point.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
xyz : iterable of float
|
||||
Cartesian coordinates at position
|
||||
density : float
|
||||
Density in atom/b-cm
|
||||
|
||||
Returns
|
||||
-------
|
||||
int
|
||||
Return status (negative if an error occurs)
|
||||
|
||||
"""
|
||||
return self._dll.openmc_set_density(_double3(*xyz), density)
|
||||
|
||||
def set_temperature(self, xyz, T):
|
||||
"""Set temperature at a given point.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
xyz : iterable of float
|
||||
Cartesian coordinates at position
|
||||
T : float
|
||||
Temperature in K
|
||||
|
||||
Returns
|
||||
-------
|
||||
int
|
||||
Return status (negative if an error occurs)
|
||||
|
||||
"""
|
||||
return self._dll.openmc_set_temperature(_double3(*xyz), T)
|
||||
|
||||
def tally_results(self, tally_id):
|
||||
"""Get tally results array
|
||||
|
||||
|
|
|
|||
59
src/api.F90
59
src/api.F90
|
|
@ -31,8 +31,6 @@ module openmc_api
|
|||
public :: openmc_plot_geometry
|
||||
public :: openmc_reset
|
||||
public :: openmc_run
|
||||
public :: openmc_set_density
|
||||
public :: openmc_set_temperature
|
||||
public :: openmc_tally_results
|
||||
|
||||
contains
|
||||
|
|
@ -322,63 +320,6 @@ contains
|
|||
|
||||
end subroutine openmc_reset
|
||||
|
||||
!===============================================================================
|
||||
! OPENMC_SET_DENSITY sets the density of a material at a given point
|
||||
!===============================================================================
|
||||
|
||||
function openmc_set_density(xyz, density) result(err) bind(C)
|
||||
real(C_DOUBLE), intent(in) :: xyz(3)
|
||||
real(C_DOUBLE), intent(in), value :: density
|
||||
integer(C_INT) :: err
|
||||
|
||||
logical :: found
|
||||
type(Particle) :: p
|
||||
|
||||
call p % initialize()
|
||||
p % coord(1) % xyz(:) = xyz
|
||||
p % coord(1) % uvw(:) = [ZERO, ZERO, ONE]
|
||||
call find_cell(p, found)
|
||||
|
||||
err = -1
|
||||
if (found) then
|
||||
if (p % material /= MATERIAL_VOID) then
|
||||
associate (m => materials(p % material))
|
||||
err = m % set_density(density, nuclides)
|
||||
end associate
|
||||
end if
|
||||
end if
|
||||
end function openmc_set_density
|
||||
|
||||
!===============================================================================
|
||||
! OPENMC_SET_TEMPERATURE sets the temperature of a cell at a given point
|
||||
!===============================================================================
|
||||
|
||||
function openmc_set_temperature(xyz, T) result(err) bind(C)
|
||||
real(C_DOUBLE), intent(in) :: xyz(3)
|
||||
real(C_DOUBLE), intent(in), value :: T
|
||||
integer(C_INT) :: err
|
||||
|
||||
logical :: found
|
||||
type(Particle) :: p
|
||||
|
||||
call p % initialize()
|
||||
p % coord(1) % xyz(:) = xyz
|
||||
p % coord(1) % uvw(:) = [ZERO, ZERO, ONE]
|
||||
call find_cell(p, found)
|
||||
|
||||
err = -1
|
||||
if (found) then
|
||||
associate (c => cells(p % coord(p % n_coord) % cell))
|
||||
if (size(c % sqrtkT) > 1) then
|
||||
c % sqrtkT(p % cell_instance) = sqrt(K_BOLTZMANN * T)
|
||||
else
|
||||
c % sqrtkT(1) = sqrt(K_BOLTZMANN * T)
|
||||
end if
|
||||
err = 0
|
||||
end associate
|
||||
end if
|
||||
end function openmc_set_temperature
|
||||
|
||||
!===============================================================================
|
||||
! OPENMC_TALLY_RESULTS returns a pointer to a tally results array along with its
|
||||
! shape. This allows a user to obtain in-memory tally results from Python
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue