Cleanup MultiIndex generation

This essentially implements the changes proposed in #31 (closed). Notice that this is a non-compatible interface change and you have to adjust your PreBasis and PreBasisFactory implementation accordingly!

This changes the generation and forwarding of multi index types and related information in the interfaces of the PreBasis and PreBasisFactory and the implementation DefaultGlobalBasis. In summary: The PreBasis now longer depends on the MultiIndex type which allows to move all information about required size of the multi indices to the PreBasis. Now the DefaultGlobalBasis is responsible to create suitable indices for the PreBasis (instead of makeBasis()). Changes in detail:

  • Interface changes to PreBasis
    • The typedefs PreBasis::MultiIndex and PreBasis::SizePrefix are removed.
    • The SizePrefix argument type of PreBasis::size() is a now template parameter.
    • The MultiIndex-type is no longer handed to the PreBasis.
    • There are new constants PreBasis::minMultiIndexSize <= PreBasis::maxMultiIndexSize <= PreBasis::multiIndexBufferSize. They denote the minimal and maximal size of the handed out multi indices and the maximal intermediate size needed for building each multi index.
  • Interface changes to PreBasisFactory
    • The MultiIndex-type is no longer a template argument of PreBasisFactory::makePreBasis.
    • PreBasisFactory::requiredMultiIndexSize is removed.
    • A PreBasisFactory is now invoked using factory(gridView) instead of factory.makePreBasis(gridView). This allows to drop many trivial PreBasisFactory classes in favor of simple lambda expressions.
  • Changes to DefaultGlobalBasis and makeBasis implementation:
    • PreBasis is build before MultiIndex type is constructed.
    • The MultiIndex type is constructed in the DefaultGlobalBasis instead of makeBasis.
    • makeBasis<MultiIndex> was removed. This could be re-added, if we make the MultiIndex and additional template parameter of DefaultGlobalBasis with the automatically generated type as default.
    • You can now simply write DefaultGlobalBasis(gridView, preBasisFactory) instead of makeBasis(gridView, preBasisFactory)
  • Python binding of the global basis have been adapted and simplified.

This is a breaking interface change for PreBasis and PreBasisFactory. You need to adjust your own implementations as outlined above.

Edited by Carsten Gräser

Merge request reports

Loading