Skip to content

Commit

Permalink
Integration progressing nicely
Browse files Browse the repository at this point in the history
  • Loading branch information
braxtoncuneo committed Feb 20, 2024
1 parent 703a00d commit 84529c1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ pytestdebug.log
docs/build
docs/source/pythonapi/generated/

# Harmonize
__ptxcache__/
2 changes: 1 addition & 1 deletion examples/fixed_source/kobayashi3-TD/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
)

# Setting
mcdc.setting(N_particle=1e6)
mcdc.setting(N_particle=1e3)#6)
mcdc.implicit_capture()

# Run
Expand Down
5 changes: 2 additions & 3 deletions mcdc/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,9 +976,9 @@ def copy_recordlike(P_new, P):
P_new["g"] = P["g"]
P_new["E"] = P["E"]
P_new["w"] = P["w"]
P_new["rng_seed"] = P["rng_seed"]
P_new["sensitivity_ID"] = P["sensitivity_ID"]
P_new["iqmc_w"] = P["iqmc_w"]
P_new["rng_seed"] = P["rng_seed"]
P_new["alive"] = P["alive"]
copy_track_data(P_new,P)


Expand Down Expand Up @@ -1021,7 +1021,6 @@ def copy_particle(P):
P_new["event"] = P["event"]
P_new["sensitivity_ID"] = P["sensitivity_ID"]
P_new["rng_seed"] = P["rng_seed"]
P_new["iqmc_w"] = P["iqmc_w"]
copy_track_data(P_new,P)
return P_new

Expand Down
77 changes: 0 additions & 77 deletions mcdc/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,83 +131,6 @@ def loop_eigenvalue(mcdc):
# =============================================================================


@njit
def _loop_source(seed, mcdc):
## Progress bar indicator
#N_prog = 0
#
# Loop over particle sources
#work_start = mcdc["mpi_work_start"]
#work_size = mcdc["mpi_work_size"]
#work_end = work_start + work_size
#for idx_work in range(work_size):
# seed_work = kernel.split_seed(work_start + idx_work, seed)

## Particle tracker
#if mcdc["setting"]["track_particle"]:
# mcdc["particle_track_history_ID"] += 1

## =====================================================================
## Get a source particle and put into active bank
## =====================================================================

## Get from fixed-source?
#if mcdc["bank_source"]["size"] == 0:
# # Sample source
# P = kernel.source_particle(seed_work, mcdc)

## Get from source bank
#else:
# P = mcdc["bank_source"]["particles"][idx_work]

## Check if it is beyond current census index
#idx_census = mcdc["idx_census"]
#if P["t"] > mcdc["setting"]["census_time"][idx_census]:
# kernel.add_particle(P, mcdc["bank_census"])
#else:
# # Add the source particle into the active bank
# kernel.add_particle(P, mcdc["bank_active"])

# =====================================================================
# Run the source particle and its secondaries
# =====================================================================

# Loop until active bank is exhausted
#while mcdc["bank_active"]["size"] > 0:
# Get particle from active bank
#kernel.get_particle(P,mcdc["bank_active"], mcdc)

# Apply weight window
#if mcdc["technique"]["weight_window"]:
# kernel.weight_window(P, mcdc)

## Particle tracker
#if mcdc["setting"]["track_particle"]:
# mcdc["particle_track_particle_ID"] += 1

# Particle loop
#loop_particle(P, mcdc)

## =====================================================================
## Closeout
## =====================================================================

## Tally history closeout for one-batch fixed-source simulation
#if not mcdc["setting"]["mode_eigenvalue"] and mcdc["setting"]["N_batch"] == 1:
# kernel.tally_closeout_history(mcdc)

## Tally history closeout for multi-batch uq simulation
#if mcdc["technique"]["uq"]:
# kernel.uq_tally_closeout_history(mcdc)

## Progress printout
#percent = (idx_work + 1.0) / mcdc["mpi_work_size"]
#if mcdc["setting"]["progress_bar"] and int(percent * 100.0) > N_prog:
# N_prog += 1
# with objmode():
# print_progress(percent, mcdc)


#$$$$GOOD
@njit
def generate_source_particle(idx_work, seed, prog):
Expand Down
2 changes: 1 addition & 1 deletion mcdc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def prepare():
# Make types
# =========================================================================

type_.make_type_translate()
type_.make_type_particle(input_deck)
type_.make_type_particle_record(input_deck)
type_.make_type_nuclide(input_deck)
Expand Down Expand Up @@ -187,7 +188,6 @@ def prepare():
"chi_p",
"chi_d",
]:
print(name)
mcdc["nuclides"][i][name] = input_deck.nuclides[i][name]

# CE data (load data from XS library)
Expand Down

0 comments on commit 84529c1

Please sign in to comment.