Implementation details¶
Policy-based design¶
Slam uses policy-based design to combine the storage and indexing behavior a type needs without paying for features it does not use.
Slam defines several aliases for commonly used configurations (see Choosing policies and aliases), and its types are extensible to custom storage, legacy storage and less common combinations that the alias layer does not intentionally name.
Policies include:
SizePolicy, StridePolicy, OffsetPolicy (compile time vs. runtime)
IndirectionPolicy, which chooses how set elements, relation indices and map values are reached through backing storage:
NoIndirectionfor implicitelement == positionstorageArrayIndirection(the default), backed by anaxom::Arraywhose lifetime the Slam object managesArrayViewIndirection, backed by anaxom::ArrayViewof a buffer managed elsewhere. These are small and trivially copyable, so it is the form used for lightweight, device-capturable Slam objectsCArrayIndirectionandSTLVectorIndirectionfor interoperation with raw-pointer andstd::vectorstoragecustom policies, e.g.
mfem::Arrayadapters
SubsettingPolicy (none, virtual parent, concrete parent)
OwnershipPolicy (local, sidre, other repository)
Map and BivariateMap default to ArrayIndirection.
The following feature diagram of slam::OrderedSet policies shows how these policies
interact with the subscript operator:
Simplifying mesh setup¶
- Builder classes
Chained initialization using named-parameter idiom
Generator classes to simplify types