hstop_StudyHeightHmaxAngle_exponential.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 
)
134 {
135  logger(INFO, "restart at study_num=%, h=%, a=%", study_num, h, a);
136 
137  std::stringstream name;
138  name << "Report" << study_num;
139  ReportFile.open(name.str().c_str(),std::fstream::out | std::fstream::app);
140  //~ ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
141  bool piac = PointIsAboveCurve(argc,argv,h,a,study_num);
142  ReportFile.close();
143 
144  //now increase height gradually; decrease angle if flow starts
145  if (h<hMax)
146  {
147  //exponential
148  if (piac) a -= .5;
149  else
150  {
151  h *= pow(2., .25);
152  a += .25;
153  }
154  //linear
155  //if (piac) a-=.5;
156  //else h+=2;
157  //write arg file
158  std::stringstream command;
159  command << "echo " << study_num << " " << h << " " << hMax << " " << a << " > arg";
160  logger(INFO, "%", command.str());
161  return system(command.str().c_str());
162  } else {
163  return 0;
164  }
165 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137
bool PointIsAboveCurve(int argc, char *argv[], Mdouble h, Mdouble a, int study_num)
Definition: hstop_StudyHeightHmaxAngle_exponential.cpp:97
std::fstream ReportFile
Definition: hstop_StudyHeightHmaxAngle_exponential.cpp:95
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(), Eigen::bfloat16_impl::pow(), and ReportFile.

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
168 {
169  if (argc < 4)
170  {
171  logger(ERROR, "Please specify Study, Height, max. Height and Angle");
172  }
173  HstopCurve(argc, argv, atoi(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));
174 }
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_exponential.cpp:133

References ERROR, HstopCurve(), and logger.

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( int  argc,
char argv[],
Mdouble  h,
Mdouble  a,
int  study_num 
)
97  {
98  logger(INFO, "PointIsAboveCurve(%, h=%, a=%)", study_num, h, a);
100  problem.setInflowHeight(h);
101  problem.setChuteAngle(a);
102  problem.set_study(study_num);
103  std::stringstream name;
104  name << "H" << problem.getInflowHeight()
105  << "A" << problem.getChuteAngleDegrees()
106  << "L" << round(100. * problem.getFixedParticleRadius() * 2.) / 100.
107  << "M" << problem.species->getSlidingFrictionCoefficient()
108  << "B" << problem.getSlidingFrictionCoefficientBottom();
109  problem.setName(name.str().c_str());
110  logger(INFO, "starting %", name.str().c_str());
111  problem.writeRestartFile();
112  if ((argc > 5) && (!strcmp(argv[5], "-test")))
113  {
114  // for test runs:
115  problem.solve_analytic();
116  }
117  else
118  {
119  // for real runs:
120  problem.solve();
121  }
122  std::stringstream com;
123  ReportFile << problem.getInflowHeight()
124  << "\t" << problem.getChuteAngleDegrees()
125  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
126  << "\t" << problem.species->getSlidingFrictionCoefficient()
127  << "\t" << problem.getSlidingFrictionCoefficientBottom()
128  << "\t" << problem.pointIsAboveCurve
129  << std::endl;
130  return problem.pointIsAboveCurve;
131 }
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().