celeritas icon indicating copy to clipboard operation
celeritas copied to clipboard

Construct optical photon physics cross section tables

Open sethrj opened this issue 1 year ago • 2 comments

Split off from https://github.com/celeritas-project/celeritas/issues/886 . I think this could be a good opportunity to explore a new design for building physics tables that can be extended to satisfy https://github.com/celeritas-project/celeritas/issues/907 and https://github.com/celeritas-project/celeritas/issues/253 .

First, I think to keep the Model (or OpticalVolumeProcess) interface simple, we should have a single virtual method that takes or returns a relatively complicated object for the cross section construction. In ORANGE, for constructing surfaces and numerous other data structures from a "Solid" factory object, the model of passing in a Builder class (which has wrappers for the various CollectionBuilder methods) has worked really well.

So perhaps our class would have:

virtual void build(XsBuilder&) const = 0;

and XsBuilder would have:

  • Accessors for getting the optical material data, properties, cutoffs, etc.
  • Internally a GenericGridBuilder for adding the cross section data
  • A method like insert_xs(OpticalMaterialId, SpanReal energy, SpanReal xs) with error checking to make sure that it's called once per material for all materials

Then during construction, the OpticalPhysics will:

  • Construct a temporary XsBuilder
  • Loop over all OpticalVolumeProcess to construct the XS data
  • Generate total cross sections, etc.

sethrj avatar Jun 30 '24 11:06 sethrj

I made a rough draft of an idea I had for splitting out some of the builder functionality:

https://github.com/hhollenb/celeritas/pull/1

I'm not fully happy with it, but there might be something there that could be refactored into something useful.

hhollenb avatar Jul 03 '24 13:07 hhollenb

Thanks @hhollenb ! There are some good ideas there but I'm not sure how we can make them reusable/general without sacrificing clarity/robustness...

sethrj avatar Jul 03 '24 18:07 sethrj

Tagging #1469

sethrj avatar Oct 25 '24 08:10 sethrj

Done by @hhollenb

sethrj avatar Apr 09 '25 18:04 sethrj