Skip to content

WIP: Redesign of quadrature rules

Redesign of the implementation of quadrature rules in Dune. Basically: generate c++ files from tabulated values, stored in a clearly defined .csv file. See issue "Redesign of quadrature rules" #9 for some details.

Main changes:

  • The file quadraturerules.hh is cleaned up, i.e.
    • internal definitions of specific quadrature rules removed (e.g. prism quadrature rule)
  • several old rules are removed, e.g. gauss.cc, gauss_imp.hh, gausslobatto.cc, gausslobatto_imp.hh, jacobi_1_0.cc, jacobi_1_0_imp.hh, jacobi_2_0.cc, jacobi_2_0_imp.hh, simplexquadrature.hh
  • a directory utility is added, that provides generators for several rules:
    • the *.mac files are moved to utility
    • a script make_rules.py is added that generates rules from a set of .csv files
    • a script make_all_rules.py calls make_rules.py for all geometry types
    • the rules.templ.hh file is similar to the old simplexquadrature.hh but with placeholders for dim, maxorder and geomtry-type and an internal script that writes points and weights given as input
  • A directory utility/rules is added that contains for all geometry types a set of quadrature rules in .csv files.
  • Using the make_rules.py script with the template rules.templ.hh and the defined rules in the folder rules some implementations for quadrature rules are generated and stored in the folder quadraturerules:
    • cube2dquadrature.inc.hh, cube3dquadrature.inc.hh, gausslobattoquadrature.inc.hh, gaussquadrature.inc.hh, jacobi1quadrature.inc.hh, jacobi2quadrature.inc.hh, prismquadrature.inc.hh, pyramidquadrature.inc.hh, simplex2dquadrature.inc.hh, simplex3dquadrature.inc.hh
    • These files are included in the main quadraturerules.hh
  • To provide multi-precision rules all rules are given as string representation of the values
    • A conversion function is provided in common/cast.hh with a specialization for quadprecision in quadmath.hh
    • All standard floating-point types are cast from string using std methods, like std::strtod( string ) for double. All unknown types are assumed to have a string constructor. (This implementation may be changed in favour of std::stringstream)

Thus, the user-interface is not changed, only the way the concrete quadrature rules are defined.

Merge request reports