Uniform way to apply all GeometryMap subclasses to the SetupStorage
The application of a GeometryMap to all primitives currently works differently for each type/subclass.
Most maps implement a static method setMap( ... )
that does that. However, the signature is always different which makes the selection of a map during run time annoying. Some examples:
- IcosahedralShellMap::setMap()
- TokamakMap::setMap()
- CircularMap does not even have that method.
The procedure then usually goes as follows:
SetupPrimitiveStorage setupStorage( meshInfo, numProcesses );
// Different call for all maps
AnnulusMap::setMap( setupStorage );
Would be nice if we could do something like this:
void createStorage( std::shared_ptr< GeometryMap > someMap )
{
SetupPrimitiveStorage setupStorage( meshInfo, numProcesses );
// Same call for all maps.
someMap->setMap( setupStorage );
}
Is there any reason setMap()
cannot be a virtual method in the GeometryMap
class? Maybe I am missing something.