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

Rename members to improve clarity

Generically, changes look like
- m_item_to_subitem_local_item -> m_item_local_numbers_in_their_subitem
- itemToSubitemLocalItem() -> itemLocalNumbersInTheirSubitem()
parent bff71102
No related branches found
No related tags found
1 merge request!6Feature/crs
...@@ -158,7 +158,7 @@ void Connectivity<3>::_computeFaceCellConnectivities() ...@@ -158,7 +158,7 @@ void Connectivity<3>::_computeFaceCellConnectivities()
m_connectivity_computer.computeInverseConnectivityMatrix(cell_to_face_matrix, m_connectivity_computer.computeInverseConnectivityMatrix(cell_to_face_matrix,
face_to_cell_matrix); face_to_cell_matrix);
m_face_to_cell_local_face m_face_local_numbers_in_their_cells
= m_connectivity_computer.computeLocalItemNumberInChildItem<ItemType::face, = m_connectivity_computer.computeLocalItemNumberInChildItem<ItemType::face,
ItemType::cell>(*this); ItemType::cell>(*this);
...@@ -278,10 +278,10 @@ Connectivity(const std::vector<std::vector<unsigned int>>& cell_by_node_vector) ...@@ -278,10 +278,10 @@ Connectivity(const std::vector<std::vector<unsigned int>>& cell_by_node_vector)
m_connectivity_computer.computeInverseConnectivityMatrix(cell_to_node_matrix, m_connectivity_computer.computeInverseConnectivityMatrix(cell_to_node_matrix,
node_to_cell_matrix); node_to_cell_matrix);
m_node_to_cell_local_node m_node_local_numbers_in_their_cells
= m_connectivity_computer.computeLocalItemNumberInChildItem<ItemType::node, ItemType::cell>(*this); = m_connectivity_computer.computeLocalItemNumberInChildItem<ItemType::node, ItemType::cell>(*this);
m_cell_to_node_local_cell m_cell_local_numbers_in_their_nodes
= m_connectivity_computer.computeLocalItemNumberInChildItem<ItemType::cell, ItemType::node>(*this); = m_connectivity_computer.computeLocalItemNumberInChildItem<ItemType::cell, ItemType::node>(*this);
if constexpr (Dimension>1) { if constexpr (Dimension>1) {
......
...@@ -248,30 +248,29 @@ class Connectivity final ...@@ -248,30 +248,29 @@ class Connectivity final
return m_cell_face_is_reversed; return m_cell_face_is_reversed;
} }
[[deprecated("These member functions are poorly named")]] const auto& cellLocalNumbersInTheirNodes() const
const auto& cellToNodeLocalCell() const
{ {
return m_cell_to_node_local_cell; return m_cell_local_numbers_in_their_nodes;
} }
const auto& nodeToCellLocalNode() const const auto& nodeLocalNumbersInTheirCells() const
{ {
return m_node_to_cell_local_node; return m_node_local_numbers_in_their_cells;
} }
const auto& faceToCellLocalFace() const const auto& faceLocalNumbersInTheirCells() const
{ {
if constexpr(dimension>1) { if constexpr(dimension>1) {
return m_face_to_cell_local_face; return m_face_local_numbers_in_their_cells;
} else { } else {
return m_node_to_cell_local_node; return m_node_local_numbers_in_their_cells;
} }
} }
const auto& nodeToFaceLocalNode() const const auto& nodeToFaceLocalNode() const
{ {
static_assert("this function has no meaning in 1d"); static_assert(Dimension==1,"this function has no meaning in 1d");
return m_node_to_face_local_node; return m_node_local_numbers_in_their_faces;
} }
private: private:
...@@ -279,17 +278,16 @@ private: ...@@ -279,17 +278,16 @@ private:
FaceValuePerCell<const bool> m_cell_face_is_reversed; FaceValuePerCell<const bool> m_cell_face_is_reversed;
[[deprecated("These members are poorly named")]] NodeValuePerCell<const unsigned short> m_cell_local_numbers_in_their_nodes;
NodeValuePerCell<const unsigned short> m_cell_to_node_local_cell;
CellValuePerFace<const unsigned short> m_face_to_cell_local_face; CellValuePerFace<const unsigned short> m_face_local_numbers_in_their_cells;
CellValuePerNode<const unsigned short> m_node_to_cell_local_node; CellValuePerNode<const unsigned short> m_node_local_numbers_in_their_cells;
// not plugged ... // not plugged ...
#warning remaining def #warning remaining def
NodeValuePerFace<unsigned short> m_node_to_face_local_node; NodeValuePerFace<unsigned short> m_node_local_numbers_in_their_faces;
FaceValuePerNode<unsigned short> m_face_to_node_local_face; FaceValuePerNode<unsigned short> m_face_local_numbers_in_their_nodes;
// ... not plugged // ... not plugged
ConnectivityComputer m_connectivity_computer; ConnectivityComputer m_connectivity_computer;
......
...@@ -101,14 +101,18 @@ class AcousticSolver ...@@ -101,14 +101,18 @@ class AcousticSolver
const auto& node_to_cell_matrix const auto& node_to_cell_matrix
= getConnectivityMatrix<ItemType::node, = getConnectivityMatrix<ItemType::node,
ItemType::cell>(m_connectivity); ItemType::cell>(m_connectivity);
const auto& node_to_cell_local_node = m_connectivity.nodeToCellLocalNode(); const auto& node_local_numbers_in_their_cells
= m_connectivity.nodeLocalNumbersInTheirCells();
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 = node_to_cell_matrix.rowConst(r); const auto& node_to_cell = node_to_cell_matrix.rowConst(r);
const auto& cell_local_node = node_to_cell_local_node.itemValues(r); const auto& node_local_number_in_its_cells
= node_local_numbers_in_their_cells.itemValues(r);
for (size_t j=0; j<node_to_cell.length; ++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 = cell_local_node[j]; const unsigned int R = node_local_number_in_its_cells[j];
sum += Ajr(J,R); sum += Ajr(J,R);
} }
m_Ar(r) = sum; m_Ar(r) = sum;
...@@ -126,15 +130,18 @@ class AcousticSolver ...@@ -126,15 +130,18 @@ class AcousticSolver
const auto& node_to_cell_matrix const auto& node_to_cell_matrix
= getConnectivityMatrix<ItemType::node, = getConnectivityMatrix<ItemType::node,
ItemType::cell>(m_connectivity); ItemType::cell>(m_connectivity);
const auto& node_to_cell_local_node = m_connectivity.nodeToCellLocalNode(); const auto& node_local_numbers_in_their_cells
= m_connectivity.nodeLocalNumbersInTheirCells();
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 = node_to_cell_matrix.rowConst(r); const auto& node_to_cell = node_to_cell_matrix.rowConst(r);
const auto& cell_local_node = node_to_cell_local_node.itemValues(r); const auto& node_local_number_in_its_cells
= node_local_numbers_in_their_cells.itemValues(r);
for (size_t j=0; j<node_to_cell.length; ++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 = cell_local_node[j]; const unsigned int R = node_local_number_in_its_cells[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