MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Helpers.h File Reference
#include "ExtendedMath.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <Logger.h>

Go to the source code of this file.

Classes

class  helpers::KAndDisp
 return type specifically for fuctions returning k and disp at once More...
 
class  helpers::KAndDispAndKtAndDispt
 return type specifically for fuctions returning k, disp, kt, dispt at once More...
 

Namespaces

 helpers
 

Functions

MERCURY_DEPRECATED KAndDisp helpers::computeKAndDispFromCollisionTimeAndRestitutionCoefficientAndEffectiveMass (Mdouble tc, Mdouble r, Mdouble mass)
 Set disp and k such that is matches a given collision time tc and restitution coefficient r for a collision of effective/reduced mass m. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeCollisionTimeFromKAndDispAndEffectiveMass (Mdouble k, Mdouble disp, Mdouble mass)
 Calculates the collision time for a given stiffness, dissipation, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeRestitutionCoefficientFromKAndDispAndEffectiveMass (Mdouble k, Mdouble disp, Mdouble mass)
 Calculates the restitution coefficient time for a given stiffness, dissipation, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeDispFromKAndRestitutionCoefficientAndEffectiveMass (Mdouble k, Mdouble r, Mdouble mass)
 Calculates the dissipation for a given stiffness, restitution coefficient, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeCollisionTimeFromKAndRestitutionCoefficientAndEffectiveMass (Mdouble k, Mdouble r, Mdouble mass)
 Calculates the collision time for a given stiffness, restitution coefficient, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeDispFromKAndCollisionTimeAndEffectiveMass (Mdouble k, Mdouble tc, Mdouble mass)
 Calculates the dissipation for a given stiffness, collision time, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeRestitutionCoefficientFromKAndCollisionTimeAndEffectiveMass (Mdouble k, Mdouble tc, Mdouble mass)
 Calculates the restitution coefficient for a given stiffness, collision time, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeDispFromCollisionTimeAndRestitutionCoefficientAndEffectiveMass (Mdouble tc, Mdouble r, Mdouble mass)
 Calculates the dissipation for a given collision time, restitution coefficient, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeKFromCollisionTimeAndRestitutionCoefficientAndEffectiveMass (Mdouble tc, Mdouble r, Mdouble mass)
 Calculates the stiffness for a given collision time, restitution coefficient, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeKFromCollisionTimeAndDispAndEffectiveMass (Mdouble tc, Mdouble disp, Mdouble mass)
 Calculates the stiffness for a given collision time, dissipation, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeRestitutionCoefficientFromCollisionTimeAndDispAndEffectiveMass (Mdouble tc, Mdouble disp, Mdouble mass)
 Calculates the resitution coefficient for a given collision time, dissipation, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeKFromDispAndRestitutionCoefficientAndEffectiveMass (Mdouble disp, Mdouble r, Mdouble mass)
 Calculates the stiffness for a given dissipation, restitution coefficient, and effective mass. More...
 
MERCURY_DEPRECATED Mdouble helpers::computeCollisionTimeFromDispAndRestitutionCoefficientAndEffectiveMass (Mdouble disp, Mdouble r, Mdouble mass)
 Calculates the collision time for a given dissipation, restitution coefficient, and effective mass. More...
 
MERCURY_DEPRECATED
KAndDispAndKtAndDispt 
helpers::computeDisptFromCollisionTimeAndRestitutionCoefficientAndTangentialRestitutionCoefficientAndEffectiveMass (Mdouble tc, Mdouble r, Mdouble beta, Mdouble mass)
 Set disp, k, dispt and kt such that is matches a given collision time tc and a normal andtangential restitution coefficient r, beta for a collision of effective/reduced mass m. From Deen...Kuipers2006, eq. 43 and 30. More...
 
MERCURY_DEPRECATED Mdouble helpers::getMaximumVelocity (Mdouble k, Mdouble disp, Mdouble radius, Mdouble mass)
 Calculates the maximum relative velocity allowed for a normal collision of two particles of radius r and particle mass m (for higher velocities particles could pass through each other) More...
 
unsigned int helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimestep (unsigned int numberOfSaves, Mdouble timeMax, Mdouble timestep)
 Returns the correct saveCount if the total number of saves, the final time and the time step is known. More...
 
void helpers::getLineFromStringStream (std::istream &in, std::stringstream &out)
 Reads a line from one stringstream into another, and prepares the latter for reading in. More...
 
bool helpers::writeToFile (std::string filename, std::string filecontent)
 Writes a string to a file. More...
 
bool helpers::addToFile (std::string filename, std::string filecontent)
 Adds a string to an existing file. More...
 
bool helpers::fileExists (std::string strFilename)
 Function to check if a file exists, is used to check if a run has already need done. More...
 
bool helpers::openFile (std::fstream &file, std::string filename, std::fstream::openmode mode)
 Provides a simple interface for opening a file. More...
 
Mdouble helpers::getEffectiveMass (Mdouble mass0, Mdouble mass1)
 Calculates the effective mass of a particle pair, i.e. half the harmonic mean of two particle masses. More...
 
std::vector< double > helpers::readArrayFromFile (std::string filename, int &n, int &m)
 
template<typename T >
std::string helpers::to_string (const T &n)
 
template<typename T >
void helpers::readOptionalVariable (std::istream &is, std::string name, T &variable)
 
void helpers::loadingTest (const ParticleSpecies *species, Mdouble displacement, Mdouble velocity, Mdouble radius, std::string name)
 Used to test the loading/unloading properties of a contact law. More...
 
void helpers::normalAndTangentialLoadingTest (const ParticleSpecies *species, Mdouble displacement, Mdouble tangentialDisplacement, Mdouble velocity, Mdouble radius, std::string name)
 Used to test the tangential loading/unloading/reloading properties of a frictional contact law. More...
 
void helpers::objectivenessTest (const ParticleSpecies *species, Mdouble displacement, Mdouble tangentialDisplacement, Mdouble velocity, Mdouble radius, std::string name)
 Used to test the tangential loading/unloading/reloading properties of a frictional contact law. More...
 
template<typename T >
helpers::readFromFile (std::string fileName, std::string varName, T value)
 Allows a quick read-in from a parameter file. More...
 
bool helpers::compare (std::istream &is, std::string s)
 
void helpers::check (double real, double ideal, double error, std::string errorMessage)