This repository has been archived on 2018-12-13. You can view files and clone it, but cannot push or open issues or pull requests.
arma-flow/src/args.hpp

101 lines
2.3 KiB
C++
Raw Normal View History

2018-04-08 15:21:54 +00:00
//
// arma-flow/args.hpp
//
// @author CismonX
//
2018-04-05 11:01:10 +00:00
#pragma once
#include <complex>
2018-06-06 19:30:09 +00:00
#include <janus.h>
2018-04-05 11:01:10 +00:00
namespace flow
{
2018-04-08 15:21:54 +00:00
/// Provides CLI argument parsing utility.
2018-04-05 11:01:10 +00:00
class args
{
2018-04-08 15:21:54 +00:00
/// The argument parser.
2018-06-06 19:30:09 +00:00
janus::ArgParser arg_parser_;
2018-04-05 11:01:10 +00:00
public:
2018-04-08 15:21:54 +00:00
/**
* Constructor.
*/
2018-04-05 11:01:10 +00:00
explicit args();
2018-04-08 15:21:54 +00:00
/**
* Parse arguments.
*
* @param argc Number of arguments.
* @param argv Arguments.
*/
2018-04-05 11:01:10 +00:00
void parse(int argc, char** argv);
2018-04-08 15:21:54 +00:00
/**
* Get input file path from arguments.
*
* @param nodes Path to node data file.
* @param edges Path to edge data file.
* @return Whether argument is provided.
*/
2018-04-05 11:01:10 +00:00
bool input_file_path(std::string& nodes, std::string& edges);
2018-04-08 15:21:54 +00:00
/**
* Get output file path prefix from arguments.
*
* @param output Path prefix to output files.
* @return Whether argument is provided.
*/
2018-04-05 11:01:10 +00:00
bool output_file_path(std::string& output);
2018-04-08 15:21:54 +00:00
/**
* Check whether to remove the first line from input files.
*/
2018-04-05 11:01:10 +00:00
bool remove_first_line();
2018-04-08 15:21:54 +00:00
/**
* Check max number of iterations before aborting calculation.
*
* @return Whether argument is provided.
*/
bool max_iterations(unsigned& max);
2018-04-05 11:01:10 +00:00
2018-04-08 15:21:54 +00:00
/**
* Check max deviation to be tolerated.
*
* @return Whether argument is provided.
*/
bool accuracy(double& epsilon);
2018-04-05 11:01:10 +00:00
/**
* Calculate three-phase short circuit on specified node.
*
* @return Whether argument is provided.
*/
bool short_circuit(unsigned& node);
/**
* Check whether to ignore load current when calculating short circuit.
*/
bool ignore_load();
/**
* Get transition impedance of three-phase short circuit.
*/
bool transition_impedance(std::complex<double>& z_f);
2018-04-08 15:21:54 +00:00
/**
* Check whether to enable verbose output.
*
* @return Whether argument is provided.
*/
2018-04-05 11:01:10 +00:00
bool verbose();
2018-04-08 15:21:54 +00:00
/**
2018-05-29 13:19:48 +00:00
* Print help message and exit.
2018-04-08 15:21:54 +00:00
*
* @return Whether argument is provided.
*/
2018-04-05 11:01:10 +00:00
void help();
};
}