MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtendedMath.h File Reference
#include <algorithm>
#include <sstream>
#include <iostream>

Go to the source code of this file.

Classes

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

Namespaces

 constants
 
 mathsFunc
 Namespace for some extra maths function that are often needed.
 
 besselFunc
 Namespace for evaluating the zeroth modified Bessel function of the first kind, I0(x), required in StatisticsPoint.hcc.
 
 helperFunc
 

Macros

#define sqr(a)   ((a)*(a))
 
#define cubic(a)   ((a)*(a)*(a))
 
#define UNUSED   __attribute__ ((__unused__))
 

Typedefs

typedef double Mdouble
 

Functions

Mdouble mathsFunc::gamma (Mdouble gamma_in)
 This is the gamma function returns the true value for the half integer value. More...
 
Mdouble mathsFunc::chi_squared (Mdouble x, int k)
 This is a chi_squared function return the value x and degrees of freedom k. More...
 
Mdouble mathsFunc::chi_squared_prob (Mdouble x, int k)
 This is the function which actually gives the probability back using a chi squared test. More...
 
template<typename T >
int mathsFunc::sign (T val)
 This is a sign function, it returns -1 for negative numbers, 1 for positive numbers and 0 for 0. More...
 
Mdouble besselFunc::chebyshev (Mdouble x, const Mdouble coef[], int N)
 
Mdouble besselFunc::I0_exp (Mdouble x)
 
Mdouble besselFunc::I0 (Mdouble x)
 
KAndDisp helperFunc::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...
 
KAndDispAndKtAndDispt helperFunc::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. More...
 
Mdouble helperFunc::getCollisionTime (Mdouble k, Mdouble disp, Mdouble mass)
 Calculates collision time for two copies of a particle of given disp, k, effective mass. More...
 
Mdouble helperFunc::getRestitutionCoefficient (Mdouble k, Mdouble disp, Mdouble mass)
 Calculates restitution coefficient for two copies of given disp, k, effective mass. More...
 
Mdouble helperFunc::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...
 
void getLineFromStringStream (std::istream &in, std::stringstream &out)
 

Variables

const Mdouble constants::pi =3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068
 
const Mdouble constants::sqrt_pi =1.772453850905516027298167483341145182797549456122387128213807789852911284591032181374950656738544665
 
const Mdouble constants::sqr_pi =9.869604401089358618834490999876151135313699407240790626413349376220044822419205243001773403718552232
 
const Mdouble constants::sqrt_2 =1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573
 
const Mdouble constants::sqrt_3 =1.732050807568877293527446341505872366942805253810380628055806979451933016908800037081146186757248576
 

Macro Definition Documentation

#define cubic (   a)    ((a)*(a)*(a))
#define sqr (   a)    ((a)*(a))

Definition at line 36 of file ExtendedMath.h.

Referenced by StatisticsPoint< T >::CG_function(), StatisticsPoint< T >::CG_integral_1D(), StatisticsPoint< T >::CG_integral_2D(), StatisticsPoint< T >::CG_integral_gradient(), StatisticsPoint< T >::CG_integral_gradient_1D(), InsertionBoundary::checkBoundaryActionsBeforeTimeStep(), StatisticsPoint< T >::compute_Gaussian_invvolume(), MD::compute_internal_forces(), BaseParticle::compute_particle_mass(), MD::compute_plastic_internal_forces(), MD::compute_walls(), helperFunc::computeDisptFromCollisionTimeAndRestitutionCoefficientAndTangentialRestitutionCoefficientAndEffectiveMass(), helperFunc::computeKAndDispFromCollisionTimeAndRestitutionCoefficientAndEffectiveMass(), StatisticsVector< T >::evaluate_particle_statistics(), StatisticsVector< T >::gather_statistics_collision(), PeriodicBoundary::get_close_together(), CSpecies::get_collision_time(), StatisticsVector< T >::get_cutoff2(), StatisticsPoint< T >::get_distance2(), CSpecies::get_plastic_dt(), helperFunc::getCollisionTime(), helperFunc::getMaximumVelocity(), StatisticsPoint< T >::getSquared(), CSpecies::set_collision_time_and_normal_and_tangential_restitution_coefficient(), CSpecies::set_collision_time_and_normal_and_tangential_restitution_coefficient_nodispt(), Chute::set_collision_time_and_restitution_coefficient(), CSpecies::set_collision_time_and_restitution_coefficient(), CSpecies::set_k_and_restitution_coefficient(), StatisticsVector< T >::set_w(), StatisticsVector< T >::set_w2(), HGRID_base::TestObject(), and CSpecies::update_disp().

#define UNUSED   __attribute__ ((__unused__))

Definition at line 38 of file ExtendedMath.h.

Typedef Documentation

typedef double Mdouble

Definition at line 33 of file ExtendedMath.h.

Function Documentation

void getLineFromStringStream ( std::istream &  in,
std::stringstream &  out 
)

Definition at line 204 of file ExtendedMath.cc.

Referenced by HGRID_base::read(), MD::read(), MD::read_v1(), and MD::read_v2().

205 {
206  std::string line_string;
207  getline(in,line_string);
208  out.str(line_string);
209  out.clear();
210 }