obsolete_codes/hstopGlass_StudyHeightHmaxAngle.cpp File Reference
#include "GlasPeriodic.h"

Classes

class  SilbertHstop
 

Functions

bool PointIsAboveCurve (Mdouble h, Mdouble a, int study_num)
 
int HstopCurve (string cmd UNUSED, int study_num, Mdouble h, Mdouble hMax, Mdouble a)
 
int main (int argc, char *argv[])
 

Variables

fstream ReportFile
 

Function Documentation

◆ HstopCurve()

int HstopCurve ( string cmd  UNUSED,
int  study_num,
Mdouble  h,
Mdouble  hMax,
Mdouble  a 
)
144 {
145  cout << "restart at study_num=" << study_num << ", h=" << h << ", a=" << a << endl;
146 
147  stringstream name;
148  name << "Report" << study_num;
149  ReportFile.open(name.str().c_str(),fstream::out | fstream::app);
150  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
151  bool piac = PointIsAboveCurve(h,a,study_num);
152  ReportFile.close();
153 
154  //now increase height gradually; decrease angle if flow starts
155  if (h<hMax) {
156  if (piac) a-=.5;
157  else h+=2;
158  stringstream command;
159  // for msm1:
160  command << "nohup nice -18 ../hstopGlass_StudyHeightHmaxAngle.exe " << study_num << " " << h << " " << hMax << " " << a << " &>>outS" << study_num << "H" << h << "HMax" << hMax << "A" << a << " &";
161  // for einder:
162  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHmaxAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMax << " " << a << "&";
163  cout << command.str() << endl;
164  return system (command.str().c_str());
165  } else {
166  return 0;
167  }
168 }
std::string name
Definition: MercuryProb.h:48
bool PointIsAboveCurve(Mdouble h, Mdouble a, int study_num)
Definition: obsolete_codes/hstopGlass_StudyHeightHmaxAngle.cpp:111
fstream ReportFile
Definition: obsolete_codes/hstopGlass_StudyHeightHmaxAngle.cpp:109

References units::name, PointIsAboveCurve(), and ReportFile.

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
171 {
172  if (argc<4) { cout << "Please specify Study, Height, max. Height and Angle" << endl; exit(-1); }
173  HstopCurve(argv[0],atoi(argv[1]),atof(argv[2]),atof(argv[3]),atof(argv[4]));
174 }
int HstopCurve(string cmd UNUSED, int study_num, Mdouble h, Mdouble hMax, Mdouble a)
Definition: obsolete_codes/hstopGlass_StudyHeightHmaxAngle.cpp:143

References HstopCurve().

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( Mdouble  h,
Mdouble  a,
int  study_num 
)
111  {
112  cout << "PointIsAboveCurve(" << study_num << ", h=" << h << ", a=" << a << ")" << endl;
113  SilbertHstop problem;
114  problem.setInflowHeight(h) ;
115  problem.setChuteAngle(a);
116  problem.set_study(study_num);
117  stringstream name;
118  name << "H" << problem.getInflowHeight()
119  << "A" << problem.getChuteAngleDegrees()
120  << "L" << round(100.*problem.getFixedParticleRadius()*2.)/100.
121  << "M" << problem.getSlidingFrictionCoefficient()
122  << "B" << problem.getSlidingFrictionCoefficientBottom();
123  problem.setName(name.str().c_str());
124  cout << "starting " << name.str().c_str() << endl;
125  // if you want more restart output, use these options
126  //problem.restartFile.setFileType(FileType::MULTIPLE_FILES_PADDED);
127  // for real runs:
128  //~ problem.set_Hertzian(true);
129  problem.solve();
130  // for test runs:
131  //problem.solve_analytic();
132  stringstream com;
133  ReportFile << problem.getInflowHeight()
134  << "\t" << problem.getChuteAngleDegrees()
135  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
136  << "\t" << problem.getSlidingFrictionCoefficient()
137  << "\t" << problem.getSlidingFrictionCoefficientBottom()
138  << "\t" << problem.pointIsAboveCurve
139  << endl;
140  return problem.pointIsAboveCurve;
141 }
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:671
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:974
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:957
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:816
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Definition: hstop_StudyHeightHmaxAngle.cpp:33
double pointIsAboveCurve
Definition: hstop_StudyHeightHmaxAngle.cpp:45
Mdouble getSlidingFrictionCoefficientBottom()
Definition: GlasPeriodic.h:81
void set_study(int study_num)
Definition: flowRuleDiego_HeightAngle.cpp:101
Mdouble round(Mdouble value, unsigned int precision)
rounds a floating point number with a given precision
Definition: MathHelpers.cc:28

References Chute::getChuteAngleDegrees(), Chute::getFixedParticleRadius(), Chute::getInflowHeight(), SilbertPeriodic::getSlidingFrictionCoefficientBottom(), units::name, SilbertHstop::pointIsAboveCurve, ReportFile, helpers::round(), SilbertPeriodic::set_study(), Chute::setChuteAngle(), Chute::setInflowHeight(), DPMBase::setName(), and DPMBase::solve().

Referenced by HstopCurve().

Variable Documentation

◆ ReportFile

fstream ReportFile

Referenced by HstopCurve(), and PointIsAboveCurve().