Compadre 1.6.4
Loading...
Searching...
No Matches
CommandLineProcessor.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Compadre: COMpatible PArticle Discretization and REmap Toolkit
4//
5// Copyright 2018 NTESS and the Compadre contributors.
6// SPDX-License-Identifier: BSD-2-Clause
7// *****************************************************************************
8// @HEADER
9#ifndef COMMANDLINEPROCESSOR
10#define COMMANDLINEPROCESSOR
11
13
16
18
19 CommandLineProcessor(int argc, char* args[], const bool print=true) {
20
21 order = 2;
22 dimension = 3;
26
27 constraint_name = "NO_CONSTRAINT"; // "NEUMANN_GRAD_SCALAR"
28 solver_name = "QR"; // LU
29 problem_name = "STANDARD"; // MANIFOLD
32
33 for (int i = 1; i < argc; ++i) {
34 if (i + 1 < argc) { // not at end
35 if (std::string(args[i]) == "--p") {
36 order = atoi(args[i+1]);
37 } else if (std::string(args[i]) == "--d") {
38 dimension = atoi(args[i+1]);
39 } else if (std::string(args[i]) == "--nt") {
40 number_target_coords = atoi(args[i+1]);
41 } else if (std::string(args[i]) == "--ns") {
42 number_source_coords = atoi(args[i+1]);
43 } else if (std::string(args[i]) == "--nb") {
44 number_of_batches = atoi(args[i+1]);
45 } else if (std::string(args[i]) == "--solver") {
46 solver_name = std::string(args[i+1]);
47 } else if (std::string(args[i]) == "--problem") {
48 problem_name = std::string(args[i+1]);
49 } else if (std::string(args[i]) == "--constraint") {
50 constraint_name = std::string(args[i+1]);
51 } else if (std::string(args[i]) == "--kernel-type") {
52 kernel_type = Compadre::GMLS::translateWeightingType(std::string(args[i+1]));
53 } else if (std::string(args[i]) == "--curvature-kernel-type") {
55 }
56 }
57 }
58
59 if (print) {
60 std::cout << "************************************************************************" << std::endl;
61 std::cout << "order: " << order << ", dimension: " << dimension << ", number_target_coords: " << number_target_coords << std::endl;
62 std::cout << "solver: " << solver_name << ", problem: " << problem_name << ", constraint: " << constraint_name << std::endl;
63 std::cout << "************************************************************************" << std::endl;
64
65 }
66 }
67};
68
69#endif
static WeightingFunctionType translateWeightingType(const std::string &wt)
Type for weighting kernel for GMLS problem.
WeightingFunctionType
Available weighting kernel function types.
Compadre::WeightingFunctionType curvature_kernel_type
Compadre::WeightingFunctionType kernel_type
CommandLineProcessor(int argc, char *args[], const bool print=true)