Skip to content

Tutorials

Assemble A Coupled-EM Library Model

For library use, the basic coupled-EM assembly flow is:

  1. Define materials with MaterialInputDefinition.
  2. Convert them with material_definitions_from_inputs.
  3. Build a geometry, typically with RectilinearGridInputDefinition and make_rectilinear_grid.
  4. Build tallies with TallySetInputDefinition and make_tally_set_definition.
  5. Import physics tables for the elements used by those materials.
  6. Fill CoupledEmPhysicsData.
  7. Construct a CoupledEmModelInputDefinition.
  8. Run with either IndependentSourceDefinition or CoupledEmSourceBatchRunDefinition.

The concrete public importer functions are:

  • import_nndc_photon_runtime_table
  • import_endfb_eedl_electron_runtime_table
  • import_endfb_decay_runtime_table

For the current coupled-EM path, the relaxation table is also a PhotonRuntimeTable, so the usual setup is to reuse the imported photon table for CoupledEmPhysicsData::relaxation.

Assemble A Mixed Package Run

Use MixedTransportModel when your source can emit particles owned by more than one enabled package.

Typical flow:

  1. Reuse the same material, geometry, tally, and coupled-EM physics setup.
  2. Provide configuration for the packages you enable: ProtonTransportConfig, AlphaTransportConfig, and/or NeutronTransportConfig plus neutron physics data when needed.
  3. Construct MixedTransportModel::InputDefinition.
  4. Supply a MixedSourceBatchHook or MixedTransportSource.
  5. Return one or more SourceSite values for each history.
  6. Let the library partition the batch by owning transport package.

StaticDecayInventorySource, make_static_decay_inventory_source_batch, and mixed_transport_source_from_static_decay(...) are the most direct current ways to produce mixed decay-driven benchmark sources.

Build And Run A Benchmark Consumer

The old point-source detector example has been replaced by benchmark executables that each serve a specific physics question. Current benchmark targets include:

  • neomc_decay_source_term
  • neomc_decay_inventory_chain
  • neomc_activation_inventory
  • neomc_radioisotope_gamma_shielding
  • neomc_positron_annihilation
  • neomc_electron_range_dose
  • neomc_proton_csda_range
  • neomc_alpha_csda_range
  • neomc_neutron_microscopic_xs
  • neomc_mixed_decay_transport

Current benchmark helper scripts include:

  • benchmarks/radioisotope_gamma_shielding/scan_thickness.py for Co-60 Pb shielding detector-response thickness scans;
  • benchmarks/electron_range_dose/scan_beta_sources.py for beta source/range scans over supported decay-source choices.

Build them with the default configuration:

bash
cmake -S . -B build
cmake --build build --parallel

For a compact importer-backed example, run:

bash
./build/neomc_decay_source_term reference

Use these workflows when you want concrete consumers of the library that state their benchmark problem, reference data, observables, and current limitations.

Verify Mixed-Source Routing

The repository includes a benchmark executable that exercises the mixed-source path: a static decay inventory emits transport particles into the mixed transport model and reports shared tally and source-rate accounting.

Build and run:

bash
cmake -S . -B build
cmake --build build --target neomc_mixed_decay_transport --parallel
./build/neomc_mixed_decay_transport reference --histories 50

A successful run means:

  • the static decay source emitted a mixed particle batch;
  • enabled transport packages participated when their particles were emitted;
  • deposited energy, source rates, and energy accounting closed consistently.

Library Orientation

The main user-facing entry points at the moment are:

  • MaterialInputDefinition and material_definitions_from_inputs
  • RectilinearGridInputDefinition, make_rectilinear_grid, GeometryHandle
  • TallySetInputDefinition and make_tally_set_definition
  • IndependentSourceDefinition
  • GeneralSourceDefinition
  • StaticDecayInventorySource
  • RunManager and PhysicsListBuilder
  • CoupledEmModel and run_coupled_em_simulation
  • MixedTransportModel
  • SimulationModel, compile_simulation_model, and run_simulation_model

See ../reference/README.md for the public module map.

NeoMC user documentation.