OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > Struct Template Reference

#include <contactContainer.h>

+ Collaboration diagram for olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >:

Public Member Functions

 ContactContainer (int resizeParticleContactTo=0, int resizeWallContactsTo=0)
 Constructor.
 
void combineContacts ()
 Combine contacts with same ids.
 
void cleanParticleContacts ()
 Clean contacts - remove "empty" contacts.
 
void cleanWallContacts ()
 Clean contacts - remove "empty" contacts.
 
void cleanContacts ()
 Clean contacts - remove "empty" contacts.
 
void clearParticleContacts ()
 Clear contacts - remove all content.
 
void clearWallContacts ()
 Clear contacts - remove all content.
 
void clearContacts ()
 Clear contacts - remove all content.
 
ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & operator= (ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > &container)
 

Public Attributes

std::vector< PARTICLECONTACTTYPE > particleContacts
 resizeable vector containing all particle-particle contacts
 
std::vector< WALLCONTACTTYPE > wallContacts
 resizeable vector containg all particle-wall contacts
 

Detailed Description

template<typename T, typename PARTICLECONTACTTYPE, typename WALLCONTACTTYPE>
struct olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >

Definition at line 35 of file contactContainer.h.

Constructor & Destructor Documentation

◆ ContactContainer()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::ContactContainer ( int resizeParticleContactTo = 0,
int resizeWallContactsTo = 0 )

Constructor.

Definition at line 35 of file contactContainer.hh.

37{
38 particleContacts.resize(resizeParticleContactTo);
39 wallContacts.resize(resizeWallContactsTo);
40}
std::vector< PARTICLECONTACTTYPE > particleContacts
resizeable vector containing all particle-particle contacts
std::vector< WALLCONTACTTYPE > wallContacts
resizeable vector containg all particle-wall contacts

Member Function Documentation

◆ cleanContacts()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
void olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::cleanContacts ( )

Clean contacts - remove "empty" contacts.

Definition at line 77 of file contactContainer.hh.

78{
81}
void cleanWallContacts()
Clean contacts - remove "empty" contacts.
void cleanParticleContacts()
Clean contacts - remove "empty" contacts.
+ Here is the caller graph for this function:

◆ cleanParticleContacts()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
void olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::cleanParticleContacts ( )

Clean contacts - remove "empty" contacts.

Definition at line 64 of file contactContainer.hh.

65{
67}
void cleanContacts(std::vector< CONTACTTYPE > &contacts)

References olb::particles::contact::cleanContacts().

+ Here is the call graph for this function:

◆ cleanWallContacts()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
void olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::cleanWallContacts ( )

Clean contacts - remove "empty" contacts.

Definition at line 71 of file contactContainer.hh.

References olb::particles::contact::cleanContacts().

+ Here is the call graph for this function:

◆ clearContacts()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
void olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::clearContacts ( )

Clear contacts - remove all content.

Definition at line 102 of file contactContainer.hh.

103{
106}
void clearWallContacts()
Clear contacts - remove all content.
void clearParticleContacts()
Clear contacts - remove all content.

◆ clearParticleContacts()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
void olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::clearParticleContacts ( )

Clear contacts - remove all content.

Definition at line 85 of file contactContainer.hh.

86{
87 const std::size_t capacity = particleContacts.capacity();
88 particleContacts.clear();
89 particleContacts.reserve(capacity / 2);
90}

◆ clearWallContacts()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
void olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::clearWallContacts ( )

Clear contacts - remove all content.

Definition at line 94 of file contactContainer.hh.

95{
96 const std::size_t capacity = wallContacts.capacity();
97 wallContacts.clear();
98 wallContacts.reserve(capacity / 2);
99}

◆ combineContacts()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
void olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::combineContacts ( )

Combine contacts with same ids.

Definition at line 44 of file contactContainer.hh.

45{
46 for (auto it = std::begin(particleContacts); it != std::end(particleContacts);
47 ++it) {
48 for (auto it2 = it + 1; it2 != std::end(particleContacts); ++it2) {
49 // combineWith must check if the particle ids are the same
50 it->combineWith(*it2);
51 }
52 }
53
54 for (auto it = std::begin(wallContacts); it != std::end(wallContacts); ++it) {
55 for (auto it2 = it + 1; it2 != std::end(wallContacts); ++it2) {
56 // combineWith must check if the contacts are the same
57 it->combineWith(*it2);
58 }
59 }
60}
+ Here is the caller graph for this function:

◆ operator=()

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::operator= ( ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & container)

Definition at line 110 of file contactContainer.hh.

112{
113 particleContacts.clear();
114 particleContacts.reserve(container.particleContacts.size());
115 for (size_t i = 0; i < container.particleContacts.size(); ++i) {
116 particleContacts.push_back(container.particleContacts[i]);
117 }
118
119 wallContacts.clear();
120 wallContacts.reserve(container.wallContacts.size());
121 for (size_t i = 0; i < container.wallContacts.size(); ++i) {
122 wallContacts.push_back(container.wallContacts[i]);
123 }
124
125 return *this;
126}

References olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::particleContacts, and olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::wallContacts.

Member Data Documentation

◆ particleContacts

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
std::vector<PARTICLECONTACTTYPE> olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::particleContacts

resizeable vector containing all particle-particle contacts

Definition at line 41 of file contactContainer.h.

◆ wallContacts

template<typename T , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE >
std::vector<WALLCONTACTTYPE> olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::wallContacts

resizeable vector containg all particle-wall contacts

Definition at line 43 of file contactContainer.h.


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