Merge pull request #34 from PhasicFlow/solvers

build floating point type report
This commit is contained in:
PhasicFlow 2022-10-01 19:19:11 +03:30 committed by GitHub
commit e38a3d347a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -36,10 +36,11 @@ pFlow::commandLine::commandLine(word appName, word disptn)
{ {
CLI::App::add_flag_callback( CLI::App::add_flag_callback(
"--discription", "--description",
[disptn, appName]() { [disptn, appName]() {
output<<"\n"<<yellowText(versoinCopyright)<<endl<<endl; output<<"\n"<<yellowText(versoinCopyright)<<endl;
output<<"Discription for "<< boldText(appName)<<":\n"; output<<yellowText(floatingPointDescription())<<endl<<endl;
output<<"Description for "<< boldText(appName)<<":\n";
output<<" "<<disptn<<endl; output<<" "<<disptn<<endl;
}, },
"What does this app do?" "What does this app do?"
@ -52,7 +53,7 @@ bool pFlow::commandLine::parse(
{ {
try { try {
CLI::App::parse(argc, argv); CLI::App::parse(argc, argv);
if(CLI::App::count("--discription")) return false; if(CLI::App::count("--description")) return false;
return true; return true;
} catch(const ParseError &e) { } catch(const ParseError &e) {
CLI::App::exit(e); CLI::App::exit(e);

View File

@ -30,10 +30,13 @@ namespace pFlow
#ifdef pFlow_Build_Double #ifdef pFlow_Build_Double
#define useDouble 1 #define useDouble 1
inline const char* floatingPointType__ = "double";
#else #else
#define useDouble 0 #define useDouble 0
inline const char* floatingPointType__ = "float";
#endif #endif
// scalars // scalars
#if useDouble #if useDouble
using real = double; using real = double;
@ -57,6 +60,12 @@ using label = std::size_t;
using word = std::string; using word = std::string;
inline
auto floatingPointDescription()
{
return word("In this build, ") + word(floatingPointType__) +
word(" is used for floating point operations.");
}
} // end of pFlow } // end of pFlow

View File

@ -41,6 +41,7 @@ if(!cmds.parse(argc, argv)) return 0;
output<<endl; output<<endl;
Report(1)<< "You are using "<<yellowText(cmds.productNameCopyright())<<endReport; Report(1)<< "You are using "<<yellowText(cmds.productNameCopyright())<<endReport;
Report(1)<< yellowText(pFlow::floatingPointDescription())<<endReport;
// this should be palced in each main // this should be palced in each main