mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Bank surface source particles in all active cycles (#2592)
Co-authored-by: Jose Ignacio Marquez Damian <22483345+marquezj@users.noreply.github.com>
This commit is contained in:
parent
0666e3a4f6
commit
c5f551103f
4 changed files with 10 additions and 1 deletions
|
|
@ -107,6 +107,9 @@ public:
|
|||
//! \param size The new size of the container
|
||||
void resize(int64_t size) { size_ = size; }
|
||||
|
||||
//! Return whether the array is full
|
||||
bool full() const { return size_ == capacity_; }
|
||||
|
||||
//! Return the number of elements that the container has currently allocated
|
||||
//! space for.
|
||||
int64_t capacity() { return capacity_; }
|
||||
|
|
|
|||
|
|
@ -468,7 +468,8 @@ void Particle::cross_surface()
|
|||
write_message(1, " Crossing surface {}", surf->id_);
|
||||
}
|
||||
|
||||
if (surf->surf_source_ && simulation::current_batch == settings::n_batches) {
|
||||
if (surf->surf_source_ && simulation::current_batch > settings::n_inactive &&
|
||||
!simulation::surf_source_bank.full()) {
|
||||
SourceSite site;
|
||||
site.r = r();
|
||||
site.u = u();
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -7,6 +7,7 @@ import pytest
|
|||
import openmc
|
||||
|
||||
from tests.testing_harness import PyAPITestHarness
|
||||
from tests.regression_tests import config
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -118,10 +119,14 @@ class SurfaceSourceTestHarness(PyAPITestHarness):
|
|||
|
||||
@pytest.mark.surf_source_op('write')
|
||||
def test_surface_source_write(model):
|
||||
# Test result is based on 1 MPI process
|
||||
np = config['mpi_np']
|
||||
config['mpi_np'] = '1'
|
||||
harness = SurfaceSourceTestHarness('statepoint.10.h5',
|
||||
model,
|
||||
'inputs_true_write.dat')
|
||||
harness.main()
|
||||
config['mpi_np'] = np
|
||||
|
||||
|
||||
@pytest.mark.surf_source_op('read')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue