linear_solid_contact_with_gravity.cc File Reference
#include <fenv.h>
#include "generic.h"
#include "solid.h"
#include "linear_elasticity.h"
#include "meshes/triangle_mesh.h"
#include "meshes/rectangular_quadmesh.h"
#include "contact_elements.h"

Classes

class  FiniteElementComp
 
class  WarpedLine
 Warped line in 2D space. More...
 
class  CircularPenetratorElement
 
class  ContactProblem< ELEMENT >
 Problem class. More...
 

Namespaces

 ProblemParameters
 Namespace for exact solution and problem parameters.
 

Functions

void ProblemParameters::body_force (const double &time, const Vector< double > &x, Vector< double > &result)
 The body force function. More...
 
int main (int argc, char *argv[])
 Driver code. More...
 

Variables

double ProblemParameters::Body_force_amplitude =0.0
 Body force magnitude. More...
 
double ProblemParameters::Body_force_alpha =1.0e4
 
WarpedLine ProblemParameters::Boundary_geom_object_left (1.0e-10, 0.0, X_contact_end_left)
 
WarpedLine ProblemParameters::Boundary_geom_object_contact (1.0e-10, X_contact_end_left, X_contact_end_right)
 
WarpedLine ProblemParameters::Boundary_geom_object_right (1.0e-10, X_contact_end_right, 1.0)
 
IsotropicElasticityTensor ProblemParameters::E (Nu)
 The elasticity tensor. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

2307 {
2308 
2309  FiniteElement::Accept_negative_jacobian=true;
2310 
2311  // Store command line arguments
2312  CommandLineArgs::setup(argc,argv);
2313 
2314  // Define possible command line arguments and parse the ones that
2315  // were actually specified
2316 
2317  // Suppress adaptation
2319 
2320  // Initial element size
2323 
2324  // Suppress adaptation
2326 
2327  // Parse command line
2329 
2330  // Doc what has actually been specified on the command line
2332 
2333  // Create generalised Hookean constitutive equations
2336 
2337 
2338  // Define centre of penetrator
2339  ProblemParameters::Centre.resize(2);
2342 
2343  // Build penetrator
2347 
2348 
2349 #ifdef STRUCTURED_MESH
2350 
2351  // Build problem
2355  problem;
2356 
2357 #else
2358 
2359  // Build problem
2363  TPVDElement<2,3> > > > problem;
2364 
2365 #endif
2366 
2367 
2368  // Pure imposed displacement of upper surface -- no contact
2369  //---------------------------------------------------------
2370  {
2371  // Doc initial domain shape
2372  problem.doc_solution();
2373 
2374  // Max. number of adaptations per solve
2375  unsigned max_adapt=1;
2376 
2377  //Parameter incrementation
2378  unsigned nstep=2;
2379  for(unsigned i=0;i<nstep;i++)
2380  {
2381 
2382  double d_ampl=0.05;
2383  double ampl=0.0;
2384 
2385 #ifdef STRUCTURED_MESH
2386 
2387  // Increment imposed boundary displacement
2390 
2391 #else
2392 
2393  // Increment imposed boundary displacement
2398 
2399 #endif
2400 
2401  oomph_info << "Re-solving for prescr displ amplitude = "
2402  << ampl << std::endl;
2403 
2404  // Solve the problem with Newton's method, allowing
2405  // up to max_adapt mesh adaptations after every solve.
2406  problem.newton_solve(max_adapt);
2407 
2408  // Doc solution
2409  problem.doc_solution();
2410  }
2411  }
2412 
2413 
2414 #ifdef STRUCTURED_MESH
2419 #else
2424 #endif
2425 
2426 
2427  //Output initial condition
2428  problem.doc_solution();
2429 
2430  unsigned max_adapt=1;
2432  {
2433  max_adapt=0;
2434  }
2435 
2436 
2437  // Move position of centre directly
2438  //----------------------------------
2439 
2440  double dyc=0.00024;
2441  unsigned nstep=3;
2442  for (unsigned i=0;i<nstep;i++)
2443  {
2444  ProblemParameters::Centre[1]-=dyc;
2445  oomph_info << "Re-solving imposed circle pos for yc="
2447  << std::endl;
2448 
2449  // Solve
2450  problem.newton_solve(max_adapt);
2451 
2452  //Output solution
2453  problem.doc_solution();
2454  }
2455 
2456 
2457  // Now increase resolution
2458  //------------------------
2459  nstep=3;
2460  for (unsigned i=0;i<nstep;i++)
2461  {
2462 
2463  oomph_info << "Re-solving imposed circle pos for element length factor: "
2465  << std::endl;
2466 
2467  // Re-solve
2468  problem.newton_solve(max_adapt);
2469 
2470  //Output solution
2471  problem.doc_solution();
2472 
2473  // Refine
2475  }
2476 
2477  // Switch to node control
2479 
2480  // Use displacement control initially
2481  //-----------------------------------
2482  problem.adapt();
2483  problem.switch_to_displ_control();
2484  dyc=0.0003;
2485  nstep=1;
2486  for (unsigned i=0;i<nstep;i++)
2487  {
2489  oomph_info << "Re-solving for yc="
2491  << std::endl;
2492 
2493  // Solve
2494  problem.newton_solve(max_adapt);
2495 
2496  //Output solution
2497  problem.doc_solution();
2498  }
2499 
2500 
2501  // Switch to force control
2502  problem.switch_to_force_control();
2503 
2504  // Balance it in the horizontal direction
2505  //---------------------------------------
2507 
2508  oomph_info << "RE-solving for weight="
2509  << dynamic_cast<CircularPenetratorElement*>(
2510  ProblemParameters::Penetrator_pt)->target_weight()
2511  << " and horizontal force: "
2512  << dynamic_cast<CircularPenetratorElement*>(
2513  ProblemParameters::Penetrator_pt)->target_horizontal_force()
2514  << std::endl;
2515 
2516  // Re-solve
2517  problem.newton_solve(max_adapt);
2518 
2519  //Output solution
2520  problem.doc_solution();
2521 
2522 
2523  // Now increase weight
2524  //--------------------
2525  double dweight=0.0001;
2526  nstep=1;
2527  for (unsigned i=0;i<nstep;i++)
2528  {
2529  oomph_info << "Re-solving for weight="
2530  << dynamic_cast<CircularPenetratorElement*>(
2531  ProblemParameters::Penetrator_pt)->target_weight()
2532  << " and horizontal force: "
2533  << dynamic_cast<CircularPenetratorElement*>(
2534  ProblemParameters::Penetrator_pt)->target_horizontal_force()
2535  << std::endl;
2536 
2537  // Re-solve
2538  problem.newton_solve(max_adapt);
2539 
2540  //Output solution
2541  problem.doc_solution();
2542 
2543  // Increase weight
2544  ProblemParameters::Weight+=dweight;
2545  }
2546 
2547 
2548 // Now detach elastic body
2549 //------------------------
2550  nstep=3;
2551  double d_lift_off_ampl=0.0001;
2552  for (unsigned i=0;i<nstep;i++)
2553  {
2554 
2555  double lift_off=0.0;
2556 
2557 #ifdef STRUCTURED_MESH
2558 
2559  // Increment imposed boundary displacement
2561  d_lift_off_ampl;
2562 
2564 
2565 #else
2566 
2567  // Increment imposed boundary displacement
2569  d_lift_off_ampl;
2571  d_lift_off_ampl;
2573  d_lift_off_ampl;
2574 
2576  lift_off_amplitude();
2577 
2578 #endif
2579 
2580 
2581  oomph_info << "Re-solving for weight="
2582  << dynamic_cast<CircularPenetratorElement*>(
2583  ProblemParameters::Penetrator_pt)->target_weight()
2584  << " and horizontal force: "
2585  << dynamic_cast<CircularPenetratorElement*>(
2586  ProblemParameters::Penetrator_pt)->target_horizontal_force()
2587  << " and lift off: "
2588  << lift_off
2589  << std::endl;
2590 
2591  // Re-solve
2592  problem.newton_solve(max_adapt);
2593 
2594  //Output solution
2595  problem.doc_solution();
2596  }
2597 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: linear_solid_contact_with_gravity.cc:256
Problem class.
Definition: heated_linear_solid_contact_with_gravity.cc:2892
double radius() const
Return radius.
Definition: heated_linear_solid_contact_with_gravity.cc:2052
double y_c() const
Return y coordinate of centre.
Definition: heated_linear_solid_contact_with_gravity.cc:2059
double & lift_off_amplitude()
Lift off amplitude.
Definition: heated_linear_solid_contact_with_gravity.cc:2088
double & ampl()
Access to amplitude.
Definition: heated_linear_solid_contact_with_gravity.cc:2066
Penetrator – here implemented as a circle.
Definition: contact_elements.h:249
Definition: constitutive_laws.h:699
Linear elasticity upgraded to become projectable.
Definition: linear_elasticity_elements.h:617
Definition: pseudosolid_node_update_elements.h:58
Refineable version of the PseudoSolidNodeUpdateELement.
Definition: pseudosolid_node_update_elements.h:585
Class for refineable QLinearElasticityElement elements.
Definition: refineable_linear_elasticity_elements.h:197
Class for refineable QPVDElement elements.
Definition: refineable_solid_elements.h:181
Definition: solid_elements.h:1756
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.
WarpedLine Boundary_geom_object_contact(1.0e-10, X_contact_end_left, X_contact_end_right)
Penetrator * Penetrator_pt
Penetrator.
Definition: circular_boulder_melt.cc:88
WarpedLine Boundary_geom_object_right(1.0e-10, X_contact_end_right, 1.0)
double Horizontal_force
Horizontal force of penetrator.
Definition: heated_linear_solid_contact_with_gravity.cc:2841
double El_area
Initial/max element area.
Definition: heated_linear_solid_contact_with_gravity.cc:2857
Vector< double > Centre
Position of centre of penetrator.
Definition: circular_boulder_melt.cc:85
WarpedLine Boundary_geom_object_left(1.0e-10, 0.0, X_contact_end_left)
double Weight
NOTE: WE IMPOSE EITHER THESE ...
Definition: heated_linear_solid_contact_with_gravity.cc:2838
double Element_length_factor
Factor for element length on contact boundary.
Definition: heated_linear_solid_contact_with_gravity.cc:2861
double Radius
Radius of penetrator.
Definition: circular_boulder_melt.cc:79
double Nu
Poisson's ratio.
Definition: unstructured_two_d_curved.cc:65
bool Impose_position_of_centre
Definition: heated_linear_solid_contact_with_gravity.cc:2815
double Y_c
... OR THESE...
Definition: heated_linear_solid_contact_with_gravity.cc:2846
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition: circular_boulder_melt.cc:76
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
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, ProblemParameters::Boundary_geom_object_contact, ProblemParameters::Boundary_geom_object_left, ProblemParameters::Boundary_geom_object_right, ProblemParameters::Centre, oomph::CommandLineArgs::command_line_flag_has_been_set(), ProblemParameters::Constitutive_law_pt, oomph::CommandLineArgs::doc_specified_flags(), ProblemParameters::El_area, ProblemParameters::Element_length_factor, ProblemParameters::Horizontal_force, i, ProblemParameters::Impose_position_of_centre, WarpedLine::lift_off_amplitude(), ProblemParameters::Nu, oomph::oomph_info, oomph::CommandLineArgs::parse_and_assign(), ProblemParameters::Penetrator_pt, problem, ProblemParameters::Radius, WarpedLine::radius(), Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), ProblemParameters::Weight, WarpedLine::y_c(), and ProblemParameters::Y_c.