Classes | Functions | Variables
oomph::CommandLineArgs Namespace Reference

Namespace for command line arguments. More...

Classes

struct  ArgInfo
 Structure to store information on a command line argument. More...
 

Functions

void setup (int argc, char **argv)
 Set values. More...
 
void output ()
 Doc the command line arguments. More...
 
void specify_command_line_flag (const std::string &command_line_flag, const std::string &doc)
 Specify possible argument-free command line flag. More...
 
void specify_command_line_flag (const std::string &command_line_flag, double *arg_pt, const std::string &doc)
 Specify possible command line flag that specifies a double, accessed via pointer. More...
 
void specify_command_line_flag (const std::string &command_line_flag, int *arg_pt, const std::string &doc)
 Specify possible command line flag that specifies an int, accessed via pointer. More...
 
void specify_command_line_flag (const std::string &command_line_flag, unsigned *arg_pt, const std::string &doc)
 Specify possible command line flag that specifies an unsigned, accessed via pointer. More...
 
void specify_command_line_flag (const std::string &command_line_flag, std::string *arg_pt, const std::string &doc)
 Specify possible command line flag that specifies a string, accessed via pointer. More...
 
bool command_line_flag_has_been_set (const std::string &flag)
 Check if command line flag has been set (value will have been assigned directly). More...
 
void doc_all_flags (std::ostream &outstream)
 Document the values of all flags (specified or not). More...
 
void doc_specified_flags ()
 Document specified command line flags. More...
 
void doc_available_flags ()
 Document available command line flags. More...
 
void check_arg_index (const int &argc, const int &arg_index)
 Helper function to check if command line index is legal. More...
 
void parse_and_assign (int argc, char *argv[], const bool &throw_on_unrecognised_args)
 Parse command line, check for recognised flags and assign associated values. More...
 
void parse_and_assign (const bool &throw_on_unrecognised_args)
 Parse previously specified command line, check for recognised flags and assign associated values. More...
 

Variables

int Argc
 Number of arguments + 1. More...
 
char ** Argv
 Arguments themselves. More...
 
std::map< std::string, ArgInfo< bool > > Specified_command_line_flag
 Map to indicate an input flag as having been set. More...
 
std::map< std::string, ArgInfo< double > > Specified_command_line_double_pt
 Map to associate an input flag with a double – specified via pointer. More...
 
std::map< std::string, ArgInfo< int > > Specified_command_line_int_pt
 Map to associate an input flag with an int – specified via pointer. More...
 
std::map< std::string, ArgInfo< unsigned > > Specified_command_line_unsigned_pt
 Map to associate an input flag with an unsigned – specified via pointer. More...
 
std::map< std::string, ArgInfo< std::string > > Specified_command_line_string_pt
 Map to associate an input flag with a string – specified via pointer. More...
 

Detailed Description

Namespace for command line arguments.

Function Documentation

◆ check_arg_index()

void oomph::CommandLineArgs::check_arg_index ( const int &  argc,
const int &  arg_index 
)

Helper function to check if command line index is legal.

Definition at line 737 of file oomph_utilities.cc.

References doc_available_flags(), and output().

Referenced by parse_and_assign().

◆ command_line_flag_has_been_set()

bool oomph::CommandLineArgs::command_line_flag_has_been_set ( const std::string &  flag)

Check if command line flag has been set (value will have been assigned directly).

Check if specified flag has been set (the associated value will have been assigned directly)

Definition at line 501 of file oomph_utilities.cc.

References Specified_command_line_double_pt, Specified_command_line_flag, Specified_command_line_int_pt, Specified_command_line_string_pt, Specified_command_line_unsigned_pt, and oomph::Global_string_for_annotation::string().

◆ doc_all_flags()

void oomph::CommandLineArgs::doc_all_flags ( std::ostream &  outstream)

Document the values of all flags (specified or not).

Document the values of all flags (specified or not)

Definition at line 562 of file oomph_utilities.cc.

References Specified_command_line_double_pt, Specified_command_line_flag, Specified_command_line_int_pt, Specified_command_line_string_pt, Specified_command_line_unsigned_pt, and oomph::Global_string_for_annotation::string().

◆ doc_available_flags()

void oomph::CommandLineArgs::doc_available_flags ( )

◆ doc_specified_flags()

void oomph::CommandLineArgs::doc_specified_flags ( )

◆ output()

void oomph::CommandLineArgs::output ( )

Doc the command line arguments.

Definition at line 436 of file oomph_utilities.cc.

References Argc, Argv, i, and oomph::oomph_info.

Referenced by check_arg_index(), oomph::VectorHelpers::cross(), oomph::FSIAxisymmetricLinearElasticityTractionElement< ELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::output(), oomph::LinearisedFSIAxisymmetricNStNoSlipBCElementElement< FLUID_BULK_ELEMENT, SOLID_BULK_ELEMENT >::output(), oomph::LinearisedAxisymPoroelasticBJS_FSIElement< FLUID_BULK_ELEMENT, POROELASTICITY_BULK_ELEMENT >::output(), oomph::AxisymmetricPoroelasticityTractionElement< ELEMENT >::output(), oomph::SolidQHermiteElement< DIM >::output(), oomph::FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::HelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::PMLHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::DarcyFaceElement< ELEMENT >::output(), oomph::SpineUpdateFluidInterfaceElement< EQUATION_CLASS, DERIVATIVE_CLASS, ELEMENT >::output(), oomph::ElasticUpdateFluidInterfaceElement< EQUATION_CLASS, DERIVATIVE_CLASS, ELEMENT >::output(), oomph::PseudoSolidNodeUpdateElement< BASIC, SOLID >::output(), oomph::RefineablePseudoSolidNodeUpdateElement< BASIC, SOLID >::output(), oomph::QElement< 1, NNODE_1D >::output(), oomph::QElement< 2, NNODE_1D >::output(), oomph::QElement< 3, NNODE_1D >::output(), oomph::UnsteadyHeatFluxElement< ELEMENT >::output(), oomph::ProjectableAxisymmetricPoroelasticityElement< AXISYMMETRIC_POROELASTICITY_ELEMENT >::output(), oomph::ProjectableDarcyElement< DARCY_ELEMENT >::output(), oomph::ProjectableFourierDecomposedHelmholtzElement< FOURIER_DECOMPOSED_HELMHOLTZ_ELEMENT >::output(), oomph::ProjectableHelmholtzElement< HELMHOLTZ_ELEMENT >::output(), oomph::ProjectablePMLFourierDecomposedHelmholtzElement< FOURIER_DECOMPOSED_HELMHOLTZ_ELEMENT >::output(), oomph::ProjectablePMLHelmholtzElement< HELMHOLTZ_ELEMENT >::output(), oomph::TElement< 1, NNODE_1D >::output(), oomph::TElement< 2, NNODE_1D >::output(), oomph::TElement< 3, NNODE_1D >::output(), oomph::DenseMatrix< T >::output(), oomph::TrilinosMLPreconditioner::set_output(), oomph::StringConversion::to_lower(), and oomph::StringConversion::to_upper().

◆ parse_and_assign() [1/2]

void oomph::CommandLineArgs::parse_and_assign ( const bool &  throw_on_unrecognised_args)

Parse previously specified command line, check for recognised flags and assign associated values.

Definition at line 936 of file oomph_utilities.cc.

References Argc, Argv, and parse_and_assign().

◆ parse_and_assign() [2/2]

void oomph::CommandLineArgs::parse_and_assign ( int  argc,
char *  argv[],
const bool &  throw_on_unrecognised_args 
)

◆ setup()

void oomph::CommandLineArgs::setup ( int  argc,
char **  argv 
)

Set values.

Definition at line 429 of file oomph_utilities.cc.

References Argc, and Argv.

◆ specify_command_line_flag() [1/5]

void oomph::CommandLineArgs::specify_command_line_flag ( const std::string &  command_line_flag,
const std::string &  doc 
)

Specify possible argument-free command line flag.

Definition at line 451 of file oomph_utilities.cc.

References oomph::LeakCheckNames::doc(), and Specified_command_line_flag.

◆ specify_command_line_flag() [2/5]

void oomph::CommandLineArgs::specify_command_line_flag ( const std::string &  command_line_flag,
double *  arg_pt,
const std::string &  doc 
)

Specify possible command line flag that specifies a double, accessed via pointer.

Definition at line 460 of file oomph_utilities.cc.

References oomph::LeakCheckNames::doc(), and Specified_command_line_double_pt.

◆ specify_command_line_flag() [3/5]

void oomph::CommandLineArgs::specify_command_line_flag ( const std::string &  command_line_flag,
int *  arg_pt,
const std::string &  doc 
)

Specify possible command line flag that specifies an int, accessed via pointer.

Definition at line 470 of file oomph_utilities.cc.

References oomph::LeakCheckNames::doc(), and Specified_command_line_int_pt.

◆ specify_command_line_flag() [4/5]

void oomph::CommandLineArgs::specify_command_line_flag ( const std::string &  command_line_flag,
std::string *  arg_pt,
const std::string &  doc 
)

Specify possible command line flag that specifies a string, accessed via pointer.

Definition at line 490 of file oomph_utilities.cc.

References oomph::LeakCheckNames::doc(), and Specified_command_line_string_pt.

◆ specify_command_line_flag() [5/5]

void oomph::CommandLineArgs::specify_command_line_flag ( const std::string &  command_line_flag,
unsigned *  arg_pt,
const std::string &  doc 
)

Specify possible command line flag that specifies an unsigned, accessed via pointer.

Definition at line 480 of file oomph_utilities.cc.

References oomph::LeakCheckNames::doc(), and Specified_command_line_unsigned_pt.

Variable Documentation

◆ Argc

int oomph::CommandLineArgs::Argc

Number of arguments + 1.

Definition at line 407 of file oomph_utilities.cc.

Referenced by output(), parse_and_assign(), print_stacktrace(), and setup().

◆ Argv

char ** oomph::CommandLineArgs::Argv

Arguments themselves.

Definition at line 410 of file oomph_utilities.cc.

Referenced by output(), parse_and_assign(), print_stacktrace(), and setup().

◆ Specified_command_line_double_pt

std::map< std::string, ArgInfo< double > > oomph::CommandLineArgs::Specified_command_line_double_pt

Map to associate an input flag with a double – specified via pointer.

Definition at line 416 of file oomph_utilities.cc.

Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().

◆ Specified_command_line_flag

std::map< std::string, ArgInfo< bool > > oomph::CommandLineArgs::Specified_command_line_flag

Map to indicate an input flag as having been set.

Definition at line 413 of file oomph_utilities.cc.

Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().

◆ Specified_command_line_int_pt

std::map< std::string, ArgInfo< int > > oomph::CommandLineArgs::Specified_command_line_int_pt

Map to associate an input flag with an int – specified via pointer.

Definition at line 419 of file oomph_utilities.cc.

Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().

◆ Specified_command_line_string_pt

std::map< std::string, ArgInfo< std::string > > oomph::CommandLineArgs::Specified_command_line_string_pt

Map to associate an input flag with a string – specified via pointer.

Definition at line 426 of file oomph_utilities.cc.

Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().

◆ Specified_command_line_unsigned_pt

std::map< std::string, ArgInfo< unsigned > > oomph::CommandLineArgs::Specified_command_line_unsigned_pt

Map to associate an input flag with an unsigned – specified via pointer.

Definition at line 422 of file oomph_utilities.cc.

Referenced by command_line_flag_has_been_set(), doc_all_flags(), doc_available_flags(), doc_specified_flags(), parse_and_assign(), and specify_command_line_flag().