SilbertPeriodic.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #include <iomanip>
27 #include <string.h>
28 
29 #include "Chute.h"
31 #include "Walls/InfiniteWall.h"
33 
34 class SilbertPeriodic : public Chute
35 {
36 public:
37 
39  // Problem parameters
40  setName("silbert");
41 
42  //time stepping
43  setTimeStep(1e-4);
44  setTimeMax(2000);
45 
46  //output parameters
47  setSaveCount(50e4);
48 
49  //particle radii
51  setFixedParticleRadius(.5);//getInflowParticleRadius());
53 
54 
55  //particle properties
56  baseSpecies = nullptr;
59  species->setStiffness(2e5);
60  species->setSlidingStiffness(2.0/7.0* species->getStiffness());
61  species->setDissipation(25.0);
62  //setSlidingDissipation(2.0/7.0*getDissipation());
63  species->setSlidingDissipation(species->getDissipation());
64  species->setSlidingFrictionCoefficient(0.5);
66 
67  //chute properties
69  setChuteLength(20);
70  setChuteWidth(10);
72  set_H(20);
73 
74  randomiseSpecies=false;
75  nCreated_=0;
76 
81  }
82 
83  //void fix_hgrid() {
84  //assume 1-2 levels are optimal (which is the case for mono and bidispersed) and set the cell size to min and max
85  // !this is not optimal for polydispersed
86  // Mdouble minCell = 2.*min(getFixedParticleRadius(),getMinInflowParticleRadius());
87  // Mdouble maxCell = 2.*max(getFixedParticleRadius(),getMaxInflowParticleRadius());
88  // if ((minCell==maxCell)|(minCell==0.)) set_HGRID_max_levels(1);
89  // else set_HGRID_max_levels(2);
90  // set_HGRID_cell_to_cell_ratio (1.0000001*maxCell/minCell);
91  //}
92 
94  if (baseSpecies!= nullptr)
95  return baseSpecies->getSlidingFrictionCoefficient();
96  else return species->getSlidingFrictionCoefficient();
97  }
100  baseSpecies->setSlidingFrictionCoefficient(new_);
101  }
102  virtual void createBaseSpecies() {
103  //only create once
104  static bool created=false;
105  if (!created) {
106  auto species1 = speciesHandler.copyAndAddObject(species);
108  for (unsigned int i=0; i<particleHandler.getNumberOfObjects(); i++) {
111  }
112  }
113  }
114 
115  void set_study() {
116  std::stringstream name;
117  name << "H" << getInflowHeight()
118  << "A" << getChuteAngleDegrees()
119  << "L" << round(100.*getFixedParticleRadius()*2.)/100.
120  << "M" << species->getSlidingFrictionCoefficient()
122  setName(name.str().c_str());
123  //set_data_filename();
124  }
125 
126  void set_study(int study_num) {
127  //S=0-5: lambda = 0, 3./6., 4./6., 5./6., 1, 2
128  //S=6-8: mu = 0, 1, inf
129  //S=9-13: mub = 0,1,inf,1/4,1/8
130  //S=14-15: mu = 1/4, 1/8
131  //S=16-19: lambda = 1./6., 2./6., 1.5, 4
132  //S=21-25: mub=1/16,1/32,1/64,1/128,1/1024
133  //S=26-28: lambda=1/2, mub=1/16,1/128,1/1024
134  //S=29-32: lambda=0, mub=1/16,1/128,1/1024,0
135  //Case 37 set getSlidingDissipation()=0
136  //Case 38 set eps=0.97
137  //Case 39 set hertzian = true
138  //Case 40, 41, 42: set Foerster glass, Lorenz steel, Lorenz glassv
139  //Case 43, 44, 45, 46: set Silbert, Foerster glass, Lorenz steel, Lorenz glass with rolling friction
140  logger(INFO, "Study %", study_num);
141 
142  if (study_num < 6) {
143  // set mu_all = 0.5, vary lambda
144  Mdouble Lambdas[] = {0, 3./6., 4./6., 5./6., 1, 2};
145  setFixedParticleRadius(Lambdas[study_num]/2.);
146  species->setSlidingFrictionCoefficient(0.5);
147  } else if (study_num < 9) { //Case 6,7,8
148  // set lambda = 1, vary mu_all
149  Mdouble MuAll[] = {0, 1., 1e20};
150  species->setSlidingFrictionCoefficient(MuAll[study_num-6]);
152  } else if (study_num < 12) { //Case 9,10,11
153  // set lambda = 1, mu_all = 0.5, vary mu_bottom
154  Mdouble MuBottom[] = {0, 1., 1e20};
155  species->setSlidingFrictionCoefficient(0.5);
156  setSlidingFrictionCoefficientBottom(MuBottom[study_num-9]);
158  } else if (study_num < 14) { //Case 12,13
159  // set lambda = 1, mu_all = 0.5, vary mu_bottom
160  Mdouble MuBottom[] = {0.25, 0.125};
161  species->setSlidingFrictionCoefficient(0.5);
162  setSlidingFrictionCoefficientBottom(MuBottom[study_num-12]);
164  } else if (study_num < 16) { //Case 14,15
165  // set lambda = 1, vary mu_all
166  Mdouble MuAll[] = {0.25, 0.125};
167  species->setSlidingFrictionCoefficient(MuAll[study_num-14]);
169  } else if (study_num < 21) { //Case 16,17,18,19,20
170  // set mu_all = 0.5, vary lambda
171  Mdouble Lambdas[] = {1./6., 2./6., 1.5, 4, 1./12};
172  setFixedParticleRadius(Lambdas[study_num-16]/2.);
173  species->setSlidingFrictionCoefficient(0.5);
174  } else if (study_num < 26) { //Case 21 22 23 24 25
175  // set lambda = 1, mu_all = 0.5, vary mu_bottom
176  Mdouble MuBottom[] = {1./16.,1./32.,1./64.,1./128.,1./1024.};
177  species->setSlidingFrictionCoefficient(0.5);
178  setSlidingFrictionCoefficientBottom(MuBottom[study_num-21]);
180  } else if (study_num < 29) { //Case 26 27 28
181  // set lambda = 1/2, mu_all = 0.5, vary mu_bottom
182  Mdouble MuBottom[] = {1./16.,1./128.,1./1024.};
183  species->setSlidingFrictionCoefficient(0.5);
184  setSlidingFrictionCoefficientBottom(MuBottom[study_num-26]);
186  } else if (study_num < 33) { //Case 29 30 31 32
187  // set lambda = 0, mu_all = 0.5, vary mu_bottom
188  Mdouble MuBottom[] = {1./16.,1./128.,1./1024.,0};
189  species->setSlidingFrictionCoefficient(0.5);
190  setSlidingFrictionCoefficientBottom(MuBottom[study_num-29]);
192  } else if (study_num < 37) { //Case 33-36
193  logger(INFO, "S %", study_num);
194  // set lambda = 1, mu_b = 0.5, vary mu
195  Mdouble Mu[] = {1e20,1,1./64,0};
196  species->setSlidingFrictionCoefficient(Mu[study_num-33]);
199  } else if (study_num < 38) { //Case 37
200  // set getSlidingDissipation()=0
201  species->setSlidingDissipation(0);
202  } else if (study_num < 39) { //Case 38
203  // set eps=0.97
204  Mdouble eps = 0.97;
206  species->setSlidingDissipation(species->getDissipation());
207  } else if (study_num < 40)
208  { //Case 39
209  // set hertzian = true
210  logger(INFO, "Hertzian implementation has been changed");
211  exit(-1);
212  //set_Hertzian(true);
214  } else if (study_num < 43) { //Case 40, 41, 42
215  // set Foerster glass, Lorenz steel, Lorenz glass
216  Mdouble eps[] = {0.97 , 0.95 , 0.972};
217  Mdouble beta[]= {0.44 , 0.32 , 0.25 };
218  Mdouble mu[] = {0.092, 0.099, 0.177};
219  species->setSlidingFrictionCoefficient(mu[study_num-40]);
220  species->setCollisionTimeAndNormalAndTangentialRestitutionCoefficient
221  (50.*getTimeStep(), eps[study_num-40], beta[study_num-40], 1);
222  } else if (study_num < 47) { //Case 43, 44, 45, 46
223  // set Silbert, Foerster glass, Lorenz steel, Lorenz glass with rolling friction
224  Mdouble eps[] = {0.97 , 0.95 , 0.972};
225  Mdouble beta[]= {0.44 , 0.32 , 0.25 };
226  Mdouble mu[] = {0.092, 0.099, 0.177};
227  if (study_num!=43) {
228  species->setSlidingFrictionCoefficient(mu[study_num-44]);
229  species->setCollisionTimeAndNormalAndTangentialRestitutionCoefficient
230  (50.*getTimeStep(), eps[study_num-44], beta[study_num-44], 1);
231  }
233  species->setRollingStiffness(0.4*species->getStiffness());
234  species->setRollingFrictionCoefficient(0.05);
235  } else if (study_num < 48) { //Case 47
236  // set lambda = 1, mu_all = 0.5, vary mu_half
237  Mdouble MuHalf[] = {0};
238  species->setSlidingFrictionCoefficient(MuHalf[study_num-47]);
241  randomiseSpecies = true;
242  } else if (study_num < 52) { //Case 48, 49, 50, 51
243  // set vary eps
244  Mdouble eps[] = {0.001, 0.01, 0.1, 1};
245  species->setCollisionTimeAndNormalAndTangentialRestitutionCoefficient
246  (50.*getTimeStep(), eps[study_num-48], eps[study_num-48], 1);
247  species->setSlidingFrictionCoefficient(0.0);
248  } else if (study_num < 53) { //Case 52
250  } else if (study_num < 54) { //Case 53
251  logger(INFO, "using mu=0.3, r=0.1");
252  species->setSlidingFrictionCoefficient(0.3);
253  species->setCollisionTimeAndNormalAndTangentialRestitutionCoefficient
254  (50.*getTimeStep(),0.1,0.1,1);
255  } else if (study_num < 55) { //Case 54
256  logger(INFO, "using mu=0.3, r=0.88");
257  species->setSlidingFrictionCoefficient(0.3);
258  species->setCollisionTimeAndNormalAndTangentialRestitutionCoefficient
259  (50.*getTimeStep(),0.88,0.88,1);
260  } else
261  {
262  //If study_num is complete quit
263  logger(VERBOSE, "Study is complete ");
264  exit(0);
265  }
266  //Note make sure h and a is defined
267  if (study_num < 37 || (study_num>=53&&study_num<=55))
268  {
269  set_study();
270  }
271  else
272  {
273  std::stringstream name;
274  name << "S" << study_num;
275  dataFile.setName(name.str().c_str());
276  //set_data_filename();
277  }
278 
279  }
280 
281  //Do not add or remove particles
282  virtual void actionsBeforeTimeStep() override { };
283 
284  //Set up periodic walls, rough bottom, add flow particles
285  void setupInitialConditions() override
286  {
287  //fix_hgrid();
289 
290  createBottom();
291  //~ write(std::cout,false);
292  //cout << "correct fixed" << endl;
294  for (unsigned int i=0; i<particleHandler.getNumberOfObjects(); i++)
297  }
298 
300  wallHandler.clear();
301  InfiniteWall w0;
303  if (getFixedParticleRadius()) {
304  w0.set(Vec3D(0,0,-1), Vec3D(0,0,-3.4* getMaxInflowParticleRadius()));
305  } else {
306  w0.set(Vec3D(0,0,-1), Vec3D(0,0,0));
307  }
309 
310  PeriodicBoundary b0;
311  b0.set(Vec3D(1.0, 0.0, 0.0), getXMin(), getXMax());
313  b0.set(Vec3D(0.0, 1.0, 0.0), getYMin(), getYMax());
315 
317 
318  logger(INFO, "\nStatus before solve:");
319 // std::cout
320 // << "tc=" << getCollisionTime()
321 // << ", eps=" << getRestitutionCoefficient()
322 // << ", vmax=" << getInflowParticle()->calculateMaximumVelocity(getSpecies())
323 // << ", inflowHeight/zMax=" << getInflowHeight()/getZMax()
324 // << std::endl << std::endl;
325  //~ timer.set(t,tmax);
326 
327  //optimize number of buckets
329  //setHGridNumberOfBucketsToPower(particleHandler.getNumberOfObjects()*1.5);
330  }
331 
332  //add flow particles
334  {
335  //setHGridNumberOfBucketsToPower(particleHandler.getStorageCapacity());
339  unsigned int N=getChuteLength()*getChuteWidth()* getInflowHeight();
341  Mdouble H = getInflowHeight();
342  setZMax(1.0*getInflowHeight());
343  //uncomment the following line to achieve a high packing fraction
345 
347  //try to find new insertable particles
348  while (getNCreated()<N){
352  //duplicate particle
353  for (BaseBoundary* it : boundaryHandler)
354  it->createPeriodicParticle(p, particleHandler);
356  //duplicate duplicate particles (this is a hack which is needed as there are two boundaries, so the doubly periodic images are needed)
357  for (BaseBoundary* it : boundaryHandler)
358  it->createPeriodicParticle(p, particleHandler);
359  //hGridActionsBeforeTimeStep();
362  }
363  for (unsigned int i = particleHandler.getNumberOfObjects(); i >= 1; i--)
364  if (particleHandler.getObject(i - 1)->getPeriodicFromParticle() != nullptr)
365  {
366  while (particleHandler.getObject(i - 1)->getInteractions().size() > 0)
367  {
369  }
371  }
372  setInflowHeight(H);
373  //setHGridNumberOfBucketsToPower();
374  write(std::cout,false);
375  }
376 
377  //defines type of flow particles
379  {
381  //inflowParticle_.computeMass();
382 
383  //The position components are first stored in a Vec3D, because if you pass them directly into setPosition the compiler is allowed to change the order in which the numbers are generated
384  Vec3D position;
385  position.X = random.getRandomNumber(getXMin(), getXMax());
386  position.Y = random.getRandomNumber(getYMin(), getYMax());
388  inflowParticle_.setPosition(position);
390  if (randomiseSpecies)
391  {
392  int indSpecies = floor(random.getRandomNumber(0, speciesHandler.getNumberOfObjects() - 1e-200));
394  }
395  }
396 
397  //set approximate height of flow
398  void set_H(Mdouble new_)
399  {
400  setInflowHeight(new_);
402  }
403 
405  { return getInflowHeight(); }
406 
407  void printTime() const override
408  {
409  logger(INFO, "t=%3.6"
410  ", tmax=%3.6"
411  ", N=%3.6"
412  ", theta=%3.6",
414  //<< ", time left=" << setprecision(3) << left << setw(6) << timer.getTime2Finish(t)
415  //~ << ", finish by " << setprecision(3) << left << setw(6) << timer.getFinishTime(t)
416  }
417 
418  bool readNextArgument(int& i, int argc, char* argv[]) override
419  {
420  if (!strcmp(argv[i], "-muBottom"))
421  {
422  setSlidingFrictionCoefficientBottom(atof(argv[i + 1]));
424  }
425  else if (!strcmp(argv[i], "-oldValues"))
426  {
427  species->setSlidingDissipation(species->getDissipation());
428  logger(INFO, "getSlidingDissipation()=%", species->getSlidingDissipation());
429  }
430  else return Chute::readNextArgument(i, argc, argv); //if argv[i] is not found, check the commands in Chute
431  return true; //returns true if argv[i] is found
432  }
433 
434  int getNCreated() const
435  {
436  return nCreated_;
437  }
438 
440  {
441  nCreated_++;
442  }
443 
444  int nCreated_;
445  bool randomiseSpecies;
447 
450 };
@ MULTILAYER
Definition: Chute.h:53
@ MULTIPLE_FILES_PADDED
each time-step will be written into/read from separate files numbered consecutively,...
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ INFO
@ VERBOSE
Definition: BaseBoundary.h:49
virtual unsigned int getNumberOfObjects() const
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles)
Definition: BaseHandler.h:648
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
void setStorageCapacity(const unsigned int N)
Sets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:669
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
unsigned int getStorageCapacity() const
Gets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:662
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
Definition: BaseInteractable.h:277
Definition: BaseParticle.h:54
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Definition: BaseParticle.h:93
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:341
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:818
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:169
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:1039
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:848
void setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:714
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:1059
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:671
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:947
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:974
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Definition: Chute.cc:323
bool readNextArgument(int &i, int argc, char *argv[]) override
This method can be used for reading object properties from a string.
Definition: Chute.cc:555
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:789
Mdouble getChuteLength() const
Returns the chute length (X-direction)
Definition: Chute.cc:1069
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:983
void write(std::ostream &os, bool writeAllParticles=true) const override
This function writes the Chute properties to an ostream, and adds the properties of ALL chute particl...
Definition: Chute.cc:206
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:938
Mdouble getChuteWidth() const
Returns the chute width (Y-direction)
Definition: Chute.cc:1049
Mdouble getInflowVelocity() const
Returns the average inflow velocity.
Definition: Chute.cc:1000
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:957
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:653
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:816
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:619
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:632
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1452
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
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1467
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1432
void checkAndDuplicatePeriodicParticles()
For simulations using periodic boundaries, checks and adds particles when necessary into the particle...
Definition: DPMBase.cc:5029
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
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
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:644
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:198
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:118
void removeObjectKeepingPeriodics(unsigned int id)
Removes interactions of periodic particles when the periodic particles get deleted (see DPMBase::remo...
Definition: InteractionHandler.cc:316
void setStiffnessAndRestitutionCoefficient(Mdouble k_, Mdouble eps, Mdouble mass)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P.
Definition: LinearViscoelasticNormalSpecies.cc:186
Mdouble getStiffness() const
Allows the spring constant to be accessed.
Definition: LinearViscoelasticNormalSpecies.cc:104
void setDissipation(Mdouble dissipation)
Allows the normal dissipation to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:117
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
Definition: LinearViscoelasticNormalSpecies.cc:130
void setStiffness(Mdouble new_k)
Allows the spring constant to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:93
void hGridActionsBeforeTimeLoop() override
This sets up the broad phase information, has to be done at this stage because it requires the partic...
Definition: MercuryBase.cc:94
bool checkParticleForInteraction(const BaseParticle &P) final
Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle.
Definition: MercuryBase.cc:594
void hGridActionsBeforeTimeStep() override
Performs all necessary actions before a time-step, like updating the particles and resetting all the ...
Definition: MercuryBase.cc:323
Contains contact force properties for contacts between particles with two different species.
Definition: MixedSpecies.h:43
void removeObject(unsigned int index) override
Removes a BaseParticle from the ParticleHandler.
Definition: ParticleHandler.cc:394
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1325
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Defines a pair of periodic walls. Inherits from BaseBoundary.
Definition: PeriodicBoundary.h:41
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a PeriodicBoundary by its normal and positions.
Definition: PeriodicBoundary.cc:84
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
Definition: flowRuleDiego_HeightAngle.cpp:35
virtual void createBaseSpecies()
Definition: flowRuleDiego_HeightAngle.cpp:89
LinearViscoelasticMixedSpecies * baseSpecies
Definition: flowRuleDiego_HeightAngle.cpp:266
void setSlidingFrictionCoefficientBottom(Mdouble new_)
Definition: SilbertPeriodic.h:98
void add_flow_particles()
Definition: flowRuleDiego_HeightAngle.cpp:165
void create_inflow_particle()
Definition: flowRuleDiego_HeightAngle.cpp:210
LinearViscoelasticSpecies * species
Definition: flowRuleDiego_HeightAngle.cpp:265
void increaseNCreated()
Definition: flowRuleDiego_HeightAngle.cpp:256
virtual void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: SilbertPeriodic.h:282
void set_study()
Definition: SilbertPeriodic.h:115
void set_H(Mdouble new_)
Definition: flowRuleDiego_HeightAngle.cpp:231
SphericalParticle inflowParticle_
Definition: flowRuleDiego_HeightAngle.cpp:263
SilbertPeriodic()
Definition: SilbertPeriodic.h:38
bool readNextArgument(int &i, int argc, char *argv[]) override
Interprets the i^th command-line argument.
Definition: SilbertPeriodic.h:418
Mdouble get_H()
Definition: SilbertPeriodic.h:404
int nCreated_
Definition: flowRuleDiego_HeightAngle.cpp:261
Mdouble getSlidingFrictionCoefficientBottom()
Definition: SilbertPeriodic.h:93
bool randomiseSpecies
Definition: flowRuleDiego_HeightAngle.cpp:262
void set_study(int study_num)
Definition: SilbertPeriodic.h:126
void printTime() const override
Displays the current simulation time and the maximum simulation duration.
Definition: SilbertPeriodic.h:407
int getNCreated() const
Definition: flowRuleDiego_HeightAngle.cpp:251
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: SilbertPeriodic.h:285
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Definition: SpeciesHandler.h:74
Contains material and contact force properties.
Definition: Species.h:35
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
Definition: Vector.h:51
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
const Mdouble pi
Definition: ExtendedMath.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Mdouble round(Mdouble value, unsigned int precision)
rounds a floating point number with a given precision
Definition: MathHelpers.cc:28
Mdouble beta(Mdouble z, Mdouble w)
This is the beta function, returns the approximation based on cmath's implementation of ln(gamma)
Definition: ExtendedMath.cc:164
std::string name
Definition: MercuryProb.h:48