hstop_restart.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 
)
137 {
138  cout << "restart at study_num=" << study_num << ", h=" << h << ", a=" << a << endl;
139 
140  Mdouble hMax = 60; //height at which bisection algorithm stops
141  Mdouble dh = 2; //how much I decrease the height after a point is found
142  Mdouble da = .5; // how exact I want the angle to be determined
143 
144  stringstream name;
145  name << "Report" << study_num;
146  ReportFile.open(name.str().c_str(),fstream::out);
147  ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
148 
149  //now increase height gradually; decrease angle if flow starts
150  for (; h<hMax; h+=dh) while (PointIsAboveCurve(h,a,study_num)) a-=da;
151 
152  ReportFile.close();
153  return;
154 }
double Mdouble
Definition: GeneralDefine.h:34
bool PointIsAboveCurve(Mdouble h, Mdouble a, int study_num)
Definition: hstop_restart.cpp:111
fstream ReportFile
Definition: hstop_restart.cpp:109
std::string name
Definition: MercuryProb.h:48

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

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
157 {
158  if (argc>3)
159  HstopCurve(atoi(argv[1]),atof(argv[2]),atof(argv[3]));
160  else exit(-1);
161 }
void HstopCurve(int study_num, Mdouble h, Mdouble a)
Definition: hstop_restart.cpp:136

References HstopCurve().

◆ PointIsAboveCurve()

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