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

Function A_ref

cpp/demo/custom_kernel/main.cpp:39–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37/// @return Element reference matrix (row-major storage).
38template <typename T>
39std::array<T, 9> A_ref(mdspand_t<const T, 4> phi, std::span<const T> w)
40{
41 std::array<T, 9> A_b{};
42 mdspan2_t<T, 3, 3> A(A_b.data());
43 for (std::size_t k = 0; k < phi.extent(1); ++k) // quadrature point
44 for (std::size_t i = 0; i < A.extent(0); ++i) // row i
45 for (std::size_t j = 0; j < A.extent(1); ++j) // column j
46 A(i, j) += w[k] * phi(0, k, i, 0) * phi(0, k, j, 0);
47 return A_b;
48}
49
50/// @brief Compute the P1 RHS vector for f=1 on the reference cell.
51/// @tparam T Scalar type.

Callers

nothing calls this directly

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected