xref: /libCEED/examples/rust/ex1-volume-vector/src/opt.rs (revision d4cc18453651bd0f94c1a2e078b2646a92dafdcc)
1*9ba83ac0SJeremy L Thompson // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
23eb59678SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
33eb59678SJeremy L Thompson //
43eb59678SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
53eb59678SJeremy L Thompson //
63eb59678SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
73eb59678SJeremy L Thompson 
83eb59678SJeremy L Thompson use clap::Parser;
93eb59678SJeremy L Thompson 
103eb59678SJeremy L Thompson // ----------------------------------------------------------------------------
113eb59678SJeremy L Thompson // Command line arguments
123eb59678SJeremy L Thompson // ----------------------------------------------------------------------------
133eb59678SJeremy L Thompson #[derive(Debug, Parser)]
143eb59678SJeremy L Thompson #[command(
153eb59678SJeremy L Thompson     name = "libCEED Rust Example 3 - Vector Volume",
163eb59678SJeremy L Thompson     about = "This example uses the mass matrix to compute the length, area, or volume of a region in triplicate, depending upon runtime parameters."
173eb59678SJeremy L Thompson )]
183eb59678SJeremy L Thompson pub(crate) struct Opt {
193eb59678SJeremy L Thompson     /// libCEED backend resource to use
203eb59678SJeremy L Thompson     #[arg(name = "CEED", short, long = "ceed", default_value = "/cpu/self")]
213eb59678SJeremy L Thompson     pub(crate) ceed_spec: String,
223eb59678SJeremy L Thompson     /// Mesh dimension
233eb59678SJeremy L Thompson     #[arg(short, long = "dimension", default_value = "3")]
243eb59678SJeremy L Thompson     pub(crate) dim: usize,
253eb59678SJeremy L Thompson     /// Polynomial degree for the mesh
263eb59678SJeremy L Thompson     #[arg(short, long, default_value = "4")]
273eb59678SJeremy L Thompson     pub(crate) mesh_degree: usize,
283eb59678SJeremy L Thompson     /// Polynomial degree for the solution
293eb59678SJeremy L Thompson     #[arg(short = 'p', long, default_value = "4")]
303eb59678SJeremy L Thompson     pub(crate) solution_degree: usize,
313eb59678SJeremy L Thompson     /// Number of quadrature points in 1D
323eb59678SJeremy L Thompson     #[arg(short = 'q', long, default_value = "6")]
333eb59678SJeremy L Thompson     pub(crate) num_qpts: usize,
343eb59678SJeremy L Thompson     /// Approximate problem size
353eb59678SJeremy L Thompson     #[arg(name = "DoF", short = 's', long = "problem_size", default_value = "-1")]
363eb59678SJeremy L Thompson     pub(crate) problem_size_requested: i64,
373eb59678SJeremy L Thompson     /// Test mode
383eb59678SJeremy L Thompson     #[arg(short, long)]
393eb59678SJeremy L Thompson     pub(crate) test: bool,
403eb59678SJeremy L Thompson     /// Quiet mode
413eb59678SJeremy L Thompson     #[arg(short = 'x', long)]
423eb59678SJeremy L Thompson     pub(crate) quiet: bool,
433eb59678SJeremy L Thompson     /// Use QFunctions from the Gallery instead of example
443eb59678SJeremy L Thompson     #[arg(short, long)]
453eb59678SJeremy L Thompson     pub(crate) gallery: bool,
463eb59678SJeremy L Thompson }
473eb59678SJeremy L Thompson 
483eb59678SJeremy L Thompson // ----------------------------------------------------------------------------
49