xref: /libCEED/examples/rust/ex1-volume/src/opt.rs (revision 95c5335012e856a33af6aba783b9fc84ad0611ca)
1 // Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC.
2 // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
3 // All Rights reserved. See files LICENSE and NOTICE for details.
4 //
5 // This file is part of CEED, a collection of benchmarks, miniapps, software
6 // libraries and APIs for efficient high-order finite element and spectral
7 // element discretizations for exascale applications. For more information and
8 // source code availability see http://github.com/ceed.
9 //
10 // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11 // a collaborative effort of two U.S. Department of Energy organizations (Office
12 // of Science and the National Nuclear Security Administration) responsible for
13 // the planning and preparation of a capable exascale ecosystem, including
14 // software, applications, hardware, advanced system engineering and early
15 // testbed platforms, in support of the nation's exascale computing imperative.
16 
17 use structopt::StructOpt;
18 
19 // ----------------------------------------------------------------------------
20 // Command line arguments
21 // ----------------------------------------------------------------------------
22 #[derive(Debug, StructOpt)]
23 #[structopt(
24     name = "libCEED Rust Example 1 - Volume",
25     about = "This example uses the mass matrix to compute the length, area, or volume of a region, depending upon runtime parameters."
26 )]
27 #[cfg(not(tarpaulin_include))]
28 pub(crate) struct Opt {
29     /// libCEED backend resource to use
30     #[structopt(name = "ceed", short = "c", long = "ceed", default_value = "/cpu/self")]
31     pub(crate) ceed_spec: String,
32     /// Mesh dimension
33     #[structopt(
34         name = "dimension",
35         short = "d",
36         long = "dimension",
37         default_value = "3"
38     )]
39     pub(crate) dim: usize,
40     /// Polynomial degree for the mesh
41     #[structopt(
42         name = "mesh degree",
43         short = "m",
44         long = "mesh_degree",
45         default_value = "4"
46     )]
47     pub(crate) mesh_degree: usize,
48     /// Polynomial degree for the solution
49     #[structopt(
50         name = "solution degree",
51         short = "p",
52         long = "solution_degree",
53         default_value = "4"
54     )]
55     pub(crate) solution_degree: usize,
56     /// Number of quadrature points in 1D
57     #[structopt(
58         name = "number of quadrature points",
59         short = "q",
60         long = "num_qpts",
61         default_value = "6"
62     )]
63     pub(crate) num_qpts: usize,
64     /// Approximate problem size
65     #[structopt(
66         name = "problem size",
67         short = "s",
68         long = "problem_size",
69         default_value = "-1"
70     )]
71     pub(crate) problem_size_requested: i64,
72     /// Test mode
73     #[structopt(name = "test mode", short = "t", long = "test")]
74     pub(crate) test: bool,
75     /// Quiet mode
76     #[structopt(name = "quiet mode", short = "q", long = "quiet")]
77     pub(crate) quiet: bool,
78     /// Gallery QFunctions
79     #[structopt(name = "gallery QFunctions", short = "g", long = "gallery")]
80     pub(crate) gallery: bool,
81 }
82 
83 // ----------------------------------------------------------------------------
84