Skip to content
Snippets Groups Projects
Commit 03544238 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[P|grid.provider] fix centers()

parent 6bbe2155
No related branches found
No related tags found
1 merge request!20Update bindings
...@@ -77,11 +77,11 @@ public: ...@@ -77,11 +77,11 @@ public:
MultipleCodimMultipleGeomTypeMapper<decltype(grid_view)> mapper( MultipleCodimMultipleGeomTypeMapper<decltype(grid_view)> mapper(
grid_view, grid_view,
[codim](GeometryType gt, int dimgrid) { return dimgrid - Common::numeric_cast<int>(gt.dim()) == codim; }); [codim](GeometryType gt, int dimgrid) { return dimgrid - Common::numeric_cast<int>(gt.dim()) == codim; });
XT::LA::CommonDenseMatrix<double> centers(mapper.size(), size_t(d), 0.); XT::LA::CommonDenseMatrix<double> centers(mapper.size(), Common::numeric_cast<size_t>(dim), 0.);
for (auto&& element : elements(grid_view)) { for (auto&& element : elements(grid_view)) {
auto index = mapper.index(element); auto index = mapper.index(element);
auto center = element.geometry().center(); auto center = element.geometry().center();
for (size_t jj = 0; jj < d; ++jj) for (size_t jj = 0; jj < Common::numeric_cast<size_t>(dim); ++jj)
centers.set_entry(index, jj, center[jj]); centers.set_entry(index, jj, center[jj]);
} }
return centers; return centers;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment