From f864d42e3f061f315eb3d6238809f251b2cbc40c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 15 Mar 2023 12:06:11 -0400 Subject: [PATCH] Fix concepts support for clang++ (and Tpetra) --- include/deal.II/base/point.h | 105 +++-- include/deal.II/dofs/dof_handler.h | 78 ++-- include/deal.II/grid/tria.h | 42 +- include/deal.II/grid/tria_accessor.h | 3 +- source/dofs/dof_handler.cc | 207 +++++---- source/grid/tria.cc | 654 +++++++++++++++------------ 6 files changed, 610 insertions(+), 479 deletions(-) diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index 6787d0dbb4..ed984aaa93 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -344,23 +344,24 @@ public: // At least clang-3.7 requires us to have a user-defined constructor // and we can't use 'Point::Point () = default' here. template -inline DEAL_II_HOST_DEVICE -Point::Point() // NOLINT +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point::Point() // NOLINT {} template -inline DEAL_II_HOST_DEVICE -Point::Point(const Tensor<1, dim, Number> &t) +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point::Point( + const Tensor<1, dim, Number> &t) : Tensor<1, dim, Number>(t) {} template -inline DEAL_II_HOST_DEVICE -Point::Point(const Number x) +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point::Point(const Number x) { Assert(dim == 1, ExcMessage( @@ -385,8 +386,9 @@ Point::Point(const Number x) template -inline DEAL_II_HOST_DEVICE -Point::Point(const Number x, const Number y) +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point::Point(const Number x, + const Number y) { Assert(dim == 2, ExcMessage( @@ -406,8 +408,10 @@ Point::Point(const Number x, const Number y) template -inline DEAL_II_HOST_DEVICE -Point::Point(const Number x, const Number y, const Number z) +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point::Point(const Number x, + const Number y, + const Number z) { Assert(dim == 3, ExcMessage( @@ -429,6 +433,7 @@ Point::Point(const Number x, const Number y, const Number z) template +DEAL_II_CXX20_REQUIRES(dim >= 0) template > inline Point::Point( @@ -450,8 +455,9 @@ inline Point::Point( template -inline DEAL_II_HOST_DEVICE Point - Point::unit_vector(unsigned int i) +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point Point::unit_vector( + unsigned int i) { Point p; p[i] = 1.; @@ -460,8 +466,9 @@ inline DEAL_II_HOST_DEVICE Point template -inline DEAL_II_HOST_DEVICE Number -Point::operator()(const unsigned int index) const +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Number Point::operator()( + const unsigned int index) const { AssertIndexRange(static_cast(index), dim); return this->values[index]; @@ -470,8 +477,9 @@ Point::operator()(const unsigned int index) const template -inline DEAL_II_HOST_DEVICE Number & -Point::operator()(const unsigned int index) +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Number &Point::operator()( + const unsigned int index) { AssertIndexRange(static_cast(index), dim); return this->values[index]; @@ -480,9 +488,10 @@ Point::operator()(const unsigned int index) template +DEAL_II_CXX20_REQUIRES(dim >= 0) template -inline DEAL_II_ALWAYS_INLINE Point & -Point::operator=(const Tensor<1, dim, OtherNumber> &p) +inline DEAL_II_ALWAYS_INLINE Point &Point::operator=( + const Tensor<1, dim, OtherNumber> &p) { Tensor<1, dim, Number>::operator=(p); return *this; @@ -491,8 +500,9 @@ Point::operator=(const Tensor<1, dim, OtherNumber> &p) template -inline DEAL_II_HOST_DEVICE Point -Point::operator+(const Tensor<1, dim, Number> &p) const +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point Point::operator+( + const Tensor<1, dim, Number> &p) const { Point tmp = *this; tmp += p; @@ -502,8 +512,9 @@ Point::operator+(const Tensor<1, dim, Number> &p) const template -inline DEAL_II_HOST_DEVICE Tensor<1, dim, Number> -Point::operator-(const Point &p) const +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Tensor<1, dim, Number> Point::operator-( + const Point &p) const { return (Tensor<1, dim, Number>(*this) -= p); } @@ -511,8 +522,9 @@ Point::operator-(const Point &p) const template -inline DEAL_II_HOST_DEVICE Point -Point::operator-(const Tensor<1, dim, Number> &p) const +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point Point::operator-( + const Tensor<1, dim, Number> &p) const { Point tmp = *this; tmp -= p; @@ -522,8 +534,9 @@ Point::operator-(const Tensor<1, dim, Number> &p) const template -inline DEAL_II_HOST_DEVICE Point -Point::operator-() const +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Point Point::operator-() + const { Point result; for (unsigned int i = 0; i < dim; ++i) @@ -534,12 +547,12 @@ Point::operator-() const template +DEAL_II_CXX20_REQUIRES(dim >= 0) template -inline DEAL_II_HOST_DEVICE - Point::type>::type> - Point::operator*(const OtherNumber factor) const +inline DEAL_II_HOST_DEVICE Point< + dim, + typename ProductType::type>:: + type> Point::operator*(const OtherNumber factor) const { Point::type> tmp; for (unsigned int i = 0; i < dim; ++i) @@ -550,12 +563,12 @@ inline DEAL_II_HOST_DEVICE template +DEAL_II_CXX20_REQUIRES(dim >= 0) template -inline DEAL_II_HOST_DEVICE - Point::type>::type> - Point::operator/(const OtherNumber factor) const +inline DEAL_II_HOST_DEVICE Point< + dim, + typename ProductType::type>:: + type> Point::operator/(const OtherNumber factor) const { const Tensor<1, dim, Number> &base_object = *this; return Point< @@ -568,8 +581,9 @@ inline DEAL_II_HOST_DEVICE template -inline DEAL_II_HOST_DEVICE Number -Point::operator*(const Tensor<1, dim, Number> &p) const +DEAL_II_CXX20_REQUIRES(dim >= 0) +inline DEAL_II_HOST_DEVICE Number Point::operator*( + const Tensor<1, dim, Number> &p) const { Number res = Number(); for (unsigned int i = 0; i < dim; ++i) @@ -579,8 +593,9 @@ Point::operator*(const Tensor<1, dim, Number> &p) const template +DEAL_II_CXX20_REQUIRES(dim >= 0) inline DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type -Point::square() const + Point::square() const { return this->norm_square(); } @@ -588,8 +603,9 @@ Point::square() const template +DEAL_II_CXX20_REQUIRES(dim >= 0) inline DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type -Point::distance(const Point &p) const + Point::distance(const Point &p) const { return std::sqrt(distance_square(p)); } @@ -597,8 +613,9 @@ Point::distance(const Point &p) const template +DEAL_II_CXX20_REQUIRES(dim >= 0) inline DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type -Point::distance_square(const Point &p) const + Point::distance_square(const Point &p) const { Number sum = internal::NumberType::value(0.0); for (unsigned int i = 0; i < dim; ++i) @@ -613,9 +630,9 @@ Point::distance_square(const Point &p) const template +DEAL_II_CXX20_REQUIRES(dim >= 0) template -inline void -Point::serialize(Archive &ar, const unsigned int) +inline void Point::serialize(Archive &ar, const unsigned int) { // forward to serialization // function in the base class @@ -653,6 +670,7 @@ inline DEAL_II_HOST_DEVICE * @relatesalso Point */ template +DEAL_II_CXX20_REQUIRES(dim >= 0) inline std::ostream & operator<<(std::ostream &out, const Point &p) { @@ -670,6 +688,7 @@ operator<<(std::ostream &out, const Point &p) * @relatesalso Point */ template +DEAL_II_CXX20_REQUIRES(dim >= 0) inline std::istream & operator>>(std::istream &in, Point &p) { diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index 37b7d41f44..e5d57108ae 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1812,8 +1812,8 @@ namespace internal template -inline bool -DoFHandler::has_hp_capabilities() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline bool DoFHandler::has_hp_capabilities() const { return hp_capability_enabled; } @@ -1821,8 +1821,8 @@ DoFHandler::has_hp_capabilities() const template -inline bool -DoFHandler::has_level_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline bool DoFHandler::has_level_dofs() const { return mg_number_cache.size() > 0; } @@ -1830,8 +1830,8 @@ DoFHandler::has_level_dofs() const template -inline bool -DoFHandler::has_active_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline bool DoFHandler::has_active_dofs() const { return number_cache.n_global_dofs > 0; } @@ -1839,8 +1839,8 @@ DoFHandler::has_active_dofs() const template -inline types::global_dof_index -DoFHandler::n_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline types::global_dof_index DoFHandler::n_dofs() const { return number_cache.n_global_dofs; } @@ -1848,8 +1848,9 @@ DoFHandler::n_dofs() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) inline types::global_dof_index -DoFHandler::n_dofs(const unsigned int level) const + DoFHandler::n_dofs(const unsigned int level) const { Assert(has_level_dofs(), ExcMessage( @@ -1861,8 +1862,8 @@ DoFHandler::n_dofs(const unsigned int level) const template -types::global_dof_index -DoFHandler::n_locally_owned_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +types::global_dof_index DoFHandler::n_locally_owned_dofs() const { return number_cache.n_locally_owned_dofs; } @@ -1870,8 +1871,8 @@ DoFHandler::n_locally_owned_dofs() const template -const IndexSet & -DoFHandler::locally_owned_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const IndexSet &DoFHandler::locally_owned_dofs() const { return number_cache.locally_owned_dofs; } @@ -1879,8 +1880,9 @@ DoFHandler::locally_owned_dofs() const template -const IndexSet & -DoFHandler::locally_owned_mg_dofs(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const IndexSet &DoFHandler::locally_owned_mg_dofs( + const unsigned int level) const { Assert(level < this->get_triangulation().n_global_levels(), ExcMessage("The given level index exceeds the number of levels " @@ -1895,8 +1897,9 @@ DoFHandler::locally_owned_mg_dofs(const unsigned int level) const template -inline const FiniteElement & -DoFHandler::get_fe(const types::fe_index number) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline const FiniteElement &DoFHandler::get_fe( + const types::fe_index number) const { Assert(fe_collection.size() > 0, ExcMessage("No finite element collection is associated with " @@ -1907,8 +1910,9 @@ DoFHandler::get_fe(const types::fe_index number) const template -inline const hp::FECollection & -DoFHandler::get_fe_collection() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline const hp::FECollection + &DoFHandler::get_fe_collection() const { return fe_collection; } @@ -1916,8 +1920,9 @@ DoFHandler::get_fe_collection() const template -inline const Triangulation & -DoFHandler::get_triangulation() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline const Triangulation + &DoFHandler::get_triangulation() const { Assert(tria != nullptr, ExcMessage("This DoFHandler object has not been associated " @@ -1928,8 +1933,8 @@ DoFHandler::get_triangulation() const template -inline MPI_Comm -DoFHandler::get_communicator() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline MPI_Comm DoFHandler::get_communicator() const { Assert(tria != nullptr, ExcMessage("This DoFHandler object has not been associated " @@ -1940,8 +1945,8 @@ DoFHandler::get_communicator() const template -inline const BlockInfo & -DoFHandler::block_info() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline const BlockInfo &DoFHandler::block_info() const { Assert(this->hp_capability_enabled == false, ExcNotImplementedWithHP()); @@ -1951,9 +1956,9 @@ DoFHandler::block_info() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) template -types::global_dof_index -DoFHandler::n_boundary_dofs( +types::global_dof_index DoFHandler::n_boundary_dofs( const std::map *> &boundary_ids) const { @@ -1994,9 +1999,9 @@ namespace internal template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) template -void -DoFHandler::save(Archive &ar, const unsigned int) const +void DoFHandler::save(Archive &ar, const unsigned int) const { if (this->hp_capability_enabled) { @@ -2044,9 +2049,9 @@ DoFHandler::save(Archive &ar, const unsigned int) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) template -void -DoFHandler::load(Archive &ar, const unsigned int) +void DoFHandler::load(Archive &ar, const unsigned int) { if (this->hp_capability_enabled) { @@ -2126,11 +2131,12 @@ DoFHandler::load(Archive &ar, const unsigned int) template -inline types::global_dof_index & -DoFHandler::MGVertexDoFs::access_index( - const unsigned int level, - const unsigned int dof_number, - const unsigned int dofs_per_vertex) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline types::global_dof_index + &DoFHandler::MGVertexDoFs::access_index( + const unsigned int level, + const unsigned int dof_number, + const unsigned int dofs_per_vertex) { Assert((level >= coarsest_level) && (level <= finest_level), ExcInvalidLevel(level)); diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 1a7b8f6b1e..46162bb969 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -4342,8 +4342,9 @@ namespace internal template -inline bool -Triangulation::vertex_used(const unsigned int index) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline bool Triangulation::vertex_used( + const unsigned int index) const { AssertIndexRange(index, vertices_used.size()); return vertices_used[index]; @@ -4352,23 +4353,23 @@ Triangulation::vertex_used(const unsigned int index) const template -inline unsigned int -Triangulation::n_levels() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline unsigned int Triangulation::n_levels() const { return number_cache.n_levels; } template -inline unsigned int -Triangulation::n_global_levels() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline unsigned int Triangulation::n_global_levels() const { return number_cache.n_levels; } template -inline unsigned int -Triangulation::n_vertices() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline unsigned int Triangulation::n_vertices() const { return vertices.size(); } @@ -4376,17 +4377,18 @@ Triangulation::n_vertices() const template -inline const std::vector> & -Triangulation::get_vertices() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline const std::vector> + &Triangulation::get_vertices() const { return vertices; } template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) template -void -Triangulation::save(Archive &ar, const unsigned int) const +void Triangulation::save(Archive &ar, const unsigned int) const { // as discussed in the documentation, do not store the signals as // well as boundary and manifold description but everything else @@ -4423,9 +4425,9 @@ Triangulation::save(Archive &ar, const unsigned int) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) template -void -Triangulation::load(Archive &ar, const unsigned int) +void Triangulation::load(Archive &ar, const unsigned int) { // clear previous content. this also calls the respective signal clear(); @@ -4496,9 +4498,10 @@ Triangulation::load(Archive &ar, const unsigned int) template -inline unsigned int -Triangulation::coarse_cell_id_to_coarse_cell_index( - const types::coarse_cell_id coarse_cell_id) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +inline unsigned int Triangulation:: + coarse_cell_id_to_coarse_cell_index( + const types::coarse_cell_id coarse_cell_id) const { return coarse_cell_id; } @@ -4506,9 +4509,10 @@ Triangulation::coarse_cell_id_to_coarse_cell_index( template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) inline types::coarse_cell_id -Triangulation::coarse_cell_index_to_coarse_cell_id( - const unsigned int coarse_cell_index) const + Triangulation::coarse_cell_index_to_coarse_cell_id( + const unsigned int coarse_cell_index) const { return coarse_cell_index; } diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index ee950f0719..298fb52f02 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -4172,8 +4172,7 @@ private: friend class Triangulation; - template - friend class parallel::TriangulationBase; + friend class parallel::TriangulationBase; friend struct dealii::internal::TriangulationImplementation::Implementation; friend struct dealii::internal::TriangulationImplementation:: diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 9acebdf600..62fc1523ea 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -43,6 +43,7 @@ DEAL_II_NAMESPACE_OPEN template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) const types::fe_index DoFHandler::default_fe_index; @@ -1711,6 +1712,7 @@ namespace internal template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) DoFHandler::DoFHandler() : hp_capability_enabled(true) , tria(nullptr, typeid(*this).name()) @@ -1720,6 +1722,7 @@ DoFHandler::DoFHandler() template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) DoFHandler::DoFHandler(const Triangulation &tria) : DoFHandler() { @@ -1729,6 +1732,7 @@ DoFHandler::DoFHandler(const Triangulation &tria) template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) DoFHandler::~DoFHandler() { // unsubscribe all attachments to signals of the underlying triangulation @@ -1755,8 +1759,8 @@ DoFHandler::~DoFHandler() template -void -DoFHandler::reinit(const Triangulation &tria) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::reinit(const Triangulation &tria) { // // call destructor @@ -1795,8 +1799,9 @@ DoFHandler::reinit(const Triangulation &tria) /*------------------------ Cell iterator functions ------------------------*/ template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::cell_iterator -DoFHandler::begin(const unsigned int level) const + DoFHandler::begin(const unsigned int level) const { typename Triangulation::cell_iterator cell = this->get_triangulation().begin(level); @@ -1808,8 +1813,9 @@ DoFHandler::begin(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::active_cell_iterator -DoFHandler::begin_active(const unsigned int level) const + DoFHandler::begin_active(const unsigned int level) const { // level is checked in begin cell_iterator i = begin(level); @@ -1824,8 +1830,9 @@ DoFHandler::begin_active(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::cell_iterator -DoFHandler::end() const + DoFHandler::end() const { return cell_iterator(&this->get_triangulation(), -1, -1, this); } @@ -1833,8 +1840,9 @@ DoFHandler::end() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::cell_iterator -DoFHandler::end(const unsigned int level) const + DoFHandler::end(const unsigned int level) const { typename Triangulation::cell_iterator cell = this->get_triangulation().end(level); @@ -1846,8 +1854,9 @@ DoFHandler::end(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::active_cell_iterator -DoFHandler::end_active(const unsigned int level) const + DoFHandler::end_active(const unsigned int level) const { typename Triangulation::cell_iterator cell = this->get_triangulation().end_active(level); @@ -1859,8 +1868,9 @@ DoFHandler::end_active(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::level_cell_iterator -DoFHandler::begin_mg(const unsigned int level) const + DoFHandler::begin_mg(const unsigned int level) const { Assert(this->has_level_dofs(), ExcMessage("You can only iterate over mg " @@ -1875,8 +1885,9 @@ DoFHandler::begin_mg(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::level_cell_iterator -DoFHandler::end_mg(const unsigned int level) const + DoFHandler::end_mg(const unsigned int level) const { Assert(this->has_level_dofs(), ExcMessage("You can only iterate over mg " @@ -1891,8 +1902,9 @@ DoFHandler::end_mg(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename DoFHandler::level_cell_iterator -DoFHandler::end_mg() const + DoFHandler::end_mg() const { return level_cell_iterator(&this->get_triangulation(), -1, -1, this); } @@ -1900,8 +1912,10 @@ DoFHandler::end_mg() const template -IteratorRange::cell_iterator> -DoFHandler::cell_iterators() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange::cell_iterator> DoFHandler< + dim, + spacedim>::cell_iterators() const { return IteratorRange::cell_iterator>( begin(), end()); @@ -1910,8 +1924,10 @@ DoFHandler::cell_iterators() const template -IteratorRange::active_cell_iterator> -DoFHandler::active_cell_iterators() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + active_cell_iterator> DoFHandler:: + active_cell_iterators() const { return IteratorRange< typename DoFHandler::active_cell_iterator>(begin_active(), @@ -1921,8 +1937,10 @@ DoFHandler::active_cell_iterators() const template -IteratorRange::level_cell_iterator> -DoFHandler::mg_cell_iterators() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange< + typename DoFHandler:: + level_cell_iterator> DoFHandler::mg_cell_iterators() const { return IteratorRange::level_cell_iterator>( begin_mg(), end_mg()); @@ -1931,9 +1949,10 @@ DoFHandler::mg_cell_iterators() const template -IteratorRange::cell_iterator> -DoFHandler::cell_iterators_on_level( - const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange::cell_iterator> DoFHandler< + dim, + spacedim>::cell_iterators_on_level(const unsigned int level) const { return IteratorRange::cell_iterator>( begin(level), end(level)); @@ -1942,9 +1961,10 @@ DoFHandler::cell_iterators_on_level( template -IteratorRange::active_cell_iterator> -DoFHandler::active_cell_iterators_on_level( - const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + active_cell_iterator> DoFHandler:: + active_cell_iterators_on_level(const unsigned int level) const { return IteratorRange< typename DoFHandler::active_cell_iterator>( @@ -1954,9 +1974,10 @@ DoFHandler::active_cell_iterators_on_level( template -IteratorRange::level_cell_iterator> -DoFHandler::mg_cell_iterators_on_level( - const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + level_cell_iterator> DoFHandler:: + mg_cell_iterators_on_level(const unsigned int level) const { return IteratorRange::level_cell_iterator>( begin_mg(level), end_mg(level)); @@ -1969,8 +1990,8 @@ DoFHandler::mg_cell_iterators_on_level( template -types::global_dof_index -DoFHandler::n_boundary_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +types::global_dof_index DoFHandler::n_boundary_dofs() const { Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled == false, ExcNotImplementedWithHP()); @@ -2018,8 +2039,8 @@ DoFHandler::n_boundary_dofs() const template -types::global_dof_index -DoFHandler::n_boundary_dofs( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +types::global_dof_index DoFHandler::n_boundary_dofs( const std::set &boundary_ids) const { Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled == false, @@ -2070,8 +2091,8 @@ DoFHandler::n_boundary_dofs( template -std::size_t -DoFHandler::memory_consumption() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +std::size_t DoFHandler::memory_consumption() const { std::size_t mem = MemoryConsumption::memory_consumption(this->tria) + MemoryConsumption::memory_consumption(this->fe_collection) + @@ -2114,8 +2135,8 @@ DoFHandler::memory_consumption() const template -void -DoFHandler::distribute_dofs( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::distribute_dofs( const FiniteElement &fe) { this->distribute_dofs(hp::FECollection(fe)); @@ -2124,8 +2145,8 @@ DoFHandler::distribute_dofs( template -void -DoFHandler::distribute_dofs( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::distribute_dofs( const hp::FECollection &ff) { Assert( @@ -2255,8 +2276,8 @@ DoFHandler::distribute_dofs( template -void -DoFHandler::distribute_mg_dofs() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::distribute_mg_dofs() { AssertThrow(hp_capability_enabled == false, ExcNotImplementedWithHP()); @@ -2287,8 +2308,8 @@ DoFHandler::distribute_mg_dofs() template -void -DoFHandler::initialize_local_block_info() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::initialize_local_block_info() { AssertThrow(hp_capability_enabled == false, ExcNotImplementedWithHP()); @@ -2298,8 +2319,8 @@ DoFHandler::initialize_local_block_info() template -void -DoFHandler::setup_policy() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::setup_policy() { // decide whether we need a sequential or a parallel distributed policy if (dynamic_cast @@ -2321,8 +2342,8 @@ DoFHandler::setup_policy() template -void -DoFHandler::clear() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::clear() { // release memory this->clear_space(); @@ -2332,8 +2353,8 @@ DoFHandler::clear() template -void -DoFHandler::clear_space() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::clear_space() { object_dof_indices.clear(); @@ -2348,8 +2369,8 @@ DoFHandler::clear_space() template -void -DoFHandler::clear_mg_space() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::clear_mg_space() { this->mg_levels.clear(); this->mg_faces.reset(); @@ -2364,8 +2385,8 @@ DoFHandler::clear_mg_space() template -void -DoFHandler::renumber_dofs( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::renumber_dofs( const std::vector &new_numbers) { if (hp_capability_enabled) @@ -2476,8 +2497,8 @@ DoFHandler::renumber_dofs( template -void -DoFHandler::renumber_dofs( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::renumber_dofs( const unsigned int level, const std::vector &new_numbers) { @@ -2519,8 +2540,9 @@ DoFHandler::renumber_dofs( template -unsigned int -DoFHandler::max_couplings_between_boundary_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int DoFHandler::max_couplings_between_boundary_dofs() + const { Assert(this->fe_collection.size() > 0, ExcNoFESelected()); @@ -2553,8 +2575,8 @@ DoFHandler::max_couplings_between_boundary_dofs() const template -unsigned int -DoFHandler::max_couplings_between_dofs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int DoFHandler::max_couplings_between_dofs() const { Assert(this->fe_collection.size() > 0, ExcNoFESelected()); return internal::DoFHandlerImplementation::Implementation:: @@ -2564,8 +2586,8 @@ DoFHandler::max_couplings_between_dofs() const template -void -DoFHandler::set_active_fe_indices( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::set_active_fe_indices( const std::vector &active_fe_indices) { Assert(active_fe_indices.size() == this->get_triangulation().n_active_cells(), @@ -2585,8 +2607,8 @@ DoFHandler::set_active_fe_indices( template -void -DoFHandler::set_active_fe_indices( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::set_active_fe_indices( const std::vector &active_fe_indices) { set_active_fe_indices(std::vector(active_fe_indices.begin(), @@ -2596,8 +2618,9 @@ DoFHandler::set_active_fe_indices( template -std::vector -DoFHandler::get_active_fe_indices() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +std::vector DoFHandler::get_active_fe_indices() + const { std::vector active_fe_indices( this->get_triangulation().n_active_cells(), numbers::invalid_fe_index); @@ -2615,8 +2638,8 @@ DoFHandler::get_active_fe_indices() const template -void -DoFHandler::get_active_fe_indices( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::get_active_fe_indices( std::vector &active_fe_indices) const { const std::vector indices = get_active_fe_indices(); @@ -2627,8 +2650,8 @@ DoFHandler::get_active_fe_indices( template -void -DoFHandler::set_future_fe_indices( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::set_future_fe_indices( const std::vector &future_fe_indices) { Assert(future_fe_indices.size() == this->get_triangulation().n_active_cells(), @@ -2650,8 +2673,9 @@ DoFHandler::set_future_fe_indices( template -std::vector -DoFHandler::get_future_fe_indices() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +std::vector DoFHandler::get_future_fe_indices() + const { std::vector future_fe_indices( this->get_triangulation().n_active_cells(), numbers::invalid_fe_index); @@ -2669,8 +2693,8 @@ DoFHandler::get_future_fe_indices() const template -void -DoFHandler::connect_to_triangulation_signals() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::connect_to_triangulation_signals() { // make sure this is called during initialization in hp-mode Assert(hp_capability_enabled, ExcOnlyAvailableWithHP()); @@ -2761,8 +2785,8 @@ DoFHandler::connect_to_triangulation_signals() template -void -DoFHandler::create_active_fe_table() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::create_active_fe_table() { AssertThrow(hp_capability_enabled == true, ExcOnlyAvailableWithHP()); @@ -2812,8 +2836,8 @@ DoFHandler::create_active_fe_table() template -void -DoFHandler::update_active_fe_table() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::update_active_fe_table() { // // Normally only one level is added, but if this Triangulation // // is created by copy_triangulation, it can be more than one level. @@ -2850,8 +2874,8 @@ DoFHandler::update_active_fe_table() template -void -DoFHandler::pre_transfer_action() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::pre_transfer_action() { Assert(this->active_fe_index_transfer == nullptr, ExcInternalError()); @@ -2864,8 +2888,8 @@ DoFHandler::pre_transfer_action() template -void -DoFHandler::pre_distributed_transfer_action() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::pre_distributed_transfer_action() { #ifndef DEAL_II_WITH_P4EST Assert(false, @@ -2931,8 +2955,8 @@ DoFHandler::pre_distributed_transfer_action() template -void -DoFHandler::post_transfer_action() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::post_transfer_action() { update_active_fe_table(); @@ -2954,8 +2978,8 @@ DoFHandler::post_transfer_action() template -void -DoFHandler::post_distributed_transfer_action() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::post_distributed_transfer_action() { #ifndef DEAL_II_WITH_P4EST Assert(false, ExcInternalError()); @@ -2986,8 +3010,8 @@ DoFHandler::post_distributed_transfer_action() template -void -DoFHandler::prepare_for_serialization_of_active_fe_indices() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::prepare_for_serialization_of_active_fe_indices() { #ifndef DEAL_II_WITH_P4EST Assert(false, @@ -3044,8 +3068,8 @@ DoFHandler::prepare_for_serialization_of_active_fe_indices() template -void -DoFHandler::deserialize_active_fe_indices() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::deserialize_active_fe_indices() { #ifndef DEAL_II_WITH_P4EST Assert(false, @@ -3108,6 +3132,7 @@ DoFHandler::deserialize_active_fe_indices() template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) DoFHandler::MGVertexDoFs::MGVertexDoFs() : coarsest_level(numbers::invalid_unsigned_int) , finest_level(0) @@ -3116,8 +3141,8 @@ DoFHandler::MGVertexDoFs::MGVertexDoFs() template -void -DoFHandler::MGVertexDoFs::init( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void DoFHandler::MGVertexDoFs::init( const unsigned int cl, const unsigned int fl, const unsigned int dofs_per_vertex) @@ -3142,8 +3167,8 @@ DoFHandler::MGVertexDoFs::init( template -unsigned int -DoFHandler::MGVertexDoFs::get_coarsest_level() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int DoFHandler::MGVertexDoFs::get_coarsest_level() const { return coarsest_level; } @@ -3151,8 +3176,8 @@ DoFHandler::MGVertexDoFs::get_coarsest_level() const template -unsigned int -DoFHandler::MGVertexDoFs::get_finest_level() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int DoFHandler::MGVertexDoFs::get_finest_level() const { return finest_level; } diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 810c54783d..af6b308ec4 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -11099,11 +11099,13 @@ namespace internal template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) const unsigned int Triangulation::dimension; template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) Triangulation::Triangulation( const MeshSmoothing smooth_grid, const bool check_for_distorted_cells) @@ -11129,6 +11131,7 @@ Triangulation::Triangulation( template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) Triangulation::Triangulation( Triangulation &&tria) noexcept : Subscriptor(std::move(tria)) @@ -11155,8 +11158,8 @@ Triangulation::Triangulation( template -Triangulation & -Triangulation::operator=( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +Triangulation &Triangulation::operator=( Triangulation &&tria) noexcept { Subscriptor::operator=(std::move(tria)); @@ -11186,6 +11189,7 @@ Triangulation::operator=( template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) Triangulation::~Triangulation() { // notify listeners that the triangulation is going down... @@ -11214,8 +11218,8 @@ Triangulation::~Triangulation() template -void -Triangulation::clear() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::clear() { // notify listeners that the triangulation is going down... signals.clear(); @@ -11229,8 +11233,8 @@ Triangulation::clear() template -MPI_Comm -Triangulation::get_communicator() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +MPI_Comm Triangulation::get_communicator() const { return MPI_COMM_SELF; } @@ -11238,8 +11242,10 @@ Triangulation::get_communicator() const template -const std::weak_ptr -Triangulation::global_active_cell_index_partitioner() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const std::weak_ptr Triangulation< + dim, + spacedim>::global_active_cell_index_partitioner() const { return number_cache.active_cell_index_partitioner; } @@ -11247,9 +11253,10 @@ Triangulation::global_active_cell_index_partitioner() const template -const std::weak_ptr -Triangulation::global_level_cell_index_partitioner( - const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const std::weak_ptr Triangulation< + dim, + spacedim>::global_level_cell_index_partitioner(const unsigned int level) const { AssertIndexRange(level, this->n_levels()); @@ -11259,8 +11266,8 @@ Triangulation::global_level_cell_index_partitioner( template -void -Triangulation::set_mesh_smoothing( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::set_mesh_smoothing( const MeshSmoothing mesh_smoothing) { Assert(n_levels() == 0, @@ -11271,8 +11278,9 @@ Triangulation::set_mesh_smoothing( template -const typename Triangulation::MeshSmoothing & -Triangulation::get_mesh_smoothing() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const typename Triangulation::MeshSmoothing + &Triangulation::get_mesh_smoothing() const { return smooth_grid; } @@ -11280,8 +11288,8 @@ Triangulation::get_mesh_smoothing() const template -void -Triangulation::set_manifold( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::set_manifold( const types::manifold_id m_number, const Manifold &manifold_object) { @@ -11293,8 +11301,9 @@ Triangulation::set_manifold( template -void -Triangulation::reset_manifold(const types::manifold_id m_number) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::reset_manifold( + const types::manifold_id m_number) { AssertIndexRange(m_number, numbers::flat_manifold_id); @@ -11304,16 +11313,16 @@ Triangulation::reset_manifold(const types::manifold_id m_number) template -void -Triangulation::reset_all_manifolds() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::reset_all_manifolds() { manifolds.clear(); } template -void -Triangulation::set_all_manifold_ids( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::set_all_manifold_ids( const types::manifold_id m_number) { Assert( @@ -11327,8 +11336,8 @@ Triangulation::set_all_manifold_ids( template -void -Triangulation::set_all_manifold_ids_on_boundary( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::set_all_manifold_ids_on_boundary( const types::manifold_id m_number) { Assert( @@ -11344,8 +11353,8 @@ Triangulation::set_all_manifold_ids_on_boundary( template -void -Triangulation::set_all_manifold_ids_on_boundary( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::set_all_manifold_ids_on_boundary( const types::boundary_id b_id, const types::manifold_id m_number) { @@ -11385,8 +11394,8 @@ Triangulation::set_all_manifold_ids_on_boundary( template -const Manifold & -Triangulation::get_manifold( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const Manifold &Triangulation::get_manifold( const types::manifold_id m_number) const { // look, if there is a manifold stored at @@ -11408,8 +11417,9 @@ Triangulation::get_manifold( template -std::vector -Triangulation::get_boundary_ids() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +std::vector Triangulation::get_boundary_ids() + const { // in 1d, we store a map of all used boundary indicators. use it for // our purposes @@ -11440,8 +11450,9 @@ Triangulation::get_boundary_ids() const template -std::vector -Triangulation::get_manifold_ids() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +std::vector Triangulation::get_manifold_ids() + const { std::set m_ids; for (const auto &cell : active_cell_iterators()) @@ -11468,8 +11479,8 @@ Triangulation::get_manifold_ids() const template -void -Triangulation::copy_triangulation( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::copy_triangulation( const Triangulation &other_tria) { Assert((vertices.size() == 0) && (levels.size() == 0) && (faces == nullptr), @@ -11534,8 +11545,8 @@ Triangulation::copy_triangulation( template -void -Triangulation::create_triangulation_compatibility( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::create_triangulation_compatibility( const std::vector> &v, const std::vector> & cells, const SubCellData & subcelldata) @@ -11553,8 +11564,8 @@ Triangulation::create_triangulation_compatibility( template -void -Triangulation::reset_policy() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::reset_policy() { this->update_reference_cells(); @@ -11579,8 +11590,8 @@ Triangulation::reset_policy() template -void -Triangulation::create_triangulation( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::create_triangulation( const std::vector> &v, const std::vector> & cells, const SubCellData & subcelldata) @@ -11764,8 +11775,8 @@ Triangulation::create_triangulation( template -void -Triangulation::create_triangulation( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::create_triangulation( const TriangulationDescription::Description &construction_data) { // 1) create coarse grid @@ -11891,8 +11902,8 @@ Triangulation::create_triangulation( template -void -Triangulation::flip_all_direction_flags() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::flip_all_direction_flags() { AssertThrow(dim + 1 == spacedim, ExcMessage("Only works for dim == spacedim-1")); @@ -11903,8 +11914,8 @@ Triangulation::flip_all_direction_flags() template -void -Triangulation::set_all_refine_flags() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::set_all_refine_flags() { Assert(n_cells() > 0, ExcMessage("Error: An empty Triangulation can not be refined.")); @@ -11919,8 +11930,8 @@ Triangulation::set_all_refine_flags() template -void -Triangulation::refine_global(const unsigned int times) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::refine_global(const unsigned int times) { for (unsigned int i = 0; i < times; ++i) { @@ -11932,8 +11943,8 @@ Triangulation::refine_global(const unsigned int times) template -void -Triangulation::coarsen_global(const unsigned int times) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::coarsen_global(const unsigned int times) { for (unsigned int i = 0; i < times; ++i) { @@ -11952,8 +11963,8 @@ Triangulation::coarsen_global(const unsigned int times) template -void -Triangulation::save_refine_flags(std::vector &v) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_refine_flags(std::vector &v) const { v.resize(dim * n_active_cells(), false); std::vector::iterator i = v.begin(); @@ -11969,8 +11980,8 @@ Triangulation::save_refine_flags(std::vector &v) const template -void -Triangulation::save_refine_flags(std::ostream &out) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_refine_flags(std::ostream &out) const { std::vector v; save_refine_flags(v); @@ -11983,8 +11994,8 @@ Triangulation::save_refine_flags(std::ostream &out) const template -void -Triangulation::load_refine_flags(std::istream &in) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_refine_flags(std::istream &in) { std::vector v; read_bool_vector(mn_tria_refine_flags_begin, v, mn_tria_refine_flags_end, in); @@ -11994,8 +12005,8 @@ Triangulation::load_refine_flags(std::istream &in) template -void -Triangulation::load_refine_flags(const std::vector &v) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_refine_flags(const std::vector &v) { AssertThrow(v.size() == dim * n_active_cells(), ExcGridReadError()); @@ -12021,8 +12032,9 @@ Triangulation::load_refine_flags(const std::vector &v) template -void -Triangulation::save_coarsen_flags(std::vector &v) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_coarsen_flags( + std::vector &v) const { v.resize(n_active_cells(), false); std::vector::iterator i = v.begin(); @@ -12038,8 +12050,8 @@ Triangulation::save_coarsen_flags(std::vector &v) const template -void -Triangulation::save_coarsen_flags(std::ostream &out) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_coarsen_flags(std::ostream &out) const { std::vector v; save_coarsen_flags(v); @@ -12052,8 +12064,8 @@ Triangulation::save_coarsen_flags(std::ostream &out) const template -void -Triangulation::load_coarsen_flags(std::istream &in) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_coarsen_flags(std::istream &in) { std::vector v; read_bool_vector(mn_tria_coarsen_flags_begin, @@ -12066,8 +12078,9 @@ Triangulation::load_coarsen_flags(std::istream &in) template -void -Triangulation::load_coarsen_flags(const std::vector &v) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_coarsen_flags( + const std::vector &v) { Assert(v.size() == n_active_cells(), ExcGridReadError()); @@ -12086,8 +12099,8 @@ Triangulation::load_coarsen_flags(const std::vector &v) template -bool -Triangulation::get_anisotropic_refinement_flag() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +bool Triangulation::get_anisotropic_refinement_flag() const { return anisotropic_refinement; } @@ -12158,8 +12171,8 @@ namespace template -void -Triangulation::clear_user_data() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::clear_user_data() { // let functions in anonymous namespace do their work dealii::clear_user_data(levels); @@ -12197,8 +12210,8 @@ namespace template -void -Triangulation::clear_user_flags_line() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::clear_user_flags_line() { dealii::clear_user_flags_line(dim, levels, faces.get()); } @@ -12237,8 +12250,8 @@ namespace template -void -Triangulation::clear_user_flags_quad() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::clear_user_flags_quad() { dealii::clear_user_flags_quad(dim, levels, faces.get()); } @@ -12277,8 +12290,8 @@ namespace template -void -Triangulation::clear_user_flags_hex() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::clear_user_flags_hex() { dealii::clear_user_flags_hex(dim, levels, faces.get()); } @@ -12286,8 +12299,8 @@ Triangulation::clear_user_flags_hex() template -void -Triangulation::clear_user_flags() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::clear_user_flags() { clear_user_flags_line(); clear_user_flags_quad(); @@ -12297,8 +12310,8 @@ Triangulation::clear_user_flags() template -void -Triangulation::save_user_flags(std::ostream &out) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags(std::ostream &out) const { save_user_flags_line(out); @@ -12315,8 +12328,8 @@ Triangulation::save_user_flags(std::ostream &out) const template -void -Triangulation::save_user_flags(std::vector &v) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags(std::vector &v) const { // clear vector and append // all the stuff later on @@ -12346,8 +12359,8 @@ Triangulation::save_user_flags(std::vector &v) const template -void -Triangulation::load_user_flags(std::istream &in) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags(std::istream &in) { load_user_flags_line(in); @@ -12364,8 +12377,8 @@ Triangulation::load_user_flags(std::istream &in) template -void -Triangulation::load_user_flags(const std::vector &v) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags(const std::vector &v) { Assert(v.size() == n_lines() + n_quads() + n_hexs(), ExcInternalError()); std::vector tmp; @@ -12401,8 +12414,9 @@ Triangulation::load_user_flags(const std::vector &v) template -void -Triangulation::save_user_flags_line(std::vector &v) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags_line( + std::vector &v) const { v.resize(n_lines(), false); std::vector::iterator i = v.begin(); @@ -12416,8 +12430,8 @@ Triangulation::save_user_flags_line(std::vector &v) const template -void -Triangulation::save_user_flags_line(std::ostream &out) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags_line(std::ostream &out) const { std::vector v; save_user_flags_line(v); @@ -12430,8 +12444,8 @@ Triangulation::save_user_flags_line(std::ostream &out) const template -void -Triangulation::load_user_flags_line(std::istream &in) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags_line(std::istream &in) { std::vector v; read_bool_vector(mn_tria_line_user_flags_begin, @@ -12444,8 +12458,9 @@ Triangulation::load_user_flags_line(std::istream &in) template -void -Triangulation::load_user_flags_line(const std::vector &v) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags_line( + const std::vector &v) { Assert(v.size() == n_lines(), ExcGridReadError()); @@ -12520,8 +12535,9 @@ namespace template -void -Triangulation::save_user_flags_quad(std::vector &v) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags_quad( + std::vector &v) const { v.resize(n_quads(), false); @@ -12539,8 +12555,8 @@ Triangulation::save_user_flags_quad(std::vector &v) const template -void -Triangulation::save_user_flags_quad(std::ostream &out) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags_quad(std::ostream &out) const { std::vector v; save_user_flags_quad(v); @@ -12553,8 +12569,8 @@ Triangulation::save_user_flags_quad(std::ostream &out) const template -void -Triangulation::load_user_flags_quad(std::istream &in) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags_quad(std::istream &in) { std::vector v; read_bool_vector(mn_tria_quad_user_flags_begin, @@ -12567,8 +12583,9 @@ Triangulation::load_user_flags_quad(std::istream &in) template -void -Triangulation::load_user_flags_quad(const std::vector &v) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags_quad( + const std::vector &v) { Assert(v.size() == n_quads(), ExcGridReadError()); @@ -12589,8 +12606,9 @@ Triangulation::load_user_flags_quad(const std::vector &v) template -void -Triangulation::save_user_flags_hex(std::vector &v) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags_hex( + std::vector &v) const { v.resize(n_hexs(), false); @@ -12608,8 +12626,8 @@ Triangulation::save_user_flags_hex(std::vector &v) const template -void -Triangulation::save_user_flags_hex(std::ostream &out) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_flags_hex(std::ostream &out) const { std::vector v; save_user_flags_hex(v); @@ -12622,8 +12640,8 @@ Triangulation::save_user_flags_hex(std::ostream &out) const template -void -Triangulation::load_user_flags_hex(std::istream &in) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags_hex(std::istream &in) { std::vector v; read_bool_vector(mn_tria_hex_user_flags_begin, @@ -12636,8 +12654,9 @@ Triangulation::load_user_flags_hex(std::istream &in) template -void -Triangulation::load_user_flags_hex(const std::vector &v) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_flags_hex( + const std::vector &v) { Assert(v.size() == n_hexs(), ExcGridReadError()); @@ -12658,8 +12677,8 @@ Triangulation::load_user_flags_hex(const std::vector &v) template -void -Triangulation::save_user_indices( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_indices( std::vector &v) const { // clear vector and append all the @@ -12690,8 +12709,8 @@ Triangulation::save_user_indices( template -void -Triangulation::load_user_indices( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_indices( const std::vector &v) { Assert(v.size() == n_lines() + n_quads() + n_hexs(), ExcInternalError()); @@ -12770,8 +12789,8 @@ namespace template -void -Triangulation::save_user_indices_line( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_indices_line( std::vector &v) const { v.resize(n_lines(), 0); @@ -12784,8 +12803,8 @@ Triangulation::save_user_indices_line( template -void -Triangulation::load_user_indices_line( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_indices_line( const std::vector &v) { Assert(v.size() == n_lines(), ExcGridReadError()); @@ -12798,8 +12817,8 @@ Triangulation::load_user_indices_line( template -void -Triangulation::save_user_indices_quad( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_indices_quad( std::vector &v) const { v.resize(n_quads(), 0); @@ -12816,8 +12835,8 @@ Triangulation::save_user_indices_quad( template -void -Triangulation::load_user_indices_quad( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_indices_quad( const std::vector &v) { Assert(v.size() == n_quads(), ExcGridReadError()); @@ -12833,8 +12852,8 @@ Triangulation::load_user_indices_quad( template -void -Triangulation::save_user_indices_hex( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_indices_hex( std::vector &v) const { v.resize(n_hexs(), 0); @@ -12851,8 +12870,8 @@ Triangulation::save_user_indices_hex( template -void -Triangulation::load_user_indices_hex( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_indices_hex( const std::vector &v) { Assert(v.size() == n_hexs(), ExcGridReadError()); @@ -12914,8 +12933,9 @@ namespace template -void -Triangulation::save_user_pointers(std::vector &v) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_pointers( + std::vector &v) const { // clear vector and append all the // stuff later on @@ -12945,8 +12965,9 @@ Triangulation::save_user_pointers(std::vector &v) const template -void -Triangulation::load_user_pointers(const std::vector &v) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_pointers( + const std::vector &v) { Assert(v.size() == n_lines() + n_quads() + n_hexs(), ExcInternalError()); std::vector tmp; @@ -12982,8 +13003,8 @@ Triangulation::load_user_pointers(const std::vector &v) template -void -Triangulation::save_user_pointers_line( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_pointers_line( std::vector &v) const { v.resize(n_lines(), nullptr); @@ -12996,8 +13017,8 @@ Triangulation::save_user_pointers_line( template -void -Triangulation::load_user_pointers_line( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_pointers_line( const std::vector &v) { Assert(v.size() == n_lines(), ExcGridReadError()); @@ -13011,8 +13032,8 @@ Triangulation::load_user_pointers_line( template -void -Triangulation::save_user_pointers_quad( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_pointers_quad( std::vector &v) const { v.resize(n_quads(), nullptr); @@ -13029,8 +13050,8 @@ Triangulation::save_user_pointers_quad( template -void -Triangulation::load_user_pointers_quad( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_pointers_quad( const std::vector &v) { Assert(v.size() == n_quads(), ExcGridReadError()); @@ -13046,8 +13067,8 @@ Triangulation::load_user_pointers_quad( template -void -Triangulation::save_user_pointers_hex( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::save_user_pointers_hex( std::vector &v) const { v.resize(n_hexs(), nullptr); @@ -13064,8 +13085,8 @@ Triangulation::save_user_pointers_hex( template -void -Triangulation::load_user_pointers_hex( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::load_user_pointers_hex( const std::vector &v) { Assert(v.size() == n_hexs(), ExcGridReadError()); @@ -13085,8 +13106,9 @@ Triangulation::load_user_pointers_hex( template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::raw_cell_iterator -Triangulation::begin_raw(const unsigned int level) const + Triangulation::begin_raw(const unsigned int level) const { switch (dim) { @@ -13105,8 +13127,9 @@ Triangulation::begin_raw(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::cell_iterator -Triangulation::begin(const unsigned int level) const + Triangulation::begin(const unsigned int level) const { switch (dim) { @@ -13125,8 +13148,9 @@ Triangulation::begin(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_cell_iterator -Triangulation::begin_active(const unsigned int level) const + Triangulation::begin_active(const unsigned int level) const { switch (dim) { @@ -13145,8 +13169,9 @@ Triangulation::begin_active(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::cell_iterator -Triangulation::last() const + Triangulation::last() const { const unsigned int level = levels.size() - 1; if (levels[level]->cells.n_objects() == 0) @@ -13170,8 +13195,9 @@ Triangulation::last() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_cell_iterator -Triangulation::last_active() const + Triangulation::last_active() const { // get the last used cell cell_iterator cell = last(); @@ -13191,8 +13217,10 @@ Triangulation::last_active() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::cell_iterator -Triangulation::create_cell_iterator(const CellId &cell_id) const + Triangulation::create_cell_iterator( + const CellId &cell_id) const { cell_iterator cell( this, 0, coarse_cell_id_to_coarse_cell_index(cell_id.get_coarse_cell_id())); @@ -13216,8 +13244,9 @@ Triangulation::create_cell_iterator(const CellId &cell_id) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::cell_iterator -Triangulation::end() const + Triangulation::end() const { return cell_iterator(const_cast *>(this), -1, @@ -13227,8 +13256,9 @@ Triangulation::end() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::raw_cell_iterator -Triangulation::end_raw(const unsigned int level) const + Triangulation::end_raw(const unsigned int level) const { // This function may be called on parallel triangulations on levels // that exist globally, but not on the local portion of the @@ -13256,8 +13286,9 @@ Triangulation::end_raw(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::cell_iterator -Triangulation::end(const unsigned int level) const + Triangulation::end(const unsigned int level) const { // This function may be called on parallel triangulations on levels // that exist globally, but not on the local portion of the @@ -13285,8 +13316,9 @@ Triangulation::end(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_cell_iterator -Triangulation::end_active(const unsigned int level) const + Triangulation::end_active(const unsigned int level) const { // This function may be called on parallel triangulations on levels // that exist globally, but not on the local portion of the @@ -13313,8 +13345,10 @@ Triangulation::end_active(const unsigned int level) const template -IteratorRange::cell_iterator> -Triangulation::cell_iterators() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + cell_iterator> Triangulation::cell_iterators() + const { return IteratorRange::cell_iterator>( begin(), end()); @@ -13322,8 +13356,10 @@ Triangulation::cell_iterators() const template -IteratorRange::active_cell_iterator> -Triangulation::active_cell_iterators() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + active_cell_iterator> Triangulation:: + active_cell_iterators() const { return IteratorRange< typename Triangulation::active_cell_iterator>(begin_active(), @@ -13333,9 +13369,10 @@ Triangulation::active_cell_iterators() const template -IteratorRange::cell_iterator> -Triangulation::cell_iterators_on_level( - const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + cell_iterator> Triangulation:: + cell_iterators_on_level(const unsigned int level) const { return IteratorRange::cell_iterator>( begin(level), end(level)); @@ -13344,9 +13381,10 @@ Triangulation::cell_iterators_on_level( template -IteratorRange::active_cell_iterator> -Triangulation::active_cell_iterators_on_level( - const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + active_cell_iterator> Triangulation:: + active_cell_iterators_on_level(const unsigned int level) const { return IteratorRange< typename Triangulation::active_cell_iterator>( @@ -13358,8 +13396,9 @@ Triangulation::active_cell_iterators_on_level( template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::face_iterator -Triangulation::begin_face() const + Triangulation::begin_face() const { switch (dim) { @@ -13379,8 +13418,9 @@ Triangulation::begin_face() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_face_iterator -Triangulation::begin_active_face() const + Triangulation::begin_active_face() const { switch (dim) { @@ -13400,8 +13440,9 @@ Triangulation::begin_active_face() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::face_iterator -Triangulation::end_face() const + Triangulation::end_face() const { switch (dim) { @@ -13421,8 +13462,10 @@ Triangulation::end_face() const template -IteratorRange::active_face_iterator> -Triangulation::active_face_iterators() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +IteratorRange:: + active_face_iterator> Triangulation:: + active_face_iterators() const { return IteratorRange< typename Triangulation::active_face_iterator>( @@ -13433,8 +13476,9 @@ Triangulation::active_face_iterators() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::vertex_iterator -Triangulation::begin_vertex() const + Triangulation::begin_vertex() const { vertex_iterator i = raw_vertex_iterator(const_cast *>(this), 0, 0); @@ -13450,8 +13494,9 @@ Triangulation::begin_vertex() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_vertex_iterator -Triangulation::begin_active_vertex() const + Triangulation::begin_active_vertex() const { // every vertex is active return begin_vertex(); @@ -13460,8 +13505,9 @@ Triangulation::begin_active_vertex() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::vertex_iterator -Triangulation::end_vertex() const + Triangulation::end_vertex() const { return raw_vertex_iterator(const_cast *>(this), -1, @@ -13475,8 +13521,9 @@ Triangulation::end_vertex() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::raw_line_iterator -Triangulation::begin_raw_line(const unsigned int level) const + Triangulation::begin_raw_line(const unsigned int level) const { // This function may be called on parallel triangulations on levels // that exist globally, but not on the local portion of the @@ -13515,8 +13562,9 @@ Triangulation::begin_raw_line(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::line_iterator -Triangulation::begin_line(const unsigned int level) const + Triangulation::begin_line(const unsigned int level) const { // level is checked in begin_raw raw_line_iterator ri = begin_raw_line(level); @@ -13531,8 +13579,10 @@ Triangulation::begin_line(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_line_iterator -Triangulation::begin_active_line(const unsigned int level) const + Triangulation::begin_active_line( + const unsigned int level) const { // level is checked in begin_raw line_iterator i = begin_line(level); @@ -13547,8 +13597,9 @@ Triangulation::begin_active_line(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::line_iterator -Triangulation::end_line() const + Triangulation::end_line() const { return raw_line_iterator(const_cast *>(this), -1, @@ -13561,8 +13612,9 @@ Triangulation::end_line() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::raw_quad_iterator -Triangulation::begin_raw_quad(const unsigned int level) const + Triangulation::begin_raw_quad(const unsigned int level) const { // This function may be called on parallel triangulations on levels // that exist globally, but not on the local portion of the @@ -13615,8 +13667,9 @@ Triangulation::begin_raw_quad(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::quad_iterator -Triangulation::begin_quad(const unsigned int level) const + Triangulation::begin_quad(const unsigned int level) const { // level is checked in begin_raw raw_quad_iterator ri = begin_raw_quad(level); @@ -13631,8 +13684,10 @@ Triangulation::begin_quad(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_quad_iterator -Triangulation::begin_active_quad(const unsigned int level) const + Triangulation::begin_active_quad( + const unsigned int level) const { // level is checked in begin_raw quad_iterator i = begin_quad(level); @@ -13647,8 +13702,9 @@ Triangulation::begin_active_quad(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::quad_iterator -Triangulation::end_quad() const + Triangulation::end_quad() const { return raw_quad_iterator(const_cast *>(this), -1, @@ -13660,8 +13716,9 @@ Triangulation::end_quad() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::raw_hex_iterator -Triangulation::begin_raw_hex(const unsigned int level) const + Triangulation::begin_raw_hex(const unsigned int level) const { // This function may be called on parallel triangulations on levels // that exist globally, but not on the local portion of the @@ -13706,8 +13763,9 @@ Triangulation::begin_raw_hex(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::hex_iterator -Triangulation::begin_hex(const unsigned int level) const + Triangulation::begin_hex(const unsigned int level) const { // level is checked in begin_raw raw_hex_iterator ri = begin_raw_hex(level); @@ -13722,8 +13780,9 @@ Triangulation::begin_hex(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::active_hex_iterator -Triangulation::begin_active_hex(const unsigned int level) const + Triangulation::begin_active_hex(const unsigned int level) const { // level is checked in begin_raw hex_iterator i = begin_hex(level); @@ -13738,8 +13797,9 @@ Triangulation::begin_active_hex(const unsigned int level) const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::hex_iterator -Triangulation::end_hex() const + Triangulation::end_hex() const { return raw_hex_iterator(const_cast *>(this), -1, @@ -13804,37 +13864,39 @@ namespace internal template -unsigned int -Triangulation::n_cells() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_cells() const { return internal::TriangulationImplementation::n_cells(number_cache); } template -unsigned int -Triangulation::n_active_cells() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_cells() const { return internal::TriangulationImplementation::n_active_cells(number_cache); } template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) types::global_cell_index -Triangulation::n_global_active_cells() const + Triangulation::n_global_active_cells() const { return n_active_cells(); } template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) types::coarse_cell_id -Triangulation::n_global_coarse_cells() const + Triangulation::n_global_coarse_cells() const { return n_cells(0); } template -unsigned int -Triangulation::n_faces() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_faces() const { switch (dim) { @@ -13852,8 +13914,8 @@ Triangulation::n_faces() const template -unsigned int -Triangulation::n_raw_faces() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_raw_faces() const { switch (dim) { @@ -13871,8 +13933,8 @@ Triangulation::n_raw_faces() const template -unsigned int -Triangulation::n_active_faces() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_faces() const { switch (dim) { @@ -13890,8 +13952,9 @@ Triangulation::n_active_faces() const template -unsigned int -Triangulation::n_raw_cells(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_raw_cells( + const unsigned int level) const { switch (dim) { @@ -13910,8 +13973,9 @@ Triangulation::n_raw_cells(const unsigned int level) const template -unsigned int -Triangulation::n_cells(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_cells( + const unsigned int level) const { switch (dim) { @@ -13930,8 +13994,9 @@ Triangulation::n_cells(const unsigned int level) const template -unsigned int -Triangulation::n_active_cells(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_cells( + const unsigned int level) const { switch (dim) { @@ -13949,8 +14014,8 @@ Triangulation::n_active_cells(const unsigned int level) const template -bool -Triangulation::has_hanging_nodes() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +bool Triangulation::has_hanging_nodes() const { if (anisotropic_refinement == false) { @@ -13970,8 +14035,8 @@ Triangulation::has_hanging_nodes() const template -unsigned int -Triangulation::n_lines() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_lines() const { return number_cache.n_lines; } @@ -13979,8 +14044,9 @@ Triangulation::n_lines() const template -unsigned int -Triangulation::n_raw_lines(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_raw_lines( + const unsigned int level) const { if (dim == 1) { @@ -13994,8 +14060,8 @@ Triangulation::n_raw_lines(const unsigned int level) const template -unsigned int -Triangulation::n_raw_lines() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_raw_lines() const { if (dim == 1) { @@ -14008,8 +14074,9 @@ Triangulation::n_raw_lines() const template -unsigned int -Triangulation::n_lines(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_lines( + const unsigned int level) const { AssertIndexRange(level, number_cache.n_lines_level.size()); Assert(dim == 1, ExcFacesHaveNoLevel()); @@ -14018,16 +14085,17 @@ Triangulation::n_lines(const unsigned int level) const template -unsigned int -Triangulation::n_active_lines() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_lines() const { return number_cache.n_active_lines; } template -unsigned int -Triangulation::n_active_lines(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_lines( + const unsigned int level) const { AssertIndexRange(level, number_cache.n_lines_level.size()); Assert(dim == 1, ExcFacesHaveNoLevel()); @@ -14183,16 +14251,17 @@ Triangulation<1, 3>::n_active_quads() const template -unsigned int -Triangulation::n_quads() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_quads() const { return number_cache.n_quads; } template -unsigned int -Triangulation::n_quads(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_quads( + const unsigned int level) const { Assert(dim == 2, ExcFacesHaveNoLevel()); AssertIndexRange(level, number_cache.n_quads_level.size()); @@ -14231,8 +14300,8 @@ Triangulation<3, 3>::n_raw_quads(const unsigned int) const template -unsigned int -Triangulation::n_raw_quads() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_raw_quads() const { Assert(false, ExcNotImplemented()); return 0; @@ -14250,16 +14319,17 @@ Triangulation<3, 3>::n_raw_quads() const template -unsigned int -Triangulation::n_active_quads() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_quads() const { return number_cache.n_active_quads; } template -unsigned int -Triangulation::n_active_quads(const unsigned int level) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_quads( + const unsigned int level) const { AssertIndexRange(level, number_cache.n_quads_level.size()); Assert(dim == 2, ExcFacesHaveNoLevel()); @@ -14269,8 +14339,8 @@ Triangulation::n_active_quads(const unsigned int level) const template -unsigned int -Triangulation::n_hexs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_hexs() const { return 0; } @@ -14278,8 +14348,8 @@ Triangulation::n_hexs() const template -unsigned int -Triangulation::n_hexs(const unsigned int) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_hexs(const unsigned int) const { return 0; } @@ -14287,16 +14357,16 @@ Triangulation::n_hexs(const unsigned int) const template -unsigned int -Triangulation::n_raw_hexs(const unsigned int) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_raw_hexs(const unsigned int) const { return 0; } template -unsigned int -Triangulation::n_active_hexs() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_hexs() const { return 0; } @@ -14304,8 +14374,9 @@ Triangulation::n_active_hexs() const template -unsigned int -Triangulation::n_active_hexs(const unsigned int) const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_active_hexs( + const unsigned int) const { return 0; } @@ -14361,8 +14432,8 @@ Triangulation<3, 3>::n_active_hexs(const unsigned int level) const template -unsigned int -Triangulation::n_used_vertices() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::n_used_vertices() const { return std::count(vertices_used.begin(), vertices_used.end(), true); } @@ -14370,8 +14441,8 @@ Triangulation::n_used_vertices() const template -const std::vector & -Triangulation::get_used_vertices() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const std::vector &Triangulation::get_used_vertices() const { return vertices_used; } @@ -14404,8 +14475,8 @@ Triangulation<1, 3>::max_adjacent_cells() const template -unsigned int -Triangulation::max_adjacent_cells() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +unsigned int Triangulation::max_adjacent_cells() const { cell_iterator cell = begin(0), endc = (n_levels() > 1 ? begin(1) : cell_iterator(end())); @@ -14437,8 +14508,9 @@ Triangulation::max_adjacent_cells() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) types::subdomain_id -Triangulation::locally_owned_subdomain() const + Triangulation::locally_owned_subdomain() const { return numbers::invalid_subdomain_id; } @@ -14446,8 +14518,8 @@ Triangulation::locally_owned_subdomain() const template -Triangulation & -Triangulation::get_triangulation() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +Triangulation &Triangulation::get_triangulation() { return *this; } @@ -14455,8 +14527,9 @@ Triangulation::get_triangulation() template -const Triangulation & -Triangulation::get_triangulation() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const Triangulation + &Triangulation::get_triangulation() const { return *this; } @@ -14464,8 +14537,8 @@ Triangulation::get_triangulation() const template -void -Triangulation::add_periodicity( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::add_periodicity( const std::vector> &periodicity_vector) { @@ -14480,12 +14553,13 @@ Triangulation::add_periodicity( template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) const typename std::map< std::pair::cell_iterator, unsigned int>, std::pair::cell_iterator, unsigned int>, - std::bitset<3>>> & -Triangulation::get_periodic_face_map() const + std::bitset<3>>> + &Triangulation::get_periodic_face_map() const { return periodic_face_map; } @@ -14493,8 +14567,8 @@ Triangulation::get_periodic_face_map() const template -void -Triangulation::execute_coarsening_and_refinement() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::execute_coarsening_and_refinement() { // Call our version of prepare_coarsening_and_refinement() even if a derived // class like parallel::distributed::Triangulation overrides it. Their @@ -14543,8 +14617,8 @@ Triangulation::execute_coarsening_and_refinement() template -void -Triangulation::reset_active_cell_indices() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::reset_active_cell_indices() { unsigned int active_cell_index = 0; for (raw_cell_iterator cell = begin_raw(); cell != end(); ++cell) @@ -14562,8 +14636,8 @@ Triangulation::reset_active_cell_indices() template -void -Triangulation::reset_global_cell_indices() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::reset_global_cell_indices() { { types::global_cell_index cell_index = 0; @@ -14582,8 +14656,8 @@ Triangulation::reset_global_cell_indices() template -void -Triangulation::reset_cell_vertex_indices_cache() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::reset_cell_vertex_indices_cache() { for (unsigned int l = 0; l < levels.size(); ++l) { @@ -14656,8 +14730,8 @@ Triangulation::reset_cell_vertex_indices_cache() template -void -Triangulation::update_periodic_face_map() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::update_periodic_face_map() { // first empty the currently stored objects periodic_face_map.clear(); @@ -14719,8 +14793,8 @@ Triangulation::update_periodic_face_map() template -void -Triangulation::update_reference_cells() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::update_reference_cells() { std::set reference_cells_set; for (auto cell : active_cell_iterators()) @@ -14735,8 +14809,9 @@ Triangulation::update_reference_cells() template -const std::vector & -Triangulation::get_reference_cells() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +const std::vector + &Triangulation::get_reference_cells() const { return this->reference_cells; } @@ -14744,8 +14819,8 @@ Triangulation::get_reference_cells() const template -bool -Triangulation::all_reference_cells_are_hyper_cube() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +bool Triangulation::all_reference_cells_are_hyper_cube() const { Assert(this->reference_cells.size() > 0, ExcMessage("You can't ask about the kinds of reference " @@ -14758,8 +14833,8 @@ Triangulation::all_reference_cells_are_hyper_cube() const template -bool -Triangulation::all_reference_cells_are_simplex() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +bool Triangulation::all_reference_cells_are_simplex() const { Assert(this->reference_cells.size() > 0, ExcMessage("You can't ask about the kinds of reference " @@ -14772,8 +14847,8 @@ Triangulation::all_reference_cells_are_simplex() const template -bool -Triangulation::is_mixed_mesh() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +bool Triangulation::is_mixed_mesh() const { Assert(this->reference_cells.size() > 0, ExcMessage("You can't ask about the kinds of reference " @@ -14787,8 +14862,8 @@ Triangulation::is_mixed_mesh() const template -void -Triangulation::clear_despite_subscriptions() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::clear_despite_subscriptions() { levels.clear(); faces.reset(); @@ -14804,8 +14879,9 @@ Triangulation::clear_despite_subscriptions() template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) typename Triangulation::DistortedCellList -Triangulation::execute_refinement() + Triangulation::execute_refinement() { const DistortedCellList cells_with_distorted_children = this->policy->execute_refinement(*this, check_for_distorted_cells); @@ -14834,8 +14910,8 @@ Triangulation::execute_refinement() template -void -Triangulation::execute_coarsening() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::execute_coarsening() { // first find out if there are any cells at all to be coarsened in the // loop below @@ -14915,8 +14991,8 @@ Triangulation::execute_coarsening() template -void -Triangulation::fix_coarsen_flags() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::fix_coarsen_flags() { // copy a piece of code from prepare_coarsening_and_refinement that // ensures that the level difference at vertices is limited if so @@ -15317,8 +15393,8 @@ namespace template -bool -Triangulation::prepare_coarsening_and_refinement() +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +bool Triangulation::prepare_coarsening_and_refinement() { // save the flags to determine whether something was changed in the // course of this function @@ -16326,8 +16402,8 @@ Triangulation::prepare_coarsening_and_refinement() template -void -Triangulation::write_bool_vector( +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::write_bool_vector( const unsigned int magic_number1, const std::vector &v, const unsigned int magic_number2, @@ -16361,11 +16437,12 @@ Triangulation::write_bool_vector( template -void -Triangulation::read_bool_vector(const unsigned int magic_number1, - std::vector &v, - const unsigned int magic_number2, - std::istream & in) +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +void Triangulation::read_bool_vector( + const unsigned int magic_number1, + std::vector &v, + const unsigned int magic_number2, + std::istream & in) { AssertThrow(in.fail() == false, ExcIO()); @@ -16399,8 +16476,8 @@ Triangulation::read_bool_vector(const unsigned int magic_number1, template -std::size_t -Triangulation::memory_consumption() const +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) +std::size_t Triangulation::memory_consumption() const { std::size_t mem = 0; mem += sizeof(MeshSmoothing); @@ -16424,6 +16501,7 @@ Triangulation::memory_consumption() const template +DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) Triangulation::DistortedCellList::~DistortedCellList() noexcept = default; -- 2.39.5