revision: v0.14
hstop_relaunch.cpp File Reference
#include "SilbertPeriodic.h"

Classes

class  SilbertHstop
 

Functions

bool PointIsAboveCurve (Mdouble h, Mdouble a, int study_num)
 
void HstopCurve (int study_num, Mdouble h, Mdouble a)
 
int main (int argc, char *argv[])
 

Variables

fstream ReportFile
 

Function Documentation

◆ HstopCurve()

void HstopCurve ( int  study_num,
Mdouble  h,
Mdouble  a 
)
139 {
140  cout << "restart at study_num=" << study_num << ", h=" << h << ", a=" << a << endl;
141 
142  Mdouble hMax = 60; //height at which bisection algorithm stops
143  Mdouble dh = 2; //how much I decrease the height after a point is found
144  Mdouble da = .5; // how exact I want the angle to be determined
145 
146  stringstream name;
147  name << "Report" << study_num;
148  ReportFile.open(name.str().c_str(),fstream::out | fstream::app);
149  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
150 
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-=da;
157  else h+=dh;
158  stringstream command;
159  command << "~/hstop/runstat.sh " << study_num << " " << h << " " << a << "&";
160  int sysret;
161  sysret = system (command.str().c_str());
162  }
163 
164  return;
165 }

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

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
168 {
169  if (argc>3)
170  HstopCurve(atoi(argv[1]),atof(argv[2]),atof(argv[3]));
171  else exit(-1);
172 }

References HstopCurve().

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( Mdouble  h,
Mdouble  a,
int  study_num 
)
113  {
114  SilbertHstop problem;
115  problem.setInflowHeight(h) ;
116  problem.setChuteAngle(a);
117  problem.set_study(study_num);
118  stringstream name;
119  name << "H" << problem.getInflowHeight()
120  << "A" << problem.getChuteAngleDegrees()
121  << "L" << round(100.*problem.getFixedParticleRadius()*2.)/100.
122  << "M" << problem.getSlidingFrictionCoefficient()
123  << "B" << problem.getSlidingFrictionCoefficientBottom();
124  problem.setName(name.str().c_str());
125  cout << "starting " << name.str().c_str() << endl;
126  problem.solve_analytic();
127  stringstream com;
128  ReportFile << problem.getInflowHeight()
129  << "\t" << problem.getChuteAngleDegrees()
130  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
131  << "\t" << problem.getSlidingFrictionCoefficient()
132  << "\t" << problem.getSlidingFrictionCoefficientBottom()
133  << "\t" << problem.pointIsAboveCurve
134  << endl;
135  return problem.pointIsAboveCurve;
136 }

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 SilbertHstop::solve_analytic().

Referenced by HstopCurve().

Variable Documentation

◆ ReportFile

fstream ReportFile

Referenced by HstopCurve(), and PointIsAboveCurve().

DPMBase::setName
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
SilbertPeriodic::getSlidingFrictionCoefficientBottom
Mdouble getSlidingFrictionCoefficientBottom()
Definition: GlasPeriodic.h:81
Chute::getChuteAngleDegrees
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:743
Chute::setInflowHeight
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:884
SilbertHstop::pointIsAboveCurve
double pointIsAboveCurve
Definition: hstop_StudyHeightHmaxAngle.cpp:45
Chute::setChuteAngle
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:695
Mdouble
double Mdouble
Definition: GeneralDefine.h:34
SilbertPeriodic::set_study
void set_study(int study_num)
Definition: flowRuleDiego_HeightAngle.cpp:101
SilbertHstop
Definition: hstop_StudyHeightHmaxAngle.cpp:33
helpers::round
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:598
ReportFile
fstream ReportFile
Definition: hstop_relaunch.cpp:111
Chute::getFixedParticleRadius
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:626
SilbertHstop::solve_analytic
void solve_analytic()
Definition: hstop_StudyHeightHmaxAngle.cpp:76
HstopCurve
void HstopCurve(int study_num, Mdouble h, Mdouble a)
Definition: hstop_relaunch.cpp:138
Chute::getInflowHeight
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:901
units::name
std::string name
Definition: MercuryProb.h:48
PointIsAboveCurve
bool PointIsAboveCurve(Mdouble h, Mdouble a, int study_num)
Definition: hstop_relaunch.cpp:113