12 #include <Eigen/Dense>
13 #include <dolfinx/fem/utils.h>
14 #include <dolfinx/mesh/Mesh.h>
27 Eigen::Ref<Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>>
30 const std::vector<std::int32_t>& active_cells)
37 Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> coeffs
41 const Eigen::Array<T, Eigen::Dynamic, 1> constant_values
48 = mesh->geometry().dofmap();
51 const int num_dofs_g = x_dofmap.
num_links(0);
52 const Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor>& x_g
53 = mesh->geometry().x();
56 const int gdim = mesh->geometry().dim();
57 Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
58 coordinate_dofs(num_dofs_g, gdim);
60 Eigen::Array<T, Eigen::Dynamic, 1> values_e;
61 const Eigen::Index num_points = e.
num_points();
62 const Eigen::Index value_size = e.
value_size();
63 const Eigen::Index size = num_points * value_size;
64 values_e.setZero(size);
68 for (std::int32_t c : active_cells)
70 auto x_dofs = x_dofmap.
links(c);
71 for (Eigen::Index j = 0; j < num_dofs_g; ++j)
73 const auto x_dof = x_dofs[j];
74 for (Eigen::Index k = 0; k < gdim; ++k)
75 coordinate_dofs(j, k) = x_g(x_dof, k);
78 auto coeff_cell = coeffs.row(c);
81 for (Eigen::Index j = 0; j < size; j++)
84 fn(values_e.data(), coeff_cell.data(), constant_values.data(),
85 coordinate_dofs.data());
87 values.row(i) = values_e;