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

Function create_cell_partitioner_cpp

python/dolfinx/wrappers/mesh.cpp:41–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace part::impl
40{
41CppCellPartitionFunction
42create_cell_partitioner_cpp(const PythonCellPartitionFunction& p)
43{
44 if (p)
45 {
46 return [p](MPI_Comm comm, int n,
47 const std::vector<dolfinx::mesh::CellType>& cell_types,
48 const std::vector<std::span<const std::int64_t>>& cells)
49 {
50 std::vector<nb::ndarray<const std::int64_t, nb::numpy>> cells_nb;
51 std::ranges::transform(
52 cells, std::back_inserter(cells_nb),
53 [](auto c)
54 {
55 return nb::ndarray<const std::int64_t, nb::numpy>(c.data(),
56 {c.size()});
57 });
58 return p(dolfinx_wrappers::MPICommWrapper(comm), n, cell_types, cells_nb);
59 };
60 }
61 else
62 return nullptr;
63}
64} // namespace part::impl
65
66void mesh(nb::module_& m)

Callers 2

declare_refinementFunction · 0.85
declare_meshFunction · 0.85

Calls 4

transformFunction · 0.85
MPICommWrapperClass · 0.85
dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected