18 #ifndef LIBMESH_MULTI_PREDICATES_H
19 #define LIBMESH_MULTI_PREDICATES_H
22 #include "libmesh/libmesh.h"
23 #include "libmesh/single_predicates.h"
29 #include <initializer_list>
57 using pred_ptr = std::unique_ptr<predicate<T>>;
81 libmesh_assert (pred);
136 template <
typename U>
142 operator T() const&& {
return std::move(
t); }
153 std::vector<T> r( std::make_move_iterator(il.begin()), std::make_move_iterator(il.end()) );
161 template <
typename T>
166 std::make_unique<is_null<T>>()
175 template <
typename T>
180 std::make_unique<not_null<T>>()
189 template <
typename T>
194 std::make_unique<not_null<T>>(),
204 template <
typename T>
209 std::make_unique<not_null<T>>(),
221 template <
typename T>
226 std::make_unique<not_null<T>>(),
238 template <
typename T>
243 std::make_unique<not_null<T>>(),
255 template <
typename T>
260 std::make_unique<not_null<T>>(),
272 template <
typename T>
277 std::make_unique<not_null<T>>(),
288 template <
typename T>
293 std::make_unique<not_null<T>>(),
294 std::make_unique<
pid<T>>(my_pid)
324 template <
typename T>
329 std::make_unique<not_null<T>>(),
331 std::make_unique<not_subactive<T>>(),
342 template <
typename T>
347 std::make_unique<not_null<T>>(),
349 std::make_unique<facelocal_pid<T>>(my_pid)
359 template <
typename T>
364 std::make_unique<not_null<T>>(),
374 template <
typename T>
379 std::make_unique<not_null<T>>(),
381 std::make_unique<not_pid<T>>(my_pid)
389 template <
typename T>
394 std::make_unique<not_null<T>>(),
404 template <
typename T>
409 std::make_unique<not_null<T>>(),
411 std::make_unique<elem_type<T>>(type)
417 #ifdef LIBMESH_ENABLE_AMR
422 template <
typename T>
427 std::make_unique<not_null<T>>(),
438 template <
typename T>
443 std::make_unique<not_null<T>>(),
445 std::make_unique<pid<T>>(proc_id)
449 #endif // LIBMESH_ENABLE_AMR
458 template <
typename T>
463 std::make_unique<not_null<T>>(),
465 std::make_unique<pid<T>>(proc_id)
477 template <
typename T>
482 std::make_unique<not_null<T>>(),
484 std::make_unique<pid<T>>(my_pid)
495 template <
typename T>
500 std::make_unique<not_null<T>>(),
501 std::make_unique<
pid<T>>(proc_id)
511 template <
typename T>
516 std::make_unique<not_null<T>>(),
517 std::make_unique<
bid<T>>(bndry_id, bndry_info)
526 template <
typename T>
531 std::make_unique<not_null<T>>(),
532 std::make_unique<
bnd<T>>(bndry_info)
542 template <
typename T>
547 std::make_unique<not_null<T>>(),
557 template <
typename T>
562 std::make_unique<not_null<T>>(),
573 template <
typename T>
578 std::make_unique<not_null<T>>(),
589 template <
typename T>
595 std::make_unique<not_null<T>>(),
596 std::make_unique<
pid<T>>(my_pid),
597 std::make_unique<level<T>>(l)
607 template <
typename T>
613 std::make_unique<not_null<T>>(),
614 std::make_unique<
pid<T>>(my_pid),
615 std::make_unique<not_level<T>>(l)
625 template <
typename T>
630 std::make_unique<not_null<T>>(),
632 std::make_unique<null_neighbor<T>>()
642 template <
typename T>
647 std::make_unique<boundary_side<T>>()
657 template <
typename T>
663 std::make_unique<not_null<T>>(),
665 std::make_unique<pid<T>>(my_pid),
676 template <
typename T>
681 std::make_unique<not_null<T>>(),
683 std::make_unique<subdomain<T>>(subdomain_id)
693 template <
typename T>
698 std::make_unique<not_null<T>>(),
700 std::make_unique<subdomain_set<T>>(sset)
710 template <
typename T>
716 std::make_unique<not_null<T>>(),
718 std::make_unique<pid<T>>(my_pid),
732 template <
typename T>
737 std::make_unique<not_null<T>>(),
739 std::make_unique<not_pid<T>>(my_pid),
750 template <
typename T>
756 std::make_unique<not_null<T>>(),
758 std::make_unique<evaluable<T>>(dof_map, var_num)
768 template <
typename T>
773 std::make_unique<not_null<T>>(),
775 std::make_unique<multi_evaluable<T>>(dof_maps)
784 #endif // LIBMESH_MULTI_PREDICATES_H
Ghost(processor_id_type my_pid)
FlaggedPID(unsigned char rflag, processor_id_type proc_id)
ActiveLocalSubdomainSet(processor_id_type my_pid, std::set< subdomain_id_type > sset)
NotLocal(processor_id_type my_pid)
Used to iterate over non-nullptr, elements of a given geometric type.
Used to iterate over non-nullptr, active, local elements owned by a given processor.
movable_il(T &&in)
Construct from rvalue reference of type T.
std::unique_ptr< predicate< T >> pred_ptr
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Used to iterate over non-nullptr, entries that have children (i.e.
BND(const BoundaryInfo &bndry_info)
Used to iterate over non-nullptr, elements with a given refinement flag.
ActiveLocalSubdomain(processor_id_type my_pid, subdomain_id_type subdomain_id)
ActiveSubdomainSet(std::set< subdomain_id_type > sset)
Used to iterate over non-nullptr elements of a specified (refinement) level.
ActiveSemiLocal(processor_id_type my_pid)
Used to iterate over non-nullptr, active elements on a given subdomain.
Used to iterate over non-nullptr, active entries in a container.
Used to iterate over non-nullptr local elements not of a specified (refinement) level.
Helper object for creating a std::vector from a std::initializer_list https://stackoverflow.com/questions/46737054/vectorunique-ptra-using-initialization-list.
Used to iterate over non-nullptr entries in a container.
uint8_t processor_id_type
Used to iterate over nullptr entries in a container.
Evaluable(const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint)
This class handles the numbering of degrees of freedom on a mesh.
Used to iterate over elements where solutions indexed by a given vector of DofMaps are evaluable for ...
ActivePID(processor_id_type proc_id)
abstract_multi_predicate & operator=(const abstract_multi_predicate &rhs)
PID(processor_id_type proc_id)
Used to iterate over non-nullptr, non-local entries in a container.
void deep_copy(const abstract_multi_predicate &rhs)
Used to iterate over non-nullptr, elements with a given refinement flag belonging to a given processo...
Used to iterate over non-nullptr, inactive entries in a container.
NotPID(processor_id_type proc_id)
abstract_multi_predicate(std::vector< pred_ptr< T >> &&predicates)
virtual bool operator()(const T &it) const
Used to iterate over non-nullptr elements owned by a given processor.
virtual ~abstract_multi_predicate()=default
Used to iterate over non-nullptr, active elements owned by a given processor.
MultiEvaluable(const std::vector< const DofMap * > &dof_maps)
Used to iterate over non-nullptr elements not of a specified (refinement) level.
LocalNotLevel(processor_id_type my_pid, unsigned int l)
ActiveLocal(processor_id_type my_pid)
Used to iterate over non-nullptr, entries that have no children (i.e.
abstract_multi_predicate(const abstract_multi_predicate &rhs)
Flagged(unsigned char rflag)
Used to iterate over non-nullptr elements on the boundary with a given ID.
Used to iterate over non-nullptr, face-local entries (i.e.
Used to iterate over non-nullptr elements not owned by a given processor.
Used to iterate over non-nullptr, active, non-local entries in a container.
Local(processor_id_type my_pid)
Used to iterate over non-nullptr, active elements whose subdomains are in a user-specified set...
FaceLocal(processor_id_type my_pid)
Used to iterate over non-nullptr elements not owned by a given processor but semi-local to that proce...
Used to iterate over non-nullptr, active elements which are on the boundary.
Used to iterate over non-nullptr, active elements with a given PID whose subdomains are in a user-spe...
ActiveType(ElemType type)
Used to iterate over non-nullptr, local entries (i.e.
Used to iterate over non-nullptr, subactive entries (i.e.
ActiveSubdomain(subdomain_id_type subdomain_id)
Used to iterate over non-nullptr, semi-local entries (i.e.
std::vector< pred_ptr< T > > _predicates
Used to iterate over non-nullptr elements on the boundary.
Used to iterate over non-nullptr local elements with a specified (refinement) level.
ActiveNotLocal(processor_id_type my_pid)
BID(boundary_id_type bndry_id, const BoundaryInfo &bndry_info)
Used to iterate over non-nullptr, active elements of a given geometric type.
std::vector< T > make_vec(std::initializer_list< movable_il< T > > il)
Helper function that creates a std::vector from an initializer_list of movable_il objects...
LocalLevel(processor_id_type my_pid, unsigned int l)
Used to iterate over elements where solutions indexed by a given DofMap are evaluable for a given var...
movable_il(U &&in)
Construct from rvalue reference of type U, using forwarding.
abstract_multi_predicate()=default
Used to iterate over non-nullptr, non-subactive entries (i.e.
Used to iterate over the sides of an element which are on the boundary of the Mesh.
Used to iterate over non-nullptr, active elements with a given PID on a given subdomain.