hstopGlass_StudyHeightHmaxAngle.cpp File Reference
#include <iomanip>
#include "GlasPeriodic.h"

Classes

class  SilbertHstop
 

Functions

bool PointIsAboveCurve (double h, double a, int study_num)
 
int HstopCurve (std::string cmd UNUSED, int study_num, double h, double hMax, double a)
 
int main (int argc, char *argv[])
 

Variables

std::fstream ReportFile
 

Function Documentation

◆ HstopCurve()

int HstopCurve ( std::string cmd  UNUSED,
int  study_num,
double  h,
double  hMax,
double  a 
)
124 {
125  logger(INFO, "restart at study_num=%, h=%, a=%", study_num, h, a);
126 
127  std::stringstream name;
128  name << "Report" << study_num;
129  ReportFile.open(name.str().c_str(),std::fstream::out | std::fstream::app);
130  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
131  bool piac = PointIsAboveCurve(h,a,study_num);
132  ReportFile.close();
133 
134  //now increase height gradually; decrease angle if flow starts
135  if (h<hMax) {
136  if (piac) a-=.5;
137  else h+=2;
138  std::stringstream command;
139  // for msm1:
140  command << "nohup nice -18 ../hstopGlass_StudyHeightHmaxAngle.exe " << study_num << " " << h << " " << hMax << " " << a << " &>>outS" << study_num << "H" << h << "HMax" << hMax << "A" << a << " &";
141  // for einder:
142  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHmaxAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMax << " " << a << "&";
143  logger(INFO, "%", command.str());
144  return system (command.str().c_str());
145  } else {
146  return 0;
147  }
148 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
bool PointIsAboveCurve(double h, double a, int study_num)
Definition: hstopGlass_StudyHeightHmaxAngle.cpp:91
std::fstream ReportFile
Definition: hstopGlass_StudyHeightHmaxAngle.cpp:89
std::string name
Definition: MercuryProb.h:48

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

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
151 {
152  if (argc < 4)
153  {
154  logger(ERROR, "Please specify Study, Height, max. Height and Angle");
155  }
156  HstopCurve(argv[0], atoi(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));
157 }
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
int HstopCurve(std::string cmd UNUSED, int study_num, double h, double hMax, double a)
Definition: hstopGlass_StudyHeightHmaxAngle.cpp:123

References ERROR, HstopCurve(), and logger.

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( double  h,
double  a,
int  study_num 
)
91  {
92  logger(INFO, "PointIsAboveCurve(%, h=%, a=%)", study_num, h, a);
93  SilbertHstop problem;
94  problem.setInflowHeight(h);
95  problem.setChuteAngle(a);
96  problem.set_study(study_num);
97  std::stringstream name;
98  name << "H" << problem.getInflowHeight()
99  << "A" << problem.getChuteAngleDegrees()
100  << "L" << round(100. * problem.getFixedParticleRadius() * 2.) / 100.
101  << "M" << problem.species->getSlidingFrictionCoefficient()
102  << "B" << problem.getSlidingFrictionCoefficientBottom();
103  problem.setName(name.str().c_str());
104  logger(INFO, "starting %", name.str().c_str());
105  // if you want more restart output, use these options
106  //problem.restartFile.setFileType(FileType::MULTIPLE_FILES_PADDED);
107  // for real runs:
108  //~ problem.set_Hertzian(true);
109  problem.solve();
110  // for test runs:
111  //problem.solve_analytic();
112  std::stringstream com;
113  ReportFile << problem.getInflowHeight()
114  << "\t" << problem.getChuteAngleDegrees()
115  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
116  << "\t" << problem.species->getSlidingFrictionCoefficient()
117  << "\t" << problem.getSlidingFrictionCoefficientBottom()
118  << "\t" << problem.pointIsAboveCurve
119  << std::endl;
120  return problem.pointIsAboveCurve;
121 }
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
LinearViscoelasticSpecies * species
Definition: flowRuleDiego_HeightAngle.cpp:265
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(), INFO, logger, units::name, SilbertHstop::pointIsAboveCurve, ReportFile, helpers::round(), SilbertPeriodic::set_study(), Chute::setChuteAngle(), Chute::setInflowHeight(), DPMBase::setName(), DPMBase::solve(), and SilbertPeriodic::species.

Referenced by HstopCurve().

Variable Documentation

◆ ReportFile

std::fstream ReportFile

Referenced by HstopCurve(), and PointIsAboveCurve().