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

Classes

class  oomph::TemplateFreeHeatedPenetratorFluxElementBase
 
class  oomph::TLinearHeatAndElasticityElement< DIM, NNODE_1D >
 Bulk element which combines linear elasticity and unsteady heat. More...
 
class  oomph::FaceGeometry< TLinearHeatAndElasticityElement< DIM, NNODE_1D > >
 Face geometry of the customised element. More...
 
class  oomph::ProjectableLinearHeatAndElasticityElement< LINEAR_HEAT_AND_ELAST_ELEMENT >
 Linear heat and elasticity upgraded to become projectable. More...
 
class  oomph::FaceGeometry< ProjectableLinearHeatAndElasticityElement< ELEMENT > >
 
class  oomph::FaceGeometry< FaceGeometry< ProjectableLinearHeatAndElasticityElement< ELEMENT > > >
 
class  oomph::TemplateFreeHeatedLinearSurfaceContactElementBase
 Template-free base class for linear contact with a heated penetrator. More...
 
class  oomph::HeatedLinearSurfaceContactElement< ELEMENT >
 
class  oomph::HeatedPenetratorFluxElement< ELEMENT >
 
class  FiniteElementComp
 
class  WarpedLine
 Warped line in 2D space. More...
 
class  HeatedCircularPenetratorElement
 
class  ContactProblem< ELEMENT >
 Problem class. More...
 

Namespaces

 oomph
 DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
 
 ProblemParameters
 Namespace for exact solution and problem parameters.
 

Functions

void ProblemParameters::unit_flux (const double &time, const Vector< double > &x, double &flux)
 hierher temp flux. More...
 
int main (int argc, char *argv[])
 Driver code. More...
 

Variables

double ProblemParameters::T_contact =0.0
 hierher More...
 
double ProblemParameters::X_contact_end_left =0.3
 Left end of contact region (for unstructured mesh only) More...
 
double ProblemParameters::X_contact_end_right =0.7
 Right end of contact region (for unstructured mesh only) More...
 
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)
 
bool ProblemParameters::Impose_position_of_centre =true
 
IsotropicElasticityTensor ProblemParameters::E (Nu)
 The elasticity tensor. More...
 
double ProblemParameters::Weight =0.0
 NOTE: WE IMPOSE EITHER THESE ... More...
 
double ProblemParameters::Horizontal_force =0.0
 Horizontal force of penetrator. More...
 
double ProblemParameters::Y_c =0.0
 ... OR THESE... More...
 
double ProblemParameters::Rotation_angle =0.0
 Target rotation angle about control node. More...
 
double ProblemParameters::El_area =0.02
 Initial/max element area. More...
 
double ProblemParameters::Element_length_factor =0.01
 Factor for element length on contact boundary. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code.

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

4616 {
4617  //feenableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW);
4618 
4619  FiniteElement::Accept_negative_jacobian=true;
4620 
4621  // Store command line arguments
4622  CommandLineArgs::setup(argc,argv);
4623 
4624  // Define possible command line arguments and parse the ones that
4625  // were actually specified
4626 
4627  // Suppress adaptation
4629 
4630  // Initial element size
4633 
4634  // Suppress adaptation
4636 
4637  // Parse command line
4639 
4640  // Doc what has actually been specified on the command line
4642 
4643  // Create generalised Hookean constitutive equations
4646 
4647 
4648  // Define centre of penetrator
4649  ProblemParameters::Centre.resize(2);
4652 
4653  // Build penetrator
4657 
4658 
4659 #ifdef STRUCTURED_MESH
4660 
4661  // Build problem
4665  problem;
4666 
4667 #else
4668 
4669  // Build problem
4673  TPVDElement<2,3> > > > problem;
4674 
4675 #endif
4676 
4677 
4678  // Initialise timestep -- also sets the weights for all timesteppers
4679  // in the problem.
4680  double dt=0.01;
4681  problem.initialise_dt(dt);
4682  problem.assign_initial_values_impulsive();
4683 
4684  double max_residuals = 100;
4685  problem.max_residuals() = max_residuals;
4686  unsigned max_iterations = 10;
4687 
4688  //Output initial condition
4689  problem.doc_solution();
4690 
4691  unsigned max_adapt=1; // hierher
4693  {
4694  max_adapt=0;
4695  }
4696 
4697  // Pure imposed displacement of upper surface -- no contact
4698  //---------------------------------------------------------
4699  {
4700  //Parameter incrementation
4701  unsigned nstep=2;
4702  for(unsigned i=0;i<nstep;i++)
4703  {
4704 
4705  double d_ampl=0.05;
4706  double ampl=0.0;
4707 
4708 #ifdef STRUCTURED_MESH
4709 
4710  // Increment imposed boundary displacement
4713 
4714 #else
4715 
4716  // Increment imposed boundary displacement
4721 
4722 #endif
4723 
4724  oomph_info << "Re-solving for prescr displ amplitude = "
4725  << ampl << std::endl;
4726 
4727  // Solve the problem with Newton's method, allowing
4728  // up to max_adapt mesh adaptations after every solve.
4729  bool first=false;
4730  problem.unsteady_newton_solve(dt,max_adapt,first);
4731 
4732  // Doc solution
4733  problem.doc_solution();
4734  }
4735  }
4736 
4737 #ifdef STRUCTURED_MESH
4742 #else
4747 #endif
4748 
4749 
4750  // Switch on temperature
4752 
4753  // Move position of centre directly
4754  //----------------------------------
4755  unsigned nstep=30;
4756  for (unsigned i=0;i<nstep;i++)
4757  {
4758 
4759  double dyc=0.00024;
4760  ProblemParameters::Centre[1]-=dyc;
4761  oomph_info << "Re-solving imposed circle pos for yc="
4763  << std::endl;
4764 
4765  // Solve
4766  //bool first=false;
4767  // problem.unsteady_newton_solve(dt,max_adapt,first);
4768  try
4769  {
4770  max_iterations = 10;
4771  problem.max_newton_iterations() = max_iterations;
4772  problem.unsteady_newton_solve(dt);
4773  }
4774  catch(OomphLibError& error) //This will catch any error,
4775 //but actually we only want to catch failure to converge
4776  {
4777  max_iterations = 100;
4778  problem.max_newton_iterations() = max_iterations;
4779  problem.enable_globally_convergent_newton_method();
4780  problem.unsteady_newton_solve(dt,false);
4781  problem.disable_globally_convergent_newton_method();
4782  }
4783 
4784  //Output solution
4785  problem.doc_solution();
4786  }
4787 
4788 
4789 // exit(0);
4790 
4791  // // Now increase resolution
4792  // //------------------------
4793  // nstep=3;
4794  // for (unsigned i=0;i<nstep;i++)
4795  // {
4796 
4797  // oomph_info << "Re-solving imposed circle pos for element length factor: "
4798  // << ProblemParameters::Element_length_factor
4799  // << std::endl;
4800 
4801  // // Re-solve
4802  // problem.newton_solve(max_adapt);
4803 
4804  // //Output solution
4805  // problem.doc_solution();
4806 
4807  // // Refine
4808  // ProblemParameters::Element_length_factor/=2.0;
4809  // }
4810 
4811  // Switch to node control
4813 
4814  // Use displacement control initially
4815  //-----------------------------------
4816  problem.adapt();
4817  problem.switch_to_displ_control();
4818  double dyc=0.0003;
4819  nstep=1;
4820  for (unsigned i=0;i<nstep;i++)
4821  {
4823  oomph_info << "Re-solving for yc="
4825  << std::endl;
4826 
4827  // Solve
4828 
4829  // Try using normal newton solver, if it fails to converge, try a more stabl
4830  // but slower globally convergent method
4831  try
4832  {
4833  //This problem can have quite high initial residuals
4834  max_residuals = 100;
4835 
4836  //Set max number of iterations to low number
4837  max_iterations = 10;
4838  problem.max_newton_iterations() = max_iterations;
4839 
4840  problem.newton_solve(max_adapt);
4841  }
4842  catch(OomphLibError& error) //This will catch any error,
4843  //but actually we only want to catch failure to converge
4844  {
4845  //Increase number of iterations to give it chance to converge
4846  max_iterations = 100;
4847  problem.max_newton_iterations() = max_iterations;
4848 
4849  //Activate globally convergent method, then deactivate after
4850  problem.enable_globally_convergent_newton_method();
4851  problem.newton_solve(max_adapt);
4852  problem.disable_globally_convergent_newton_method();
4853  }
4854 
4855 
4856  //Output solution
4857  problem.doc_solution();
4858  }
4859 
4860 
4861  // Switch to force control
4862  problem.switch_to_force_control();
4863 
4864  // Balance it in the horizontal direction
4865  //---------------------------------------
4867 
4868  oomph_info << "RE-solving for weight="
4869  << dynamic_cast<HeatedCircularPenetratorElement*>(
4870  ProblemParameters::Penetrator_pt)->target_weight()
4871  << " and horizontal force: "
4872  << dynamic_cast<HeatedCircularPenetratorElement*>(
4873  ProblemParameters::Penetrator_pt)->target_horizontal_force()
4874  << std::endl;
4875 
4876  // Re-solve
4877  // problem.unsteady_newton_solve(dt); // max_adapt);
4878 
4879  // Try using normal newton solver, if it fails to converge, try a more stable
4880  // but slower globally convergent method
4881  try
4882  {
4883  //Set max number of iterations to low number
4884  max_iterations = 10;
4885  problem.max_newton_iterations() = max_iterations;
4886 
4887  problem.unsteady_newton_solve(dt);
4888  }
4889  catch(OomphLibError& error) //This will catch any error,
4890 //but actually we only want to catch failure to converge
4891  {
4892  //Increase number of iterations to give it chance to converge
4893  max_iterations = 100;
4894  problem.max_newton_iterations() = max_iterations;
4895 
4896  //Activate globally convergent method, then deactivate after
4897  problem.enable_globally_convergent_newton_method();
4898  problem.unsteady_newton_solve(dt,false);
4899  problem.disable_globally_convergent_newton_method();
4900  }
4901 
4902 
4903 
4904 
4905  //Output solution
4906  problem.doc_solution();
4907 
4908 
4909  // // Now increase weight
4910  // //--------------------
4911  // double dweight=0.0001;
4912  // nstep=1;
4913  // for (unsigned i=0;i<nstep;i++)
4914  // {
4915  // oomph_info << "Re-solving for weight="
4916  // << dynamic_cast<HeatedCircularPenetratorElement*>(
4917  // ProblemParameters::Penetrator_pt)->target_weight()
4918  // << " and horizontal force: "
4919  // << dynamic_cast<HeatedCircularPenetratorElement*>(
4920  // ProblemParameters::Penetrator_pt)->target_horizontal_force()
4921  // << std::endl;
4922 
4923  // // Re-solve
4924  // problem.newton_solve(max_adapt);
4925 
4926  // //Output solution
4927  // problem.doc_solution();
4928 
4929  // // Increase weight
4930  // ProblemParameters::Weight+=dweight;
4931  // }
4932 
4933 
4934 // Now detach elastic body
4935 //------------------------
4936  nstep=3;
4937  double d_lift_off_ampl=0.0001;
4938  for (unsigned i=0;i<nstep;i++)
4939  {
4940 
4941  double lift_off=0.0;
4942 
4943 #ifdef STRUCTURED_MESH
4944 
4945  // Increment imposed boundary displacement
4947  d_lift_off_ampl;
4948 
4950 
4951 #else
4952 
4953  // Increment imposed boundary displacement
4955  d_lift_off_ampl;
4957  d_lift_off_ampl;
4959  d_lift_off_ampl;
4960 
4962  lift_off_amplitude();
4963 
4964 #endif
4965 
4966 
4967  oomph_info << "Re-solving for weight="
4968  << dynamic_cast<HeatedCircularPenetratorElement*>(
4969  ProblemParameters::Penetrator_pt)->target_weight()
4970  << " and horizontal force: "
4971  << dynamic_cast<HeatedCircularPenetratorElement*>(
4972  ProblemParameters::Penetrator_pt)->target_horizontal_force()
4973  << " and lift off: "
4974  << lift_off
4975  << std::endl;
4976 
4977  // Re-solve
4978  try
4979  {
4980  max_residuals = 100;
4981  max_iterations = 10;
4982  problem.max_newton_iterations() = max_iterations;
4983  problem.max_residuals() = max_residuals;
4984  problem.newton_solve(max_adapt);
4985  }
4986  catch(OomphLibError& error) //This will catch any error,
4987 //but actually we only want to catch failure to converge
4988  {
4989  max_iterations = 100;
4990  problem.max_newton_iterations() = max_iterations;
4991  problem.enable_globally_convergent_newton_method();
4992  problem.newton_solve(max_adapt);
4993  problem.disable_globally_convergent_newton_method();
4994  }
4995 
4996 
4997 
4998  //Output solution
4999  problem.doc_solution();
5000 
5001  }
5002 
5003 
5004 
5005 
5006 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Problem class.
Definition: heated_linear_solid_contact_with_gravity.cc:2892
Definition: heated_linear_solid_contact_with_gravity.cc:2167
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
Definition: constitutive_laws.h:699
Heated circular penetrator.
Definition: contact_elements.h:392
Definition: oomph_definitions.h:222
Linear heat and elasticity upgraded to become projectable.
Definition: heated_linear_solid_contact_with_gravity.cc:368
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 T_contact
hierher
Definition: heated_linear_solid_contact_with_gravity.cc:2782
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
int error
Definition: calibrate.py:297
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, calibrate::error, 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::T_contact, WarpedLine::y_c(), and ProblemParameters::Y_c.