votca 2024-dev
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Static Protected Member Functions | Protected Attributes | List of all members
votca::csg::NBList Class Reference

Neighbour list class. More...

#include <nblist.h>

Inheritance diagram for votca::csg::NBList:
Inheritance graph
[legend]
Collaboration diagram for votca::csg::NBList:
Collaboration graph
[legend]

Classes

class  Functor
 
class  FunctorMember
 Functor for member functions. More...
 
class  FunctorNonMember
 Functor for non-member functions. More...
 

Public Member Functions

 NBList ()
 
 ~NBList () override
 
virtual void Generate (BeadList &list1, BeadList &list2, bool do_exclusions=true)
 Generate the neighbour list based on two bead lists (e.g. bead types)
 
virtual void Generate (BeadList &list, bool do_exclusions=true)
 Generate the neighbour list based on a single bead list.
 
void setCutoff (double cutoff)
 set the cutoff for the neighbour search
 
double getCutoff () const
 get the cutoff for the neighbour search
 
template<typename T >
void SetMatchFunction (T *object, bool(T::*fkt)(Bead *, Bead *, const Eigen::Vector3d &, double dist))
 match function for class member functions
 
void SetMatchFunction (bool(*fkt)(Bead *, Bead *, const Eigen::Vector3d &, double))
 match function for static member functions or plain functions
 
template<typename pair_type >
void setPairType ()
 function to use a user defined pair type
 
template<typename T >
void SetMatchFunction (T *object, bool(T::*fkt)(Bead *, Bead *, const Eigen::Vector3d &, double))
 
- Public Member Functions inherited from votca::csg::PairList< Bead *, BeadPair >
 PairList ()=default
 
virtual ~PairList ()
 
void AddPair (BeadPair *p)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
BeadPairfront ()
 
BeadPairback ()
 
bool empty () const
 
Index size () const
 
void Cleanup ()
 
BeadPairFindPair (Bead * e1, Bead * e2)
 
const BeadPairFindPair (Bead * e1, Bead * e2) const
 
partnersFindPartners (Bead * e1)
 

Static Public Member Functions

static bool match_always (Bead *, Bead *, const Eigen::Vector3d &, double)
 standard match function
 

Protected Types

using pair_creator_t = BeadPair *(*)(Bead *, Bead *, const Eigen::Vector3d &)
 

Static Protected Member Functions

template<typename pair_type >
static BeadPairbeadpair_create_policy (Bead *bead1, Bead *bead2, const Eigen::Vector3d &r)
 policy function to create new bead types
 

Protected Attributes

double cutoff_
 cutoff
 
bool do_exclusions_
 take into account exclusions from topolgoy
 
pair_creator_t pair_creator_
 the current bead pair creator function
 
std::unique_ptr< Functormatch_function_
 
- Protected Attributes inherited from votca::csg::PairList< Bead *, BeadPair >
std::vector< BeadPair * > pairs_
 
std::map< Bead *, std::map< Bead *, BeadPair * > > pair_map_
 

Additional Inherited Members

- Public Types inherited from votca::csg::PairList< Bead *, BeadPair >
using iterator = typename std::vector< BeadPair * >::iterator
 
using const_iterator = typename std::vector< BeadPair * >::const_iterator
 
typedef std::map< Bead *, BeadPair * > partners
 
using element_t = Bead *
 
using pair_t = BeadPair
 

Detailed Description

Neighbour list class.

Implements a simple N^2 neighbour search and stores neigbourlist with pair structure. User defined criteria can be added by SetMatchFunction. To only get every pair listed once, the SetMatchFunction can be used and always return that the pair is not stored.

Definition at line 39 of file nblist.h.

Member Typedef Documentation

◆ pair_creator_t

using votca::csg::NBList::pair_creator_t = BeadPair *(*)(Bead *, Bead *, const Eigen::Vector3d &)
protected

Definition at line 102 of file nblist.h.

Constructor & Destructor Documentation

◆ NBList()

votca::csg::NBList::NBList ( )

Definition at line 28 of file nblist.cc.

◆ ~NBList()

votca::csg::NBList::~NBList ( )
override

Definition at line 33 of file nblist.cc.

Member Function Documentation

◆ beadpair_create_policy()

template<typename pair_type >
static BeadPair * votca::csg::NBList::beadpair_create_policy ( Bead bead1,
Bead bead2,
const Eigen::Vector3d &  r 
)
inlinestaticprotected

policy function to create new bead types

Definition at line 97 of file nblist.h.

◆ Generate() [1/2]

virtual void votca::csg::NBList::Generate ( BeadList list,
bool  do_exclusions = true 
)
inlinevirtual

Generate the neighbour list based on a single bead list.

Reimplemented in votca::csg::NBListGrid.

Definition at line 48 of file nblist.h.

◆ Generate() [2/2]

void votca::csg::NBList::Generate ( BeadList list1,
BeadList list2,
bool  do_exclusions = true 
)
virtual

Generate the neighbour list based on two bead lists (e.g. bead types)

Reimplemented in votca::csg::NBListGrid.

Definition at line 37 of file nblist.cc.

◆ getCutoff()

double votca::csg::NBList::getCutoff ( ) const
inline

get the cutoff for the neighbour search

Definition at line 55 of file nblist.h.

◆ match_always()

static bool votca::csg::NBList::match_always ( Bead ,
Bead ,
const Eigen::Vector3d &  ,
double   
)
inlinestatic

standard match function

Definition at line 81 of file nblist.h.

◆ setCutoff()

void votca::csg::NBList::setCutoff ( double  cutoff)
inline

set the cutoff for the neighbour search

Definition at line 53 of file nblist.h.

◆ SetMatchFunction() [1/3]

void votca::csg::NBList::SetMatchFunction ( bool(*)(Bead *, Bead *, const Eigen::Vector3d &, double)  fkt)
inline

match function for static member functions or plain functions

Definition at line 166 of file nblist.h.

◆ SetMatchFunction() [2/3]

template<typename T >
void votca::csg::NBList::SetMatchFunction ( T *  object,
bool(T::*)(Bead *, Bead *, const Eigen::Vector3d &, double dist)  fkt 
)

match function for class member functions

SetMatchFunction can be used to specify additional criteria, weather two beads are added to the list of pairs or not. The function gets the two two beads and the distance vector as argument. If a pair should be added, the function should return true, otherwise false.

This function can also be used, in a situation where each pair needs only to be processed once, but the total number of pairs is to big to be stored in memory, e.g. to calculate rdf for huge systems. In this case, set a match function which always returns false (->no pair is added), and do the processing in the match function.

◆ SetMatchFunction() [3/3]

template<typename T >
void votca::csg::NBList::SetMatchFunction ( T *  object,
bool(T::*)(Bead *, Bead *, const Eigen::Vector3d &, double)  fkt 
)
inline

Definition at line 159 of file nblist.h.

◆ setPairType()

template<typename pair_type >
void votca::csg::NBList::setPairType

function to use a user defined pair type

Definition at line 154 of file nblist.h.

Member Data Documentation

◆ cutoff_

double votca::csg::NBList::cutoff_
protected

cutoff

Definition at line 91 of file nblist.h.

◆ do_exclusions_

bool votca::csg::NBList::do_exclusions_
protected

take into account exclusions from topolgoy

Definition at line 93 of file nblist.h.

◆ match_function_

std::unique_ptr<Functor> votca::csg::NBList::match_function_
protected

Definition at line 150 of file nblist.h.

◆ pair_creator_

pair_creator_t votca::csg::NBList::pair_creator_
protected

the current bead pair creator function

Definition at line 104 of file nblist.h.


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