Commit 9c6d3846 authored by Andreas Dedner's avatar Andreas Dedner

small fix

parent cb05fcd5
Pipeline #12740 passed with stage
in 13 minutes and 48 seconds
#include <cstddef>
#include <iostream>
#include <dune/common/fvector.hh>
// #include <dune/python/grid/entity.hh>
......@@ -20,13 +21,14 @@ double l2norm2 ( const GridView &gridView, const Rules &rules, const GF& gf )
auto pointsWeights = pyPW.template cast<
std::pair<pybind11::array_t<double>,
pybind11::array_t<double>> >();
const auto &valuesArray = lf( pointsWeights.first ).template cast< pybind11::array_t< double > >();
// check shape here...
auto values = valuesArray.template unchecked< 1 >();
for( std::size_t i = 0, sz = pointsWeights.second.size(); i < sz; ++i )
{
LocalCoordinate hatx(0);
for (int c=0;c<2;++c)
for (std::size_t c=0;c<LocalCoordinate::size();++c)
hatx[c] = pointsWeights.first.at(c,i);
double weight = pointsWeights.second.at( i ) * geo.integrationElement( hatx );
l2norm2 += (values[ i ] * values[ i ]) * weight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment