From ecb421e857d0a76667e2d3e7bcf7f916c57cc21a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz>
Date: Sun, 1 May 2022 20:15:05 +0200
Subject: [PATCH] Added a Doxygen group for documenting Hypre wrappers

---
 Documentation/Doxyfile               |  1 +
 Documentation/Pages/main-page.md     |  5 +++++
 src/TNL/Containers/HypreParVector.h  |  2 ++
 src/TNL/Containers/HypreVector.h     |  2 ++
 src/TNL/Hypre.h                      | 16 ++++++++++++++++
 src/TNL/Matrices/HypreCSRMatrix.h    |  2 ++
 src/TNL/Matrices/HypreParCSRMatrix.h |  2 ++
 src/TNL/Solvers/Linear/Hypre.h       |  6 ++++++
 8 files changed, 36 insertions(+)

diff --git a/Documentation/Doxyfile b/Documentation/Doxyfile
index 58f4b4b1f5..8b3faf7032 100644
--- a/Documentation/Doxyfile
+++ b/Documentation/Doxyfile
@@ -2123,6 +2123,7 @@ INCLUDE_FILE_PATTERNS  =
 PREDEFINED = DOXYGEN_ONLY
 PREDEFINED += HAVE_MPI
 PREDEFINED += HAVE_CUDA
+PREDEFINED += HAVE_HYPRE
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
diff --git a/Documentation/Pages/main-page.md b/Documentation/Pages/main-page.md
index 8ad6e6d80b..32d97d75f4 100644
--- a/Documentation/Pages/main-page.md
+++ b/Documentation/Pages/main-page.md
@@ -178,6 +178,11 @@ computing platform, and (optionally) some libraries.
       <td> </td>
       <td> Only used for the compilation of the `tnl-decompose-mesh` tool. </td>
   </tr>
+  <tr><td> [Hypre](https://github.com/hypre-space/hypre) </td>
+      <td> \ref Hypre "Wrappers for Hypre solvers" </td>
+      <td> `-DHAVE_HYPRE -lHYPRE` </td>
+      <td> Attention should be paid to Hypre build options, e.g. `--enable-bigint`. </td>
+  </tr>
   <tr><td> [libpng](http://www.libpng.org/pub/png/libpng.html) </td>
       <td> \ref TNL::Images "Image processing" classes </td>
       <td> `-DHAVE_PNG_H -lpng` </td>
diff --git a/src/TNL/Containers/HypreParVector.h b/src/TNL/Containers/HypreParVector.h
index a26b3c96b5..20258e3dd9 100644
--- a/src/TNL/Containers/HypreParVector.h
+++ b/src/TNL/Containers/HypreParVector.h
@@ -23,6 +23,8 @@ namespace Containers {
  * - https://github.com/hypre-space/hypre/blob/master/src/parcsr_mv/par_vector.h
  * - https://github.com/hypre-space/hypre/blob/master/src/parcsr_mv/par_vector.c
  * - https://github.com/hypre-space/hypre/blob/master/src/parcsr_mv/_hypre_parcsr_mv.h (catch-all interface)
+ *
+ * \ingroup Hypre
  */
 class HypreParVector
 {
diff --git a/src/TNL/Containers/HypreVector.h b/src/TNL/Containers/HypreVector.h
index 9dce7dbe36..5fc6a6ebdc 100644
--- a/src/TNL/Containers/HypreVector.h
+++ b/src/TNL/Containers/HypreVector.h
@@ -24,6 +24,8 @@ namespace Containers {
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/vector.h
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/vector.c
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/seq_mv.h (catch-all interface)
+ *
+ * \ingroup Hypre
  */
 class HypreVector
 {
diff --git a/src/TNL/Hypre.h b/src/TNL/Hypre.h
index 1cdecf007a..591b82fcc1 100644
--- a/src/TNL/Hypre.h
+++ b/src/TNL/Hypre.h
@@ -36,6 +36,19 @@
 
 namespace TNL {
 
+/**
+ * \defgroup Hypre  Wrappers for the Hypre library
+ *
+ * This group includes various wrapper classes for data structures and
+ * algorithms implemented in the [Hypre library][hypre]. See the
+ * [example][example] for how these wrappers can be used.
+ *
+ * [hypre]: https://github.com/hypre-space/hypre
+ * [example]: https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/blob/develop/src/Examples/Hypre/tnl-hypre-ex5.cpp
+ *
+ * @{
+ */
+
 /**
  * \brief A simple RAII wrapper for Hypre's initialization and finalization.
  *
@@ -111,4 +124,7 @@ struct Hypre
    #endif
 // clang-format on
 
+// this is a Doxygen end-group marker
+//! @}
+
 #endif  // HAVE_HYPRE
diff --git a/src/TNL/Matrices/HypreCSRMatrix.h b/src/TNL/Matrices/HypreCSRMatrix.h
index eca80e816c..0a9590ba45 100644
--- a/src/TNL/Matrices/HypreCSRMatrix.h
+++ b/src/TNL/Matrices/HypreCSRMatrix.h
@@ -24,6 +24,8 @@ namespace Matrices {
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/csr_matrix.h
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/csr_matrix.c
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/seq_mv.h (catch-all interface)
+ *
+ * \ingroup Hypre
  */
 class HypreCSRMatrix
 {
diff --git a/src/TNL/Matrices/HypreParCSRMatrix.h b/src/TNL/Matrices/HypreParCSRMatrix.h
index 225fc4917e..b409e8d7c5 100644
--- a/src/TNL/Matrices/HypreParCSRMatrix.h
+++ b/src/TNL/Matrices/HypreParCSRMatrix.h
@@ -20,6 +20,8 @@ namespace Matrices {
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/csr_matrix.h
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/csr_matrix.c
  * - https://github.com/hypre-space/hypre/blob/master/src/seq_mv/seq_mv.h (catch-all interface)
+ *
+ * \ingroup Hypre
  */
 class HypreParCSRMatrix
 {
diff --git a/src/TNL/Solvers/Linear/Hypre.h b/src/TNL/Solvers/Linear/Hypre.h
index ec46cd852f..229da24f65 100644
--- a/src/TNL/Solvers/Linear/Hypre.h
+++ b/src/TNL/Solvers/Linear/Hypre.h
@@ -17,6 +17,9 @@ namespace TNL {
 namespace Solvers {
 namespace Linear {
 
+//! \addtogroup Hypre
+//! @{
+
 //! \brief Abstract class for Hypre's solvers and preconditioners
 class HypreSolver
 {
@@ -762,4 +765,7 @@ protected:
 
    #include "Hypre.hpp"
 
+// this is a Doxygen end-group marker
+//! @}
+
 #endif  // HAVE_HYPRE
-- 
GitLab