10 #include <dolfinx/common/array2d.h>
11 #include <dolfinx/common/span.hpp>
12 #include <dolfinx/fem/utils.h>
13 #include <dolfinx/mesh/Mesh.h>
29 const tcb::span<const std::int32_t>& active_cells)
45 = mesh->geometry().dofmap();
49 mesh->topology_mutable().create_entity_permutations();
50 const std::vector<std::uint32_t>& cell_info
51 = mesh->topology().get_cell_permutation_info();
54 const int num_dofs_g = x_dofmap.
num_links(0);
58 const int gdim = mesh->geometry().dim();
63 for (std::size_t i = 0; i < active_cells.size(); ++i)
65 const std::int32_t c = active_cells[i];
66 auto x_dofs = x_dofmap.
links(c);
67 for (
int j = 0; j < num_dofs_g; ++j)
69 const auto x_dof = x_dofs[j];
70 for (
int k = 0; k < gdim; ++k)
71 coordinate_dofs(j, k) = x_g(x_dof, k);
74 auto coeff_cell = coeffs.
row(c);
75 std::fill(values_e.begin(), values_e.end(), 0.0);
76 fn(values_e.data(), coeff_cell.data(), constant_values.data(),
77 coordinate_dofs.
data());
79 for (std::size_t j = 0; j < values_e.size(); ++j)
80 values(i, j) = values_e[j];
This class provides a dynamic 2-dimensional row-wise array data structure.
Definition: array2d.h:21
constexpr tcb::span< value_type > row(size_type i)
Access a row in the array.
Definition: array2d.h:116
constexpr value_type * data() noexcept
Get pointer to the first element of the underlying storage.
Definition: array2d.h:133
This class manages coordinate mappings for isoparametric cells.
Definition: CoordinateElement.h:25
Represents a mathematical expression evaluated at a pre-defined set of points on the reference cell....
Definition: Expression.h:39
const std::size_t value_size() const
Get value size.
Definition: Expression.h:128
std::shared_ptr< const mesh::Mesh > mesh() const
Get mesh.
Definition: Expression.h:120
const std::size_t num_points() const
Get number of points.
Definition: Expression.h:132
const std::function< void(T *, const T *, const T *, const double *)> & get_tabulate_expression() const
Get function for tabulate_expression.
Definition: Expression.h:104
This class provides a static adjacency list data structure. It is commonly used to store directed gra...
Definition: AdjacencyList.h:68
tcb::span< T > links(int node)
Get the links (edges) for given node.
Definition: AdjacencyList.h:151
int num_links(int node) const
Number of connections for given node.
Definition: AdjacencyList.h:141
Finite element method functionality.
Definition: assemble_matrix_impl.h:23
std::vector< typename U::scalar_type > pack_constants(const U &u)
Pack constants of u of generic type U ready for assembly.
Definition: utils.h:453
void eval(array2d< T > &values, const fem::Expression< T > &e, const tcb::span< const std::int32_t > &active_cells)
Evaluate a UFC expression.
Definition: evaluate.h:28
array2d< typename U::scalar_type > pack_coefficients(const U &u)
Pack coefficients of u of generic type U ready for assembly.
Definition: utils.h:398