Skip to content

Lagrangebasis with runtime order

Oliver Sander requested to merge lagrangebasis-with-runtime-order into master

This MR extends the LagrangeBasis class to also allow to select the polynomial order at run-time. For this, the integer template parameter 'k' (the order) is made optional, with a default value of -1. If k is explicitly set to something non-negative, then the basis implementation behaves as before. If k is indeed -1 then the basis object needs to be constructed by a new constructor that accepts a run-time order.

The changes to LagrangeBasis are completely backward-compatible. I did not do any measurements of the performance, but as the switch between run-time and compile-time order is based on a simple compile-time criterion I expect decent compilers to optimize away all new code if a compile-time order is selected.

Edited by Oliver Sander

Merge request reports