hstop_demo.cpp File Reference
#include "SilbertPeriodic.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 UNUSED, char *argv[])
 

Variables

fstream ReportFile
 

Function Documentation

◆ HstopCurve()

int HstopCurve ( string cmd  UNUSED,
int  study_num,
Mdouble  h,
Mdouble  hMax,
Mdouble  a 
)
143 {
144  cout << "restart at study_num=" << study_num << ", h=" << h << ", a=" << a << endl;
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  bool piac = PointIsAboveCurve(h,a,study_num);
151  ReportFile.close();
152 
153  //now increase height gradually; decrease angle if flow starts
154  if (h<hMax) {
155  if (piac) a-=.5;
156  else h+=2;
157  stringstream command;
158  // for msm1:
159  command << "echo " << study_num << " " << h << " " << hMax << " " << a << " > arg";
160  // for einder:
161  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHmaxAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMax << " " << a << "&";
162  cout << command.str() << endl;
163  return system (command.str().c_str());
164  } else {
165  return 0;
166  }
167 }
bool PointIsAboveCurve(Mdouble h, Mdouble a, int study_num)
Definition: hstop_demo.cpp:111
fstream ReportFile
Definition: hstop_demo.cpp:109
std::string name
Definition: MercuryProb.h:48

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

Referenced by main().

◆ main()

int main ( int argc  UNUSED,
char argv[] 
)
171 {
172  HstopCurve(argv[0],4,4.,60.,24.);
173 }
int HstopCurve(string cmd UNUSED, int study_num, Mdouble h, Mdouble hMax, Mdouble a)
Definition: hstop_demo.cpp:142

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.solve();
129  // for test runs:
130  problem.solve_analytic();
131  stringstream com;
132  ReportFile << problem.getInflowHeight()
133  << "\t" << problem.getChuteAngleDegrees()
134  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
135  << "\t" << problem.getSlidingFrictionCoefficient()
136  << "\t" << problem.getSlidingFrictionCoefficientBottom()
137  << "\t" << problem.pointIsAboveCurve
138  << endl;
139  return problem.pointIsAboveCurve;
140 }
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
Definition: hstop_StudyHeightHmaxAngle.cpp:33
void solve_analytic()
Definition: hstop_StudyHeightHmaxAngle.cpp:76
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 SilbertHstop::solve_analytic().

Referenced by HstopCurve().

Variable Documentation

◆ ReportFile

fstream ReportFile

Referenced by HstopCurve(), and PointIsAboveCurve().