31 #include "meshes/one_d_lagrangian_mesh.h"
35 using namespace oomph;
52 void load(
const Vector<double>& xi,
const Vector<double> &x,
53 const Vector<double>& N, Vector<double>&
load)
55 for(
unsigned i=0;i<2;i++) {
load[i] = -
P_ext*N[i];}
72 void parameter_study();
75 OneDLagrangianMesh<HermiteBeamElement>*
mesh_pt()
76 {
return dynamic_cast<OneDLagrangianMesh<HermiteBeamElement>*
>
77 (Problem::mesh_pt());}
103 const double &length) : Length(length)
112 new OneDLagrangianMesh<HermiteBeamElement>(n_elem,length,
Undef_beam_pt);
116 for(
unsigned b=0;b<2;b++)
126 mesh_pt()->boundary_node_pt(b,0)->pin_position(0);
127 mesh_pt()->boundary_node_pt(b,0)->pin_position(1);
131 unsigned n_element =
mesh_pt()->nelement();
134 for(
unsigned e=0;e<n_element;e++)
137 HermiteBeamElement *elem_pt =
138 dynamic_cast<HermiteBeamElement*
>(
mesh_pt()->element_pt(e));
155 unsigned n_nod=
mesh_pt()->nnode();
158 cout <<
"Warning: Even number of nodes " << n_nod << std::endl;
159 cout <<
"Comparison with exact solution will be misleading..." << std::endl;
164 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
175 Problem::Max_residuals = 1.0e10;
178 double pext_increment = 0.001;
188 doc_info.set_directory(
"RESLT");
191 ofstream trace(
"RESLT/trace_beam.dat");
195 "VARIABLES=\"p_e_x_t\",\"d\"" <<
196 ", \"p_e_x_t_(_e_x_a_c_t_)\"" << std::endl;
205 for(
unsigned i=1;i<=nstep;i++)
219 double exact_pressure = 0.0;
225 double alpha = 2.0*atan(2.0*tanbeta/(1.0-tanbeta*tanbeta));
228 if (alpha<0) alpha+=2.0*MathematicalConstants::Pi;
231 double gamma=0.5*(0.25*alpha*alpha/(sin(0.5*alpha)*sin(0.5*alpha))-1.0);
239 sprintf(filename,
"RESLT/beam%i.dat",i);
248 <<
" " << exact_pressure
271 unsigned n_element = 10;
277 cout <<
"\n\n\nProblem self-test ";
278 if (problem.self_test()==0)
280 cout <<
"passed: Problem can be solved." << std::endl;
284 throw OomphLibError(
"Self test failed",
285 OOMPH_CURRENT_FUNCTION,
286 OOMPH_EXCEPTION_LOCATION);
GeomObject * Undef_beam_pt
Pointer to geometric object that represents the beam's undeformed shape.
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.
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.
double Length
Length of domain (in terms of the Lagrangian coordinates)
OneDLagrangianMesh< HermiteBeamElement > * mesh_pt()
Return pointer to the mesh.
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.