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

Use GraphRowViewConst::length instead of number of cells table

parent 44843f95
Branches
Tags
1 merge request!6Feature/crs
...@@ -99,13 +99,11 @@ private: ...@@ -99,13 +99,11 @@ private:
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
const Kokkos::View<const Rdd*> const Kokkos::View<const Rdd*>
computeAr(const Kokkos::View<const Rdd**>& Ajr) { computeAr(const Kokkos::View<const Rdd**>& Ajr) {
const Kokkos::View<const unsigned short*> node_nb_cells = m_connectivity.nodeNbCells();
Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) { Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) {
Rdd sum = zero; Rdd sum = zero;
const auto& node_to_cell = m_connectivity.m_node_to_cell_matrix.rowConst(r); const auto& node_to_cell = m_connectivity.m_node_to_cell_matrix.rowConst(r);
const auto& node_to_cell_local_node = m_connectivity.m_node_to_cell_local_node_matrix.rowConst(r); const auto& node_to_cell_local_node = m_connectivity.m_node_to_cell_local_node_matrix.rowConst(r);
for (int j=0; j<node_nb_cells(r); ++j) { for (size_t j=0; j<node_to_cell.length; ++j) {
const unsigned int J = node_to_cell(j); const unsigned int J = node_to_cell(j);
const unsigned int R = node_to_cell_local_node(j); const unsigned int R = node_to_cell_local_node(j);
sum += Ajr(J,R); sum += Ajr(J,R);
...@@ -122,14 +120,12 @@ private: ...@@ -122,14 +120,12 @@ private:
const Kokkos::View<const Rd**>& Cjr, const Kokkos::View<const Rd**>& Cjr,
const Kokkos::View<const Rd*>& uj, const Kokkos::View<const Rd*>& uj,
const Kokkos::View<const double*>& pj) { const Kokkos::View<const double*>& pj) {
const Kokkos::View<const unsigned short*>& node_nb_cells = m_connectivity.nodeNbCells();
Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) { Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) {
Rd& br = m_br(r); Rd& br = m_br(r);
br = zero; br = zero;
const auto& node_to_cell = m_connectivity.m_node_to_cell_matrix.rowConst(r); const auto& node_to_cell = m_connectivity.m_node_to_cell_matrix.rowConst(r);
const auto& node_to_cell_local_node = m_connectivity.m_node_to_cell_local_node_matrix.rowConst(r); const auto& node_to_cell_local_node = m_connectivity.m_node_to_cell_local_node_matrix.rowConst(r);
for (int j=0; j<node_nb_cells(r); ++j) { for (size_t j=0; j<node_to_cell.length; ++j) {
const unsigned int J = node_to_cell(j); const unsigned int J = node_to_cell(j);
const unsigned int R = node_to_cell_local_node(j); const unsigned int R = node_to_cell_local_node(j);
br += Ajr(J,R)*uj(J) + pj(J)*Cjr(J,R); br += Ajr(J,R)*uj(J) + pj(J)*Cjr(J,R);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment