This implements three features:
GeometryTypeProviders. Together they allow to avoid the polymorphic local finite element interface if either the grid only supports a single geometry type, or if you explicitly know that it only contains a single geometry type.
This encodes all the information of a
GeometryType as template
parameters. Some remarks on the implementation:
- This may be a solution for using geometry types a template paremters and is thus a candidate for dune-geometry
- All methods in
Dune::GeometryTypes::have analogues in
Dune::Functions::StaticGeometryTypes::and additional template aliases for parametrized types. Hence you can e.g. use Simplex.
- There is
LocalHybridGeometryTypeIndexwhich works like
- Some topologyIds are different: If you want to overload for specific
StaticGeometryTypes, you must be sure that the same geometry type leads to the same type. Hence topologyIds are normalize to have 0 in the first bit.
- One may consider using
uniqueTopologyId = (topologyId >> 1)as template parameter instead to get rid of the nasty non-uniqueness.
This works like
PQkFiniteElementCache in dune-localfunctions
but also allows to obtain raw fe-implemenations without polymorphic
wrapper if the geometry type is provided statically as
This allows to seamlessly switch between the polymorphic and non-polymorphic
version by using
These allow to map an entity to its geometry type. Depending on the
selected provider and grid view, this is encoded as
StaticGeometryType. There are several implementations:
MixedGeometryTypeProviderwill always act like a mixed element grid and simply forward the dynamic
GeometryType. You'd normally not want to use this one.
AutoGeometryTypeProviderwill use a
StaticGeometryTypeif the grid satisfies
GeometryTypeis used. This is the default choise which should work always.
CubeGeometryTypeProviderwill always provide the corresponding
StaticGeometryType. This can be used to avoid the costly polymorphic interface if your grid supports mixed elements, but you know, that there are only simplices or cubes.