revision: v0.14
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 }

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 }

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 }

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

ReportFile
fstream ReportFile
Definition: hstop_restart.cpp:109
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
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
Chute::getFixedParticleRadius
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:626
PointIsAboveCurve
bool PointIsAboveCurve(Mdouble h, Mdouble a, int study_num)
Definition: hstop_restart.cpp:111
Chute::getInflowHeight
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:901
HstopCurve
void HstopCurve(int study_num, Mdouble h, Mdouble a)
Definition: hstop_restart.cpp:136
units::name
std::string name
Definition: MercuryProb.h:48