Detailed Description

Apply a HCSITS (Hard-contact semi-implicit timestepping solver) relaxation to all contacts.

Call this kernel on all bodies to perform on relaxation step of the solver. There exist different friction and relaxation models. See comments on their respective methods for an extended documentation. Use setRelaxationModel() to set it. getDeltaMax() can be used to query the maximum change in the impulses applied wrt to the last iteration.

Use setMaxSubIterations() to set the maximum number of iterations performed to solve optimization problems arising during the relaxation (in InelasticGeneralizedMaximumDissipationContact and InelasticCoulombContactByDecoupling).

Use setCor() to set the coefficient of restitution between 0 and 1 for the InelasticProjectedGaussSeidel model. All other models describe inelastic contacts.

Example of Using the HCSITS kernels in a simulation:

// ps: Particle storage
// cs: Contact storage
// pa: Particle accessor
// ca: Contact accessor
// Detect contacts first and fill contact storage
mesa_pd::mpi::ReduceProperty reductionKernel;
mesa_pd::mpi::BroadcastProperty broadcastKernel;
kernel::IntegrateBodiesHCSITS integration;
kernel::InitContactsForHCSITS initContacts(1);
initContacts.setFriction(0,0,real_t(0.2));
kernel::InitBodiesForHCSITS initBodies;
kernel::HCSITSRelaxationStep relaxationStep;
relaxationStep.setCor(real_t(0.1)); // Only effective for PGSM
// Init Contacts and Bodies (order is arbitrary)
cs.forEachContact(false, kernel::SelectAll(), ca, initContacts, ca, pa);
ps.forEachParticle(false, kernel::SelectAll(), pa, initBodies, pa, dt);
// Reduce and Broadcast velocities with relaxation parameter 1 before the iteration
reductionKernel.operator()<VelocityCorrectionNotification>(*ps);
broadcastKernel.operator()<VelocityUpdateNotification>(*ps);
for(int j = 0; j < 10; j++){
cs.forEachContact(false, kernel::SelectAll(), ca, relaxationStep, ca, pa, dt);
reductionKernel.operator()<VelocityCorrectionNotification>(*ps);
broadcastKernel.operator()<VelocityUpdateNotification>(*ps);
}
ps.forEachParticle(false, kernel::SelectAll(), pa, integration, pa, dt);

#include <HCSITSRelaxationStep.h>

Public Types

enum  RelaxationModel {
  InelasticFrictionlessContact, ApproximateInelasticCoulombContactByDecoupling, ApproximateInelasticCoulombContactByOrthogonalProjections, InelasticCoulombContactByDecoupling,
  InelasticCoulombContactByOrthogonalProjections, InelasticGeneralizedMaximumDissipationContact, InelasticProjectedGaussSeidel
}
 

Public Member Functions

 HCSITSRelaxationStep ()
 
const size_tgetMaxSubIterations () const
 
void setMaxSubIterations (size_t v)
 
const RelaxationModelgetRelaxationModel () const
 
void setRelaxationModel (RelaxationModel v)
 
const real_tgetDeltaMax () const
 
void setDeltaMax (real_t v)
 
const real_tgetCor () const
 
void setCor (real_t v)
 
template<typename CAccessor , typename PAccessor >
void operator() (size_t cid, CAccessor &ca, PAccessor &pa, real_t dt)
 Perform relaxation for a single contact. More...
 
template<typename CAccessor , typename PAccessor >
real_t relaxInelasticFrictionlessContacts (size_t cid, real_t dtinv, CAccessor &ca, PAccessor &pa)
 Relaxes The contact with ID cid once. More...
 
template<typename CAccessor , typename PAccessor >
real_t relaxApproximateInelasticCoulombContactsByDecoupling (size_t cid, real_t dtinv, CAccessor &ca, PAccessor &pa)
 Relaxes all contacts once. More...
 
template<typename CAccessor , typename PAccessor >
real_t relaxInelasticCoulombContactsByDecoupling (size_t cid, real_t dtinv, CAccessor &ca, PAccessor &pa)
 Relaxes all contacts once. More...
 
template<typename CAccessor , typename PAccessor >
real_t relaxInelasticCoulombContactsByOrthogonalProjections (size_t cid, real_t dtinv, bool approximate, CAccessor &ca, PAccessor &pa)
 Relaxes all contacts once. More...
 
template<typename CAccessor , typename PAccessor >
real_t relaxInelasticGeneralizedMaximumDissipationContacts (size_t cid, real_t dtinv, CAccessor &ca, PAccessor &pa)
 Relaxes all contacts once. More...
 
template<typename CAccessor , typename PAccessor >
real_t relaxInelasticContactsByProjectedGaussSeidel (size_t cid, real_t dtinv, CAccessor &ca, PAccessor &pa)
 Relaxes all contacts once. More...
 

Private Attributes

size_t maxSubIterations_
 
RelaxationModel relaxationModel_
 
real_t deltaMax_
 
real_t cor_
 

Member Enumeration Documentation

◆ RelaxationModel

Enumerator
InelasticFrictionlessContact 
ApproximateInelasticCoulombContactByDecoupling 
ApproximateInelasticCoulombContactByOrthogonalProjections 
InelasticCoulombContactByDecoupling 
InelasticCoulombContactByOrthogonalProjections 
InelasticGeneralizedMaximumDissipationContact 
InelasticProjectedGaussSeidel 

Constructor & Destructor Documentation

◆ HCSITSRelaxationStep()

walberla::mesa_pd::kernel::HCSITSRelaxationStep::HCSITSRelaxationStep ( )
inline

Member Function Documentation

◆ getCor()

const real_t& walberla::mesa_pd::kernel::HCSITSRelaxationStep::getCor ( ) const
inline

◆ getDeltaMax()

const real_t& walberla::mesa_pd::kernel::HCSITSRelaxationStep::getDeltaMax ( ) const
inline

◆ getMaxSubIterations()

const size_t& walberla::mesa_pd::kernel::HCSITSRelaxationStep::getMaxSubIterations ( ) const
inline

◆ getRelaxationModel()

const RelaxationModel& walberla::mesa_pd::kernel::HCSITSRelaxationStep::getRelaxationModel ( ) const
inline

◆ operator()()

template<typename CAccessor , typename PAccessor >
void walberla::mesa_pd::kernel::HCSITSRelaxationStep::operator() ( size_t  cid,
CAccessor &  ca,
PAccessor &  pa,
real_t  dt 
)
inline

Perform relaxation for a single contact.

Parameters
cidThe index of the contact with the accessor ca.
caThe contact accessor.
paThe particle accessor.
dtThe timestep size used.

◆ relaxApproximateInelasticCoulombContactsByDecoupling()

template<typename CAccessor , typename PAccessor >
real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::relaxApproximateInelasticCoulombContactsByDecoupling ( size_t  cid,
real_t  dtinv,
CAccessor &  ca,
PAccessor &  pa 
)
inline

Relaxes all contacts once.

The contact model is for inelastic unilateral contacts with approximate Coulomb friction.

Returns
The largest variation of contact impulses in the L-infinity norm.

This function is to be called from resolveContacts(). Separating contacts are preferred over other solutions if valid. Static solutions are preferred over dynamic solutions. Dynamic solutions are computed by decoupling the normal from the frictional components. That is for a dynamic contact the normal component is relaxed first followed by the frictional components. The determination of the frictional components does not perform any subiterations and guarantees that the friction partially opposes slip.

◆ relaxInelasticContactsByProjectedGaussSeidel()

template<typename CAccessor , typename PAccessor >
real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::relaxInelasticContactsByProjectedGaussSeidel ( size_t  cid,
real_t  dtinv,
CAccessor &  ca,
PAccessor &  pa 
)
inline

Relaxes all contacts once.

The contact model is from the paper by Tschisgale et al. "A constraint-based collision model for Cosserat rods" and works with a coefficient of restitution cor with 0 < cor <= 1.

Returns
The largest variation of contact impulses in the L-infinity norm.

◆ relaxInelasticCoulombContactsByDecoupling()

template<typename CAccessor , typename PAccessor >
real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::relaxInelasticCoulombContactsByDecoupling ( size_t  cid,
real_t  dtinv,
CAccessor &  ca,
PAccessor &  pa 
)
inline

Relaxes all contacts once.

The contact model is for inelastic unilateral contacts with Coulomb friction.

Returns
The largest variation of contact impulses in the L-infinity norm.

This function is to be called from resolveContacts(). Separating contacts are preferred over other solutions if valid. Static solutions are preferred over dynamic solutions. Dynamic solutions are computed by decoupling the normal from the frictional components. That is for a dynamic contact the normal component is relaxed first followed by the frictional components. How much the frictional components directly oppose slip as required by the Coulomb friction model depends on the number of subiterations performed. If no subiterations are performed the friction is guaranteed to be at least partially dissipative.

◆ relaxInelasticCoulombContactsByOrthogonalProjections()

template<typename CAccessor , typename PAccessor >
real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::relaxInelasticCoulombContactsByOrthogonalProjections ( size_t  cid,
real_t  dtinv,
bool  approximate,
CAccessor &  ca,
PAccessor &  pa 
)
inline

Relaxes all contacts once.

The contact model is for inelastic unilateral contacts with Coulomb friction.

Parameters
dtinvThe inverse of the current time step.
approximateUse the approximate model showing bouncing.
Returns
The largest variation of contact impulses in the L-infinity norm.

This function is to be called from resolveContacts(). The iterative method to solve the contact problem is e.g. described in the article "A matrix-free cone complementarity approach for solving large-scale, nonsmooth, rigid body dynamics" by A. Tasora and M. Anitescu in Computer Methods in Applied Mechanics and Engineering (Volume 200, Issues 5–8, 15 January 2011, Pages 439-453). The contact model is purely quadratic and convergence should be good but depends on a parameter. The one-contact problem has a unique solution. The frictional reactions for a dynamic contact converge to those that directly oppose slip. However, the contact is not perfectly inelastic for dynamic contacts but bounces. These vertical motions tend to go to zero for smaller time steps and can be interpreted as exaggerated vertical motions coming from micro asperities (see "Optimization-based simulation of nonsmooth rigid multibody dynamics" by M. Anitescu in Mathematical Programming (Volume 105, Issue 1, January 2006, Pages 113-143). These motions can be prevented by a small change in the iteration proposed in "The bipotential method: a constructive approach to design the complete contact law with friction and improved numerical algorithms" by G. De Saxce and Z-Q. Feng in Mathematical and Computer Modelling (Volume 28, Issue 4, 1998, Pages 225-245). Which iteration is used is controlled with the approximate parameter.

◆ relaxInelasticFrictionlessContacts()

template<typename CAccessor , typename PAccessor >
real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::relaxInelasticFrictionlessContacts ( size_t  cid,
real_t  dtinv,
CAccessor &  ca,
PAccessor &  pa 
)
inline

Relaxes The contact with ID cid once.

The contact model is for inelastic unilateral contacts without friction.

Parameters
cidThe index of the contact
caThe contact accessor
paThe particle accessor
Returns
The largest variation of contact impulses in the L-infinity norm.

This function is to be called from resolveContacts(). Separating contacts are preferred over persisting solutions if valid.

◆ relaxInelasticGeneralizedMaximumDissipationContacts()

template<typename CAccessor , typename PAccessor >
real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::relaxInelasticGeneralizedMaximumDissipationContacts ( size_t  cid,
real_t  dtinv,
CAccessor &  ca,
PAccessor &  pa 
)
inline

Relaxes all contacts once.

The contact model is for inelastic unilateral contacts with the generalized maximum dissipation principle for friction.

Returns
The largest variation of contact impulses in the L-infinity norm.

This function is to be called from resolveContacts(). Dynamic solutions are computed by minimizing the kinetic energy along the intersection of the plane of maximum compression and the friction cone.

◆ setCor()

void walberla::mesa_pd::kernel::HCSITSRelaxationStep::setCor ( real_t  v)
inline

◆ setDeltaMax()

void walberla::mesa_pd::kernel::HCSITSRelaxationStep::setDeltaMax ( real_t  v)
inline

◆ setMaxSubIterations()

void walberla::mesa_pd::kernel::HCSITSRelaxationStep::setMaxSubIterations ( size_t  v)
inline

◆ setRelaxationModel()

void walberla::mesa_pd::kernel::HCSITSRelaxationStep::setRelaxationModel ( RelaxationModel  v)
inline

Member Data Documentation

◆ cor_

real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::cor_
private

◆ deltaMax_

real_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::deltaMax_
private

◆ maxSubIterations_

size_t walberla::mesa_pd::kernel::HCSITSRelaxationStep::maxSubIterations_
private

◆ relaxationModel_

RelaxationModel walberla::mesa_pd::kernel::HCSITSRelaxationStep::relaxationModel_
private

The documentation for this class was generated from the following file:
float real_t
Definition: DataTypes.h:167
static real_t relaxationParam
Definition: VelocityUpdateNotification.h:55