Only Construct the Materials We Need

Issue #348 duplicate
Laurie Nevay created an issue

Currently, BDSMaterials class constructs all the materials BDSIM can produce. This is a marginal overhead in memory and cpu time. We could only construct the materials required as needed.

I propose to change BDSMaterials to use delegate simple functions for each material construction and a map of name → &function along with a cache of already constructed materials. This would follow a little bit the pattern in BDSModularPhysicsList.

Comments (1)

  1. Log in to comment