elastic_gas_with_gravity.cpp File Reference
#include <iostream>
#include <Species/LinearViscoelasticFrictionSpecies.h>
#include "DPMBase.h"
#include "Mercury2D.h"
#include "StatisticsVector.h"

Classes

class  my_problem
 todo{This code is not working as is wanted} More...
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Start off my solving the default problem

66 {
67 
68 
69 
71  my_problem problem;
72  problem.setName("free_cooling");
73 
74  //Stefan problem
75  //problem.set_dissipation(0.0);
76 // species->setStiffness(1e5);
77 // problem.setTimeStep(4e-5);
78 // problem.setSaveCount(250000);
79 // problem.setTimeMax(10);
80 
81  //Vits problem
83  species->setDissipation(0.0);
84  species->setStiffness(1e6);
85  species->setDensity(2000);
86  problem.setTimeStep(4e-5);
87  problem.setTimeMax(12e-5);
88  //problem.set_HGRID_max_levels(1);
89  //problem.set_HGRID_num_buckets(1e5);
90  problem.setGravity(Vec3D(0.0,0.0,1.0));
91  problem.setSaveCount(1e5);
92 
93 
94 
95  problem.write(std::cout,false);
96  problem.solve();
97  problem.write(std::cout,false);
98  problem.writeRestartFile();
99 
100  //StatisticsVector problemstats(problem.getName(), 100, 100, 0, 0.05, Gaussian);
101  StatisticsVector<XY> problemstats;
102  problemstats.setName(problem.getName());
103  problemstats.setNX(100);
104  problemstats.setNY(100);
105  problemstats.setNZ(0);
106  problemstats.setCGWidth(0.05);
107  problemstats.setCGShape(Gaussian);
108  problemstats.statistics_from_fstat_and_data();
109 
110 
111 
112 /* cout << endl << "v=" << problem2.getMaximumVelocity_of_smallest_particle() << endl;
113  cout << "tc=" << problem2.getCollisionTime_for_smallest_particle() << endl;
114  cout << "eps=" << problem2.getRestitutionCoefficient_for_smallest_particle() << endl;*/
115 }
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
@ Gaussian
Definition: StatisticsPoint.h:32
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
virtual void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: DPMBase.cc:2942
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes all data into a restart file.
Definition: MercuryBase.cc:147
This class is used to extract statistical data from MD simulations.
Definition: StatisticsVector.h:62
void setCGShape(const char *new_)
void setNX(int new_)
Definition: StatisticsVector.h:127
void setCGWidth(Mdouble w)
Set CG variables w2 and CG_invvolume.
Definition: StatisticsVector.h:317
void setNZ(int new_)
Definition: StatisticsVector.h:159
void setNY(int new_)
Definition: StatisticsVector.h:143
void statistics_from_fstat_and_data()
get StatisticsPoint
Definition: Vector.h:51
todo{This code is not working as is wanted}
Definition: elastic_gas.cpp:34

References BaseHandler< T >::copyAndAddObject(), Gaussian, DPMBase::getName(), StatisticsVector< T >::setCGShape(), StatisticsVector< T >::setCGWidth(), DPMBase::setGravity(), DPMBase::setName(), StatisticsVector< T >::setNX(), StatisticsVector< T >::setNY(), StatisticsVector< T >::setNZ(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::solve(), DPMBase::speciesHandler, StatisticsVector< T >::statistics_from_fstat_and_data(), MercuryBase::write(), and DPMBase::writeRestartFile().