Skip to content
Snippets Groups Projects
Commit d6ec246c authored by Jö Fahlke's avatar Jö Fahlke
Browse files

Be strict about constant expressions

The local basis is passed into the local operator kernels as a const
reference.  That means, its lvalue is not a constant expression.  Would we
pass it by value, then it's lvalue would be a constant expression (through
it's rvalue still would not).

Calling a static function of a class throuh an object with the syntax
```c++
  lb.size()
```
will evaluate the lvalue of the object.  Since that lvalue is not constant
when the object was passed by reference, the call cannot be a constant
expression.

Clang (rightly) complained about this, so write the call as
```c++
LocalBases::size()
```
where a constant expression is required.
parent 6ae036cc
No related branches found
No related tags found
1 merge request!18Don't use std::vectors inside local operators
Pipeline #19678 passed
......@@ -71,7 +71,7 @@ namespace PPS {
// geometry of inside cell
auto geo_inside = isect.inside().geometry();
std::array<typename LocalBasis::Jacobian, lb.size()> gradphi;
std::array<typename LocalBasis::Jacobian, LocalBasis::size()> gradphi;
// loop over quadrature points
for (const auto& ip : PPS::quadratureRule(geo,order))
......@@ -141,7 +141,7 @@ namespace PPS {
// geometry of inside cell
auto geo_inside = isect.inside().geometry();
std::array<typename LocalBasis::Jacobian, lb.size()> gradphi;
std::array<typename LocalBasis::Jacobian, LocalBasis::size()> gradphi;
// loop over quadrature points
for (const auto& ip : PPS::quadratureRule(geo,order))
......
......@@ -124,7 +124,7 @@ namespace PPS {
auto geo = elem.geometry();
const int order = incrementorder() + 2*lb.order();
std::array<typename LocalBasis::Jacobian, lb.size()> gradphi;
std::array<typename LocalBasis::Jacobian, LocalBasis::size()> gradphi;
// loop over quadrature points
for (const auto& ip : PPS::quadratureRule(geo, order))
......@@ -176,7 +176,7 @@ namespace PPS {
auto geo = elem.geometry();
const int order = incrementorder() + 2*lb.order();
std::array<typename LocalBasis::Jacobian, lb.size()> gradphi;
std::array<typename LocalBasis::Jacobian, LocalBasis::size()> gradphi;
// loop over quadrature points
for (const auto& ip : PPS::quadratureRule(geo, order))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment