hstopHertz_StudyHeightHmaxAngle.cpp File Reference
#include "SilbertPeriodic.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 
)
101 {
102  logger(INFO, "restart at study_num=%, h=%, a=%", study_num, h, a);
103 
104  std::stringstream name;
105  name << "Report" << study_num;
106  ReportFile.open(name.str().c_str(),std::fstream::out | std::fstream::app);
107  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
108  bool piac = PointIsAboveCurve(h,a,study_num);
109  ReportFile.close();
110 
111  //now increase height gradually; decrease angle if flow starts
112  if (h<hMax) {
113  if (piac) a-=.5;
114  else h+=2;
115  std::stringstream command;
116  // for msm1:
117  command << "nohup nice -18 ../hstopHertz_StudyHeightHmaxAngle.exe " << study_num << " " << h << " " << hMax << " " << a << " &>>outS" << study_num << "H" << h << "HMax" << hMax << "A" << a << " &";
118  // for einder:
119  //command << "name="<<cmd<<" && cd ${name/hstop_StudyHeightHmaxAngle.exe/} && ~/clusterscriptexecute $name " << study_num << " " << h << " " << hMax << " " << a << "&";
120  logger(INFO, "%", command.str());
121  return system (command.str().c_str());
122  } else {
123  return 0;
124  }
125 }
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: hstopHertz_StudyHeightHmaxAngle.cpp:67
std::fstream ReportFile
Definition: hstopHertz_StudyHeightHmaxAngle.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[] 
)
128 {
129  if (argc < 4)
130  {
131  logger(ERROR, "Please specify Study, Height, max. Height and Angle");
132  }
133  HstopCurve(argv[0], atoi(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));
134 }
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: hstopHertz_StudyHeightHmaxAngle.cpp:100

References ERROR, HstopCurve(), and logger.

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( double  h,
double  a,
int  study_num 
)
Todo:
TWnow: add Hertz again
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:
85  //problem.speciesHandler.getObject(0)->setForceType(ForceType::HERTZ);
86  problem.solve();
87  // for test runs:
88  //problem.solve_analytic();
89  std::stringstream com;
90  ReportFile << problem.getInflowHeight()
91  << "\t" << problem.getChuteAngleDegrees()
92  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
93  << "\t" << problem.species->getSlidingFrictionCoefficient()
94  << "\t" << problem.getSlidingFrictionCoefficientBottom()
95  << "\t" << problem.pointIsAboveCurve
96  << std::endl;
97  return problem.pointIsAboveCurve;
98 }
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().