mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Move openmc_run to C++ side
This commit is contained in:
parent
14455dc43e
commit
faf35d21bc
4 changed files with 20 additions and 24 deletions
18
src/simulation.cpp
Normal file
18
src/simulation.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "openmc.h"
|
||||
|
||||
// OPENMC_RUN encompasses all the main logic where iterations are performed
|
||||
// over the batches, generations, and histories in a fixed source or k-eigenvalue
|
||||
// calculation.
|
||||
|
||||
int openmc_run() {
|
||||
openmc_simulation_init();
|
||||
|
||||
int err = 0;
|
||||
int status = 0;
|
||||
while (status == 0 && err == 0) {
|
||||
err = openmc_next_batch(&status);
|
||||
}
|
||||
|
||||
openmc_simulation_finalize();
|
||||
return err;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue