resize_hanging_node_tester.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

bool Global_Physical_Variables::Actually_attach_face_elements =true
 Actually attach elements? More...
 
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.

562 {
563 #ifdef OOMPH_HAS_MPI
564  MPI_Helpers::init(argc,argv);
565 #endif
566 
567  // Create mayhem by initially building the mesh without attached
568  // FaceElements
570 
571  // Store command line arguments
572  CommandLineArgs::setup(argc,argv);
573 
574  // Define possible command line arguments and parse the ones that
575  // were actually specified
576 
577  // Validation run?
579 
580  // Parse command line
582 
583  // Doc what has actually been specified on the command line
585 
586  //Set up the problem
588 
589  // Validation run
591  {
592  // Fake but repeatable load balancing for self-test
593  problem.set_default_partition_in_load_balance();
594  }
595 
596 #ifdef OOMPH_HAS_MPI
597 
598  // Distribute the problem
599  DocInfo mesh_doc_info;
600  mesh_doc_info.set_directory("RESLT");
601  mesh_doc_info.number()=38;
602 
604  unsigned n_partition=problem.mesh_pt()->nelement();
605  Vector<unsigned> element_partition(n_partition,0);
606  std::string input_string;
607  for (unsigned e=0;e<n_partition;e++)
608  {
609  // Base decision on where element is on central node on bottom edge
610  if (dynamic_cast<SolidNode*>(problem.mesh_pt()->finite_element_pt(e)->
611  node_pt(1))->xi(0)<0.5)
612  {
613  element_partition[e]=1;
614  }
615  }
616 
617  // Distribute and check halo schemes
618  bool report_stats=false;
619  problem.distribute(element_partition,mesh_doc_info,report_stats);
620  problem.check_halo_schemes(mesh_doc_info);
621 
622 #endif
623 
624  // Now start the trouble: The mesh has been distributed and
625  // we now attach the face elements only to the non-haloed elements
626  // in the left half of the domain. This means that one node gets
627  // resized there while its halo counterpart on the other processor
628  // doesn't. This will be reconciled by Mesh::resize_halo_nodes()
630 
631  // Quick hacky way of attaching the face elements
632  problem.actions_after_adapt();
633 
634  // Must now re-assign eqn numbers because additional unknowns have been
635  // created
636  problem.assign_eqn_numbers();
637 
638  // Doc initial domain shape
639  problem.doc_solution();
640 
641  // Max. number of adaptations per solve
642  unsigned max_adapt=1;
643 
644  //Parameter incrementation
645  unsigned nstep=2;
646  for(unsigned i=0;i<nstep;i++)
647  {
648  // Increment imposed boundary displacement (more gently than
649  // in other code because we're not resetting Lagrangian coordinates
650  // to faciliate identification of elements in left and right half
651  // of domain
653 
654  // Solve the problem with Newton's method, allowing
655  // up to max_adapt mesh adaptations after every solve.
656  problem.newton_solve(max_adapt);
657 
658  // Doc solution
659  problem.doc_solution();
660 
661  // For maximum stability: Reset the current nodal positions to be
662  // the "stress-free" ones -- this assignment means that the
663  // parameter study no longer corresponds to a physical experiment
664  // but is what we'd do if we wanted to use the solid solve
665  // to update a fluid mesh in an FSI problem, say.
666 
667  // NOT DOING THIS HERE TO FACILITATE IDENTIFICATION OF ELEMENTS
668  // AS BEING IN LEFT OR RIGHT HALF OF DOMAIN
669  // problem.solid_mesh_pt()->set_lagrangian_nodal_coordinates();
670 
671  }
672 
673  oomph_info << "Load balancing \n";
674 
675  // Load balance and re-solve without further adaptation
676  problem.load_balance();
677  problem.newton_solve();
678 
679  // Doc solution
680  problem.doc_solution();
681 
682 
683  // Increment imposed boundary displacement yet again...
685 
686  // ...and re-solve for a final time
687  problem.newton_solve();
688 
689  // Doc solution
690  problem.doc_solution();
691 
692 #ifdef OOMPH_HAS_MPI
693  MPI_Helpers::finalize();
694 #endif
695 
696 } //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
Definition: nodes.h:1686
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
bool Actually_attach_face_elements
Actually attach elements?
Definition: resize_hanging_node_tester.cc:142
WarpedLine Boundary_geom_object(0.0)
GeomObject specifying the shape of the boundary: Initially it's flat.
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 Global_Physical_Variables::Actually_attach_face_elements, WarpedLine::ampl(), Global_Physical_Variables::Boundary_geom_object, oomph::CommandLineArgs::command_line_flag_has_been_set(), oomph::CommandLineArgs::doc_specified_flags(), e(), 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().