DOLFINx 0.12.0.0
DOLFINx C++
Loading...
Searching...
No Matches
dolfinx::fem::ScratchBuffer Concept Reference

Concept for the mutable scratch buffers passed to the assembly kernels. More...

#include <traits.h>

Concept definition

template<class B, class T>
concept dolfinx::fem::ScratchBuffer = is_scratch_buffer_type<std::remove_cvref_t<B>>
and std::ranges::contiguous_range<B> and std::ranges::output_range<B, T>
and std::same_as<std::ranges::range_value_t<B>, T> and requires(B& b) {
{ b.data() } -> std::same_as<T*>;
{ b.size() } -> std::convertible_to<std::size_t>;
}
Concept for the mutable scratch buffers passed to the assembly kernels.
Definition traits.h:254

Detailed Description

Concept for the mutable scratch buffers passed to the assembly kernels.

Satisfied by std::span<T> and by std::array<T, N>. The buffers are taken by value, so an array carries its size in its type and the assembler can size its work at compile time; a span leaves the size to run time and the storage to the caller.