Skip to content

Commit

Permalink
Merge pull request CEMeNT-PSAAP#154 from ilhamv/main
Browse files Browse the repository at this point in the history
Keep collision-inducing neutron alive when applicable. Update on tests.
  • Loading branch information
jpmorgan98 authored Feb 15, 2024
2 parents 7a5af22 + 9cb200f commit 9ef1d04
Show file tree
Hide file tree
Showing 60 changed files with 131 additions and 695 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mpi_numba_reg.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Regression Test - Numba and MPI (2 threads)
name: Regression Test - Numba and MPI

on: [push, pull_request]

Expand Down Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Regression Test - Numba and MPI
run: |
cd test/regression
python run.py --mode=numba --mpiexec=2
python run.py --mode=numba --mpiexec=4
35 changes: 0 additions & 35 deletions .github/workflows/mpi_numba_regII.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/mpi_reg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ jobs:
run: |
cd test/regression
python run.py --mpiexec=4
python run.py --mpiexec=2
26 changes: 23 additions & 3 deletions mcdc/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,8 +2020,17 @@ def scattering(P, mcdc):
# Sample scattering phase space
sample_phasespace_scattering(P, material, P_new, mcdc)

# Bank
add_particle(P_new, mcdc["bank_active"])
# Bank, but keep it if it is the last particle
if n == N - 1:
P["alive"] = True
P["ux"] = P_new["ux"]
P["uy"] = P_new["uy"]
P["uz"] = P_new["uz"]
P["g"] = P_new["g"]
P["E"] = P_new["E"]
P["w"] = P_new["w"]
else:
add_particle(P_new, mcdc["bank_active"])


@njit
Expand Down Expand Up @@ -2289,7 +2298,18 @@ def fission(P, mcdc):
elif mcdc["setting"]["mode_eigenvalue"]:
add_particle(P_new, mcdc["bank_census"])
else:
add_particle(P_new, mcdc["bank_active"])
# Keep it if it is the last particle
if n == N - 1:
P["alive"] = True
P["ux"] = P_new["ux"]
P["uy"] = P_new["uy"]
P["uz"] = P_new["uz"]
P["t"] = P_new["t"]
P["g"] = P_new["g"]
P["E"] = P_new["E"]
P["w"] = P_new["w"]
else:
add_particle(P_new, mcdc["bank_active"])


@njit
Expand Down
33 changes: 0 additions & 33 deletions test/conftest.py

This file was deleted.

Binary file removed test/performance/c5g7/k-eigenvalue/c5g7.h5
Binary file not shown.
Loading

0 comments on commit 9ef1d04

Please sign in to comment.