libMesh
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
libMesh::Predicates::Evaluable< T > Struct Template Reference

Used to iterate over elements where solutions indexed by a given DofMap are evaluable for a given variable var_num. More...

#include <multi_predicates.h>

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

Public Member Functions

 Evaluable (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint)
 
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::Evaluable< T >

Used to iterate over elements where solutions indexed by a given DofMap are evaluable for a given variable var_num.

Definition at line 751 of file multi_predicates.h.

Constructor & Destructor Documentation

◆ Evaluable()

template<typename T >
libMesh::Predicates::Evaluable< T >::Evaluable ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
)
inline

Definition at line 753 of file multi_predicates.h.

754 : abstract_multi_predicate<T>(make_vec<pred_ptr<T>>(
755 {
756 std::make_unique<not_null<T>>(),
757 std::make_unique<active<T>>(),
758 std::make_unique<evaluable<T>>(dof_map, var_num)
759 })) {}
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.

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.

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 }

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=().

◆ 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.

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)

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

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: