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 
)
99 {
100  logger(INFO, "restart at study_num=%, h=%, a=%", study_num, h, a);
101 
102  std::stringstream name;
103  name << "Report" << study_num;
104  ReportFile.open(name.str().c_str(),std::fstream::out | std::fstream::app);
105  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
106  bool piac = PointIsAboveCurve(h,a,study_num);
107  ReportFile.close();
108 
109  //now increase height gradually; decrease angle if flow starts
110  if (h>hMin) {
111  if (!piac) a+=.5;
112  else h*=0.9;
113  std::stringstream command;
114  // for msm1:
115  command << "echo " << study_num << " " << h << " " << hMin << " " << a << " > arg";
116  // for einder:
117  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHminAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMin << " " << a << "&";
118  logger(INFO, "%", command.str());
119  return system (command.str().c_str());
120  } else {
121  return 0;
122  }
123 }
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:67
std::fstream ReportFile
Definition: hstop_StudyHeightHminAngle.cpp:65
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[] 
)
126 {
127  if (argc < 4)
128  {
129  logger(ERROR, "Please specify Study, Height, min. Height and Angle");
130  }
131  HstopCurve(argv[0], atoi(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));
132 }
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:32
int HstopCurve(std::string cmd UNUSED, int study_num, Mdouble h, Mdouble hMin, Mdouble a)
Definition: hstop_StudyHeightHminAngle.cpp:98

References ERROR, HstopCurve(), and logger.

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( Mdouble  h,
Mdouble  a,
int  study_num 
)
67  {
68  logger(INFO, "PointIsAboveCurve(%, h=%, a=%)", study_num, h, a);
70  problem.setInflowHeight(h);
71  problem.setChuteAngle(a);
72  problem.set_study(study_num);
73  std::stringstream name;
74  name << "H" << problem.getInflowHeight()
75  << "A" << problem.getChuteAngleDegrees()
76  << "L" << round(100. * problem.getFixedParticleRadius() * 2.) / 100.
77  << "M" << problem.species->getSlidingFrictionCoefficient()
78  << "B" << problem.getSlidingFrictionCoefficientBottom();
79  problem.setName(name.str().c_str());
80  logger(INFO, "starting %", name.str().c_str());
81  // if you want more restart output, use these options
82  //problem.restartFile.setFileType(FileType::MULTIPLE_FILES_PADDED);
83  // for real runs:
84  problem.solve();
85  // for test runs:
86  //problem.solve_analytic();
87  std::stringstream com;
88  ReportFile << problem.getInflowHeight()
89  << "\t" << problem.getChuteAngleDegrees()
90  << "\t" << round(100. * problem.getFixedParticleRadius() * 2.) / 100.
91  << "\t" << problem.species->getSlidingFrictionCoefficient()
92  << "\t" << problem.getSlidingFrictionCoefficientBottom()
93  << "\t" << problem.pointIsAboveCurve
94  << std::endl;
95  return problem.pointIsAboveCurve;
96 }
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().