This is an example of how to use the netdem library.
#include <iostream>
#include <string>
using namespace std;
void DemoErosionIssue();
void TestTriaxialComp(string out_dir, bool use_erosion,
double erosion_ratio_initial);
void EvaluateGJKPerformance(bool save_results = false);
int main(
int argc,
char **argv) {
if (argc == 1) {
cout << "please specify the id of the task. \n"
<< "e.g.: netdem_example_gjk_erosion_issue i" << endl;
cout << ">> 0: demo_erosion_issue" << endl;
cout << ">> 1: test_triaxial_comp: options: [out_dir] [use_erosion] "
"[erosion_ratio_initial]"
<< endl;
cout << ">> 2: ev_gjk_performance. options: [save_results]" << endl;
return -1;
}
int id = atof(argv[1]);
switch (id) {
case 0:
DemoErosionIssue();
break;
case 1:
if (argc == 5) {
string out_dir = string(argv[2]);
bool use_erosion = atof(argv[3]);
double erosion_ratio_initial = atof(argv[4]);
cout << "out_dir: " << out_dir << endl;
cout << "use_erosion: " << use_erosion << endl;
cout << "erosion_ratio_initial: " << erosion_ratio_initial << endl;
TestTriaxialComp(out_dir, use_erosion, erosion_ratio_initial);
} else {
cout << "usage: netdem_example_gjk_erosion_issue 1 [out_dir] "
"[use_erosion] [erosion_ratio_initial]"
<< endl;
}
break;
case 2:
if (argc == 3) {
bool save_results = atof(argv[2]);
EvaluateGJKPerformance(save_results);
} else {
EvaluateGJKPerformance();
}
break;
default:
break;
}
return 0;
}
int main(int argc, char *argv[])
Definition main.cpp:18