31#include "meshes/one_d_lagrangian_mesh.h"
61 void position(
const Vector<double>& zeta, Vector<double>& r)
const
72 DenseMatrix<double>& drdzeta)
const
84 RankThreeTensor<double>& ddrdzeta)
const
87 ddrdzeta(0, 0, 0) = 0.0;
88 ddrdzeta(0, 0, 1) = 0.0;
100 DenseMatrix<double>& drdzeta,
101 RankThreeTensor<double>& ddrdzeta)
const
112 ddrdzeta(0, 0, 0) = 0.0;
113 ddrdzeta(0, 0, 1) = 0.0;
141 void load(
const Vector<double>& xi,
const Vector<double> &x,
142 const Vector<double>& N, Vector<double>&
load)
144 for(
unsigned i=0;i<2;i++) {
load[i] = -
P_ext*N[i];}
159 const double& stretch_ratio);
165 OneDLagrangianMesh<HermiteBeamElement>*
mesh_pt()
166 {
return dynamic_cast<OneDLagrangianMesh<HermiteBeamElement>*
>
167 (Problem::mesh_pt());}
193 const double &length,
194 const double& stretch_ratio) : Length(length)
205 double compensated_length=length/stretch_ratio;
207 new OneDLagrangianMesh<HermiteBeamElement>(n_elem,compensated_length,
Undef_beam_pt);
211 for(
unsigned b=0;b<2;b++)
221 mesh_pt()->boundary_node_pt(b,0)->pin_position(0);
222 mesh_pt()->boundary_node_pt(b,0)->pin_position(1);
226 unsigned n_element =
mesh_pt()->nelement();
229 for(
unsigned e=0;e<n_element;e++)
232 HermiteBeamElement *elem_pt =
233 dynamic_cast<HermiteBeamElement*
>(
mesh_pt()->element_pt(e));
250 unsigned n_nod=
mesh_pt()->nnode();
253 cout <<
"Warning: Even number of nodes " << n_nod << std::endl;
254 cout <<
"Comparison with exact solution will be misleading..." << std::endl;
259 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
270 Problem::Max_residuals = 1.0e10;
273 double pext_increment = 0.001;
283 doc_info.set_directory(
"RESLT");
286 ofstream trace(
"RESLT/trace_beam.dat");
290 "VARIABLES=\"p_e_x_t\",\"d\"" <<
291 ", \"p_e_x_t_(_e_x_a_c_t_)\"" << std::endl;
300 for(
unsigned i=1;i<=nstep;i++)
314 double exact_pressure = 0.0;
320 double alpha = 2.0*atan(2.0*tanbeta/(1.0-tanbeta*tanbeta));
323 if (alpha<0) alpha+=2.0*MathematicalConstants::Pi;
326 double gamma=0.5*(0.25*alpha*alpha/(sin(0.5*alpha)*sin(0.5*alpha))-1.0);
334 sprintf(filename,
"RESLT/beam%i.dat",i);
343 <<
" " << exact_pressure
357 CommandLineArgs::setup(argc, argv);
360 double stretch_ratio=1.0;
361 CommandLineArgs::specify_command_line_flag(
362 "--stretch_ratio",&stretch_ratio);
366 CommandLineArgs::specify_command_line_flag(
370 CommandLineArgs::parse_and_assign();
373 CommandLineArgs::doc_specified_flags();
383 unsigned n_element = 10;
ElasticBeamProblem(const unsigned &n_elem, const double &length)
Constructor: The arguments are the number of elements, the length of domain.
void parameter_study()
Conduct a parameter study.
GeomObject * Undef_beam_pt
Pointer to geometric object that represents the beam's undeformed shape.
void actions_after_newton_solve()
No actions need to be performed after a solve.
void actions_before_newton_solve()
No actions need to be performed before a solve.
Node * Doc_node_pt
Pointer to the node whose displacement is documented.
OneDLagrangianMesh< HermiteBeamElement > * mesh_pt()
Return pointer to the mesh.
double Length
Length of domain (in terms of the Lagrangian coordinates)
Steady, straight 1D line in 2D space with stretch_ratio.
void operator=(const NewStraightLine &)=delete
Broken assignment operator.
NewStraightLine(const NewStraightLine &dummy)=delete
Broken copy constructor.
virtual void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Posn Vector and its 1st & 2nd derivatives w.r.t. to coordinates: = drdzeta(alpha,...
virtual void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
2nd derivative of position Vector w.r.t. to coordinates: = ddrdzeta(alpha,beta,i)....
NewStraightLine(const double &stretch_ratio=1.0)
Constructor derives from GeomObject(1, 2) Pass stretch_ratio to this class (defaults to 1 in which ca...
virtual void dposition(const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
Derivative of position Vector w.r.t. to coordinates: = drdzeta(alpha,i). Evaluated at current time.
double Stretch_ratio
Define the length of the beam.
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Namespace for physical parameters.
double P_ext
Pressure load.
void load(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Load function: Apply a constant external pressure to the beam.
double Sigma0
2nd Piola Kirchhoff pre-stress
double H
Non-dimensional thickness.
int main()
Driver for beam (string under tension) test problem.