MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LeesEdwardsSelfTest.cpp
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, 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 <iostream>
27 
28 #include "Mercury2D.h"
30 #include "Particles/BaseParticle.h"
32 
34 {
35 public:
36 
38  {
39  Mdouble tc=1e-3;
40  Mdouble r=0.8;
41  Mdouble rho=2000;
42  Mdouble minRadius= 0.11415;
43  Mdouble velocity=1.0;
44  Mdouble minMass=constants::pi * minRadius * minRadius * rho;
45 
46  setName("LeesEdwardsSelfTest");
48  setGravity(Vec3D(0.0,0.0,0.0));
49  setTimeMax(1);
50 
51  setTimeStep(0.02*tc);
52  dataFile.setSaveCount(5000);
57 
58  setXMin(0.0);
59  setYMin(0.0);
60  setXMax(1.0);
61  setYMax(1.0);
62 
64  species->setDensity(rho);
65  species->setCollisionTimeAndRestitutionCoefficient(tc, r, minMass);
66  //species->setStiffness(helpers::computeKFromCollisionTimeAndRestitutionCoefficientAndEffectiveMass (tc, r, 0.5*minMass));
67  //species->setDissipation(helpers::computeDispFromCollisionTimeAndRestitutionCoefficientAndEffectiveMass (tc, r, 0.5*minMass));
68 
71  [velocity] (double time) { return time*velocity; },
72  [velocity] (double time UNUSED) { return velocity; },
73  getXMin(),getXMax(),getYMin(),getYMax());
74 
75  BaseParticle* p;
77  p->setRadius(0.20028);
78  p->setPosition(Vec3D(0.10549,1,0.0));
80  p->setRadius(0.13451);
81  p->setPosition(Vec3D(0.075661,0.68566,0.0));
83  p->setRadius(0.14352);
84  p->setPosition(Vec3D(0.92579,0.28903,0.0));
86  p->setRadius(0.18295);
87  p->setPosition(Vec3D(0.38665,0.74146,0.0));
89  p->setRadius(0.21927);
90  p->setPosition(Vec3D(0.62318,0.39102,0.0));
92  p->setRadius(0.19289);
93  p->setPosition(Vec3D(0.76649,0.76213,0.0));
95  p->setRadius(0.11415);
96  p->setPosition(Vec3D(0.56207,0.97227,0.0));
98  p->setRadius(0.20264);
99  p->setPosition(Vec3D(0.22567,0.39866,0.0));
101  p->setRadius(0.1269);
102  p->setPosition(Vec3D(0.39448,0.13762,0.0));
104  p->setRadius(0.13683);
105  p->setPosition(Vec3D(0.77937,0.080942,0.0));
106  }
107 
108 private:
111 };
112 
113 int main(int argc UNUSED, char *argv[] UNUSED)
114 {
115  LeesEdwardsSelfTest leesEdwardsSelfTest;
116  leesEdwardsSelfTest.solve();
117 }
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
Definition: DPMBase.cc:309
void solve()
The work horse of the code.
Definition: DPMBase.cc:1895
void set(std::function< double(double)> shift, std::function< double(double)> velocity, Mdouble left, Mdouble right, Mdouble down, Mdouble up)
Sets all boundary properties.
Class which creates a boundary with Lees-Edwards type periodic boundary conditions.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Definition: DPMBase.cc:179
LinearViscoelasticSpecies * species
void setYMin(Mdouble newYMin)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin...
Definition: DPMBase.cc:280
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
Definition: DPMBase.cc:224
LeesEdwardsBoundary * leesEdwardsBoundary
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
Definition: DPMBase.cc:238
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Definition: DPMBase.cc:453
int main(int argc UNUSED, char *argv[] UNUSED)
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
Definition: DPMBase.cc:431
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
Definition: DPMBase.cc:231
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
Definition: DPMBase.cc:324
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: Files.h:214
file will not be created/read
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:268
const Mdouble pi
Definition: ExtendedMath.h:42
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:888
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
Definition: DPMBase.cc:266
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:878
void setDensity(Mdouble density)
Allows the density to be changed.
#define UNUSED
Definition: GeneralDefine.h:37
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: Files.h:209
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: Files.h:204
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:282
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
void setHGridMaxLevels(unsigned int HGridMaxLevels)
Sets the maximum number of levels of the HGrid in this MercuryBase.
Definition: MercuryBase.cc:500
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Definition: DPMBase.h:868
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
Definition: DPMBase.cc:245
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:209
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353
Contains material and contact force properties.
Definition: Interaction.h:35
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
File statFile
An instance of class File to handle in- and output into a .stat file.
Definition: Files.h:224
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
This adds on the hierarchical grid code for 2D problems.
Definition: Mercury2D.h:35