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

Classes

class  SilbertHstop
 

Functions

bool PointIsAboveCurve (int argc, char *argv[], Mdouble h, Mdouble a, int study_num)
 
int HstopCurve (int argc, char *argv[], int study_num, Mdouble h, Mdouble hMax, Mdouble a)
 
int main (int argc, char *argv[])
 

Variables

std::fstream ReportFile
 

Function Documentation

◆ HstopCurve()

int HstopCurve ( int  argc,
char argv[],
int  study_num,
Mdouble  h,
Mdouble  hMax,
Mdouble  a 
)
104 {
105  logger(INFO, "restart at study_num=%, h=%, a=%", study_num, h, a);
106 
107  std::stringstream name;
108  name << "Report" << study_num;
109  ReportFile.open(name.str().c_str(),std::fstream::out | std::fstream::app);
110  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
111  bool piac = PointIsAboveCurve(argc,argv,h,a,study_num);
112  ReportFile.close();
113 
114  //now increase height gradually; decrease angle if flow starts
115  if (h<hMax)
116  {
117  if (piac) a -= .5;
118  else h += 2;
119  //write arg file
120  std::stringstream command;
121  command << "echo " << study_num << " " << h << " " << hMax << " " << a << " > arg";
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(int argc, char *argv[], Mdouble h, Mdouble a, int study_num)
Definition: hstop_StudyHeightHmaxAngle.cpp:67
std::fstream ReportFile
Definition: hstop_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[] 
)
130 {
131  if (argc < 5)
132  {
133  logger(ERROR, "Please specify Study, Height, max. Height and Angle");
134  }
135  HstopCurve(argc, argv, 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(int argc, char *argv[], int study_num, Mdouble h, Mdouble hMax, Mdouble a)
Definition: hstop_StudyHeightHmaxAngle.cpp:103

References ERROR, HstopCurve(), and logger.

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( int  argc,
char argv[],
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  problem.writeRestartFile();
82  if ((argc > 5) && (!strcmp(argv[5], "-test")))
83  {
84  // for test runs:
85  problem.solve_analytic();
86  }
87  else
88  {
89  // for real runs:
90  problem.solve();
91  }
92  std::stringstream com;
93  ReportFile << problem.getInflowHeight()
94  << "\t" << problem.getChuteAngleDegrees()
95  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
96  << "\t" << problem.species->getSlidingFrictionCoefficient()
97  << "\t" << problem.getSlidingFrictionCoefficientBottom()
98  << "\t" << problem.pointIsAboveCurve
99  << std::endl;
100  return problem.pointIsAboveCurve;
101 }
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().