52 #ifdef ContactListHgrid
63 #include <sys/types.h>
78 #ifdef CONSTUCTOR_OUTPUT
79 std::cerr <<
"MD() finished"<<std::endl;
85 #ifdef CONSTUCTOR_OUTPUT
86 std::cerr <<
"MD(STD_save& other) finished " << std::endl;
99 void solve(
unsigned int argc,
char *argv[]) {
132 if (i>j)
return &
Species[i].MixedSpecies[j];
133 else return &
Species[j].MixedSpecies[i];
137 if (i>j)
Species[i].MixedSpecies[j] = S;
138 else Species[j].MixedSpecies[i] = S;
142 void set_tmax(
Mdouble new_tmax){
if (new_tmax>=0){
tmax=new_tmax;}
else { std::cerr <<
"Error in set_tmax, new_tmax="<<new_tmax << std::endl; exit(-1); }}
150 #ifdef ContactListHgrid
155 void set_savecount (
int new_){
if (new_>0) {
set_save_count_all(new_);}
else {std::cerr <<
"Error in set_savecount (set_savecount("<<new_<<
"))"<< std::endl; exit(-1);}}
157 void set_save_count_data (
int new_){
if (new_>0) {
save_count_data =new_;}
else {std::cerr <<
"Error in set_save_count_data, (set_save_count_data ("<<new_<<
"))"<< std::endl; exit(-1);}}
158 void set_save_count_ene (
int new_){
if (new_>0) {
save_count_ene =new_;}
else {std::cerr <<
"Error in set_save_count_ene, (set_save_count_ene ("<<new_<<
"))"<< std::endl; exit(-1);}}
159 void set_save_count_stat (
int new_){
if (new_>0) {
save_count_stat =new_;}
else {std::cerr <<
"Error in set_save_count_stat, (set_save_count_stat ("<<new_<<
"))"<< std::endl; exit(-1);}}
182 {
if (indSpecies<
Species.size()) {
Species[indSpecies].set_plastic_k1_k2max_kc_depth(k1_, k2max_, kc_, depth_);}
else {std::cerr <<
"Error in set_k: species does not exist"; exit(-1);} }
184 {
if (indSpecies<
Species.size()) {
Species[indSpecies].set_k1(new_);}
else {std::cerr <<
"Error in set_k: species does not exist"; exit(-1);} }
186 {
if (indSpecies<
Species.size()) {
Species[indSpecies].set_k2max(new_);}
else {std::cerr <<
"Error in set_k: species does not exist"; exit(-1);} }
188 {
if (indSpecies<
Species.size()) {
Species[indSpecies].set_kc(new_);}
else {std::cerr <<
"Error in set_k: species does not exist"; exit(-1);} }
190 {
if (indSpecies<
Species.size()) {
Species[indSpecies].set_depth(new_);}
else {std::cerr <<
"Error in set_k: species does not exist"; exit(-1);} }
193 {
return Species[indSpecies].get_k1();}
195 {
return Species[indSpecies].get_k2max();}
197 {
return Species[indSpecies].get_kc();}
199 {
return Species[indSpecies].get_depth();}
201 {
return Species[indSpecies].get_plastic_dt(mass);}
204 void set_k(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_k(new_);}
else {std::cerr <<
"Error in set_k: species does not exist"; exit(-1);} }
208 void set_kt(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_kt(new_);}
else {std::cerr <<
"Error in set_kt: species does not exist"; exit(-1);}}
212 void set_krolling(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_krolling(new_);}
else {std::cerr <<
"Error in set_krolling: species does not exist"; exit(-1);}}
216 void set_ktorsion(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_ktorsion(new_);}
else {std::cerr <<
"Error in set_ktorsion: species does not exist"; exit(-1);}}
220 void set_rho(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_rho(new_);}
else {std::cerr <<
"Error in set_rho: species does not exist"; exit(-1);}}
224 void set_dispt(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_dispt(new_);}
else {std::cerr <<
"Error in set_dispt: species does not exist"; exit(-1);}}
228 void set_disprolling(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_disprolling(new_);}
else {std::cerr <<
"Error in set_disprolling: species does not exist"; exit(-1);}}
232 void set_disptorsion(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_disptorsion(new_);}
else {std::cerr <<
"Error in set_disptorsion: species does not exist"; exit(-1);}}
237 void set_disp(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_dissipation(new_);}
else {std::cerr <<
"Error in set_dissipation: species does not exist"; exit(-1);}}
241 void set_dissipation(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_dissipation(new_);}
else {std::cerr <<
"Error in set_dissipation: species does not exist"; exit(-1);}}
245 void set_mu(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_mu(new_);}
else {std::cerr <<
"Error in set_mu: species does not exist"; exit(-1);}}
249 void set_murolling(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_murolling(new_);}
else {std::cerr <<
"Error in set_murolling: species does not exist"; exit(-1);}}
253 void set_mutorsion(
Mdouble new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_mutorsion(new_);}
else {std::cerr <<
"Error in set_mutorsion: species does not exist"; exit(-1);}}
261 void set_dim_particle(
int new_,
unsigned int indSpecies = 0){
if (indSpecies<
Species.size()) {
Species[indSpecies].set_dim_particle(new_);}
else {std::cerr <<
"Error in set_dim_particle: species does not exist"; exit(-1);}}
273 if (indSpecies<
Species.size()) {
Species[indSpecies].set_k_and_restitution_coefficient(k_, eps, mass);}
else {std::cerr <<
"Error in set_k_and_restitution_coefficient: species does not exist"; exit(-1);}
277 if (indSpecies<
Species.size()) {
Species[indSpecies].set_collision_time_and_restitution_coefficient(tc, eps, mass);}
else {std::cerr <<
"Error in set_collision_time_and_restitution_coefficient: species does not exist"; exit(-1);}
285 if (indSpecies<
Species.size()) {
Species[indSpecies].set_collision_time_and_restitution_coefficient(tc, eps, mass1, mass2);}
else {std::cerr <<
"Error in set_collision_time_and_restitution_coefficient: species does not exist"; exit(-1);}
290 if (indSpecies<
Species.size()) {
Species[indSpecies].set_collision_time_and_normal_and_tangential_restitution_coefficient(tc, eps, beta, mass1, mass2);}
else {std::cerr <<
"Error in set_collision_time_and_restitution_coefficient: species does not exist"; exit(-1);}
295 if (indSpecies<
Species.size()) {
Species[indSpecies].set_collision_time_and_normal_and_tangential_restitution_coefficient_nodispt(tc, eps, beta, mass1, mass2);}
else {std::cerr <<
"Error in set_collision_time_and_restitution_coefficient: species does not exist"; exit(-1);}
318 void set_xmin(
Mdouble new_xmin){
if (new_xmin<=
xmax){
xmin=new_xmin;}
else { std::cerr <<
"Warning in set_xmin(" << new_xmin <<
"): xmax=" <<
xmax << std::endl; }}
320 void set_ymin(
Mdouble new_ymin){
if (new_ymin<=
ymax){
ymin=new_ymin;}
else { std::cerr <<
"Error in set_ymin(" << new_ymin <<
"): ymax=" <<
ymax << std::endl; exit(-1); }}
324 void set_zmin(
Mdouble new_zmin){
if (new_zmin<=
zmax){
zmin=new_zmin;}
else { std::cerr <<
"Warning in set_zmin(" << new_zmin <<
"): zmax=" <<
zmax << std::endl; }}
328 void set_xmax(
Mdouble new_xmax){
if (new_xmax>=
xmin){
xmax=new_xmax;}
else { std::cerr <<
"Error in set_xmax(" << new_xmax <<
"): xmin=" <<
xmin << std::endl; exit(-1); }}
331 void set_ymax(
Mdouble new_ymax){
if (new_ymax>
ymin){
ymax=new_ymax;}
else { std::cerr <<
"Warning in set_ymax(" << new_ymax <<
"): ymin=" <<
ymin << std::endl; }}
334 void set_zmax(
Mdouble new_zmax){
if (new_zmax>
ymin){
zmax=new_zmax;}
else { std::cerr <<
"Error in set_zmax(" << new_zmax <<
"): zmin=" <<
zmin << std::endl; exit(-1); }}
337 void set_dt(
Mdouble new_dt){
if (
dt>=0.0){
dt=new_dt;}
else { std::cerr <<
"Error in set_dt" << std::endl; exit(-1); }}
367 void set_dim(
int new_dim){
if (new_dim>=1 && new_dim<=3)
dim = new_dim;
else { std::cerr <<
"Error in set_dim" << std::endl; exit(-1); }}
422 #ifdef ContactListHgrid
476 virtual void write(std::ostream& os);
478 virtual void read(std::istream& is);
480 virtual void write_v1(std::ostream& os);
482 virtual void read_v1(std::istream& is);
483 virtual void read_v2(std::istream& is);
496 virtual void print(std::ostream& os,
bool print_all=
false);
512 virtual int readNextArgument(
unsigned int& i,
unsigned int argc,
char *argv[]);
622 std::cout <<
"\rt=" << std::setprecision(3) << std::left << std::setw(6) <<
t
623 <<
", tmax=" << std::setprecision(3) << std::left << std::setw(6) <<
tmax <<
" \r";
625 #ifdef FOLLOWPARTICLE
626 std::cout<<std::endl;
710 #ifdef ContactListHgrid
void set_number_of_saves(Mdouble N)
std::vector< CSpecies > & get_Species(void)
Allows the species to be copied.
bool find_next_data_file(Mdouble tmin, bool verbose=true)
virtual void cout_time()
std::couts time
BaseParticle * getLargestParticle() const
Gets a pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
void set_save_count_stat(int new_)
CSpecies * get_Species(int i)
Allows the species to be accessed.
Mdouble get_zmin()
Gets zmin.
std::string xballs_additional_arguments
virtual void setup_particles_initial_conditions()
This function allows the initial conditions of the particles to be set, by default locations is rando...
void set_ene_ela(Mdouble new_)
Sets ene_ela.
void set_krolling(Mdouble new_, unsigned int indSpecies=0)
Allows the spring constant to be changed.
Mdouble get_ktorsion(int indSpecies=0)
Allows the spring constant to be accessed.
virtual void output_ene()
This function outputs statistical data - The default is to compute the rotational kinetic engergy...
Container to store all BaseBoundary.
void set_zmax(Mdouble new_zmax)
Sets ymax and walls, assuming the standard definition of walls as in the default constructor.
Mdouble get_kc(unsigned int indSpecies=0)
std::string get_xballs_additional_arguments()
void set_collision_time_and_normal_and_tangential_restitution_coefficient(Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass1, Mdouble mass2, unsigned int indSpecies=0)
See CSpecies::set_collision_time_and_normal_and_tangential_restitution_coefficient.
CTangentialSpring * getTangentialSpring(BaseParticle *PI, BaseParticle *PJ, BaseParticle *PJreal)
void set_MixedSpecies(int i, int j, CSpecies &S)
Allows the mixed species to be set.
virtual void read_v1(std::istream &is)
Reads all MD data.
Mdouble get_disprolling(unsigned int indSpecies=0)
Allows the tangential viscosity to be accessed.
CSpecies * get_MixedSpecies(int i, int j)
Allows the mixed species to be accessed.
int get_savecount()
Allows the number of time steps between saves to be accessed.
Here are the rounties to use a counter file to store run numbers.
void set_restarted(bool new_)
bool load_par_ini_file(const char *filename)
allows the user to read par.ini files (useful to read MDCLR files)
Mdouble get_dispt(unsigned int indSpecies=0)
Allows the tangential viscosity to be accessed.
void set_append(bool new_)
Sets restarted.
void reset_DeltaMax()
sets the history parameter DeltaMax of all particles to zero
Mdouble get_mutorsion(unsigned int indSpecies=0)
Allows the Coulomb friction coefficient to be accessed.
Mdouble get_ene_ela()
Gets ene_ela.
bool get_append()
Gets restarted.
void compute_particle_mass(std::vector< CSpecies > &Species)
Compute Particle mass function, which required a reference to the Species vector. It copmuters the Pa...
virtual void start_ene()
Functions for ene file.
void add_ene_ela(Mdouble new_)
Sets ene_ela.
int get_IndSpecies() const
Mdouble get_dt()
Allows the time step dt to be accessed.
double get_xballs_vscale()
virtual void HGRID_InsertParticleToHgrid(BaseParticle *obj UNUSED)
This is action before the time step is started.
void set_xballs_cmode(int new_cmode)
int read_dim_from_data_file()
void solveWithMDCLR()
Tries to solve the problem using MDCLR.
void reset_TangentialSprings()
sets the history parameter TangentialSprings of all particles to zero
void set_zmin(Mdouble new_zmin)
Sets ymin and walls, assuming the standard definition of walls as in the default constructor.
T * getObject(const unsigned int id) const
Gets a pointer to the Object at the specified index in the BaseHandler.
void set_restart_version(int new_)
Sets restart_version.
virtual void do_integration_after_force_computation(BaseParticle *pI)
This is were the integration is done.
int save_restart_data_counter
void set_xballs_scale(Mdouble new_scale)
Set the scale of the xballs problem. The default is fit to screen.
void set_dt()
Sets dt to 1/50-th of the smallest possible collision time.
void set_savecount(int new_)
Allows the number of time steps between saves to be changed, see also set_number_of_saves.
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Mdouble get_k1(unsigned int indSpecies=0)
Allows the plastic constants to be accessed.
virtual void HGRID_update_move(BaseParticle *, Mdouble)
virtual void InitBroadPhase()
Initialisation of Broad Phase Information (Default no Broad Phase so empty)
bool load_from_data_file(const char *filename, unsigned int format=0)
This allows particle data to be reloaded from data files.
friend std::ostream & operator<<(std::ostream &os, MD &md)
virtual void actions_after_solve()
This is actions at the end of the code, but before the files are closed.
int dim
The dimension of the simulation.
virtual void broad_phase(BaseParticle *i)
Broad phase of contact detection goes here. Default check all contacts.
void set_number_of_saves_ene(Mdouble N)
virtual void compute_external_forces(BaseParticle *PI)
This is were the computation of external forces takes place (e.g. gravity)
void set_xmin(Mdouble new_xmin)
Sets xmin and walls, assuming the standard definition of walls as in the default constructor.
void set_tmax(Mdouble new_tmax)
Allows the upper time limit to be changed.
void set_xballs_colour_mode(int new_cmode)
Set the xball output mode.
virtual BaseParticle * getLargestParticle()
Mdouble get_Mass_from_Radius(Mdouble radius, int indSpecies=0)
int get_dim()
Allows the dimension of the simulation to be accessed.
void Remove_Duplicate_Periodic_Particles()
Remove periodic duplicate Particles (i.e. removes particles created by Check_and_Duplicate_Periodic_P...
void constructor()
A public constructor, which sets defaults so the problem can be solved off the shelf.
int readArguments(unsigned int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
std::vector< CSpecies > Species
These are the particle parameters like dissipation etc.
Mdouble get_krolling(int indSpecies=0)
Allows the spring constant to be accessed.
bool get_save_data_stat()
Mdouble get_max_radius()
Sets restarted.
CDeltaMaxs & get_DeltaMaxs()
virtual void write(std::ostream &os)
Writes all MD data.
void solve()
The work horse of the code.
virtual void HGRID_RemoveParticleFromHgrid(BaseParticle *obj UNUSED)
void set_collision_time_and_restitution_coefficient(Mdouble tc, Mdouble eps, Mdouble mass, unsigned int indSpecies=0)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P...
Mdouble get_restitution_coefficient(Mdouble mass, unsigned int indSpecies=0)
Calculates restitution coefficient for two copies of given disp, k, mass.
Mdouble get_murolling(unsigned int indSpecies=0)
Allows the Coulomb friction coefficient to be accessed.
Mdouble get_dissipation(unsigned int indSpecies=0)
Allows the normal dissipation to be accessed.
void set_xballs_additional_arguments(std::string new_)
Set the additional arguments for xballs.
CTangentialSprings & get_TangentialSprings()
int get_save_count_data()
void set_murolling(Mdouble new_, unsigned int indSpecies=0)
Allows the Coulomb friction coefficient to be changed.
void set_t(Mdouble new_t)
Access function for the time.
bool get_save_data_fstat()
void set_depth(Mdouble new_, unsigned int indSpecies=0)
Mdouble get_ymax()
Gets ymax.
Mdouble computeShortRangeForceWithParticle(BaseParticle *PI, BaseParticle *PJ, BaseParticle *PJreal, CSpecies *pSpecies, Mdouble dist)
void set_k_and_restitution_coefficient(Mdouble k_, Mdouble eps, Mdouble mass, unsigned int indSpecies=0)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P...
std::stringstream problem_name
Stores the problem_name.
virtual void save_restart_data()
Stores all MD data.
Mdouble get_Radius() const
virtual void gather_statistics_collision(int index1 UNUSED, int index2 UNUSED, Vec3D Contact UNUSED, Mdouble delta UNUSED, Mdouble ctheta UNUSED, Mdouble fdotn UNUSED, Mdouble fdott UNUSED, Vec3D P1_P2_normal_ UNUSED, Vec3D P1_P2_tangential UNUSED)
virtual bool continue_solve()
Mdouble get_maximum_velocity(BaseParticle &P)
Calculates the maximum velocity allowed for a collision of two copies of P (for higher velocities par...
void set_dt(Mdouble new_dt)
Allows the time step dt to be changed.
This is a class that generates random numbers i.e.
void compute_particle_masses()
Computes the mass of each particle.
virtual void set_initial_pressures_for_pressure_controlled_walls()
void set_save_count_fstat(int new_)
void set_kt(Mdouble new_, unsigned int indSpecies=0)
Allows the spring constant to be changed.
ParticleHandler particleHandler
BoundaryHandler boundaryHandler
Mdouble dt
These are numerical constants like the time step size.
virtual void output_xballs_data_particle(int i)
This function outputs the location and velocity of the particle in a format the xballs progream can r...
void set_number_of_saves_fstat(Mdouble N)
virtual void process_statistics(bool usethese UNUSED)
virtual void actions_after_time_step()
This is action after the time step is finished.
virtual void do_integration_before_force_computation(BaseParticle *pI)
This is were the integration is done.
Mdouble get_t()
Access function for the time.
bool get_save_data_data()
Returns the data counter.
WallHandler & getWallHandler()
Mdouble get_ymin()
Gets ymin.
BaseParticle * getSmallestParticle() const
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
virtual void actions_before_time_loop()
This is actions before the start of the main time loop.
void statistics_from_restart_data(const char *name)
Loads all MD data and plots statistics for all timesteps in the .data file.
bool get_restarted()
Gets restarted.
virtual void fstat_header()
void set_disptorsion(Mdouble new_, unsigned int indSpecies=0)
Allows the tangential viscosity to be changed.
virtual void finish_statistics()
Mdouble t
This stores the current time.
void set_k2max(Mdouble new_, unsigned int indSpecies=0)
Mdouble get_xmin()
Get xmin.
Mdouble computeShortRangeForceWithWall(BaseParticle *pI, int wall, CSpecies *pSpecies, Mdouble dist)
void set_save_count_data(int new_)
void set_IndSpecies(const int _new)
void info()
Set up a virtual info this will be provided from the inhertiance.
virtual int readNextArgument(unsigned int &i, unsigned int argc, char *argv[])
Mdouble get_collision_time(Mdouble mass, unsigned int indSpecies=0)
Calculates collision time for two copies of a particle of given disp, k, mass.
void solve(unsigned int argc, char *argv[])
Read arguments before solving.
void set_do_stat_always(bool new_)
Sets how often the data is saved using the number of saves wanted, tmax, and dt. See also set_savecou...
void set_dim_particle(int new_, unsigned int indSpecies=0)
Allows the dimension of the particle (f.e. for mass) to be changed.
virtual bool get_HGRID_UpdateEachTimeStep()
virtual void HGRID_actions_after_integration()
Mdouble get_k(int indSpecies=0)
Allows the spring constant to be accessed.
CTangentialSpring * getTangentialSpringWall(BaseParticle *pI, int w)
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Mdouble get_rho(int indSpecies=0)
Allows the density to be accessed.
void set_save_count_all(int new_)
virtual void actions_before_time_step()
This is action before the time step is started.
Stores the tangential spring needed to compute a tangential elastic force between particles PI...
virtual void initialize_statistics()
Functions for statistics.
void set_mutorsion(Mdouble new_, unsigned int indSpecies=0)
Allows the Coulomb friction coefficient to be changed.
Mdouble get_kt(int indSpecies=0)
Allows the spring constant to be accessed.
void set_FixedParticles(unsigned int n)
virtual void compute_all_forces()
This does the force computation.
virtual void HGRID_UpdateParticleInHgrid(BaseParticle *obj UNUSED)
void set_ymax(Mdouble new_ymax)
Sets ymax and walls, assuming the standard definition of walls as in the default constructor.
void set_xballs_vector_scale(double new_vscale)
Set the scale of vectors in xballs.
Mdouble get_tmax()
Allows the upper time limit to be accessed.
void set_number_of_saves_data(Mdouble N)
Mdouble get_depth(unsigned int indSpecies=0)
void set_format(int new_)
virtual void output_statistics()
Mdouble get_disptorsion(unsigned int indSpecies=0)
Allows the tangential viscosity to be accessed.
virtual void write_v1(std::ostream &os)
Writes all MD data.
void set_k1(Mdouble new_, unsigned int indSpecies=0)
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
void initialize_tangential_springs()
void set_mu(Mdouble new_, unsigned int indSpecies=0)
Allows the Coulomb friction coefficient to be changed.
Mdouble get_maximum_velocity()
void set_number_of_saves_stat(Mdouble N)
Container to store all BaseParticle.
Mdouble get_disp(unsigned int indSpecies=0)
Allows the normal dissipation to be accessed.
void set_Radius(const Mdouble _new)
void set_rho(Mdouble new_, unsigned int indSpecies=0)
Allows the density to be changed.
virtual void read(std::istream &is)
Reads all MD data.
Container to store all BaseWall.
void set_kc(Mdouble new_, unsigned int indSpecies=0)
void set_dt(BaseParticle &P)
Sets dt to 1/50-th of the collision time for two copies of P.
void set_collision_time_and_normal_and_tangential_restitution_coefficient_nodispt(Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass1, Mdouble mass2, unsigned int indSpecies=0)
See CSpecies::set_collision_time_and_normal_and_tangential_restitution_coefficient.
A class that defines and solves a MD problem.
Mdouble get_plastic_dt(Mdouble mass, unsigned int indSpecies=0)
virtual void HGRID_actions_before_integration()
virtual void output_xballs_data()
Output xball data for Particle i.
double get_xballs_scale()
Mdouble get_mu(unsigned int indSpecies=0)
Allows the Coulomb friction coefficient to be accessed.
void set_name(const char *name)
Sets the name of the problem, used for the same data files.
virtual void read_v2(std::istream &is)
virtual void removeParticle(int iP)
int load_restart_data()
Loads all MD data.
void set_plastic_k1_k2max_kc_depth(Mdouble k1_, Mdouble k2max_, Mdouble kc_, Mdouble depth_, unsigned int indSpecies=0)
Allows the plastic constants to be changed.
virtual void HGRID_actions_before_time_loop()
This is actions before the start of the main time loop.
Vec3D gravity
Gravitational acceleration.
BoundaryHandler & getBoundaryHandler()
Mdouble ene_ela
used in force calculations
void Remove_Particle(int IP)
This function removes partice IP from the vector of particles by moving the last particle in the vect...
void set_number_of_saves_all(Mdouble N)
ParticleHandler & getParticleHandler()
void set_ktorsion(Mdouble new_, unsigned int indSpecies=0)
Allows the spring constant to be changed.
void compute_plastic_internal_forces(BaseParticle *P1, BaseParticle *P2)
Computes plastic forces between particles.
void set_dissipation(Mdouble new_, unsigned int indSpecies=0)
Allows the normal dissipation to be changed.
void set_dim(int new_dim)
Allows the dimension of the simulation to be changed.
void set_dt_by_mass(Mdouble mass)
Sets dt to 1/50-th of the collision time for two particles of mass P.
virtual void HGRID_actions_before_time_step()
This is action before the time step is started.
int get_NSpecies()
Allows the number of Species to be accessed.
int get_restart_version()
Gets restart_version.
Mdouble get_xmax()
Get xmax.
Mdouble xmin
These store the size of the domain, assume walls at the ends.
Mdouble get_k2max(unsigned int indSpecies=0)
virtual BaseParticle * getSmallestParticle()
void set_gravity(Vec3D new_gravity)
Allows the gravitational acceleration to be changed.
Implementation of a 3D vector (by Vitaliy).
virtual void checkInteractionWithBoundaries()
void set_disprolling(Mdouble new_, unsigned int indSpecies=0)
Allows the tangential viscosity to be changed.
bool read_next_from_data_file(unsigned int format=0)
by default format do not pass an argument; only specify format if you have to read a special format (...
Vec3D get_gravity()
Allows the gravitational acceleration to be accessed.
void set_rotation(bool new_)
void set_ymin(Mdouble new_ymin)
virtual double getInfo(BaseParticle &P)
Allows the user to set what is written into the info column in the data file. By default is store the...
Stores properties of the particles and the contact models such as the elastic modulus.
virtual void removeObject(unsigned const int id)
Removes a Object from the BaseHandler.
virtual void compute_walls(BaseParticle *PI)
This is were the walls are.
void set_dispt(Mdouble new_, unsigned int indSpecies=0)
Allows the tangential viscosity to be changed.
int save_count_data
These are informations for saving.
void set_collision_time_and_restitution_coefficient(Mdouble tc, Mdouble eps, Mdouble mass1, Mdouble mass2, unsigned int indSpecies=0)
Set k, disp such that is matches a given tc and eps for a collision of two different masses...
int get_save_count_fstat()
Mdouble get_zmax()
Gets zmax.
void set_k(Mdouble new_, unsigned int indSpecies=0)
Allows the spring constant to be changed.
int Check_and_Duplicate_Periodic_Particles()
Calls Check_and_Duplicate_Periodic_Particle for all Particles curently in Particles[] and returns the...
int get_save_count_stat()
virtual void compute_internal_forces(BaseParticle *i)
Computes the forces between particles (internal in the sence that the sum over all these forces is ze...
void set_save_count_ene(int new_)
virtual void print(std::ostream &os, bool print_all=false)
Outputs MD.
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
bool get_do_stat_always()
int get_dim_particle(unsigned int indSpecies=0)
Allows the dimension of the particle (f.e. for mass) to be accessed.
void set_disp(Mdouble new_, unsigned int indSpecies=0)
Allows the normal dissipation to be changed.
void set_xmax(Mdouble new_xmax)
Sets xmax and walls, assuming the standard definition of walls as in the default constructor.
virtual void create_xballs_script()
This creates a scipt which can be used to load the xballs problem to display the data just generated...