24#ifndef PARTICLE_CONTACT_H
25#define PARTICLE_CONTACT_H
41 static_assert(D == 2 || D == 3,
"Only D=2 and D=3 are supported");
60template <
typename T,
unsigned D,
bool CONVEX>
64 std::array<PhysR<T, D>, 2> particlePositions;
70 std::array<std::size_t, 2> ids;
72 std::array<T, 1> dampingFactor = {-1};
74 std::array<bool, 1> particlePositionUpdated = {
false};
76 std::array<bool, 1> newContact = {
true};
78 std::array<int, 1> responsibleRank = {std::numeric_limits<int>::max()};
81 static const std::size_t serialSize =
82 sizeof(particlePositionUpdated) +
sizeof(newContact) +
83 sizeof(particlePositions) +
sizeof(min) +
sizeof(max) +
sizeof(ids) +
84 sizeof(responsibleRank) +
sizeof(dampingFactor);
87 std::size_t processWithCommunicatables(F f);
90 static_assert(D == 2 || D == 3,
"Only D=2 and D=3 are supported");
95 const std::array<std::size_t, 2>& particleIDs);
112 constexpr const std::array<std::size_t, 2>&
getIDs()
const;
123 const std::size_t&
id);
129 const T initialRelativeVelocityMagnitude);
144 constexpr bool isEmpty()
const;
146 constexpr bool isNew()
const;
148 constexpr void isNew(
const bool newContact);
161 std::size_t
serialize(std::uint8_t* buffer);
Top level namespace for all of OpenLB.
An object holding data for a contact which is described analog to Nassauer and Kuna (2013)
constexpr void setDampingFactor(const T dampingFactor)
Set damping factor for contact.
void print()
Print relevant quantities.
constexpr const std::array< std::size_t, 2 > & getIDs() const
Read access to particle IDs.
constexpr void setParticlePositionUpdated(bool updated)
constexpr void increaseMinMax(const Vector< T, D > &increaseBy)
Increase bounding box size.
constexpr const PhysR< T, D > & getParticlePosition(const std::size_t &id) const
Return particle position.
constexpr void setParticlePositions(const std::array< PhysR< T, D >, 2 > &positions)
Set particle positions.
constexpr bool isNew() const
Returns if the contact is a new contact.
constexpr void updateMinMax(const PhysR< T, D > &positionInsideTheContact)
Update min and max with given position inside the contact.
constexpr const int & getResponsibleRank() const
Read access to the responsible rank.
constexpr void setDampingFactorFromInitialVelocity(const T coefficientOfRestitution, const T initialRelativeVelocityMagnitude)
Set damping factor from the magnitude of the initial relative impact velocity in direction of contact...
ParticleContactArbitraryFromOverlapVolume< T, D, CONVEX > & operator=(const ParticleContactArbitraryFromOverlapVolume< T, D, CONVEX > &pc)
Copy assignment.
constexpr bool isParticlePositionUpdated() const
Returns if the particle position is up-to-date.
constexpr void setParticlePosition(const PhysR< T, D > &position, const std::size_t &id)
Set position of specific particle.
static constexpr std::size_t getSerialSize()
Get serial size.
constexpr const std::array< PhysR< T, D >, 2 > & getParticlePositions() const
Read access to particle positions.
constexpr const PhysR< T, D > & getMax() const
Read access to max.
ParticleContactArbitraryFromOverlapVolume()
Constructor.
constexpr bool isEmpty() const
Returns if contact holds data.
std::size_t deserialize(std::uint8_t *buffer)
Deserialize contact data and save in object.
constexpr const PhysR< T, D > & getMin() const
Read access to min.
constexpr void combineWith(ParticleContactArbitraryFromOverlapVolume< T, D, CONVEX > &pc)
Combining two contacts, if the particle ids are the same.
constexpr const T getDampingFactor() const
Read access to damping factor.
constexpr void resetMinMax()
Reset min and max to default values.
std::size_t serialize(std::uint8_t *buffer)
Serialize contact data.
constexpr void setResponsibleRank(const int &rank)
Set processor that is responsible for contact treatment.
static const std::vector< unsigned int > indicesDim
static const std::vector< unsigned int > indicesSingle
static const std::vector< unsigned int > indicesPart
Set of functions commonly used in LB computations – header file.