hstop_StudyHeightHminAngle.cpp File Reference
#include "SilbertPeriodic.h"

Classes

class  SilbertHstop
 

Functions

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

Variables

std::fstream ReportFile
 

Function Documentation

◆ HstopCurve()

int HstopCurve ( std::string cmd  UNUSED,
int  study_num,
Mdouble  h,
Mdouble  hMin,
Mdouble  a 
)
120 {
121  logger(INFO, "restart at study_num=%, h=%, a=%", study_num, h, a);
122 
123  std::stringstream name;
124  name << "Report" << study_num;
125  ReportFile.open(name.str().c_str(),std::fstream::out | std::fstream::app);
126  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
127  bool piac = PointIsAboveCurve(h,a,study_num);
128  ReportFile.close();
129 
130  //now increase height gradually; decrease angle if flow starts
131  if (h>hMin) {
132  if (!piac) a+=.5;
133  else h*=0.9;
134  std::stringstream command;
135  // for msm1:
136  command << "echo " << study_num << " " << h << " " << hMin << " " << a << " > arg";
137  // for einder:
138  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHminAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMin << " " << a << "&";
139  logger(INFO, "%", command.str());
140  return system (command.str().c_str());
141  } else {
142  return 0;
143  }
144 }
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(Mdouble h, Mdouble a, int study_num)
Definition: hstop_StudyHeightHminAngle.cpp:88
std::fstream ReportFile
Definition: hstop_StudyHeightHminAngle.cpp:86
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[] 
)
147 {
148  if (argc < 4)
149  {
150  logger(ERROR, "Please specify Study, Height, min. Height and Angle");
151  }
152  HstopCurve(argv[0], atoi(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));
153 }
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
int HstopCurve(std::string cmd UNUSED, int study_num, Mdouble h, Mdouble hMin, Mdouble a)
Definition: hstop_StudyHeightHminAngle.cpp:119

References ERROR, HstopCurve(), and logger.

◆ PointIsAboveCurve()

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