diff --git a/src/mesh/Connectivity.cpp b/src/mesh/Connectivity.cpp index 3a35c02550e50bb7b48e7e48e9cb09e8701e6c3e..596a9b8b0afc325008e399d0d6b6a0bc5a8bd49a 100644 --- a/src/mesh/Connectivity.cpp +++ b/src/mesh/Connectivity.cpp @@ -10,7 +10,6 @@ template<size_t Dimension> void Connectivity<Dimension>:: _buildFrom(const ConnectivityDescriptor& descriptor) { -#warning All of these should be checked by ConnectivityDescriptor Assert(descriptor.cell_to_node_vector.size() == descriptor.cell_type_vector.size()); Assert(descriptor.cell_number_vector.size() == descriptor.cell_type_vector.size()); if constexpr (Dimension>1) { @@ -45,8 +44,6 @@ _buildFrom(const ConnectivityDescriptor& descriptor) { WeakCellValue<int> cell_global_index(*this); -#warning index must start accounting number of global indices of other procs -#warning must take care of ghost cells int first_index = 0; parallel_for(this->numberOfCells(), PASTIS_LAMBDA(const CellId& j) { cell_global_index[j] = first_index+j; @@ -54,15 +51,6 @@ _buildFrom(const ConnectivityDescriptor& descriptor) m_cell_global_index = cell_global_index; } - { - WeakCellValue<double> inv_cell_nb_nodes(*this); - parallel_for(this->numberOfCells(), PASTIS_LAMBDA(const CellId& j) { - const auto& cell_nodes = cell_to_node_matrix.rowConst(j); - inv_cell_nb_nodes[j] = 1./cell_nodes.length; - }); - m_inv_cell_nb_nodes = inv_cell_nb_nodes; - } - { WeakCellValue<int> cell_owner(*this); cell_owner = convert_to_array(descriptor.cell_owner_vector); diff --git a/src/mesh/Connectivity.hpp b/src/mesh/Connectivity.hpp index 09867588485a5f079e0f2ceb8865a5804888e66c..5643d07372e0ed22589096ab79b248cd0a15ac43 100644 --- a/src/mesh/Connectivity.hpp +++ b/src/mesh/Connectivity.hpp @@ -172,7 +172,6 @@ class Connectivity final ConnectivityMatrix m_item_to_item_matrix[Dimension+1][Dimension+1]; WeakCellValue<const CellType> m_cell_type; -#warning is m_cell_global_index really necessary? should it be computed on demand instead? WeakCellValue<const int> m_cell_global_index; WeakCellValue<const int> m_cell_number; @@ -721,7 +720,18 @@ class Connectivity final CellValue<const double> invCellNbNodes() const { -#warning add calculation on demand when variables will be defined + if (not m_inv_cell_nb_nodes.isBuilt()) { + const auto& cell_to_node_matrix + = m_item_to_item_matrix[itemTId(ItemType::cell)][itemTId(ItemType::node)]; + + WeakCellValue<double> inv_cell_nb_nodes(*this); + parallel_for(this->numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + const auto& cell_nodes = cell_to_node_matrix.rowConst(j); + inv_cell_nb_nodes[j] = 1./cell_nodes.length; + }); + const_cast<WeakCellValue<const double>&>(m_inv_cell_nb_nodes) = inv_cell_nb_nodes; + } + return m_inv_cell_nb_nodes; } diff --git a/src/mesh/ConnectivityDispatcher.cpp b/src/mesh/ConnectivityDispatcher.cpp index a21b316bd68be579ad6129d0e11de801f35ce67d..aa26cb6f71422cfaf646f3d52ab22ff882e0f72a 100644 --- a/src/mesh/ConnectivityDispatcher.cpp +++ b/src/mesh/ConnectivityDispatcher.cpp @@ -431,8 +431,6 @@ ConnectivityDispatcher<Dimension>::_buildItemReferenceList() return number_of_item_list_sender; }(); - pout() << "- dispatching references for " << itemName(item_type) << '\n'; - if (number_of_item_list_sender > 0) { if (number_of_item_list_sender > 1) { perr() << __FILE__ << ':' << __LINE__ << ": " @@ -505,10 +503,6 @@ ConnectivityDispatcher<Dimension>::_buildItemReferenceList() return ref_id_list; } (); - for (auto ref_id : ref_id_list) { - pout() << " - " << ref_id << '\n'; - } - using block_type = int32_t; constexpr size_t block_size = sizeof(block_type); const size_t nb_block = ref_id_list.size()/block_size + (ref_id_list.size()%block_size != 0); diff --git a/src/mesh/GmshReader.cpp b/src/mesh/GmshReader.cpp index 2817d7a3d0bd9e55d06bbb6a6190810e47efa896..1881f99a4eb55e8f6de284ee2b91a05a412aba04 100644 --- a/src/mesh/GmshReader.cpp +++ b/src/mesh/GmshReader.cpp @@ -208,12 +208,6 @@ class ConnectivityFace<2> (m_node_number_vector[m_node1_id]<m_node_number_vector[f.m_node1_id]))); } - PASTIS_INLINE - ConnectivityFace& operator=(const ConnectivityFace&) = default; - - PASTIS_INLINE - ConnectivityFace& operator=(ConnectivityFace&&) = default; - PASTIS_INLINE ConnectivityFace(const std::vector<unsigned int>& node_id_list, const std::vector<int>& node_number_vector) @@ -235,9 +229,6 @@ class ConnectivityFace<2> PASTIS_INLINE ConnectivityFace(const ConnectivityFace&) = default; - PASTIS_INLINE - ConnectivityFace(ConnectivityFace&&) = default; - PASTIS_INLINE ~ConnectivityFace() = default; }; @@ -333,19 +324,9 @@ class ConnectivityFace<3> return m_node_id_list.size() < f.m_node_id_list.size(); } - PASTIS_INLINE - ConnectivityFace& operator=(const ConnectivityFace&) = default; - - PASTIS_INLINE - ConnectivityFace& operator=(ConnectivityFace&&) = default; - PASTIS_INLINE ConnectivityFace(const ConnectivityFace&) = default; - PASTIS_INLINE - ConnectivityFace(ConnectivityFace&&) = default; - - PASTIS_INLINE ConnectivityFace() = delete; @@ -1210,7 +1191,6 @@ GmshReader::__proceedData() ErrorHandler::normal); } -#warning should use an unordered_map // A value of -1 means that the vertex is unknown __verticesCorrepondance.resize(maxNumber+1,-1); diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index e111d14531c050961ee581841cc3ffedf936e966..b103e22946019e8ff2c50a056e8c86a75fbf4c05 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -11,7 +11,6 @@ struct IMesh { virtual size_t dimension() const = 0; - // virtual CSRGraph cellToCellGraph() const = 0; ~IMesh() = default; }; @@ -66,7 +65,6 @@ public: return m_xr; } - [[deprecated("should rework this class: quite ugly")]] PASTIS_INLINE NodeValue<Rd> mutableXr() const { diff --git a/src/mesh/MeshData.hpp b/src/mesh/MeshData.hpp index dd8f33deac3c96a4fc97e7900cf4dbabd9e31ece..3d5cc9b753ae4835e78f70b729b831a1cffc06ba 100644 --- a/src/mesh/MeshData.hpp +++ b/src/mesh/MeshData.hpp @@ -178,13 +178,11 @@ class MeshData const FaceId& l = cell_faces[L]; const auto& face_nodes = face_to_node_matrix[l]; -#warning should this lambda be replaced by a precomputed correspondance? auto local_node_number_in_cell = [&](const NodeId& node_number) { for (size_t i_node=0; i_node<cell_nodes.size(); ++i_node) { if (node_number == cell_nodes[i_node]) { return i_node; - break; } } return std::numeric_limits<size_t>::max(); @@ -227,31 +225,37 @@ class MeshData } public: + PASTIS_INLINE const MeshType& mesh() const { return m_mesh; } + PASTIS_INLINE const NodeValuePerCell<const Rd>& Cjr() const { return m_Cjr; } + PASTIS_INLINE const NodeValuePerCell<const double>& ljr() const { return m_ljr; } + PASTIS_INLINE const NodeValuePerCell<const Rd>& njr() const { return m_njr; } + PASTIS_INLINE const CellValue<const Rd>& xj() const { return m_xj; } + PASTIS_INLINE const CellValue<const double>& Vj() const { return m_Vj; diff --git a/src/mesh/MeshNodeBoundary.hpp b/src/mesh/MeshNodeBoundary.hpp index ae31e3240384b9d5d0cc28160cc557603c55b784..ff8ef4a920d0bc2a767b1a0d677c2157a1fe8a9a 100644 --- a/src/mesh/MeshNodeBoundary.hpp +++ b/src/mesh/MeshNodeBoundary.hpp @@ -287,7 +287,6 @@ _getNormal(const MeshType& mesh) zmax = x; } } -#warning re work this part to avoir parallelism dependance Array<R3> xmin_array = parallel::allGather(xmin); Array<R3> xmax_array = parallel::allGather(xmax); Array<R3> ymin_array = parallel::allGather(ymin); @@ -320,7 +319,6 @@ _getNormal(const MeshType& mesh) if (x[2] > zmax[2]) { zmax = x; } } - const R3 u = xmax-xmin; const R3 v = ymax-ymin; const R3 w = zmax-zmin; @@ -355,7 +353,6 @@ _getNormal(const MeshType& mesh) normal *= 1./sqrt(normal_l2); -#warning Add flatness test // this->_checkBoundaryIsFlat(normal, xmin, xmax, mesh); return normal; diff --git a/src/utils/Messenger.cpp b/src/utils/Messenger.cpp index 2bf82efacf7fa363cdf4431b48d13c2906f4deba..6dc4056efd81957f3a5a89fefc328d3d86a1d118 100644 --- a/src/utils/Messenger.cpp +++ b/src/utils/Messenger.cpp @@ -26,7 +26,8 @@ void Messenger::destroy() } Messenger:: -Messenger(int& argc, char* argv[]) +Messenger([[maybe_unused]] int& argc, + [[maybe_unused]] char* argv[]) { #ifdef PASTIS_HAS_MPI MPI_Init(&argc, &argv); diff --git a/src/utils/Messenger.hpp b/src/utils/Messenger.hpp index 163489cc5ec9118c2c63dbafdb01cfc09030ce35..4a54994a273b55e74c253135951a59a95c186909 100644 --- a/src/utils/Messenger.hpp +++ b/src/utils/Messenger.hpp @@ -138,7 +138,8 @@ class Messenger } template <typename DataType> - void _broadcast_value(DataType& data, const size_t& root_rank) const + void _broadcast_value([[maybe_unused]] DataType& data, + [[maybe_unused]] const size_t& root_rank) const { static_assert(not std::is_const_v<DataType>); static_assert(std::is_arithmetic_v<DataType>); @@ -152,7 +153,8 @@ class Messenger } template <typename ArrayType> - void _broadcast_array(ArrayType& array, const size_t& root_rank) const + void _broadcast_array([[maybe_unused]] ArrayType& array, + [[maybe_unused]] const size_t& root_rank) const { using DataType = typename ArrayType::data_type; static_assert(not std::is_const_v<DataType>); diff --git a/src/utils/Partitioner.cpp b/src/utils/Partitioner.cpp index c1da28a49e5b477870a0e0cb32fb15a4b4500770..709038090a5454794bbff49ef9240f2ebd17a780 100644 --- a/src/utils/Partitioner.cpp +++ b/src/utils/Partitioner.cpp @@ -83,7 +83,7 @@ Array<int> Partitioner::partition(const CSRGraph& graph) #else // PASTIS_HAS_MPI -Array<int> Partitioner::partition(const CSRGraph& graph) +Array<int> Partitioner::partition(const CSRGraph&) { return Array<int>(0); } diff --git a/src/utils/SignalManager.cpp b/src/utils/SignalManager.cpp index 319765461db6d8d6c356e21cd2942e8881976934..525db43c8d14a0191f8c9d18790def38051c9761 100644 --- a/src/utils/SignalManager.cpp +++ b/src/utils/SignalManager.cpp @@ -36,9 +36,7 @@ std::string SignalManager::signalName(const int& signal) void SignalManager::pauseForDebug(const int& signal) { if (std::string(PASTIS_BUILD_TYPE) != "Release") { -#warning should try to detect if outputs to a terminal (buggy with mpi) - if (// (ConsoleManager::isTerminal(pout()) and (s_pause_on_error == "auto")) or - (s_pause_on_error == "yes")) { + if (s_pause_on_error == "yes") { std::cerr << "\n======================================\n" << rang::style::reset << rang::fg::reset