26 #include "scr/Chute.h"
33 setName(
"../../H20A22L0.5M0.5");
41 set_Nmax(get_N()*12.);
43 for (
int j=0; j<5; j++) {
44 for (
int i=0;
i<N;
i++) {
45 if (Particles[
i].is_fixed()) {
46 Particles.push_back(Particles[
i]);
47 Particles.back().indSpecies=1;
48 Particles.back().Position.X+=20*j;
54 SlowBottom.
setName(
"../../H20A22L0.75M0.5");
55 SlowBottom.load_restart_data();
56 for (
int j=5; j<10; j++) {
57 for (
int i=0;
i<SlowBottom.get_N();
i++) {
58 if (SlowBottom.getObjects()[
i].is_fixed()) {
59 Particles.push_back(SlowBottom.getObjects()[
i]);
60 Particles.back().indSpecies=1;
61 Particles.back().Position.X+=20*j;
75 set_HGRID_num_buckets_to_power();
83 static int count = 0, maxcount = 100;
88 for (
unsigned int i=0;
i<Particles.size();)
90 if (Particles[
i].Position.Z<
getZMin()-10)
92 #ifdef DEBUG_OUTPUT_FULL
93 cout <<
"erased:" << Particles[
i] << endl;
107 Particles[
i].Velocity += Particles[
i].Force*Particles[
i].get_invmass()*0.5*
getTimeStep();
108 Particles[
i].Position += Particles[
i].Velocity*
getTimeStep();
111 Particles[
i].AngularVelocity += Particles[
i].Torque*Particles[
i].get_invinertia()*0.5*
getTimeStep();
112 Particles[
i].Angle += Particles[
i].AngularVelocity*
getTimeStep();
116 if (Particles[
i].indSpecies==0 && WallsPeriodic[0].distance(Particles[
i])<0) {
117 if (Particles[
i].Position.X>18 && Particles[
i].Position.X<22) {
118 if (get_Nmax()<=get_N()) set_Nmax(get_Nmax()+10000);
119 Particles.push_back(Particles[
i]);
120 Particles.back().indSpecies=1;
122 WallsPeriodic[0].shift_position(Particles[
i].Position);
124 if (WallsPeriodic[1].distance(Particles[
i])<0)
125 WallsPeriodic[1].shift_position(Particles[
i].Position);
140 for (
int i=0;
i<get_N();
i++)
141 if (Particles[
i].indSpecies==0) counter++;
143 cout <<
"t=" << setprecision(3) << left << setw(6) <<
getTime()
144 <<
", Nmax=" << setprecision(3) << left << setw(6) << get_Nmax()
145 <<
", counter=" << setprecision(3) << left << setw(6) << counter << endl;
150 if (Particles[PI ].indSpecies!=Particles[PJreal].indSpecies) {
151 if (Particles[PI ].indSpecies==0) {
152 if (Particles[PI ].Position.X>18) {
153 Particles[PJreal].Force-=force;
156 if (Particles[PJreal].Position.X>18) {
157 Particles[PI ].Force+=force;
161 Particles[PI ].Force+=force;
162 Particles[PJreal].Force-=force;
169 if (nWallPeriodic==0 && Particles[
i].indSpecies==0 && WallsPeriodic[0].distance(Particles[
i])<Particles[
i].Radius+get_radius_of_largest_particle())
171 CParticle F0=Particles[
i];
172 WallsPeriodic[0].shift_position(F0.Position);
176 while(Particles[From].get_periodicFromParticle()!=-1)
177 From=Particles[From].get_periodicFromParticle();
178 F0.set_periodicFromParticle(From);
180 Particles.push_back(F0);
181 HGridInsertParticleToHgrid(Particles[get_N()-1]);
187 for (
int k=max(1,nWallPeriodic); k<get_NWallPeriodic(); k++) {
189 if (WallsPeriodic[k].distance(Particles[
i])<Particles[
i].Radius+get_radius_of_largest_particle())
191 CParticle F0=Particles[
i];
192 WallsPeriodic[k].shift_position(F0.Position);
196 while(Particles[From].get_periodicFromParticle()!=-1)
197 From=Particles[From].get_periodicFromParticle();
198 F0.set_periodicFromParticle(From);
200 Particles.push_back(F0);
201 HGridInsertParticleToHgrid(Particles[get_N()-1]);
214 stringstream file_name;
215 ofstream script_file;
216 file_name << problem_name.str() <<
".disp";
217 script_file.open((file_name.str()).c_str());
220 script_file <<
"#!/bin/bash" << endl;
221 script_file <<
"x=$(echo $0 | cut -c2-)" << endl;
222 script_file <<
"file=$PWD$x" << endl;
223 script_file <<
"dirname=`dirname \"$file\"`" << endl;
224 script_file <<
"cd $dirname" << endl;
229 int width=1700-140, height=1000-140;
231 if (ratio>width/height) height=width/ratio;
232 else width=height*ratio;
261 script_file <<
"../xballs -format " << format
262 <<
" -f " << data_filename.str() << ((get_options_data()==2)?
"'.0000":
"")
264 <<
" -w " << width+140
265 <<
" -h " << height+140
267 <<
" -cmax -scala 4 -sort "
277 chmod((file_name.str().c_str()),S_IRWXU);
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
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
int getXBallsColourMode() const
Get the xballs colour mode (CMode).
Definition: DPMBase.cc:1310
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
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
double getXBallsVectorScale() const
Returns the scale of vectors used in xballs.
Definition: DPMBase.cc:1330
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
std::string getXBallsAdditionalArguments() const
Returns the additional arguments for xballs.
Definition: DPMBase.cc:1355
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1501
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
double getXBallsScale() const
Returns the scale of the view in xballs.
Definition: DPMBase.cc:1372
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
unsigned int getSystemDimensions() const
Returns the system dimensionality.
Definition: DPMBase.cc:1430
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
Definition: inflowFromPeriodic.h:29
int Check_and_Duplicate_Periodic_Particle(int i, int nWallPeriodic)
Definition: inflowFromPeriodic.h:166
void integrateBeforeForceComputation(int i)
Definition: inflowFromPeriodic.h:105
void add_forces(int PI, int PJreal)
Definition: inflowFromPeriodic.h:148
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: inflowFromPeriodic.h:103
void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: inflowFromPeriodic.h:79
inflowFromPeriodic()
Definition: inflowFromPeriodic.h:31
void writeXBallsScript()
Definition: inflowFromPeriodic.h:211
void cleanChute()
Definition: inflowFromPeriodic.h:81
inflowFromPeriodic(string restart_file)
Definition: inflowFromPeriodic.h:70
void printTime()
Definition: inflowFromPeriodic.h:138
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51