12 setName(
"../../H20A22L0.5M0.5");
20 set_Nmax(get_N()*12.);
22 for (
int j=0;
j<5;
j++) {
23 for (
int i=0;
i<
N;
i++) {
24 if (Particles[
i].is_fixed()) {
25 Particles.push_back(Particles[
i]);
26 Particles.back().indSpecies=1;
27 Particles.back().Position.X+=20*
j;
33 SlowBottom.
setName(
"../../H20A22L0.75M0.5");
34 SlowBottom.load_restart_data();
35 for (
int j=5;
j<10;
j++) {
36 for (
int i=0;
i<SlowBottom.get_N();
i++) {
37 if (SlowBottom.getObjects()[
i].is_fixed()) {
38 Particles.push_back(SlowBottom.getObjects()[
i]);
39 Particles.back().indSpecies=1;
40 Particles.back().Position.X+=20*
j;
54 set_HGRID_num_buckets_to_power();
62 static int count = 0, maxcount = 100;
67 for (
unsigned int i=0;
i<Particles.size();)
69 if (Particles[
i].Position.Z<
getZMin()-10)
71 #ifdef DEBUG_OUTPUT_FULL
72 cout <<
"erased:" << Particles[
i] << endl;
86 Particles[
i].Velocity += Particles[
i].Force*Particles[
i].get_invmass()*0.5*
getTimeStep();
90 Particles[
i].AngularVelocity += Particles[
i].Torque*Particles[
i].get_invinertia()*0.5*
getTimeStep();
91 Particles[
i].Angle += Particles[
i].AngularVelocity*
getTimeStep();
95 if (Particles[
i].indSpecies==0 && WallsPeriodic[0].distance(Particles[
i])<0) {
96 if (Particles[
i].Position.X>18 && Particles[
i].Position.X<22) {
97 if (get_Nmax()<=get_N()) set_Nmax(get_Nmax()+10000);
98 Particles.push_back(Particles[
i]);
99 Particles.back().indSpecies=1;
101 WallsPeriodic[0].shift_position(Particles[
i].Position);
103 if (WallsPeriodic[1].distance(Particles[
i])<0)
104 WallsPeriodic[1].shift_position(Particles[
i].Position);
119 for (
int i=0;
i<get_N();
i++)
120 if (Particles[
i].indSpecies==0) counter++;
122 cout <<
"t=" << setprecision(3) << left << setw(6) <<
getTime()
123 <<
", Nmax=" << setprecision(3) << left << setw(6) << get_Nmax()
124 <<
", counter=" << setprecision(3) << left << setw(6) << counter << endl;
129 if (Particles[PI ].indSpecies!=Particles[PJreal].indSpecies) {
130 if (Particles[PI ].indSpecies==0) {
131 if (Particles[PI ].Position.X>18) {
132 Particles[PJreal].Force-=force;
135 if (Particles[PJreal].Position.X>18) {
136 Particles[PI ].Force+=force;
140 Particles[PI ].Force+=force;
141 Particles[PJreal].Force-=force;
148 if (nWallPeriodic==0 && Particles[
i].indSpecies==0 && WallsPeriodic[0].distance(Particles[
i])<Particles[
i].
Radius+get_radius_of_largest_particle())
150 CParticle F0=Particles[
i];
151 WallsPeriodic[0].shift_position(F0.Position);
155 while(Particles[From].get_periodicFromParticle()!=-1)
156 From=Particles[From].get_periodicFromParticle();
157 F0.set_periodicFromParticle(From);
159 Particles.push_back(F0);
160 HGridInsertParticleToHgrid(Particles[get_N()-1]);
166 for (
int k=
max(1,nWallPeriodic);
k<get_NWallPeriodic();
k++) {
168 if (WallsPeriodic[
k].distance(Particles[
i])<Particles[
i].Radius+get_radius_of_largest_particle())
170 CParticle F0=Particles[
i];
171 WallsPeriodic[
k].shift_position(F0.Position);
175 while(Particles[From].get_periodicFromParticle()!=-1)
176 From=Particles[From].get_periodicFromParticle();
177 F0.set_periodicFromParticle(From);
179 Particles.push_back(F0);
180 HGridInsertParticleToHgrid(Particles[get_N()-1]);
194 ofstream script_file;
195 file_name << problem_name.str() <<
".disp";
196 script_file.open((
file_name.str()).c_str());
199 script_file <<
"#!/bin/bash" << endl;
200 script_file <<
"x=$(echo $0 | cut -c2-)" << endl;
201 script_file <<
"file=$PWD$x" << endl;
202 script_file <<
"dirname=`dirname \"$file\"`" << endl;
203 script_file <<
"cd $dirname" << endl;
208 int width=1700-140,
height=1000-140;
240 script_file <<
"../xballs -format " <<
format
241 <<
" -f " << data_filename.str() << ((get_options_data()==2)?
"'.0000":
"")
243 <<
" -w " << width+140
246 <<
" -cmax -scala 4 -sort "
256 chmod((
file_name.str().c_str()),S_IRWXU);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
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:360
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:44
int getXBallsColourMode() const
Get the xballs colour mode (CMode).
Definition: DPMBase.cc:1301
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:603
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:610
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
double getXBallsVectorScale() const
Returns the scale of vectors used in xballs.
Definition: DPMBase.cc:1321
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:616
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
std::string getXBallsAdditionalArguments() const
Returns the additional arguments for xballs.
Definition: DPMBase.cc:1346
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1492
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
double getXBallsScale() const
Returns the scale of the view in xballs.
Definition: DPMBase.cc:1363
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:622
unsigned int getSystemDimensions() const
Returns the system dimensionality.
Definition: DPMBase.cc:1421
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:634
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:628
Definition: inflowFromPeriodic.h:8
int Check_and_Duplicate_Periodic_Particle(int i, int nWallPeriodic)
Definition: inflowFromPeriodic.h:145
void integrateBeforeForceComputation(int i)
Definition: inflowFromPeriodic.h:84
void add_forces(int PI, int PJreal)
Definition: inflowFromPeriodic.h:127
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: inflowFromPeriodic.h:82
void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: inflowFromPeriodic.h:58
inflowFromPeriodic()
Definition: inflowFromPeriodic.h:10
void writeXBallsScript()
Definition: inflowFromPeriodic.h:190
void cleanChute()
Definition: inflowFromPeriodic.h:60
inflowFromPeriodic(string restart_file)
Definition: inflowFromPeriodic.h:49
void printTime()
Definition: inflowFromPeriodic.h:117
Definition: matrices.h:74
@ N
Definition: constructor.cpp:22
#define max(a, b)
Definition: datatypes.h:23
char char char int int * k
Definition: level2_impl.h:374
double Radius
Radius of the pipe.
Definition: pipe.cc:55
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
string file_name
Definition: Particles2023AnalysisHung.py:321
std::string format(const std::string &str, const std::vector< std::string > &find, const std::vector< std::string > &replace)
Definition: openglsupport.cpp:217
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2