35 #include "meshes/one_d_lagrangian_mesh.h" 39 using namespace oomph;
56 void load(
const Vector<double>& xi,
const Vector<double> &x,
57 const Vector<double>& N, Vector<double>&
load)
59 for(
unsigned i=0;i<2;i++) {load[i] = -P_ext*N[i];}
76 void parameter_study();
79 OneDLagrangianMesh<HermiteBeamElement>*
mesh_pt()
80 {
return dynamic_cast<OneDLagrangianMesh<HermiteBeamElement>*
> 81 (Problem::mesh_pt());}
107 const double &length) : Length(length)
116 new OneDLagrangianMesh<HermiteBeamElement>(n_elem,length,
Undef_beam_pt);
120 for(
unsigned b=0;b<2;b++)
130 mesh_pt()->boundary_node_pt(b,0)->pin_position(0);
131 mesh_pt()->boundary_node_pt(b,0)->pin_position(1);
135 unsigned n_element =
mesh_pt()->nelement();
138 for(
unsigned e=0;e<n_element;e++)
141 HermiteBeamElement *elem_pt =
142 dynamic_cast<HermiteBeamElement*
>(
mesh_pt()->element_pt(e));
159 unsigned n_nod=
mesh_pt()->nnode();
162 cout <<
"Warning: Even number of nodes " << n_nod << std::endl;
163 cout <<
"Comparison with exact solution will be misleading..." << std::endl;
168 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
179 Problem::Max_residuals = 1.0e10;
182 double pext_increment = 0.001;
192 doc_info.set_directory(
"RESLT");
195 ofstream trace(
"RESLT/trace_beam.dat");
199 "VARIABLES=\"p_e_x_t\",\"d\"" <<
200 ", \"p_e_x_t_(_e_x_a_c_t_)\"" << std::endl;
209 for(
unsigned i=1;i<=nstep;i++)
223 double exact_pressure = 0.0;
229 double alpha = 2.0*atan(2.0*tanbeta/(1.0-tanbeta*tanbeta));
232 if (alpha<0) alpha+=2.0*MathematicalConstants::Pi;
235 double gamma=0.5*(0.25*alpha*alpha/(sin(0.5*alpha)*sin(0.5*alpha))-1.0);
243 sprintf(filename,
"RESLT/beam%i.dat",i);
252 <<
" " << exact_pressure
275 unsigned n_element = 10;
281 cout <<
"\n\n\nProblem self-test ";
282 if (problem.self_test()==0)
284 cout <<
"passed: Problem can be solved." << std::endl;
288 throw OomphLibError(
"Self test failed",
289 OOMPH_CURRENT_FUNCTION,
290 OOMPH_EXCEPTION_LOCATION);
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 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.
OneDLagrangianMesh< HermiteBeamElement > * mesh_pt()
Return pointer to the mesh.
double Sigma0
2nd Piola Kirchhoff pre-stress
Node * Doc_node_pt
Pointer to the node whose displacement is documented.
int main()
Driver for beam (string under tension) test problem.
void actions_after_newton_solve()
No actions need to be performed after a solve.
Namespace for physical parameters.
double H
Non-dimensional thickness.
void actions_before_newton_solve()
No actions need to be performed before a solve.
double P_ext
Pressure load.
GeomObject * Undef_beam_pt
Pointer to geometric object that represents the beam's undeformed shape.
double Length
Length of domain (in terms of the Lagrangian coordinates)