Skip to content

Commit

Permalink
Update for mdspan (#3086)
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells authored Mar 4, 2024
1 parent 0f85bab commit 989a3ed
Show file tree
Hide file tree
Showing 19 changed files with 247 additions and 318 deletions.
8 changes: 4 additions & 4 deletions cpp/dolfinx/fem/DofMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ graph::AdjacencyList<std::int32_t> fem::transpose_dofmap(
std::vector<int> num_local_contributions(max_index + 1, 0);
for (std::int32_t c = 0; c < num_cells; ++c)
{
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t d = 0; d < dofmap.extent(1); ++d)
num_local_contributions[dofs[d]]++;
}
Expand All @@ -148,8 +148,8 @@ graph::AdjacencyList<std::int32_t> fem::transpose_dofmap(
int cell_offset = 0;
for (std::int32_t c = 0; c < num_cells; ++c)
{
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t d = 0; d < dofmap.extent(1); ++d)
data[pos[dofs[d]]++] = cell_offset++;
}
Expand Down
5 changes: 2 additions & 3 deletions cpp/dolfinx/fem/Expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ class Expression
for (std::size_t e = 0; e < entities.size() / estride; ++e)
{
const std::int32_t entity = entities[e * estride];
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, entity, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, entity, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x_g.begin(), 3 * x_dofs[i]), 3,
Expand Down
54 changes: 24 additions & 30 deletions cpp/dolfinx/fem/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,20 +473,19 @@ class Function
phi0_shape.begin(), phi0_shape.end(), 1, std::multiplies{}));
impl::mdspan_t<const geometry_type, 4> phi0(phi0_b.data(), phi0_shape);
cmap.tabulate(1, std::vector<geometry_type>(tdim), {1, tdim}, phi0_b);
auto dphi0
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(phi0, std::pair(1, tdim + 1), 0,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent, 0);
auto dphi0 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
phi0, std::pair(1, tdim + 1), 0,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent, 0);

// Data structure for evaluating geometry basis at specific points.
// Used in non-affine case.
std::array<std::size_t, 4> phi_shape = cmap.tabulate_shape(1, 1);
std::vector<geometry_type> phi_b(
std::reduce(phi_shape.begin(), phi_shape.end(), 1, std::multiplies{}));
impl::mdspan_t<const geometry_type, 4> phi(phi_b.data(), phi_shape);
auto dphi = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(phi, std::pair(1, tdim + 1), 0,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent, 0);
auto dphi = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
phi, std::pair(1, tdim + 1), 0,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent, 0);

// Reference coordinates for each point
std::vector<geometry_type> Xb(xshape[0] * tdim);
Expand All @@ -510,10 +509,8 @@ class Function
continue;

// Get cell geometry (coordinate dofs)
auto x_dofs
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(x_dofmap, cell_index,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cell_index, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
assert(x_dofs.size() == num_dofs_g);
for (std::size_t i = 0; i < num_dofs_g; ++i)
{
Expand All @@ -525,12 +522,12 @@ class Function
for (std::size_t j = 0; j < gdim; ++j)
xp(0, j) = x[p * xshape[1] + j];

auto _J = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(J, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _K = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(K, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _J = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
J, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _K = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
K, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);

std::array<geometry_type, 3> Xpb = {0, 0, 0};
MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan<
Expand Down Expand Up @@ -614,19 +611,16 @@ class Function
cell_info, cell_index, reference_value_size);

{
auto _U
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(basis_derivatives_reference_values, 0, p,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _J
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(J, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _K
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(K, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _U = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
basis_derivatives_reference_values, 0, p,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _J = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
J, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto _K = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
K, p, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
push_forward_fn(basis_values, _U, _J, detJ[p], _K);
}

Expand Down
11 changes: 5 additions & 6 deletions cpp/dolfinx/fem/FunctionSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,15 @@ class FunctionSpace
std::reduce(phi_shape.begin(), phi_shape.end(), 1, std::multiplies{}));
cmdspan4_t phi_full(phi_b.data(), phi_shape);
cmap.tabulate(0, X, Xshape, phi_b);
auto phi = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(phi_full, 0, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent, 0);
auto phi = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
phi_full, 0, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent,
MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent, 0);

for (int c = 0; c < num_cells; ++c)
{
// Extract cell geometry
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
for (std::size_t j = 0; j < gdim; ++j)
coordinate_dofs(i, j) = x_g[3 * x_dofs[i] + j];
Expand Down
20 changes: 8 additions & 12 deletions cpp/dolfinx/fem/assemble_matrix_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ void assemble_cells(
std::int32_t c1 = cells1[index];

// Get cell coordinates/geometry
auto x_dofs
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
Expand Down Expand Up @@ -228,9 +227,8 @@ void assemble_exterior_facets(
std::int32_t local_facet = facets[index + 1];

// Get cell coordinates/geometry
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
Expand Down Expand Up @@ -365,17 +363,15 @@ void assemble_interior_facets(
std::array local_facet{facets[index + 1], facets[index + 3]};

// Get cell geometry
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs0.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs0[i]), 3,
std::next(cdofs0.begin(), 3 * i));
}
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs1.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs1[i]), 3,
Expand Down
20 changes: 8 additions & 12 deletions cpp/dolfinx/fem/assemble_scalar_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ T assemble_cells(mdspan2_t x_dofmap, std::span<const scalar_value_type_t<T>> x,
std::int32_t c = cells[index];

// Get cell coordinates/geometry
auto x_dofs
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
Expand Down Expand Up @@ -81,9 +80,8 @@ T assemble_exterior_facets(mdspan2_t x_dofmap,
std::int32_t local_facet = facets[index + 1];

// Get cell coordinates/geometry
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
Expand Down Expand Up @@ -132,17 +130,15 @@ T assemble_interior_facets(mdspan2_t x_dofmap,
= {facets[index + 1], facets[index + 3]};

// Get cell geometry
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs0.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs0[i]), 3,
std::next(cdofs0.begin(), 3 * i));
}
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs1.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs1[i]), 3,
Expand Down
68 changes: 28 additions & 40 deletions cpp/dolfinx/fem/assemble_vector_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ void _lift_bc_cells(
std::int32_t c = cells[index];

// Get dof maps for cell
auto dmap1
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(dofmap1, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dmap1 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap1, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);

// Check if bc is applied to cell
bool has_bc = false;
Expand Down Expand Up @@ -105,19 +104,17 @@ void _lift_bc_cells(
continue;

// Get cell coordinates/geometry
auto x_dofs
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
std::next(coordinate_dofs.begin(), 3 * i));
}

// Size data structure for assembly
auto dmap0
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(dofmap0, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dmap0 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap0, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);

const int num_rows = bs0 * dmap0.size();
const int num_cols = bs1 * dmap1.size();
Expand Down Expand Up @@ -217,9 +214,8 @@ void _lift_bc_exterior_facets(
std::int32_t local_facet = facets[index + 1];

// Get dof maps for cell
auto dmap1 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
dofmap1, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dmap1 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap1, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);

// Check if bc is applied to cell
bool has_bc = false;
Expand All @@ -239,19 +235,17 @@ void _lift_bc_exterior_facets(
continue;

// Get cell coordinates/geometry
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
std::next(coordinate_dofs.begin(), 3 * i));
}

// Size data structure for assembly
auto dmap0 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
dofmap0, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dmap0 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap0, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);

const int num_rows = bs0 * dmap0.size();
const int num_cols = bs1 * dmap1.size();
Expand Down Expand Up @@ -333,17 +327,15 @@ void _lift_bc_interior_facets(
= {facets[index + 1], facets[index + 3]};

// Get cell geometry
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs0.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs0[i]), 3,
std::next(cdofs0.begin(), 3 * i));
}
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs1.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs1[i]), 3,
Expand Down Expand Up @@ -511,9 +503,8 @@ void assemble_cells(fem::DofTransformKernel<T> auto dof_transform,
std::int32_t c = cells[index];

// Get cell coordinates/geometry
auto x_dofs
= MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
Expand All @@ -527,8 +518,8 @@ void assemble_cells(fem::DofTransformKernel<T> auto dof_transform,
dof_transform(_be, cell_info, c, 1);

// Scatter cell vector to 'global' vector array
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap, c, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
if constexpr (_bs > 0)
{
for (std::size_t i = 0; i < dofs.size(); ++i)
Expand Down Expand Up @@ -578,9 +569,8 @@ void assemble_exterior_facets(fem::DofTransformKernel<T> auto dof_transform,
std::int32_t local_facet = facets[index + 1];

// Get cell coordinates/geometry
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs[i]), 3,
Expand All @@ -595,8 +585,8 @@ void assemble_exterior_facets(fem::DofTransformKernel<T> auto dof_transform,
dof_transform(_be, cell_info, cell, 1);

// Add element vector to global vector
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::
submdspan(dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
dofmap, cell, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
if constexpr (_bs > 0)
{
for (std::size_t i = 0; i < dofs.size(); ++i)
Expand Down Expand Up @@ -646,17 +636,15 @@ void assemble_interior_facets(
= {facets[index + 1], facets[index + 3]};

// Get cell geometry
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs0 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[0], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs0.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs0[i]), 3,
std::next(cdofs0.begin(), 3 * i));
}
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::
MDSPAN_IMPL_PROPOSED_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
auto x_dofs1 = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
x_dofmap, cells[1], MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
for (std::size_t i = 0; i < x_dofs1.size(); ++i)
{
std::copy_n(std::next(x.begin(), 3 * x_dofs1[i]), 3,
Expand Down
Loading

0 comments on commit 989a3ed

Please sign in to comment.