mpi/distribution/prescribed_displ_lagr_mult/prescribed_displ_lagr_mult.cc File Reference
#include "generic.h"
#include "solid.h"
#include "constitutive.h"
#include "meshes/rectangular_quadmesh.h"

Classes

class  FiniteElementComp
 
class  WarpedLine
 Warped line in 2D space. More...
 
class  PrescribedBoundaryDisplacementProblem< ELEMENT >
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

int main (int argc, char *argv[])
 Driver code. More...
 

Variables

WarpedLine Global_Physical_Variables::Boundary_geom_object (0.0)
 GeomObject specifying the shape of the boundary: Initially it's flat. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code.

516 {
517 #ifdef OOMPH_HAS_MPI
518  MPI_Helpers::init(argc,argv);
519 #endif
520 
521 
522  // Store command line arguments
523  CommandLineArgs::setup(argc,argv);
524 
525  // Define possible command line arguments and parse the ones that
526  // were actually specified
527 
528  // Validation run?
530 
531  // Parse command line
533 
534  // Doc what has actually been specified on the command line
536 
537  //Set up the problem
539 
540  // Validation run
542  {
543  // Fake but repeatable load balancing for self-test
544  problem.set_default_partition_in_load_balance();
545  }
546 
547 #ifdef OOMPH_HAS_MPI
548 
549  // Distribute the problem
550  DocInfo mesh_doc_info;
551  mesh_doc_info.set_directory("RESLT");
552  mesh_doc_info.number()=38;
553 
554  std::ifstream input_file;
555  std::ofstream output_file;
556  char filename[100];
557 
559  unsigned n_partition=problem.mesh_pt()->nelement();
560 
561  // Get the partition from file
562  Vector<unsigned> element_partition(n_partition);
563  sprintf(filename,"presc_displ_lagr_mult_partition.dat");
564  input_file.open(filename);
565  std::string input_string;
566  for (unsigned e=0;e<n_partition;e++)
567  {
568  getline(input_file,input_string,'\n');
569  element_partition[e]=atoi(input_string.c_str());
570  }
571 
572  // Distribute and check halo schemes
573  bool report_stats=false;
574  problem.distribute(element_partition,mesh_doc_info,report_stats);
575  problem.check_halo_schemes(mesh_doc_info);
576 
577 #endif
578 
579  // Doc initial domain shape
580  problem.doc_solution();
581 
582  // Max. number of adaptations per solve
583  unsigned max_adapt=1;
584 
585  //Parameter incrementation
586  unsigned nstep=2;
587  for(unsigned i=0;i<nstep;i++)
588  {
589  // Increment imposed boundary displacement
591 
592  // Solve the problem with Newton's method, allowing
593  // up to max_adapt mesh adaptations after every solve.
594  problem.newton_solve(max_adapt);
595 
596  // Doc solution
597  problem.doc_solution();
598 
599  // For maximum stability: Reset the current nodal positions to be
600  // the "stress-free" ones -- this assignment means that the
601  // parameter study no longer corresponds to a physical experiment
602  // but is what we'd do if we wanted to use the solid solve
603  // to update a fluid mesh in an FSI problem, say.
604  problem.solid_mesh_pt()->set_lagrangian_nodal_coordinates();
605 
606  }
607 
608  oomph_info << "Load balancing \n";
609 
610  // Load balance and re-solve without further adaptation
611  problem.load_balance();
612  problem.newton_solve();
613 
614  // Doc solution
615  problem.doc_solution();
616 
617 
618  // Increment imposed boundary displacement yet again...
620 
621  // ...and re-solve for a final time
622  problem.newton_solve();
623 
624  // Doc solution
625  problem.doc_solution();
626 
627 #ifdef OOMPH_HAS_MPI
628  MPI_Helpers::finalize();
629 #endif
630 
631 } //end of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Definition: mpi/distribution/prescribed_displ_lagr_mult/prescribed_displ_lagr_mult.cc:159
double & ampl()
Access to amplitude.
Definition: heated_linear_solid_contact_with_gravity.cc:2066
Definition: oomph_utilities.h:499
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
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
WarpedLine Boundary_geom_object(0.0)
GeomObject specifying the shape of the boundary: Initially it's flat.
string filename
Definition: MergeRestartFiles.py:39
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References WarpedLine::ampl(), Global_Physical_Variables::Boundary_geom_object, oomph::CommandLineArgs::command_line_flag_has_been_set(), oomph::CommandLineArgs::doc_specified_flags(), e(), MergeRestartFiles::filename, i, oomph::DocInfo::number(), oomph::oomph_info, oomph::CommandLineArgs::parse_and_assign(), problem, oomph::DocInfo::set_directory(), Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), and oomph::Global_string_for_annotation::string().