libMesh
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
libMesh::Predicates::Local< T > Struct Template Reference

Used to iterate over non-nullptr, local entries (i.e. More...

#include <multi_predicates.h>

Inheritance diagram for libMesh::Predicates::Local< T >:
[legend]

Public Member Functions

 Local (processor_id_type my_pid)
 
virtual bool operator() (const T &it) const
 

Protected Member Functions

void deep_copy (const abstract_multi_predicate &rhs)
 

Protected Attributes

std::vector< pred_ptr< T > > _predicates
 

Detailed Description

template<typename T>
struct libMesh::Predicates::Local< T >

Used to iterate over non-nullptr, local entries (i.e.

owned by the current processor) in a container.

Definition at line 289 of file multi_predicates.h.

Constructor & Destructor Documentation

◆ Local()

template<typename T >
libMesh::Predicates::Local< T >::Local ( processor_id_type  my_pid)
inline

Definition at line 291 of file multi_predicates.h.

291  : abstract_multi_predicate<T>(make_vec<pred_ptr<T>>(
292  {
293  std::make_unique<not_null<T>>(),
294  std::make_unique<pid<T>>(my_pid)
295  })) {}

Member Function Documentation

◆ deep_copy()

template<typename T >
void libMesh::Predicates::abstract_multi_predicate< T >::deep_copy ( const abstract_multi_predicate< T > &  rhs)
inlineprotectedinherited

Definition at line 108 of file multi_predicates.h.

References libMesh::Predicates::abstract_multi_predicate< T >::_predicates.

Referenced by libMesh::Predicates::abstract_multi_predicate< T >::abstract_multi_predicate(), and libMesh::Predicates::abstract_multi_predicate< T >::operator=().

109  {
110  // First clear out the predicates vector
111  _predicates.clear();
112 
113  for (const auto & p : rhs._predicates)
114  _predicates.push_back(p->clone());
115  }

◆ operator()()

template<typename T >
virtual bool libMesh::Predicates::abstract_multi_predicate< T >::operator() ( const T &  it) const
inlinevirtualinherited

Definition at line 77 of file multi_predicates.h.

References libMesh::Predicates::abstract_multi_predicate< T >::_predicates, and libMesh::libmesh_assert().

78  {
79  for (const auto & pred : _predicates)
80  {
81  libmesh_assert (pred);
82 
83  if (!(*pred)(it))
84  return false;
85  }
86 
87  return true;
88  }
libmesh_assert(ctx)

Member Data Documentation

◆ _predicates

template<typename T >
std::vector<pred_ptr<T> > libMesh::Predicates::abstract_multi_predicate< T >::_predicates
protectedinherited

The documentation for this struct was generated from the following file: