Open sethrj opened 4 months ago
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.
Thanks @hhollenb ! There are some good ideas there but I'm not sure how we can make them reusable/general without sacrificing clarity/robustness...
Tagging #1469
Cross section tables
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
(orOpticalVolumeProcess
) 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 aBuilder
class (which has wrappers for the various CollectionBuilder methods) has worked really well.So perhaps our class would have:
and
XsBuilder
would have:GenericGridBuilder
for adding the cross section datainsert_xs(OpticalMaterialId, SpanReal energy, SpanReal xs)
with error checking to make sure that it's called once per material for all materialsThen during construction, the OpticalPhysics will:
Models