4.3.3 Device

As already indicated, a device holds the actual mesh object as well as additional meta information. The mesh data structure is provided by ViennaGrid, supporting different mesh configurations via distinct types. As the mesh configuration is not known during compile-time, a dynamic mesh storage object - based on a Boost Variant [53] data structure - is used to hold the actual mesh. This particular data structure can take on several different but fixed types, e.g., one- or two-dimensional simplex meshes: Instead of using the actual mesh types for the variant, smart pointers are used, provided by the Boost Smart Pointer library [51]. Smart pointers provide a safe - automatic memory deallocation - and a flexible way of destroying/recreating objects, because of their pointer mechanism, during run-time. The set of supported mesh types can be extended by adding additional types. This variant-based approach allows the device to wrap a dynamic layer around static objects, favoring, for instance, GUI applications.

A device supports methods to scale the contained mesh and to assign roles to segments. This identification allows the device to derive further meta information automatically, such as the ability to assign doping profiles or permittivities appropriately. Also, a device enables to assign material names to segments. This mechanism is coupled with the material database, for instance, to access the relative permittivity (εr  ) of a particular material, multiply it with the absolute permittivity constant (ε0  ), and assign the result to the appropriate mesh elements. These auxiliary methods allow to attach meta information to a bare mesh, elevating it from a physical meaningless entity to a device, providing a plethora of properties via the device’s interface methods. For instance, the problem classes (Section 4.3.6) uses these informations to assign boundary conditions to the contact segments.