From 6abb51cd3b566e53b247e95ed380f153410fa541 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 22 Apr 2023 17:58:13 -0600 Subject: [PATCH] Document concepts in a language doxygen can understand. --- include/deal.II/base/parallel.h | 32 ++++++++++ include/deal.II/base/point.h | 6 ++ include/deal.II/base/thread_management.h | 9 +++ .../distributed/fully_distributed_tria.h | 2 + include/deal.II/distributed/shared_tria.h | 4 ++ include/deal.II/distributed/tria.h | 6 ++ include/deal.II/distributed/tria_base.h | 2 + include/deal.II/dofs/dof_handler.h | 2 + include/deal.II/grid/filtered_iterator.h | 12 ++++ include/deal.II/grid/grid_generator.h | 3 + include/deal.II/grid/grid_tools.h | 60 +++++++++++++++++++ include/deal.II/grid/intergrid_map.h | 2 + include/deal.II/grid/tria.h | 2 + .../deal.II/numerics/vector_tools_evaluate.h | 12 ++++ .../vector_tools_integrate_difference.h | 14 +++++ .../numerics/vector_tools_interpolate.h | 21 +++++++ .../numerics/vector_tools_mean_value.h | 10 ++++ .../numerics/vector_tools_point_gradient.h | 16 +++++ .../numerics/vector_tools_point_value.h | 20 +++++++ .../deal.II/numerics/vector_tools_project.h | 14 +++++ .../numerics/vector_tools_project.templates.h | 8 +++ include/deal.II/numerics/vector_tools_rhs.h | 16 +++++ 22 files changed, 273 insertions(+) diff --git a/include/deal.II/base/parallel.h b/include/deal.II/base/parallel.h index 432933eea0..e73c6173e4 100644 --- a/include/deal.II/base/parallel.h +++ b/include/deal.II/base/parallel.h @@ -131,6 +131,12 @@ namespace parallel * applicable, see the * @ref threads "Parallel computing with multiple processors" * module. + * + * @dealiiConceptRequires{(std::invocable())> && + * std::assignable_from()), + * std::invoke_result_t())>>)} */ template DEAL_II_CXX20_REQUIRES( @@ -192,6 +198,14 @@ namespace parallel * applicable, see the * @ref threads "Parallel computing with multiple processors" * module. + * + * @dealiiConceptRequires{(std::invocable()), + * decltype(*std::declval())> && + * std::assignable_from()), + * std::invoke_result_t()), + * decltype(*std::declval())>>)} */ template ()), + * decltype(*std::declval()), + * decltype(*std::declval())> && + * std::assignable_from()), + * std::invoke_result_t()), + * decltype(*std::declval()), + * decltype(*std::declval())>>)} */ template )} */ template DEAL_II_CXX20_REQUIRES((std::invocable)) @@ -401,6 +427,8 @@ namespace parallel * applicable, see also the * @ref threads "Parallel computing with multiple processors" * module. + * + * @dealiiConceptRequires{(std::invocable)} */ template DEAL_II_CXX20_REQUIRES((std::invocable)) @@ -547,6 +575,10 @@ namespace parallel * applicable, see also the * @ref threads "Parallel computing with multiple processors" * module. + * + * @dealiiConceptRequires{(std::invocable && + * std::convertible_to, + * ResultType>)} */ template DEAL_II_CXX20_REQUIRES( diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index c2d94e8eb6..f6a30861d7 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -103,6 +103,8 @@ DEAL_II_NAMESPACE_OPEN * * * @ingroup geomprimitives + * + * @dealiiConceptRequires{dim >= 0} */ template DEAL_II_CXX20_REQUIRES(dim >= 0) @@ -668,6 +670,8 @@ inline DEAL_II_HOST_DEVICE * Output operator for points. Print the elements consecutively, with a space * in between. * @relatesalso Point + * + * @dealiiConceptRequires{dim >= 0} */ template DEAL_II_CXX20_REQUIRES(dim >= 0) @@ -686,6 +690,8 @@ operator<<(std::ostream &out, const Point &p) /** * Input operator for points. Inputs the elements consecutively. * @relatesalso Point + * + * @dealiiConceptRequires{dim >= 0} */ template DEAL_II_CXX20_REQUIRES(dim >= 0) diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index c5e41dbdc8..d4ae37a7a0 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -790,6 +790,8 @@ namespace Threads * @deprecated Use std::thread or std::jthread instead. * * @ingroup CPP11 + * + * @dealiiConceptRequires{(std::invocable)} */ template DEAL_II_CXX20_REQUIRES((std::invocable)) @@ -916,6 +918,9 @@ namespace Threads { /** * Set the value of a std::promise object by evaluating the action. + * + * @dealiiConceptRequires{(std::invocable && + * std::convertible_to, RT>)} */ template DEAL_II_CXX20_REQUIRES( @@ -933,6 +938,8 @@ namespace Threads * for the case where the return type is `void`. Consequently, we * can't set a value. But we do evaluate the function object and * call `std::promise::set_value()` without argument. + * + * @dealiiConceptRequires{(std::invocable)} */ template DEAL_II_CXX20_REQUIRES((std::invocable)) @@ -1566,6 +1573,8 @@ namespace Threads * for more information. * * @ingroup CPP11 + * + * @dealiiConceptRequires{(std::invocable)} */ template DEAL_II_CXX20_REQUIRES((std::invocable)) diff --git a/include/deal.II/distributed/fully_distributed_tria.h b/include/deal.II/distributed/fully_distributed_tria.h index 87c93a3a83..c156eeabf7 100644 --- a/include/deal.II/distributed/fully_distributed_tria.h +++ b/include/deal.II/distributed/fully_distributed_tria.h @@ -105,6 +105,8 @@ namespace parallel * @note Currently only simple periodicity conditions (i.e. without offsets * and rotation matrices - see also the documentation of * GridTools::collect_periodic_faces()) are supported. + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) diff --git a/include/deal.II/distributed/shared_tria.h b/include/deal.II/distributed/shared_tria.h index 86897e3097..a08381b1e7 100644 --- a/include/deal.II/distributed/shared_tria.h +++ b/include/deal.II/distributed/shared_tria.h @@ -101,6 +101,8 @@ namespace parallel * mesh. * * @ingroup distributed + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) @@ -430,6 +432,8 @@ namespace parallel * Since the constructor of this class is deleted, no such objects * can actually be created as this would be pointless given that * MPI is not available. + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) diff --git a/include/deal.II/distributed/tria.h b/include/deal.II/distributed/tria.h index e23b2a9358..09cb4b760c 100644 --- a/include/deal.II/distributed/tria.h +++ b/include/deal.II/distributed/tria.h @@ -240,6 +240,8 @@ namespace parallel * * * @ingroup distributed + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) @@ -851,6 +853,8 @@ namespace parallel * Specialization of the general template for the 1d case. There is * currently no support for distributing 1d triangulations. Consequently, * all this class does is throw an exception. + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim<1, spacedim>)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<1, spacedim>)) @@ -992,6 +996,8 @@ namespace parallel * Since the constructor of this class is deleted, no such objects * can actually be created as this would be pointless given that * p4est is not available. + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) diff --git a/include/deal.II/distributed/tria_base.h b/include/deal.II/distributed/tria_base.h index d6575b8e4d..3377c2983e 100644 --- a/include/deal.II/distributed/tria_base.h +++ b/include/deal.II/distributed/tria_base.h @@ -428,6 +428,8 @@ namespace parallel * return false; * } * @endcode + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index e5d57108ae..1976168d1d 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -309,6 +309,8 @@ namespace parallel * parallel::distributed::SolutionTransfer for more information. * * @ingroup dofs + * + * @dealiiConceptRequires{(concepts::is_valid_dim_spacedim)} */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) diff --git a/include/deal.II/grid/filtered_iterator.h b/include/deal.II/grid/filtered_iterator.h index 8180f87289..ae8a65ae27 100644 --- a/include/deal.II/grid/filtered_iterator.h +++ b/include/deal.II/grid/filtered_iterator.h @@ -641,6 +641,8 @@ public: /** * Constructor. Set the iterator to the default state and use the given * predicate for filtering subsequent assignment and iteration. + * + * @dealiiConceptRequires{(std::predicate)} */ template DEAL_II_CXX20_REQUIRES((std::predicate)) @@ -662,6 +664,8 @@ public: * If the cell triangulation.begin_active() does not have a * subdomain_id equal to 13, then the iterator will automatically be * advanced to the first cell that has. + * + * @dealiiConceptRequires{(std::predicate)} */ template DEAL_II_CXX20_REQUIRES((std::predicate)) @@ -893,6 +897,8 @@ private: * automatically here. * * @relatesalso FilteredIterator + * + * @dealiiConceptRequires{(std::predicate)} */ template DEAL_II_CXX20_REQUIRES((std::predicate)) @@ -984,6 +990,8 @@ namespace internal * * @relatesalso FilteredIterator * @ingroup CPP11 + * + * @dealiiConceptRequires{(std::predicate)} */ template DEAL_II_CXX20_REQUIRES((std::predicate)) @@ -1053,6 +1061,8 @@ inline IteratorRange> filter_iterators( * * @relatesalso FilteredIterator * @ingroup CPP11 + * + * @dealiiConceptRequires{(std::predicate)} */ template DEAL_II_CXX20_REQUIRES((std::predicate)) @@ -1127,6 +1137,8 @@ IteratorRange< * * @relatesalso FilteredIterator * @ingroup CPP11 + * + * @dealiiConceptRequires{(std::predicate)} */ template DEAL_II_CXX20_REQUIRES((std::predicate)) diff --git a/include/deal.II/grid/grid_generator.h b/include/deal.II/grid/grid_generator.h index f209623e9f..2fbad0d5a9 100644 --- a/include/deal.II/grid/grid_generator.h +++ b/include/deal.II/grid/grid_generator.h @@ -2657,6 +2657,9 @@ namespace GridGenerator * dimensions no manifold objects are copied by this function: you must * attach new manifold objects to @p surface_mesh. * + * + * @dealiiConceptRequires{ + * concepts::is_triangulation_or_dof_handler>} */ template