WIP: Redesign of quadrature rules
requested to merge simon.praetorius/dune-geometry:feature/multi-precision-quadrature-rules into master
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
callsmake_rules.py
for all geometry types - the
rules.templ.hh
file is similar to the oldsimplexquadrature.hh
but with placeholders for dim, maxorder and geomtry-type and an internal script that writes points and weights given as input
- the
- 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 templaterules.templ.hh
and the defined rules in the folderrules
some implementations for quadrature rules are generated and stored in the folderquadraturerules
:-
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 inquadmath.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 ofstd::stringstream
)
- A conversion function is provided in
Thus, the user-interface is not changed, only the way the concrete quadrature rules are defined.