Skip to content
10 changes: 7 additions & 3 deletions cpp/demo/custom_kernel/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ double assemble_matrix1(const mesh::Geometry<T>& g, const fem::DofMap& dofmap,
common::Timer timer("Assembler1 lambda (matrix)");
md::mdspan<const T, md::extents<std::size_t, md::dynamic_extent, 3>> x(
g.x().data(), g.x().size() / 3, 3);
fem::impl::assemble_cells_matrix<T>(
A.mat_add_values(), g.dofmap(), x, cells, {dofmap.map(), 1, cells}, ident,
{dofmap.map(), 1, cells}, ident, {}, {}, kernel, {}, {}, {}, {});

std::vector<T> cdofs_b(3 * g.dofmap().extent(1));
std::vector<T> Ab(dofmap.map().extent(1) * dofmap.map().extent(1));
fem::impl::assemble_cells_matrix<T>(A.mat_add_values(), g.dofmap(), x, cells,
{dofmap.map(), 1, cells}, ident,
{dofmap.map(), 1, cells}, ident, {}, {},
kernel, {}, {}, {}, {}, Ab, cdofs_b);
A.scatter_rev();
return A.squared_norm();
}
Expand Down
Loading
Loading