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

Method apply_permutation

cpp/dolfinx/io/cells.cpp:695–713  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

693}
694//-----------------------------------------------------------------------------
695std::vector<std::int64_t>
696io::cells::apply_permutation(std::span<const std::int64_t> cells,
697 std::array<std::size_t, 2> shape,
698 std::span<const std::uint16_t> p)
699{
700 assert(cells.size() == shape[0] * shape[1]);
701 assert(shape[1] == p.size());
702
703 spdlog::info("IO permuting cells");
704 std::vector<std::int64_t> cells_new(cells.size());
705 for (std::size_t c = 0; c < shape[0]; ++c)
706 {
707 auto cell = cells.subspan(c * shape[1], shape[1]);
708 std::span cell_new(cells_new.data() + c * shape[1], shape[1]);
709 for (std::size_t i = 0; i < shape[1]; ++i)
710 cell_new[i] = cell[p[i]];
711 }
712 return cells_new;
713}
714//-----------------------------------------------------------------------------
715std::int8_t io::cells::get_vtk_cell_type(mesh::CellType cell, int dim)
716{

Callers

nothing calls this directly

Calls 2

dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected