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 
)
103 {
104  logger(INFO, "restart at study_num=%, h=%, a=%", study_num, h, a);
105 
106  std::stringstream name;
107  name << "Report" << study_num;
108  ReportFile.open(name.str().c_str(),std::fstream::out | std::fstream::app);
109  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
110  bool piac = PointIsAboveCurve(h,a,study_num);
111  ReportFile.close();
112 
113  //now increase height gradually; decrease angle if flow starts
114  if (h<hMax) {
115  if (piac) a-=.5;
116  else h+=2;
117  std::stringstream command;
118  // for msm1:
119  command << "nohup nice -18 ../hstopGlass_StudyHeightHmaxAngle.exe " << study_num << " " << h << " " << hMax << " " << a << " &>>outS" << study_num << "H" << h << "HMax" << hMax << "A" << a << " &";
120  // for einder:
121  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHmaxAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMax << " " << a << "&";
122  logger(INFO, "%", command.str());
123  return system (command.str().c_str());
124  } else {
125  return 0;
126  }
127 }
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:70
std::fstream ReportFile
Definition: hstopGlass_StudyHeightHmaxAngle.cpp:68
const Scalar * a
Definition: level2_cplx_impl.h:32
#define INFO(i)
Definition: mumps_solver.h:54
string name
Definition: plotDoE.py:33
std::ofstream out("Result.txt")

References a, INFO, logger, plotDoE::name, out(), PointIsAboveCurve(), and ReportFile.

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
130 {
131  if (argc < 4)
132  {
133  logger(ERROR, "Please specify Study, Height, max. Height and Angle");
134  }
135  HstopCurve(argv[0], atoi(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));
136 }
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:32
int HstopCurve(std::string cmd UNUSED, int study_num, double h, double hMax, double a)
Definition: hstopGlass_StudyHeightHmaxAngle.cpp:102

References ERROR, HstopCurve(), and logger.

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( double  h,
double  a,
int  study_num 
)
70  {
71  logger(INFO, "PointIsAboveCurve(%, h=%, a=%)", study_num, h, a);
73  problem.setInflowHeight(h);
74  problem.setChuteAngle(a);
75  problem.set_study(study_num);
76  std::stringstream name;
77  name << "H" << problem.getInflowHeight()
78  << "A" << problem.getChuteAngleDegrees()
79  << "L" << round(100. * problem.getFixedParticleRadius() * 2.) / 100.
80  << "M" << problem.species->getSlidingFrictionCoefficient()
81  << "B" << problem.getSlidingFrictionCoefficientBottom();
82  problem.setName(name.str().c_str());
83  logger(INFO, "starting %", name.str().c_str());
84  // if you want more restart output, use these options
85  //problem.restartFile.setFileType(FileType::MULTIPLE_FILES_PADDED);
86  // for real runs:
87  //~ problem.set_Hertzian(true);
88  problem.solve();
89  // for test runs:
90  //problem.solve_analytic();
91  std::stringstream com;
92  ReportFile << problem.getInflowHeight()
93  << "\t" << problem.getChuteAngleDegrees()
94  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
95  << "\t" << problem.species->getSlidingFrictionCoefficient()
96  << "\t" << problem.getSlidingFrictionCoefficientBottom()
97  << "\t" << problem.pointIsAboveCurve
98  << std::endl;
99  return problem.pointIsAboveCurve;
100 }
Definition: hstop_StudyHeightHmaxAngle.cpp:12
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 round(const bfloat16 &a)
Definition: BFloat16.h:646
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References a, INFO, logger, plotDoE::name, problem, ReportFile, and Eigen::bfloat16_impl::round().

Referenced by HstopCurve().

Variable Documentation

◆ ReportFile

std::fstream ReportFile

Referenced by HstopCurve(), and PointIsAboveCurve().