| 37 | #[derive(Debug, Parser)] |
| 38 | #[clap(name = "streamline", verbatim_doc_comment)] |
| 39 | struct CmdlineOptions { |
| 40 | /// The log level |
| 41 | #[clap(short, long, default_value_t = tracing::Level::INFO)] |
| 42 | log_level: tracing::Level, |
| 43 | |
| 44 | /// Input file to read input from. Defaults to stdin. |
| 45 | #[clap(short, long)] |
| 46 | input: Option<PathBuf>, |
| 47 | |
| 48 | /// Output file to write result to. Defaults to stdout. |
| 49 | #[clap(short, long)] |
| 50 | output: Option<PathBuf>, |
| 51 | |
| 52 | /// A Rune script that defines the vector field. If not given, a Perlin noise field will be |
| 53 | /// used instead. |
| 54 | /// |
| 55 | /// Example: |
| 56 | /// |
| 57 | /// let temp = f64::sqrt(x.powf(2.0) + y.powf(2.0) + 4.0); |
| 58 | /// let x_new = -f64::sin(x) / temp; |
| 59 | /// let y_new = y / temp; |
| 60 | /// |
| 61 | /// I.e., the f64 x, y variables are inputs, and the x_new, y_new variables are outputs. |
| 62 | /// |
| 63 | /// May be given multiple times for multi-line functions. |
| 64 | #[clap(short, long)] |
| 65 | function: Vec<String>, |
| 66 | |
| 67 | /// The random seed to use. Use zero to let the tool pick its own random seed. |
| 68 | #[clap(long, default_value_t = 0)] |
| 69 | seed: u64, |
| 70 | |
| 71 | /// The minimum x coordinate of the vector field |
| 72 | #[clap(short = 'x', long, default_value_t = 0.0)] |
| 73 | min_x: f64, |
| 74 | |
| 75 | /// The maximum x coordinate of the vector field |
| 76 | #[clap(short = 'X', long, default_value_t = 20.0)] |
| 77 | max_x: f64, |
| 78 | |
| 79 | /// The minimum y coordinate of the vector field |
| 80 | #[clap(short = 'y', long, default_value_t = 0.0)] |
| 81 | min_y: f64, |
| 82 | |
| 83 | /// The maximum y coordinate of the vector field |
| 84 | #[clap(short = 'Y', long, default_value_t = 20.0)] |
| 85 | max_y: f64, |
| 86 | |
| 87 | /// The vector field grid spacing |
| 88 | #[clap(short = 'd', long, default_value_t = 0.5)] |
| 89 | delta_h: f64, |
| 90 | |
| 91 | /// The size of each time step |
| 92 | #[clap(short = 't', long, default_value_t = 0.1)] |
| 93 | delta_t: f64, |
| 94 | |
| 95 | /// The number of time steps to make |
| 96 | #[clap(short = 'T', long, default_value_t = 10)] |
nothing calls this directly
no outgoing calls
no test coverage detected