xref: /libCEED/examples/rust/ex2-surface/src/opt.rs (revision d3d5610df460248361ab17f2fa259b4661019597)
1 // Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 
8 use clap::Parser;
9 
10 // ----------------------------------------------------------------------------
11 // Command line arguments
12 // ----------------------------------------------------------------------------
13 #[derive(Debug, Parser)]
14 #[command(
15     name = "libCEED Rust Example 2 - Surface Area",
16     about = "This example illustrates a simple usage of libCEED to compute the surface area of a body using matrix-free application of a diffusion operator."
17 )]
18 pub(crate) struct Opt {
19     /// libCEED backend resource to use
20     #[arg(name = "CEED", short, long = "ceed", default_value = "/cpu/self")]
21     pub(crate) ceed_spec: String,
22     /// Mesh dimension
23     #[arg(short, long = "dimension", default_value = "3")]
24     pub(crate) dim: usize,
25     /// Polynomial degree for the mesh
26     #[arg(short, long, default_value = "4")]
27     pub(crate) mesh_degree: usize,
28     /// Polynomial degree for the solution
29     #[arg(short = 'p', long, default_value = "4")]
30     pub(crate) solution_degree: usize,
31     /// Number of quadrature points in 1D
32     #[arg(short = 'q', long, default_value = "6")]
33     pub(crate) num_qpts: usize,
34     /// Approximate problem size
35     #[arg(name = "DoF", short = 's', long = "problem_size", default_value = "-1")]
36     pub(crate) problem_size_requested: i64,
37     /// Test mode
38     #[arg(short, long)]
39     pub(crate) test: bool,
40     /// Quiet mode
41     #[arg(short = 'x', long)]
42     pub(crate) quiet: bool,
43     /// Use QFunctions from the Gallery instead of example
44     #[arg(short, long)]
45     pub(crate) gallery: bool,
46 }
47 
48 // ----------------------------------------------------------------------------
49