revision: v0.14
obsolete_codes/hstop_StudyHeightHminAngle.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 hMin, 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  hMin,
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>hMin) {
155  if (!piac) a+=.5;
156  else h*=0.9;
157  stringstream command;
158  // for msm1:
159  command << "echo " << study_num << " " << h << " " << hMin << " " << a << " > arg";
160  // for einder:
161  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHminAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMin << " " << a << "&";
162  cout << command.str() << endl;
163  return system (command.str().c_str());
164  } else {
165  return 0;
166  }
167 }

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

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
170 {
171  if (argc<4) { cout << "Please specify Study, Height, min. Height and Angle" << endl; exit(-1); }
172  HstopCurve(argv[0],atoi(argv[1]),atof(argv[2]),atof(argv[3]),atof(argv[4]));
173 }

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 }

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().

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
DPMBase::solve
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
SilbertPeriodic::set_study
void set_study(int study_num)
Definition: flowRuleDiego_HeightAngle.cpp:101
PointIsAboveCurve
bool PointIsAboveCurve(Mdouble h, Mdouble a, int study_num)
Definition: obsolete_codes/hstop_StudyHeightHminAngle.cpp:111
SilbertHstop
Definition: hstop_StudyHeightHmaxAngle.cpp:33
helpers::round
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:598
Chute::getFixedParticleRadius
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:626
ReportFile
fstream ReportFile
Definition: obsolete_codes/hstop_StudyHeightHminAngle.cpp:109
HstopCurve
int HstopCurve(string cmd UNUSED, int study_num, Mdouble h, Mdouble hMin, Mdouble a)
Definition: obsolete_codes/hstop_StudyHeightHminAngle.cpp:142
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