Class MultipleImpact#
Defined in Program listing for file kernel/src/simulationTools/MultipleImpact.hpp
-
class MultipleImpact : public LinearOSNS#
Formalization and Resolution of a Multiple Impact Non-Smooth problem.
- Todo:
write a short introduction about MultipleImpact …
Public Functions
-
inline MultipleImpact()#
default constructor
-
MultipleImpact(std::string type, double step = 1.0e-5)#
Constructor from data (step size is required here)
- Parameters:
type – the type of the compliance law
step – step size estimated
-
inline ~MultipleImpact()#
Destructor.
-
void set_typeCompLaw(std::string newTypeLaw)#
To set the type of the compliance law.
- Parameters:
newTypeLaw –
-
void setTolImpact(double newTolZero)#
To set the tolerance to define zero.
- Parameters:
newTolZero –
-
inline double getTolImpact()#
To get the tolerance to define zero.
- Returns:
double
-
void SetSaveData(bool var)#
To set the flag to save the data during impact or not.
- Parameters:
var –
-
void SetNameOutput(std::string file_name)#
To set the name for the output file.
- Parameters:
file_name –
-
inline double GetStepSize()#
To get step size.
- Returns:
double
-
void SetNstepSave(unsigned int var)#
To set the variable _nStepSave.
- Parameters:
var –
-
void SetNstepMax(unsigned int var)#
To set the maximal number of steps allowed for each computation.
- Parameters:
var –
-
void SetSizeDataSave(unsigned int var)#
Set number of points to be saved during impact.
- Parameters:
var –
-
void SetTolVel(double var)#
Set tolerence to define whether or not a velocity is zero.
- Parameters:
var –
-
void SetTolEner(double var)#
Set tolerence to define whether or not a potential energy is zero.
- Parameters:
var –
-
void SetZeroVelEndImp(double var)#
Set epsilon _ZeroVel_EndIm.
- Parameters:
var –
-
void SetZeroEnerEndImp(double var)#
Set epsilon _ZeroEner_EndIm.
- 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 –
-
bool isZero(double var)#
To compare a double number with zero.
- Parameters:
var –
- Returns:
bool
-
bool isVelNegative(double var)#
To compare a velocity value with zero.
- Parameters:
var –
- Returns:
bool
-
bool isEnerZero(double var)#
To compare an energy value with zero.
- Parameters:
var –
- Returns:
bool
-
void SelectPrimaContact()#
To select the pramary contact.
-
void Compute_distributionVector()#
Calculate the vector of distributing rule.
-
void ComputeImpulseContact()#
Compute the normal imulse at contacts.
-
void Compute_velocityContact()#
Compute the relative velocity at contacts.
-
void Compute_energyContact()#
Compute the potential energy at contacts during each computation step.
-
void UpdateDuringImpact()#
Compute the velocity of the bodies during impact.
-
void ComputeImpact()#
Run the iterative procedure to solve the multiple impact problem.
-
void PostComputeImpact()#
Post-compute for multiple impacts.
-
bool IsMulImpactTerminate()#
Check if the multiple impacts process is terminated or not.
- Returns:
bool
-
void AllocateMemory()#
To allocate the memory.
-
void BuildParaContact()#
To build the vector of stiffnesses and restitution coefficient at contacts.
-
void InitializeInput()#
To get the velocity of bodies, relative velocity and potential energy at the beginning of impact.
-
void Check_stateContact()#
To check the state of contacts during impact.
-
void PreComputeImpact()#
Pre-compute for multiple impacs.
-
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 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
-
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
- Returns:
bool
-
bool IsVcminNegative()#
Verify if the minimum relative velocity at contacts is negative or not.
- Returns:
bool
-
virtual int compute(double time) override#
compute the unknown post-impact relative velocity and post-impact impulse
- Parameters:
time –
- Returns:
int
-
virtual void display() const override#
print the data to the screen
-
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
-
void SaveDataOneStep(unsigned int i)#
Save data for each step.
- Parameters:
i – pointer to be save
-
unsigned int EstimateNdataCols()#
Estimate size of data matrix.
- Returns:
unsigned int