ESyS-Particle  2.3.4
APairInteractionGroup< T > Class Template Reference

Abstract base class for a group of pair interactions. More...

#include <InteractionGroup.h>

Inheritance diagram for APairInteractionGroup< T >:
Collaboration diagram for APairInteractionGroup< T >:

Public Member Functions

bool isIn (int, int)
 
virtual void setExIG (AParallelInteractionStorage *eg)
 
- Public Member Functions inherited from AInteractionGroup< T >
virtual ~AInteractionGroup ()
 
virtual void Update (ParallelParticleArray< T > *)=0
 
virtual void calcForces ()=0
 
virtual void setTimeStepSize (double dt)=0
 

Protected Attributes

set< pair< int, int > > m_set
 
unsigned int m_update_timestamp
 

Detailed Description

template<class T>
class APairInteractionGroup< T >

Abstract base class for a group of pair interactions.

The difference to AInteractionGroup is the existence of a function bool isIn(int,int) which returns if an interaction between particles with the given Ids is in this group. (Necessary because bonded -> not elastic,frictional etc.)

Member Function Documentation

◆ isIn()

template<class T >
bool APairInteractionGroup< T >::isIn ( int  id1,
int  id2 
)

◆ setExIG()

template<class T >
virtual void APairInteractionGroup< T >::setExIG ( AParallelInteractionStorage eg)
inlinevirtual

Member Data Documentation

◆ m_set

template<class T >
set<pair<int,int> > APairInteractionGroup< T >::m_set
protected

having an extra set of all pairs if particle-Ids of the interactions in the group costs some memory, but speeds up isIn to O(log N). It would be O(N) if implemented with a find() over the vector of inteactions.

Todo:
replace set (O(logN)) with hashset (O(1))

◆ m_update_timestamp

template<class T >
unsigned int APairInteractionGroup< T >::m_update_timestamp
protected

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