OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
AmrParticleLevelCounter< Key, T, Compare, Allocator > Class Template Reference

#include <AmrParticleLevelCounter.h>

Public Types

typedef std::map< Key, T >::value_type value_type
 
typedef std::map< Key, T >::size_type size_type
 
typedef std::map< Key, T >::iterator iterator
 
typedef std::map< Key, T >::const_iterator const_iterator
 

Public Member Functions

 AmrParticleLevelCounter ()
 
void increment (const Key &level, T nTimes=T(1))
 
void decrement (const Key &level, T nTimes=T(1))
 
T & operator[] (T level)
 
const T & operator[] (T level) const
 
size_type size () const
 
bool empty () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
begin (T level) const
 
end (T level) const
 
void remove (T num, T begin)
 
getLocalNumAllLevel ()
 
getLocalNumUpToLevel (T level) const
 
getLocalNumAtLevel (T level) const
 

Private Member Functions

which (T idx)
 

Private Attributes

std::map< Key, T > count_m
 

Detailed Description

template<class Key, class T, class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
class AmrParticleLevelCounter< Key, T, Compare, Allocator >

Definition at line 39 of file AmrParticleLevelCounter.h.

Member Typedef Documentation

◆ const_iterator

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
typedef std::map<Key, T>::const_iterator AmrParticleLevelCounter< Key, T, Compare, Allocator >::const_iterator

Definition at line 46 of file AmrParticleLevelCounter.h.

◆ iterator

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
typedef std::map<Key, T>::iterator AmrParticleLevelCounter< Key, T, Compare, Allocator >::iterator

Definition at line 45 of file AmrParticleLevelCounter.h.

◆ size_type

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
typedef std::map<Key, T>::size_type AmrParticleLevelCounter< Key, T, Compare, Allocator >::size_type

Definition at line 44 of file AmrParticleLevelCounter.h.

◆ value_type

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
typedef std::map<Key, T>::value_type AmrParticleLevelCounter< Key, T, Compare, Allocator >::value_type

Definition at line 43 of file AmrParticleLevelCounter.h.

Constructor & Destructor Documentation

◆ AmrParticleLevelCounter()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
AmrParticleLevelCounter< Key, T, Compare, Allocator >::AmrParticleLevelCounter ( )
inline

Definition at line 50 of file AmrParticleLevelCounter.h.

Member Function Documentation

◆ begin() [1/3]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
iterator AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin ( )
inline

◆ begin() [2/3]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
const_iterator AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin ( ) const
inline

◆ begin() [3/3]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
T AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin ( level) const
inline

Obtain the start of a level

Parameters
level
Returns
the local starting index

Definition at line 86 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::count_m, AmrParticleLevelCounter< Key, T, Compare, Allocator >::end(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::size(), sum(), and Attrib::Legacy::Distribution::T.

Here is the call graph for this function:

◆ decrement()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
void AmrParticleLevelCounter< Key, T, Compare, Allocator >::decrement ( const Key &  level,
nTimes = T(1) 
)
inline

Add more "particles" to that level

Parameters
levelwhere to add
nTimesto decrement

Definition at line 64 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::increment().

Here is the call graph for this function:

◆ empty()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
bool AmrParticleLevelCounter< Key, T, Compare, Allocator >::empty ( ) const
inline

◆ end() [1/3]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
iterator AmrParticleLevelCounter< Key, T, Compare, Allocator >::end ( )
inline

◆ end() [2/3]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
const_iterator AmrParticleLevelCounter< Key, T, Compare, Allocator >::end ( ) const
inline

◆ end() [3/3]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
T AmrParticleLevelCounter< Key, T, Compare, Allocator >::end ( level) const
inline

Obtain the end of a level

Parameters
level
Returns
the index of the local end of that level

Definition at line 105 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin().

Here is the call graph for this function:

◆ getLocalNumAllLevel()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
T AmrParticleLevelCounter< Key, T, Compare, Allocator >::getLocalNumAllLevel ( )
inline
Returns
the total particle count (should be the same as AmrParticleBase::LocalNum)

Definition at line 127 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), and AmrParticleLevelCounter< Key, T, Compare, Allocator >::count_m.

Here is the call graph for this function:

◆ getLocalNumAtLevel()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
T AmrParticleLevelCounter< Key, T, Compare, Allocator >::getLocalNumAtLevel ( level) const
inline
Returns
the total particle count at the given level

Definition at line 148 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::end(), PAssert_GE, and Attrib::Legacy::Distribution::T.

Here is the call graph for this function:

◆ getLocalNumUpToLevel()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
T AmrParticleLevelCounter< Key, T, Compare, Allocator >::getLocalNumUpToLevel ( level) const
inline
Returns
the total particle count up to the given level

Definition at line 135 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::end(), PAssert_GE, sum(), and Attrib::Legacy::Distribution::T.

Here is the call graph for this function:

◆ increment()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
void AmrParticleLevelCounter< Key, T, Compare, Allocator >::increment ( const Key &  level,
nTimes = T(1) 
)
inline

Add more "particles" to that level

Parameters
levelwhere to add
nTimesto increment

Definition at line 57 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::count_m.

Referenced by AmrParticleLevelCounter< Key, T, Compare, Allocator >::decrement().

◆ operator[]() [1/2]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
T& AmrParticleLevelCounter< Key, T, Compare, Allocator >::operator[] ( level)
inline

◆ operator[]() [2/2]

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
const T& AmrParticleLevelCounter< Key, T, Compare, Allocator >::operator[] ( level) const
inline

◆ remove()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
void AmrParticleLevelCounter< Key, T, Compare, Allocator >::remove ( num,
begin 
)
inline

Remove particle indices from the container

Parameters
numof particles that will be removed
beginof index

Definition at line 113 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::count_m, Attrib::Legacy::Distribution::T, and AmrParticleLevelCounter< Key, T, Compare, Allocator >::which().

Here is the call graph for this function:

◆ size()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
size_type AmrParticleLevelCounter< Key, T, Compare, Allocator >::size ( ) const
inline

◆ which()

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
T AmrParticleLevelCounter< Key, T, Compare, Allocator >::which ( idx)
inlineprivate

Find the level the particle belongs to

Parameters
idxis the local index of the particle
Returns
the level

Definition at line 159 of file AmrParticleLevelCounter.h.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::end(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::size(), and Attrib::Legacy::Distribution::T.

Referenced by AmrParticleLevelCounter< Key, T, Compare, Allocator >::remove().

Here is the call graph for this function:

Member Data Documentation

◆ count_m

template<class Key , class T , class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> >>
std::map<Key, T> AmrParticleLevelCounter< Key, T, Compare, Allocator >::count_m
private

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