Commit graph

40 commits

Author SHA1 Message Date
Paul Romano
bf33a9e11b
Add openmc_mesh_get_volumes C API function (#2869) 2024-02-13 06:44:05 -06:00
Paul Romano
e6a36ff796
Add C API function for getting mesh bins for rasterized plot (#2854) 2024-01-23 06:54:08 -06:00
Paul Romano
187160d082
Ability to compute material volume fractions over mesh elements (#2802) 2024-01-19 09:01:18 -06:00
Patrick Shriwise
057c33a48e
Expose Material::depletable in the CAPI (#2843)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
2024-01-17 20:46:37 +00:00
Patrick Shriwise
eda39ad9ca
Python source class refactor (#2524)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
2023-06-20 21:27:55 -05:00
Paul Romano
c123ce0fa0
New multiply_density option on tallies (#2539) 2023-06-09 08:24:00 -04:00
Paul Romano
0587aeeaa4 Allow EnergyFunctionFilter interpolation to be set from C API 2022-10-18 12:14:15 -05:00
lewisgross1296
d1775181e9 added deletion operator to TallyMapping class. used in tests and changed delete invalid id to access invalid id 2022-08-12 15:49:08 -05:00
lewisgross1296
9d82e412da added test to delete known tally. added test to throw an error if you remove tally that was not added 2022-08-12 13:24:29 -05:00
lewisgross1296
4faaa4062b moved test out of python API into C++ API. modeled after test that adds a new tally. TODO add a test that tries to delete an invalid ID 2022-08-11 14:03:21 -05:00
Paul Romano
d8425d2669
Apply @shimwell suggestions from code review
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
2022-07-18 06:48:51 -05:00
Paul Romano
ba5f6f58fa Add test for openmc.lib.sample_external_source 2022-07-15 20:12:14 -05:00
Jonathan
d91676fe1b removed unused imports 2022-02-11 22:36:46 +00:00
Paul Romano
6bb6e2ec0c Fix failing unit tests 2022-01-21 08:18:54 -06:00
Olaf Schumann
efe36357a8 Update tests to check new meshes 2021-12-20 19:43:40 +01:00
agnelson
e4476fc0b7 Delayed mpi4py import until the user clearly indicated intent to use a communicator (or they already have created one and thus have already imported it); corrected versionchanged doc statements to include comments about what changed; added stackoverflow reference 2021-10-01 09:21:41 -05:00
agnelson
e8081207d7 Modified the C API to support setting material temperatures and to support setting the event based flag. Fixed failing MPI test. 2021-09-30 16:34:58 -05:00
agnelson
ad483b3fea Moved the dummy communicator to being within openmc vice openmc.deplete, added test of model.calculate_volumes and model.deplete, fixed issues identified from those tests, and added a DLL quieting method (still needs to be propagated to integrator.integrate 2021-09-30 11:18:35 -05:00
agnelson
ad3a14fa3d Resolving comments from @paulromano. Namely, set the openmc.lib.Cell rotation and translations to be properties that can take iterables vice ndarrays. Also removed const declaration when not needed. Finally, revised code and tests so that we do not return a None for non-initialized cases. This would yield different behavior between translation and rotation and instead of leading to confusion I now simply always return a sensical ndarray of float values.That is no rotation is no longer None, but is now array([0., 0., 0.]). 2021-07-30 11:42:27 -05:00
agnelson
6a9d43bcdb Added c-api methods for rotation matrix set/get 2021-07-28 05:37:13 -05:00
agnelson
7bcf2ca9e8 Adding a check to ensure we dont translate a cell not filled with a universe and then incorporating this in the unit test. 2021-07-27 19:03:38 -05:00
agnelson
1d8f4c922e Added a set/get_translation attribute to the Cell C-API interface. This is also tested. 2021-07-27 18:30:48 -05:00
Paul Romano
731f2975bb Replace lib.Material.density property with get_density method 2021-07-13 06:57:33 -05:00
Paul Romano
329dff2018 Add tests for export_properties and import_properties 2021-06-24 15:36:41 +07:00
Paul Romano
51e1b5f41c Fix id_map test 2021-06-24 15:14:00 +07:00
Paul Romano
f1173e82c1 Address @jtramm comments 2021-05-13 07:18:46 -05:00
Paul Romano
7b31eb5699 Increase number of batches for test_lib.py::test_reset 2021-05-03 09:43:09 -05:00
Paul Romano
8547e7082a Add pytest.approx in a few unit tests for robustness 2021-05-03 09:43:09 -05:00
Patrick Shriwise
933bc22c0a Exposing translations through the Python CAPI. 2021-04-28 00:24:10 -05:00
Shikhar Kumar
b4e00b7324 Add test cases 2021-02-09 16:13:55 -05:00
Shikhar Kumar
62d1a650e3 Address @promano comments 2020-06-10 20:33:11 -04:00
Shikhar Kumar
f404ffb20b Add minor comment 2020-06-02 12:29:11 -04:00
Shikhar Kumar
961efe5614 Fix issue with statepoints not being created in test_lib.py 2020-06-02 11:00:03 -04:00
Shikhar Kumar
1f12ca286f Add unit tests for setting n_batches through C API 2020-06-02 04:09:18 -04:00
Shikhar Kumar
6e7f524561 Create getter funtion for n_batches, update test_lib.py 2020-06-01 21:19:06 -04:00
Gavin Ridley
9483c409a8 convert all but one thing in cell.h to enums 2020-01-16 15:41:45 -05:00
Andrew Johnson
801f18b357
Provide Tally writable_ setter and getters
New member functions openmc::Tally.set_writable and get_writable
act on the writable attribute. These are used in the external
API with openmc_tally_set_writable and openmc_tally_get_writable
functions.

Cleaned up some other writeable -> writable typos as well
2019-09-26 21:09:13 -04:00
Andrew Johnson
a83f4d2bb2
Rename capi_* fixtures to lib_* in test_lib.py 2019-09-20 10:17:52 -05:00
Andrew Johnson
66593fd7e1
Expose tally.writeable_ through openmc.lib
Add two functions to capi.h:
openmc_tally_set_writeable and openmc_tally_get_writeable
which are exposed to the Python API through the
openmc.lib.Tally.writeable property. These functions are very
similar to the set/get active counterparts as both act on a boolean
Tally attribute

A new unit test test_tally_writeable has been added that toggles
the writeable state of a tally. It is important to note that the
writeable state must be reset, otherwise tallies in subsequent
tests will be skewed. This is because the test_tally_writeable
function requires the capi_simulation_init fixture and the tallies
are shared by those functions that use the capi_run fixture
2019-09-20 10:13:26 -05:00
Paul Romano
67de50e4fc Rename two tests 2019-09-13 10:38:30 -05:00
Renamed from tests/unit_tests/test_capi.py (Browse further)