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

Classes

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::Radius_of_elastic_body =2.0
 Radius of elastic body. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code.

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

1880 {
1881 
1882  FiniteElement::Accept_negative_jacobian=true;
1883 
1884  // Store command line arguments
1885  CommandLineArgs::setup(argc,argv);
1886 
1887  // Define possible command line arguments and parse the ones that
1888  // were actually specified
1889 
1890  // Suppress adaptation
1892 
1893  // Initial element size
1896 
1897  // Suppress adaptation
1899 
1900  // Parse command line
1902 
1903  // Doc what has actually been specified on the command line
1905 
1906  // Create generalised Hookean constitutive equations
1909 
1910  // Define centre of penetrator
1911  ProblemParameters::Centre.resize(2);
1914 
1915 #ifdef STRUCTURED_MESH
1916 
1917  // Build problem
1919 
1920 #else
1921 
1922  // Build problem
1924 
1925 #endif
1926 
1927 
1928  // Update position of centre: Y_c has been determined as the
1929  // vertical position of a (control) node on the contact boundary.
1930  // We place the penetrator vertically above this.
1933 
1934  //Output initial condition
1935  problem.doc_solution();
1936 
1937  unsigned max_adapt=1;
1939  {
1940  max_adapt=0;
1941  }
1942 
1943 
1944  // Move position of centre directly
1945  //----------------------------------
1946  double dyc=0.00024;
1947  unsigned nstep=1;
1948  for (unsigned i=0;i<nstep;i++)
1949  {
1950  ProblemParameters::Centre[1]-=dyc;
1951  oomph_info << "Re-solving imposed circle pos for yc="
1953  << std::endl;
1954 
1955  // Solve
1956  problem.newton_solve(max_adapt);
1957 
1958  //Output solution
1959  problem.doc_solution();
1960  }
1961 
1962  // Now increase resolution
1963  //------------------------
1964  nstep=1;
1965  for (unsigned i=0;i<nstep;i++)
1966  {
1967 
1968  oomph_info << "Re-solving imposed circle pos for element length factor: "
1970  << std::endl;
1971 
1972  // Re-solve
1973  problem.newton_solve(max_adapt);
1974 
1975  //Output solution
1976  problem.doc_solution();
1977 
1978  // Refine
1980  }
1981 
1982  // Switch to node control
1984 
1985  // Use displacement control initially
1986  //-----------------------------------
1987  problem.adapt();
1988  problem.switch_to_displ_control();
1989  dyc=0.0003; // 0.00006;
1990  nstep=1;
1991  for (unsigned i=0;i<nstep;i++)
1992  {
1994  oomph_info << "Re-solving for yc="
1996  << std::endl;
1997 
1998  // Solve
1999  problem.newton_solve(max_adapt);
2000 
2001  //Output solution
2002  problem.doc_solution();
2003  }
2004 
2005 
2006  // Switch to force control
2007  problem.switch_to_force_control();
2008 
2009  // Balance it in the horizontal direction
2010  //---------------------------------------
2012 
2013  oomph_info << "RE-solving for weight="
2014  << dynamic_cast<CircularPenetratorElement*>(
2015  ProblemParameters::Penetrator_pt)->target_weight()
2016  << " and horizontal force: "
2017  << dynamic_cast<CircularPenetratorElement*>(
2018  ProblemParameters::Penetrator_pt)->target_horizontal_force()
2019  << std::endl;
2020 
2021  // Re-solve
2022  problem.newton_solve(max_adapt);
2023 
2024  //Output solution
2025  problem.doc_solution();
2026 
2027 
2028  // Now increase weight
2029  //--------------------
2030  double dweight=0.0003; // 0.0001;
2031  nstep=1;
2032  for (unsigned i=0;i<nstep;i++)
2033  {
2034  oomph_info << "Re-solving for weight="
2035  << dynamic_cast<CircularPenetratorElement*>(
2036  ProblemParameters::Penetrator_pt)->target_weight()
2037  << " and horizontal force: "
2038  << dynamic_cast<CircularPenetratorElement*>(
2039  ProblemParameters::Penetrator_pt)->target_horizontal_force()
2040  << std::endl;
2041 
2042  // Re-solve
2043  problem.newton_solve(max_adapt);
2044 
2045  //Output solution
2046  problem.doc_solution();
2047 
2048  // Increase weight
2049  ProblemParameters::Weight+=dweight;
2050  }
2051 
2052 
2053 // Now increase body force
2054 //------------------------
2055  nstep=4;
2056  for (unsigned i=0;i<nstep;i++)
2057  {
2058  // Bump up
2060 
2061  oomph_info << "Re-solving for weight="
2062  << dynamic_cast<CircularPenetratorElement*>(
2063  ProblemParameters::Penetrator_pt)->target_weight()
2064  << " and horizontal force: "
2065  << dynamic_cast<CircularPenetratorElement*>(
2066  ProblemParameters::Penetrator_pt)->target_horizontal_force()
2067  << " and body force ampl: "
2069  << std::endl;
2070 
2071  // Re-solve
2072  problem.newton_solve(max_adapt);
2073 
2074  //Output solution
2075  problem.doc_solution();
2076 
2077  }
2078 
2079  exit(0);
2080 
2081  // Now increase resolution
2082  //--------------------
2083  nstep=3;
2084  for (unsigned i=0;i<nstep;i++)
2085  {
2086 
2087  oomph_info << "Re-solving for weight="
2088  << dynamic_cast<CircularPenetratorElement*>(
2089  ProblemParameters::Penetrator_pt)->target_weight()
2090  << " and horizontal force: "
2091  << dynamic_cast<CircularPenetratorElement*>(
2092  ProblemParameters::Penetrator_pt)->target_horizontal_force()
2093  << " and body force ampl: "
2095  << " and element length factor: "
2097  << std::endl;
2098 
2099  // Re-solve
2100  problem.newton_solve(max_adapt);
2101 
2102  //Output solution
2103  problem.doc_solution();
2104 
2105  // Refine
2107  }
2108 
2109 
2110 }
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
Definition: constitutive_laws.h:699
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
Penetrator * Penetrator_pt
Penetrator.
Definition: circular_boulder_melt.cc:88
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
double Body_force_amplitude
Body force magnitude.
Definition: linear_solid_contact_with_gravity.cc:888
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 ProblemParameters::Body_force_amplitude, 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, ProblemParameters::Nu, oomph::oomph_info, oomph::CommandLineArgs::parse_and_assign(), ProblemParameters::Penetrator_pt, problem, ProblemParameters::Radius, Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), ProblemParameters::Weight, and ProblemParameters::Y_c.