refineable_young_laplace.cc File Reference

Classes

class  RefineableYoungLaplaceProblem< ELEMENT >
 

Functions

void run_it (const string &output_directory)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code for 2D RefineableYoungLaplace problem. Input arguments: none (for validation) or case (0,1,2,3 for all pinned, barrel with spines, barrel without spines, and T junction), and number of steps.

617 {
618 
619  // Store command line arguments
620  CommandLineArgs::setup(argc,argv);
621 
622  // Cases to run (By default (validation) run all
623  unsigned case_lo=0;
624  unsigned case_hi=3;
625 
626  // No command line args: Running every case with
627  // limited number of steps
628  if (CommandLineArgs::Argc==1)
629  {
630  std::cout
631  << "Running every case with limited number of steps for validation"
632  << std::endl;
633 
634  // Number of steps
636  }
637  else
638  {
639  // Which case to run?
640  case_lo=atoi(argv[1]);
641  case_hi=atoi(argv[1]);
642 
643  // Number of steps
644  GlobalParameters::Nsteps=atoi(argv[2]);
645  }
646 
647  // Loop over chosen case(s)
648  //-------------------------
649  for (unsigned my_case=case_lo;my_case<=case_hi;my_case++)
650  {
651 
652  // Choose
653  switch (my_case)
654  {
655 
656  case 0:
657 
658  cout << endl << endl
659  << "//////////////////////////////////////////////////////////\n"
660  << "All pinned solution \n"
661  << "//////////////////////////////////////////////////////////\n\n";
662 
664 
665  // Run with spines
667  run_it("RESLT_adapt_all_pinned");
668 
669  break;
670 
671  case 1:
672 
673  cout << endl << endl
674  << "//////////////////////////////////////////////////////////\n"
675  << "Barrel-shaped solution with spine \n"
676  << "/////////////////////////////////////////////////////////\n\n";
677 
681  run_it("RESLT_adapt_barrel_shape");
682 
683  break;
684 
685  case 2:
686 
687  cout << endl << endl
688  << "//////////////////////////////////////////////////////////\n"
689  << "Barrel-shaped solution without spines \n"
690  << "/////////////////////////////////////////////////////////\n\n";
691 
695  run_it("RESLT_adapt_barrel_shape_without_spines");
696 
697  break;
698 
699  case 3:
700 
701  cout << endl << endl
702  << "//////////////////////////////////////////////////////////\n"
703  << "T-junction solution \n"
704  << "//////////////////////////////////////////////////////////\n\n";
705 
711 
712  // Run with spines
714  run_it("RESLT_adapt_T_junction");
715 
716  break;
717 
718 
719  default:
720 
721  std::cout << "Wrong case! Options are:\n"
722  << "0: adaptive All pinned\n"
723  << "1: adaptive Barrel with spines\n"
724  << "2: adaptive Barrel without spines\n"
725  << "3: adaptive T_junction\n"
726  << std::endl;
727  assert(false);
728 
729  }
730 
731  }
732 
733 
734 } //end of main
#define assert(e,...)
Definition: Logger.h:744
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
double L_x
------------------—Unsteady Heat Parameters---------------------—
Definition: test_equal_order_galerkin.cc:62
double Controlled_height_increment
Increment for height control.
Definition: common_young_laplace_stuff.h:85
bool Use_spines
Use spines (true) or not (false)
Definition: common_young_laplace_stuff.h:40
unsigned Nsteps
Number of steps.
Definition: common_young_laplace_stuff.h:79
double L_y
Length of the mesh in the y-direction.
Definition: test_equal_order_galerkin.cc:65
double Gamma
Parameter for timescale of step translation.
Definition: two_d_unsteady_heat_2adapt_load_balance.cc:144
@ Barrel_shape
Definition: common_young_laplace_stuff.h:48
@ All_pinned
Definition: common_young_laplace_stuff.h:47
@ T_junction_with_nonzero_contact_angle
Definition: common_young_laplace_stuff.h:49
int Case
What case are we considering: Choose one from the enumeration Cases.
Definition: common_young_laplace_stuff.h:53
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407
void run_it(const string &output_directory)
Definition: refineable_young_laplace.cc:541

References GlobalParameters::All_pinned, oomph::CommandLineArgs::Argc, assert, GlobalParameters::Barrel_shape, GlobalParameters::Case, GlobalParameters::Controlled_height_increment, GlobalParameters::Gamma, GlobalParameters::L_x, GlobalParameters::L_y, GlobalParameters::Nsteps, BiharmonicTestFunctions2::Pi, run_it(), Flag_definition::setup(), GlobalParameters::T_junction_with_nonzero_contact_angle, and GlobalParameters::Use_spines.

◆ run_it()

void run_it ( const string &  output_directory)

Run code for current setting of parameter values – specify name of output directory

542 {
543 
544  // Create label for output
545  //------------------------
546  DocInfo doc_info;
547 
548  // Set outputs
549  //------------
550 
551  // Trace file
552  ofstream trace_file;
553 
554  // Set output directory
555  doc_info.set_directory(output_directory);
556 
557  // Open a trace file
558  char filename[100];
559  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
560  trace_file.open(filename);
561 
562  // Write kappa, exact kappa if exists and height values
563  trace_file <<
564  "VARIABLES=\"<GREEK>k</GREEK>\",\"<GREEK>k</GREEK>_{ex}\",\"h\""
565  << std::endl;
566  trace_file << "ZONE" << std::endl;
567 
568  //Set up the problem
569  //------------------
570 
571  // Create the problem with 2D nine-node elements from the
572  // RefineableQYoungLaplaceElement family.
574 
575  problem.refine_uniformly();
576 
577  //Output the solution
578  problem.doc_solution(doc_info,trace_file);
579 
580  //Increment counter for solutions
581  doc_info.number()++;
582 
583  // Parameter incrementation
584  //-------------------------
585 
586  // Loop over steps
587  for (unsigned istep=0;istep<GlobalParameters::Nsteps;istep++)
588  {
589 
590  // Bump up parameters
591  problem.increment_parameters();
592 
593  // Solve the problem
594  unsigned max_adapt=1;
595  problem.newton_solve(max_adapt);
596 
597  //Output the solution
598  problem.doc_solution(doc_info,trace_file);
599 
600  //Increment counter for solutions
601  doc_info.number()++;
602  }
603 
604  // Close output file
605  trace_file.close();
606 
607 } //end of run_it()
Definition: refineable_t_junction.cc:139
Definition: oomph_utilities.h:499
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
string filename
Definition: MergeRestartFiles.py:39
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::DocInfo::directory(), MergeRestartFiles::filename, GlobalParameters::Nsteps, oomph::DocInfo::number(), problem, and oomph::DocInfo::set_directory().

Referenced by main().