| 129 | /// @return Frobenius norm squared of the matrix. |
| 130 | template <std::floating_point T> |
| 131 | double assemble_matrix1(const mesh::Geometry<T>& g, const fem::DofMap& dofmap, |
| 132 | auto kernel, std::span<const std::int32_t> cells) |
| 133 | { |
| 134 | auto sp = la::SparsityPattern(dofmap.index_map->comm(), |
| 135 | {dofmap.index_map, dofmap.index_map}, |
| 136 | {dofmap.index_map_bs(), dofmap.index_map_bs()}); |
| 137 | fem::sparsitybuild::cells(sp, std::pair{cells, cells}, {dofmap, dofmap}); |
| 138 | sp.finalize(); |
| 139 | la::MatrixCSR<T> A(sp); |
| 140 | auto ident = [](auto, auto, auto, auto) {}; // DOF permutation not required |
| 141 | common::Timer timer("Assembler1 lambda (matrix)"); |
| 142 | md::mdspan<const T, md::extents<std::size_t, md::dynamic_extent, 3>> x( |
| 143 | g.x().data(), g.x().size() / 3, 3); |
| 144 | fem::impl::assemble_cells_matrix<T>(A.mat_add_values(), g.dofmaps().front(), |
| 145 | x, cells, {dofmap.map(), 1, cells}, ident, |
| 146 | {dofmap.map(), 1, cells}, ident, {}, {}, |
| 147 | kernel, {}, {}, {}, {}); |
| 148 | A.scatter_rev(); |
| 149 | return A.squared_norm(); |
| 150 | } |
| 151 | |
| 152 | /// @brief Assemble a RHS vector using using a lambda kernel function. |
| 153 | /// |
nothing calls this directly
no test coverage detected