Tutorials
Assemble A Coupled-EM Library Model
For library use, the basic coupled-EM assembly flow is:
- Define materials with
MaterialInputDefinition. - Convert them with
material_definitions_from_inputs. - Build a geometry, typically with
RectilinearGridInputDefinitionandmake_rectilinear_grid. - Build tallies with
TallySetInputDefinitionandmake_tally_set_definition. - Import physics tables for the elements used by those materials.
- Fill
CoupledEmPhysicsData. - Construct a
CoupledEmModelInputDefinition. - Run with either
IndependentSourceDefinitionorCoupledEmSourceBatchRunDefinition.
The concrete public importer functions are:
import_nndc_photon_runtime_tableimport_endfb_eedl_electron_runtime_tableimport_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:
- Reuse the same material, geometry, tally, and coupled-EM physics setup.
- Provide configuration for the packages you enable:
ProtonTransportConfig,AlphaTransportConfig, and/orNeutronTransportConfigplus neutron physics data when needed. - Construct
MixedTransportModel::InputDefinition. - Supply a
MixedSourceBatchHookorMixedTransportSource. - Return one or more
SourceSitevalues for each history. - 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_termneomc_decay_inventory_chainneomc_activation_inventoryneomc_radioisotope_gamma_shieldingneomc_positron_annihilationneomc_electron_range_doseneomc_proton_csda_rangeneomc_alpha_csda_rangeneomc_neutron_microscopic_xsneomc_mixed_decay_transport
Current benchmark helper scripts include:
benchmarks/radioisotope_gamma_shielding/scan_thickness.pyfor Co-60 Pb shielding detector-response thickness scans;benchmarks/electron_range_dose/scan_beta_sources.pyfor beta source/range scans over supported decay-source choices.
Build them with the default configuration:
cmake -S . -B build
cmake --build build --parallelFor a compact importer-backed example, run:
./build/neomc_decay_source_term referenceUse 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:
cmake -S . -B build
cmake --build build --target neomc_mixed_decay_transport --parallel
./build/neomc_mixed_decay_transport reference --histories 50A 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:
MaterialInputDefinitionandmaterial_definitions_from_inputsRectilinearGridInputDefinition,make_rectilinear_grid,GeometryHandleTallySetInputDefinitionandmake_tally_set_definitionIndependentSourceDefinitionGeneralSourceDefinitionStaticDecayInventorySourceRunManagerandPhysicsListBuilderCoupledEmModelandrun_coupled_em_simulationMixedTransportModelSimulationModel,compile_simulation_model, andrun_simulation_model
See ../reference/README.md for the public module map.