Skip to content
Snippets Groups Projects
Commit 03a5843c authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Begin connectivity crs storage (test for efficiency)

parent 97f6e3e8
No related branches found
No related tags found
1 merge request!6Feature/crs
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define CONNECTIVITY_3D_HPP #define CONNECTIVITY_3D_HPP
#include <Kokkos_Core.hpp> #include <Kokkos_Core.hpp>
#include <Kokkos_StaticCrsGraph.hpp>
#include <PastisAssert.hpp> #include <PastisAssert.hpp>
#include <TinyVector.hpp> #include <TinyVector.hpp>
...@@ -297,6 +298,24 @@ private: ...@@ -297,6 +298,24 @@ private:
} }
m_face_nb_cells = face_nb_cells; m_face_nb_cells = face_nb_cells;
std::vector<std::vector<unsigned int>> face_to_cell_vector(m_number_of_faces);
{
size_t l=0;
for (const auto& face_cells_vector : face_cells_map) {
const auto& cells_info_vector = face_cells_vector.second;
std::vector<unsigned int>& cells_vector = face_to_cell_vector[l];
cells_vector.resize(cells_info_vector.size());
for (size_t j=0; j<cells_info_vector.size(); ++j) {
const auto& [cell_number, local_face_in_cell, reversed] = cells_info_vector[j];
cells_vector[j] = cell_number;
}
++l;
}
}
typedef Kokkos::StaticCrsGraph<unsigned int, Kokkos::HostSpace> StaticCrsGraphType;
StaticCrsGraphType face_to_cell_matrix
= Kokkos::create_staticcrsgraph<StaticCrsGraphType>("face_to_cell_matrix", face_to_cell_vector);
#warning check that the number of cell per faces is <=2 #warning check that the number of cell per faces is <=2
Kokkos::View<unsigned int**> face_cells("face_cells", face_cells_map.size(), 2); Kokkos::View<unsigned int**> face_cells("face_cells", face_cells_map.size(), 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment