MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / assemble_vector1

Function assemble_vector1

cpp/demo/custom_kernel/main.cpp:164–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162/// @return l2 norm squared of the vector.
163template <std::floating_point T>
164double assemble_vector1(const mesh::Geometry<T>& g, const fem::DofMap& dofmap,
165 auto kernel, const std::vector<std::int32_t>& cells)
166{
167 la::Vector<T> b(dofmap.index_map, 1);
168 md::mdspan<const T, md::extents<std::size_t, md::dynamic_extent, 3>> x(
169 g.x().data(), g.x().size() / 3, 3);
170 common::Timer timer("Assembler1 lambda (vector)");
171 fem::impl::assemble_cells<1>([](auto, auto, auto, auto) {}, b.array(),
172 g.dofmaps().front(), x, cells,
173 {dofmap.map(), 1, cells}, kernel, {}, {}, {});
174 b.scatter_rev(std::plus<T>());
175 return la::squared_norm(b);
176}
177
178/// @brief Assemble P1 mass matrix and a RHS vector using element kernel
179/// approaches.

Callers

nothing calls this directly

Calls 8

squared_normFunction · 0.85
dataMethod · 0.80
mapMethod · 0.80
xMethod · 0.45
sizeMethod · 0.45
arrayMethod · 0.45
dofmapsMethod · 0.45
scatter_revMethod · 0.45

Tested by

no test coverage detected