+Settings parseArguments(int argc, char** argv)
+{
+ po::options_description desc("Available options");
+ desc.add_options()
+ ("help,h", "show this help")
+ ("windspeed,w", po::value<double>()->default_value(10),
+ "wind speed (m/s)")
+ ("size,s", po::value<char>()->default_value('s'),
+ "lattice size (s|l)")
+ ("amplitude,a", po::value<double>()->default_value(1),
+ "amplitude multiplicator")
+ ;
+
+ po::variables_map vm;
+ po::store(po::parse_command_line(argc, argv, desc), vm);
+ po::notify(vm);
+
+ if (vm.count("help")) {
+ std::cout << desc << "\n";
+ exit(1);
+ }
+
+ Settings settings;
+
+ settings.windSpeed = vm["windspeed"].as<double>();
+
+ if (vm["size"].as<char>() == 'l') {
+ settings.latticeSize = 256;
+ settings.latticeExtend = 20;
+ settings.amplitudeFactor = vm["amplitude"].as<double>() * 0.00000004;
+ }
+ else {
+ settings.latticeSize = 128;
+ settings.latticeExtend = 10;
+ settings.amplitudeFactor = vm["amplitude"].as<double>() * 0.0000001;
+ }
+
+ return settings;
+}
+