MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InsertionBoundarySelfTest.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 #include "Mercury3D.h"
29 #include "Particles/BaseParticle.h"
31 #include "Walls/InfiniteWall.h"
32 
33 
35 {
36 public:
37 
38 
40  {
41  setName("InsertionBoundarySelfTest");
43  setGravity(Vec3D(0.0,0.0,0.0));
44  setTimeStep(1e-4);
46  setTimeMax(1);
48 
49  setXMin(0.0);
50  setYMin(0.0);
51  setZMin(0.0);
52  setXMax(1.0);
53  setYMax(1.0);
54  setZMax(1.0);
55 
56 
57  species = new LinearViscoelasticSpecies; //delete is done in speciesHandler
59  species->setDensity(2000);
60  species->setStiffness(10000);
61 
62  insertionBoundary = new CubeInsertionBoundary; //delete is done in boundaryHandler
64  BaseParticle* insertionBoundaryParticle = new BaseParticle;
65  insertionBoundaryParticle->setSpecies(species);
66  insertionBoundary->set(insertionBoundaryParticle,10,Vec3D(0.25,0.25,0.25),Vec3D(0.75,0.75,0.75),Vec3D(-5,-5,-5),Vec3D(5,5,5),0.1,0.2);
67  delete insertionBoundaryParticle;
68 
69  bottomWall = new InfiniteWall(); //delete is done in wallHandler
71  Vec3D normal = Vec3D(std::pow(1.0/3.0,0.5), std::pow(1.0/3.0,0.5), std::pow(1.0/3.0,0.5));
72  bottomWall->set(normal, normal);
73  }
74 
78 
79 };
80 
81 int main(int argc UNUSED, char *argv[] UNUSED)
82 {
83  std::cout << "Simple box for creating particles" << std::endl;
85  InsertionBoundarySelfTest insertionBoundary_problem;
86 
87  insertionBoundary_problem.solve();
88 }
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 setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Definition: DPMBase.cc:179
int main(int argc UNUSED, char *argv[] UNUSED)
CubeInsertionBoundary * insertionBoundary
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
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
Definition: DPMBase.cc:338
void setSpecies(const ParticleSpecies *species)
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Definition: DPMBase.cc:453
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
Definition: DPMBase.cc:431
void set(BaseParticle *particleToCopy, int maxFailed, Vec3D posMin, Vec3D posMax, Vec3D velMin, Vec3D velMax, double radMin, double radMax)
Sets the properties of the cuboidal insertion boundary.
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
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
It's an insertion boundary which has cuboidal shape (yes, 'CuboidalInsertionBoundary' would have been...
virtual void addObject(ParticleSpecies *const S)
Adds a new ParticleSpecies to the SpeciesHandler.
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:888
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:35
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
LinearViscoelasticSpecies * species
void setDensity(Mdouble density)
Allows the density to be changed.
#define UNUSED
Definition: GeneralDefine.h:37
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: Files.h:204
void setZMin(Mdouble newZMin)
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin...
Definition: DPMBase.cc:295
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
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:883
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:70
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353
This is a class defining walls.
Definition: InfiniteWall.h:43
void addObject(BaseWall *W)
Adds a BaseWall to the WallHandler.
Definition: WallHandler.cc:93
Contains material and contact force properties.
Definition: Interaction.h:35
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
void addObject(BaseBoundary *P)
Adds a BaseBoundary to the BoundaryHandler.