lin_unsteady_ring.cc File Reference
#include "generic.h"
#include "beam.h"
#include "meshes/one_d_lagrangian_mesh.h"

Classes

class  ElasticRingProblem< ELEMENT >
 Ring problem. More...
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

int main (int argc, char *argv[])
 Driver for ring that performs small-amplitude oscillations. More...
 

Variables

unsigned Global_Physical_Variables::Long_run_flag =1
 Flag for long/short run: Default = perform long run. More...
 
unsigned Global_Physical_Variables::Fixed_timestep_flag =1
 Flag for fixed timestep: Default = fixed timestep. More...
 
bool Global_Physical_Variables::Consistent_newmark_ic
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver for ring that performs small-amplitude oscillations.

Convert command line arguments (if any) into flags:

413 {
414 
415  // Store command line arguments
416  CommandLineArgs::setup(argc,argv);
417 
419  if (argc==2)
420  {
421  // Nontrivial command line input: Setup Newmark IC directly
422  // (rather than consistently with PVD)
423  if (atoi(argv[1])==1)
424  {
426  cout << "Setting Newmark IC consistently" << std::endl;
427  }
428  else
429  {
431  cout << "Setting Newmark IC directly" << std::endl;
432  }
433 
434  cout << "Not enough command line arguments specified -- using defaults."
435  << std::endl;
436  } // end of 1 argument
437  else if (argc==4)
438  {
439  cout << "Three command line arguments specified:" << std::endl;
440  // Nontrivial command line input: Setup Newmark IC directly
441  // (rather than consistently with PVD)
442  if (atoi(argv[1])==1)
443  {
445  cout << "Setting Newmark IC consistently" << std::endl;
446  }
447  else
448  {
450  cout << "Setting Newmark IC directly" << std::endl;
451  }
452  // Flag for long run
454  // Flag for fixed timestep
456  } // end of 3 arguments
457  else
458  {
459  std::string error_message =
460  "Wrong number of command line arguments. Specify one or three.\n";
461  error_message += "Arg1: Long_run_flag [0/1]\n";
462  error_message += "Arg2: Impulsive_start_flag [0/1]\n";
463  error_message += "Arg3: Restart_flag [restart_file] (optional)\n";
464 
465  throw OomphLibError(error_message,
468  } // too many arguments
469  cout << "Setting Newmark IC consistently: "
471  cout << "Long run flag: "
473  cout << "Fixed timestep flag: "
475 
476  //Length of domain
477  double L = MathematicalConstants::Pi/2.0;
478 
479  // Number of elements
480  unsigned nelem = 13;
481 
482  //Set up the problem
484  problem(nelem,L);
485 
486  // Do unsteady run
487  problem.unsteady_run();
488 
489 } // end of main
MatrixXd L
Definition: LLT_example.cpp:6
Ring problem.
Definition: steady_ring.cc:98
Definition: oomph_definitions.h:222
double Pi
Definition: two_d_biharmonic.cc:235
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
unsigned Fixed_timestep_flag
Flag for fixed timestep: Default = fixed timestep.
Definition: lin_unsteady_ring.cc:52
unsigned Long_run_flag
Flag for long/short run: Default = perform long run.
Definition: lin_unsteady_ring.cc:49
bool Consistent_newmark_ic
Definition: lin_unsteady_ring.cc:56
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References Global_Physical_Variables::Consistent_newmark_ic, Global_Physical_Variables::Fixed_timestep_flag, L, Global_Physical_Variables::Long_run_flag, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, BiharmonicTestFunctions2::Pi, problem, Flag_definition::setup(), and oomph::Global_string_for_annotation::string().