16#ifndef dealii_filtered_iterator_h
17# define dealii_filtered_iterator_h
64 template <
class Iterator>
84 template <
class Iterator>
104 template <
class Iterator>
131 template <
class Iterator>
166 template <
class Iterator>
196 template <
class Iterator>
216 template <
class Iterator>
253 template <
class Iterator>
299 template <
class Iterator>
327 template <
class Iterator>
359 template <
class Iterator>
397 template <
class Iterator>
627template <
typename BaseIterator>
640 template <
typename Predicate>
660 template <
typename Predicate>
796 <<
"The element " << arg1
797 <<
" with which you want to compare or which you want to"
798 <<
" assign from is invalid since it does not satisfy the predicate.");
830 virtual std::unique_ptr<PredicateBase>
843 template <
typename Predicate>
862 virtual std::unique_ptr<PredicateBase>
863 clone()
const override;
890template <
typename BaseIterator,
typename Predicate>
903 namespace FilteredIteratorImplementation
909 template <
typename BaseIterator,
typename TypeList>
912 template <
typename BaseIterator,
typename Predicate>
918 template <
typename BaseIterator,
typename Predicate,
typename... Targs>
923 std::tuple<Targs...>>::type>;
980template <
typename BaseIterator,
typename Predicate>
1047template <
typename BaseIterator,
typename Predicate,
typename... Targs>
1049 typename internal::FilteredIteratorImplementation::
1050 NestFilteredIterators<
BaseIterator, std::tuple<Predicate, Targs...>>::type>
1052 const Predicate & p,
1053 const Targs... args)
1120template <
typename BaseIterator,
typename Predicate>
1132template <
typename BaseIterator>
1133template <
typename Predicate>
1140template <
typename BaseIterator>
1141template <
typename Predicate>
1153template <
typename BaseIterator>
1161 , predicate(fi.predicate->clone())
1166template <
typename BaseIterator>
1176 return operator=(bi);
1181template <
typename BaseIterator>
1186 ExcInvalidElement(bi));
1187 BaseIterator::operator=(bi);
1193template <
typename BaseIterator>
1197 BaseIterator::operator=(bi);
1199 BaseIterator::operator++();
1206template <
typename BaseIterator>
1210 BaseIterator::operator=(bi);
1212 BaseIterator::operator--();
1219template <
typename BaseIterator>
1229template <
typename BaseIterator>
1239template <
typename BaseIterator>
1249template <
typename BaseIterator>
1253 return (
static_cast<const BaseIterator &
>(*
this) == bi);
1258template <
typename BaseIterator>
1262 return (
static_cast<const BaseIterator &
>(*
this) != bi);
1267template <
typename BaseIterator>
1271 return (
static_cast<const BaseIterator &
>(*
this) < bi);
1275template <
typename BaseIterator>
1281 BaseIterator::operator++();
1288template <
typename BaseIterator>
1296 BaseIterator::operator++();
1303template <
typename BaseIterator>
1309 BaseIterator::operator--();
1316template <
typename BaseIterator>
1324 BaseIterator::operator--();
1331template <
typename BaseIterator>
1332template <
typename Predicate>
1334 Predicate>::PredicateTemplate(
const Predicate &predicate)
1335 : predicate(predicate)
1340template <
typename BaseIterator>
1341template <
typename Predicate>
1351template <
typename BaseIterator>
1352template <
typename Predicate>
1353std::unique_ptr<typename FilteredIterator<BaseIterator>::PredicateBase>
1356 return std::make_unique<PredicateTemplate>(
predicate);
1365 template <
class Iterator>
1367 Active::operator()(
const Iterator &i)
const
1369 return i->is_active();
1375 template <
class Iterator>
1377 UserFlagSet::operator()(
const Iterator &i)
const
1379 return (i->user_flag_set());
1385 template <
class Iterator>
1387 UserFlagNotSet::operator()(
const Iterator &i)
const
1389 return (!i->user_flag_set());
1394 inline LevelEqualTo::LevelEqualTo(
const unsigned int level)
1400 template <
class Iterator>
1404 return (
static_cast<unsigned int>(i->level()) ==
level);
1412 : subdomain_id(subdomain_id)
1417 template <
class Iterator>
1428 template <
class Iterator>
1432 return (i->is_locally_owned());
1438 template <
class Iterator>
1442 return (i->is_locally_owned_on_level());
1450 const bool only_locally_owned)
1451 : material_ids{material_id}
1452 , only_locally_owned(only_locally_owned)
1458 const std::set<types::material_id> &material_ids,
1459 const bool only_locally_owned)
1460 : material_ids(material_ids)
1461 , only_locally_owned(only_locally_owned)
1466 template <
class Iterator>
1472 i->is_locally_owned()) :
1480 const unsigned int active_fe_index,
1481 const bool only_locally_owned)
1482 : active_fe_indices{active_fe_index}
1483 , only_locally_owned(only_locally_owned)
1489 const std::set<unsigned int> &active_fe_indices,
1490 const bool only_locally_owned)
1491 : active_fe_indices(active_fe_indices)
1492 , only_locally_owned(only_locally_owned)
1497 template <
class Iterator>
1504 i->is_locally_owned()) :
1513 template <
class Iterator>
1517 return (i->at_boundary());
1525 : boundary_ids{boundary_id}
1531 const std::set<types::boundary_id> &boundary_ids)
1532 : boundary_ids(boundary_ids)
1537 template <
class Iterator>
1549 : manifold_ids{manifold_id}
1555 const std::set<types::manifold_id> &manifold_ids)
1556 : manifold_ids(manifold_ids)
1561 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< BaseIterator > make_filtered_iterator(const BaseIterator &i, const Predicate &p)
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
IteratorOverIterators end() const
IteratorOverIterators begin()
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
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.