24#ifndef PARTICLE_CONTACT_CONTAINER_HH
25#define PARTICLE_CONTACT_CONTAINER_HH
34template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
36 int resizeParticleContactTo,
int resizeWallContactsTo)
38 particleContacts.resize(resizeParticleContactTo);
39 wallContacts.resize(resizeWallContactsTo);
42template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
44 WALLCONTACTTYPE>::combineContacts()
46 for (
auto it = std::begin(particleContacts); it != std::end(particleContacts);
48 for (
auto it2 = it + 1; it2 != std::end(particleContacts); ++it2) {
50 it->combineWith(*it2);
54 for (
auto it = std::begin(wallContacts); it != std::end(wallContacts); ++it) {
55 for (
auto it2 = it + 1; it2 != std::end(wallContacts); ++it2) {
57 it->combineWith(*it2);
62template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
64 WALLCONTACTTYPE>::cleanParticleContacts()
69template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
71 WALLCONTACTTYPE>::cleanWallContacts()
76template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
79 cleanParticleContacts();
83template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
85 WALLCONTACTTYPE>::clearParticleContacts()
87 const std::size_t capacity = particleContacts.capacity();
88 particleContacts.clear();
89 particleContacts.reserve(capacity / 2);
92template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
94 WALLCONTACTTYPE>::clearWallContacts()
96 const std::size_t capacity = wallContacts.capacity();
98 wallContacts.reserve(capacity / 2);
101template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
104 clearParticleContacts();
108template <
typename T,
typename PARTICLECONTACTTYPE,
typename WALLCONTACTTYPE>
113 particleContacts.clear();
119 wallContacts.clear();
121 for (
size_t i = 0; i < container.
wallContacts.size(); ++i) {
void cleanContacts(std::vector< CONTACTTYPE > &contacts)
Top level namespace for all of OpenLB.
std::vector< PARTICLECONTACTTYPE > particleContacts
resizeable vector containing all particle-particle contacts
ContactContainer(int resizeParticleContactTo=0, int resizeWallContactsTo=0)
Constructor.
void cleanContacts()
Clean contacts - remove "empty" contacts.
void clearContacts()
Clear contacts - remove all content.
ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & operator=(ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > &container)
std::vector< WALLCONTACTTYPE > wallContacts
resizeable vector containg all particle-wall contacts