16#ifndef dealii_filtered_iterator_h
17#define dealii_filtered_iterator_h
31#ifdef DEAL_II_HAVE_CXX20
69 template <
class Iterator>
89 template <
class Iterator>
109 template <
class Iterator>
136 template <
class Iterator>
171 template <
class Iterator>
201 template <
class Iterator>
221 template <
class Iterator>
258 template <
class Iterator>
304 template <
class Iterator>
332 template <
class Iterator>
364 template <
class Iterator>
402 template <
class Iterator>
632template <
typename BaseIterator>
647 template <
typename Predicate>
670 template <
typename Predicate>
807 <<
"The element " << arg1
808 <<
" with which you want to compare or which you want to"
809 <<
" assign from is invalid since it does not satisfy the predicate.");
841 virtual std::unique_ptr<PredicateBase>
854 template <
typename Predicate>
873 virtual std::unique_ptr<PredicateBase>
874 clone()
const override;
903template <
typename BaseIterator,
typename Predicate>
917 namespace FilteredIteratorImplementation
923 template <
typename BaseIterator,
typename TypeList>
926 template <
typename BaseIterator,
typename Predicate>
932 template <
typename BaseIterator,
typename Predicate,
typename... Targs>
937 std::tuple<Targs...>>::type>;
996template <
typename BaseIterator,
typename Predicate>
1000 const Predicate & p)
1067template <
typename BaseIterator,
typename Predicate,
typename... Targs>
1070 typename internal::FilteredIteratorImplementation::
1071 NestFilteredIterators<
BaseIterator, std::tuple<Predicate, Targs...>>::
1073 const Predicate & p,
1074 const Targs... args)
1143template <
typename BaseIterator,
typename Predicate>
1156template <
typename BaseIterator>
1157template <
typename Predicate>
1165template <
typename BaseIterator>
1166template <
typename Predicate>
1174 set_to_next_positive(bi);
1179template <
typename BaseIterator>
1187 , predicate(fi.predicate->clone())
1192template <
typename BaseIterator>
1202 return operator=(bi);
1207template <
typename BaseIterator>
1212 ExcInvalidElement(bi));
1213 BaseIterator::operator=(bi);
1219template <
typename BaseIterator>
1223 BaseIterator::operator=(bi);
1225 BaseIterator::operator++();
1232template <
typename BaseIterator>
1236 BaseIterator::operator=(bi);
1238 BaseIterator::operator--();
1245template <
typename BaseIterator>
1255template <
typename BaseIterator>
1265template <
typename BaseIterator>
1275template <
typename BaseIterator>
1279 return (
static_cast<const BaseIterator &
>(*
this) == bi);
1284template <
typename BaseIterator>
1288 return (
static_cast<const BaseIterator &
>(*
this) != bi);
1293template <
typename BaseIterator>
1297 return (
static_cast<const BaseIterator &
>(*
this) < bi);
1301template <
typename BaseIterator>
1307 BaseIterator::operator++();
1314template <
typename BaseIterator>
1322 BaseIterator::operator++();
1329template <
typename BaseIterator>
1335 BaseIterator::operator--();
1342template <
typename BaseIterator>
1350 BaseIterator::operator--();
1357template <
typename BaseIterator>
1358template <
typename Predicate>
1360 Predicate>::PredicateTemplate(
const Predicate &predicate)
1361 : predicate(predicate)
1366template <
typename BaseIterator>
1367template <
typename Predicate>
1377template <
typename BaseIterator>
1378template <
typename Predicate>
1379std::unique_ptr<typename FilteredIterator<BaseIterator>::PredicateBase>
1382 return std::make_unique<PredicateTemplate>(
predicate);
1391 template <
class Iterator>
1393 Active::operator()(
const Iterator &i)
const
1395 return i->is_active();
1401 template <
class Iterator>
1403 UserFlagSet::operator()(
const Iterator &i)
const
1405 return (i->user_flag_set());
1411 template <
class Iterator>
1413 UserFlagNotSet::operator()(
const Iterator &i)
const
1415 return (!i->user_flag_set());
1420 inline LevelEqualTo::LevelEqualTo(
const unsigned int level)
1426 template <
class Iterator>
1430 return (
static_cast<unsigned int>(i->level()) ==
level);
1438 : subdomain_id(subdomain_id)
1443 template <
class Iterator>
1454 template <
class Iterator>
1458 return (i->is_locally_owned());
1464 template <
class Iterator>
1468 return (i->is_locally_owned_on_level());
1476 const bool only_locally_owned)
1477 : material_ids{material_id}
1478 , only_locally_owned(only_locally_owned)
1484 const std::set<types::material_id> &material_ids,
1485 const bool only_locally_owned)
1486 : material_ids(material_ids)
1487 , only_locally_owned(only_locally_owned)
1492 template <
class Iterator>
1498 i->is_locally_owned()) :
1506 const unsigned int active_fe_index,
1507 const bool only_locally_owned)
1508 : active_fe_indices{active_fe_index}
1509 , only_locally_owned(only_locally_owned)
1515 const std::set<unsigned int> &active_fe_indices,
1516 const bool only_locally_owned)
1517 : active_fe_indices(active_fe_indices)
1518 , only_locally_owned(only_locally_owned)
1523 template <
class Iterator>
1528 (i->is_locally_owned() &&
1539 template <
class Iterator>
1543 return (i->at_boundary());
1551 : boundary_ids{boundary_id}
1557 const std::set<types::boundary_id> &boundary_ids)
1558 : boundary_ids(boundary_ids)
1563 template <
class Iterator>
1575 : manifold_ids{manifold_id}
1581 const std::set<types::manifold_id> &manifold_ids)
1582 : manifold_ids(manifold_ids)
1587 template <
class Iterator>
virtual ~PredicateBase()=default
virtual bool operator()(const BaseIterator &bi) const =0
virtual std::unique_ptr< PredicateBase > clone() const =0
virtual bool operator()(const BaseIterator &bi) const override
const Predicate predicate
virtual std::unique_ptr< PredicateBase > clone() const override
FilteredIterator & set_to_next_positive(const BaseIterator &bi)
FilteredIterator & set_to_previous_positive(const BaseIterator &bi)
FilteredIterator & operator--()
typename BaseIterator::AccessorType AccessorType
bool operator==(const FilteredIterator &fi) const
bool operator!=(const FilteredIterator &fi) const
FilteredIterator(Predicate p)
bool operator<(const FilteredIterator &fi) const
FilteredIterator & operator=(const FilteredIterator &fi)
std::unique_ptr< const PredicateBase > predicate
FilteredIterator & operator++()
const bool only_locally_owned
bool operator()(const Iterator &i) const
const std::set< unsigned int > active_fe_indices
ActiveFEIndexEqualTo(const unsigned int active_fe_index, const bool only_locally_owned=false)
bool operator()(const Iterator &i) const
bool operator()(const Iterator &i) const
bool operator()(const Iterator &i) const
const std::set< types::boundary_id > boundary_ids
BoundaryIdEqualTo(const types::boundary_id boundary_id)
bool operator()(const Iterator &i) const
bool operator()(const Iterator &i) const
bool operator()(const Iterator &i) const
bool operator()(const Iterator &i) const
ManifoldIdEqualTo(const types::manifold_id manifold_id)
const std::set< types::manifold_id > manifold_ids
const bool only_locally_owned
bool operator()(const Iterator &i) const
MaterialIdEqualTo(const types::material_id material_id, const bool only_locally_owned=false)
const std::set< types::material_id > material_ids
SubdomainEqualTo(const types::subdomain_id subdomain_id)
bool operator()(const Iterator &i) const
const types::subdomain_id subdomain_id
bool operator()(const Iterator &i) const
bool operator()(const Iterator &i) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_CXX20_REQUIRES(condition)
#define DEAL_II_NAMESPACE_CLOSE
FilteredIterator< BaseIterator > make_filtered_iterator(const BaseIterator &i, const Predicate &p)
IteratorRange< typename internal::FilteredIteratorImplementation::NestFilteredIterators< BaseIterator, std::tuple< Predicate, Targs... > >::type > filter_iterators(IteratorRange< BaseIterator > i, const Predicate &p, const Targs... args)
IteratorRange< FilteredIterator< BaseIterator > > filter_iterators(IteratorRange< BaseIterator > i, const Predicate &p)
IteratorRange< FilteredIterator< BaseIterator > > operator|(IteratorRange< BaseIterator > i, const Predicate &p)
static ::ExceptionBase & ExcInvalidElement(BaseIterator arg1)
#define Assert(cond, exc)
#define DeclException1(Exception1, type1, outsequence)
@ valid
Iterator points to a valid object.