waLBerla 7.3
Loading...
Searching...
No Matches
walberla::selectable::AllSetSelectableObject< T, U > Class Template Reference

Detailed Description

template<typename T, typename U>
class walberla::selectable::AllSetSelectableObject< T, U >

Implementation of SelectableObject using sets (see "AllSet.h") as selection attributes.

AllSetSelectableObject is an implementation of SelectableObject that stores objects of type T which are attached with selection attributes of type AllSet<U>. For information on which objects are selected given a certain set as selection request see the documentation of the function "select".

#include <AllSetSelectableObject.h>

Inheritance diagram for walberla::selectable::AllSetSelectableObject< T, U >:

Classes

struct  Compare

Private Member Functions

virtual void select (std::vector< size_t > &index, const AllSet< U > &selector) const
 Given a certain selection request 'R' (= "selector" [set of objects of type U]), this function returns the index 'i' of every attribute set 'A_i' (A_0 <=> attributes_[0], A_1 <=> attributes_[1], etc.) that matches the request 'R'.

Additional Inherited Members

virtual ~SelectableObject ()=default
void add (const T &object, const AllSet< U > &attributes, const std::string &identifier=std::string())
 This function is used to add an object together with its selection attributes stored in "attributes".
iterator begin ()
iterator end ()
size_t getNumberOfMatching (const AllSet< U > &selector) const
 Returns the number of objects matching the specified "selector".
size_t get (T &object, const AllSet< U > &selector) const
 This function can be used to retrieve the one object whose attributes match with "selector".
T * getUnique (const AllSet< U > &selector)
 Non-const version of getUnique().
void toStream (std::ostream &os) const
std::string toString () const
size_t size () const
bool empty () const
std::vector< AllSet< U > > attributes_

Member Function Documentation

◆ select()

template<typename T, typename U>
void walberla::selectable::AllSetSelectableObject< T, U >::select ( std::vector< size_t > & index,
const AllSet< U > & selector ) const
privatevirtual

Given a certain selection request 'R' (= "selector" [set of objects of type U]), this function returns the index 'i' of every attribute set 'A_i' (A_0 <=> attributes_[0], A_1 <=> attributes_[1], etc.) that matches the request 'R'.

Possible candidates are:

  • for "normal" sets: sets 'A_i' that are completely contained within the set 'R'
  • for "all" sets (see "AllSet.h"): sets 'A_i' that completely contain the set 'R' Out of these possible candidates, the set A_x that contains most elements is chosen. Additionally, out of these candidates, every set that contains as many elements as A_x and every set that contains as many or even more elements than the selection request 'R' is also chosen.

Implements walberla::selectable::SelectableObject< T, AllSet< U >, AllSet< U > >.


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