Class OSNSMultipleImpact

Defined in Program listing for file kernel/src/simulationTools/OSNSMultipleImpact.hpp

class OSNSMultipleImpact : public LinearOSNS

Formalization and Resolution of a Multiple Impact Non-Smooth problem.

Public Functions

OSNSMultipleImpact()

Default constructor.

OSNSMultipleImpact(std::string type, double step)

Constructor from data (step size is required here)

Parameters
  • type: the type of the compliance law
  • step: step size estimated

~OSNSMultipleImpact()

Destructor.

void AllocateMemory()

To allocate the memory.

void BuildParaContact()

To build the vector of stiffnesses and restitution coefficient at contacts.

void Check_stateContact()

To check the state of contacts during impact.

int compute(double time)

compute the unknown post-impact relative velocity and post-impact impulse

Return
int
Parameters
  • time:

void Compute_distributionVector()

Calculate the vector of distributing rule.

void Compute_energyContact()

Compute the potential energy at contacts during each computation step.

void Compute_velocityContact()

Compute the relative velocity at contacts.

void ComputeImpact()

Run the iterative procedure to solve the multiple impact problem.

void ComputeImpulseContact()

Compute the normal imulse at contacts.

void display() const

print the data to the screen

unsigned int EstimateNdataCols()

Estimate size of data matrix.

Return
unsigned int

double GetStepSize()

To get step size.

Return
double

double getTolImpact()

To get the tolerance to define zero.

Return
double

void initialize(SP::Simulation sim)

initialize

Parameters
  • sim:

void InitializeInput()

To get the velocity of bodies, relative velocity and potential energy at the beginning of impact.

bool IsEnermaxZero()

To decide if the primary contact is selected according to the relative velocity or to the potential energy.

The first case happens when there is no potential energy at any contact

Return
bool

bool isEnerZero(double var)

To compare an energy value with zero.

Return
bool
Parameters
  • var:

bool IsMulImpactTerminate()

Check if the multiple impacts process is terminated or not.

Return
bool

bool IsVcminNegative()

Verify if the minimum relative velocity at contacts is negative or not.

Return
bool

bool isVelNegative(double var)

To compare a velocity value with zero.

Return
bool
Parameters
  • var:

bool isZero(double var)

To compare a double number with zero.

Return
bool
Parameters
  • var:

void PostComputeImpact()

Post-compute for multiple impacts.

void PreComputeImpact()

Pre-compute for multiple impacs.

void PrimConEnergy()

To get the primary contact according to the potential energy.

In this case, the primary contact corresponds to the one at which the potential energy is maximum

void PrimConVelocity()

To get the primary contact according to the relative velocity In this case, the primary contact correspond to the contact at which the relative velocity is minimum (the relative velocity for two approching bodies is negative so the magnitude of the relative velocity at the primary contact is maximum)

void SaveDataOneStep(unsigned int i)

Save data for each step.

Parameters
  • i: pointer to be save

void SelectPrimaContact()

To select the pramary contact.

void set_typeCompLaw(std::string newTypeLaw)

To set the type of the compliance law.

Parameters
  • newTypeLaw:

void SetNameOutput(std::string file_name)

To set the name for the output file.

Parameters
  • file_name:

void SetNstepMax(unsigned int var)

To set the maximal number of steps allowed for each computation.

Parameters
  • var:

void SetNstepSave(unsigned int var)

To set the variable _nStepSave.

Parameters
  • var:

void SetSaveData(bool var)

To set the flag to save the data during impact or not.

Parameters
  • var:

void SetSizeDataSave(unsigned int var)

Set number of points to be saved during impact.

Parameters
  • var:

void SetStepMinMaxSave(unsigned int min, unsigned int max)

Set the step number to start the data save and step number to stop save.

Parameters
  • min:
  • max:

void SetTolEner(double var)

Set tolerence to define whether or not a potential energy is zero.

Parameters
  • var:

void setTolImpact(double newTolZero)

To set the tolerance to define zero.

Parameters
  • newTolZero:

void SetTolVel(double var)

Set tolerence to define whether or not a velocity is zero.

Parameters
  • var:

void SetZeroEnerEndImp(double var)

Set epsilon _ZeroEner_EndIm.

Parameters
  • var:

void SetZeroVelEndImp(double var)

Set epsilon _ZeroVel_EndIm.

Parameters
  • var:

void UpdateDuringImpact()

Compute the velocity of the bodies during impact.

void WriteVectorIntoMatrix(const SiconosVector &v, const unsigned int row, const unsigned int col)

To write a SiconosVector into a matrix.

Parameters
  • v:
  • row: position starting to write
  • col: position starting to write