31 #include "time_harmonic_linear_elasticity.h"
32 #include "oomph_crbond_bessel.h"
35 #include "meshes/annular_mesh.h"
38 using namespace oomph;
59 TimeHarmonicIsotropicElasticityTensor
E(
Nu);
71 Vector<double> normal(2);
72 double norm=sqrt(x[0]*x[0]+x[1]*x[1]);
85 const Vector<double> &n,
86 Vector<std::complex<double> >&traction)
88 unsigned dim = traction.size();
89 for(
unsigned i=0;i<dim;i++)
91 traction[i] = complex<double>(-
P*n[i],
P*n[i]);
106 double BesselY(
const double& n,
const double& x)
109 double j0,j1,y0,y1,j0p,j1p,y0p,y1p;
110 CRBond_Bessel::bessjy01a(x,j0,j1,y0,y1,j0p,j1p,y0p,y1p);
122 cout <<
"Never get here...";
130 double BesselJ(
const double& n,
const double& x)
134 double j0,j1,y0,y1,j0p,j1p,y0p,y1p;
135 CRBond_Bessel::bessjy01a(x,j0,j1,y0,y1,j0p,j1p,y0p,y1p);
147 cout <<
"Never get here...";
153 void exact_u(
const Vector<double>& x, Vector<double>& u)
155 double r=sqrt(x[0]*x[0]+x[1]*x[1]);
179 MapleGenVar2 = MapleGenVar3-
BesselY(1.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
181 sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))*
P*sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
187 1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))*
P*sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
Nu*
Nu))*
189 MapleGenVar7 =
Nu*omega*
BesselY(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+
193 )/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))-
BesselY(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
195 /(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
196 MapleGenVar6 = MapleGenVar7-
BesselY(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
198 Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))+sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
Nu*
Nu))
199 *
BesselY(1.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu))*(1.0+
203 1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
204 MapleGenVar7 = MapleGenVar6+
BesselJ(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
208 (1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
209 MapleGenVar5 = MapleGenVar7-sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
Nu*
Nu))*
BesselJ(
212 BesselJ(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu))*(1.0+
218 sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
219 MapleGenVar4 = 1/MapleGenVar5;
220 MapleGenVar5 =
BesselJ(1.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+
222 MapleGenVar3 = MapleGenVar4*MapleGenVar5;
223 MapleGenVar1 = MapleGenVar2*MapleGenVar3;
224 MapleGenVar6 = -
Nu*omega*
BesselY(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+
228 )/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))+
BesselY(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
230 /(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
231 MapleGenVar5 = MapleGenVar6+
BesselY(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
233 Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))-sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
Nu*
Nu))
234 *
BesselY(1.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu))*(1.0+
238 Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
239 MapleGenVar6 = MapleGenVar5-
BesselJ(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
243 (1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
244 MapleGenVar4 = MapleGenVar6+sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
Nu*
Nu))*
BesselJ(
247 BesselJ(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu))*(1.0+
253 omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)));
254 MapleGenVar3 = 1/MapleGenVar4;
256 sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))-
P*sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
262 Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)))+2.0*
P*sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
Nu*
Nu))*
265 MapleGenVar7 = MapleGenVar6-
BesselJ(0.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
269 MapleGenVar5 = MapleGenVar7+sqrt(-(1.0-
Nu)/(-1.0+
Nu+2.0*
Nu*
Nu))*
BesselJ(
277 MapleGenVar6 =
BesselY(1.0,omega/sqrt(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+
279 MapleGenVar4 = MapleGenVar5*MapleGenVar6;
280 MapleGenVar2 = MapleGenVar3*MapleGenVar4;
281 t0 = MapleGenVar1+MapleGenVar2;
299 template<
class ELASTICITY_ELEMENT>
315 void actions_before_adapt();
318 void actions_after_adapt();
326 void create_traction_elements();
329 void delete_traction_elements();
355 template<
class ELASTICITY_ELEMENT>
366 double azimuthal_fraction_of_coating=1.0;
372 if (CommandLineArgs::command_line_flag_has_been_set(
"--have_gap"))
375 azimuthal_fraction_of_coating=0.9;
382 RefineableTwoDAnnularMesh<ELASTICITY_ELEMENT>(
383 periodic,azimuthal_fraction_of_coating,
389 Solid_mesh_pt->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
392 Solid_mesh_pt->max_refinement_level()=2;
398 TwoDAnnularMesh<ELASTICITY_ELEMENT>(
399 periodic,azimuthal_fraction_of_coating,
407 Solid_mesh_pt->output(
"solid_mesh.dat");
408 Solid_mesh_pt->output_boundaries(
"solid_mesh_boundary.dat");
413 unsigned n_element =Solid_mesh_pt->nelement();
414 for(
unsigned i=0;i<n_element;i++)
417 ELASTICITY_ELEMENT *el_pt =
418 dynamic_cast<ELASTICITY_ELEMENT*
>(Solid_mesh_pt->element_pt(i));
428 Traction_mesh_pt=
new Mesh;
429 create_traction_elements();
432 add_sub_mesh(Solid_mesh_pt);
435 add_sub_mesh(Traction_mesh_pt);
446 unsigned n_node = Solid_mesh_pt->nboundary_node(b_inner);
452 for(
unsigned i=0;i<n_node;i++)
454 Node* nod_pt=Solid_mesh_pt->boundary_node_pt(b_inner,i);
466 nod_pt->set_value(0,u[0]);
468 nod_pt->set_value(1,u[1]);
470 nod_pt->set_value(2,-u[0]);
472 nod_pt->set_value(3,-u[1]);
476 cout << assign_eqn_numbers() << std::endl;
489 template<
class ELASTICITY_ELEMENT>
493 delete_traction_elements();
496 rebuild_global_mesh();
505 template<
class ELASTICITY_ELEMENT>
510 create_traction_elements();
513 rebuild_global_mesh();
521 template<
class ELASTICITY_ELEMENT>
530 if (!CommandLineArgs::command_line_flag_has_been_set(
"--have_gap"))
536 for (
unsigned b=b_lo;b<=b_hi;b++)
539 unsigned n_element = Solid_mesh_pt->nboundary_element(b);
542 for(
unsigned e=0;e<n_element;e++)
545 ELASTICITY_ELEMENT* bulk_elem_pt =
dynamic_cast<ELASTICITY_ELEMENT*
>(
546 Solid_mesh_pt->boundary_element_pt(b,e));
549 int face_index = Solid_mesh_pt->face_index_at_boundary(b,e);
552 TimeHarmonicLinearElasticityTractionElement<ELASTICITY_ELEMENT>* el_pt=
553 new TimeHarmonicLinearElasticityTractionElement<ELASTICITY_ELEMENT>
554 (bulk_elem_pt,face_index);
557 Traction_mesh_pt->add_element_pt(el_pt);
561 el_pt->set_boundary_number_in_bulk_mesh(b);
576 template<
class ELASTICITY_ELEMENT>
580 unsigned n_element = Traction_mesh_pt->nelement();
583 for(
unsigned e=0;e<n_element;e++)
586 delete Traction_mesh_pt->element_pt(e);
590 Traction_mesh_pt->flush_element_and_node_storage();
601 template<
class ELASTICITY_ELEMENT>
613 sprintf(filename,
"%s/elast_soln%i.dat",Doc_info.directory().c_str(),
615 some_file.open(filename);
616 Solid_mesh_pt->output(some_file,n_plot);
622 sprintf(filename,
"%s/traction_soln%i.dat",Doc_info.directory().c_str(),
624 some_file.open(filename);
625 Traction_mesh_pt->output(some_file,n_plot);
630 sprintf(filename,
"%s/exact_soln%i.dat",Doc_info.directory().c_str(),
632 some_file.open(filename);
646 int main(
int argc,
char **argv)
650 CommandLineArgs::setup(argc,argv);
656 CommandLineArgs::specify_command_line_flag(
661 CommandLineArgs::specify_command_line_flag(
666 CommandLineArgs::specify_command_line_flag(
"--have_gap");
671 unsigned max_adapt=3;
672 CommandLineArgs::specify_command_line_flag(
"--max_adapt",&max_adapt);
676 CommandLineArgs::specify_command_line_flag(
"--nrefine",&nrefine);
681 double p_increment=0.1;
682 CommandLineArgs::specify_command_line_flag(
"--p_increment",&p_increment);
686 CommandLineArgs::specify_command_line_flag(
"--nstep",&nstep);
689 CommandLineArgs::parse_and_assign();
692 CommandLineArgs::doc_specified_flags();
701 for (
unsigned i=0;i<nrefine;i++)
703 problem.refine_uniformly();
718 for(
unsigned i=0;i<nstep;i++)
725 problem.newton_solve(max_adapt);
730 problem.newton_solve();
void actions_before_newton_solve()
Update function (empty)
Mesh * Solid_mesh_pt
Pointer to solid mesh.
void actions_after_newton_solve()
Update function (empty)
void actions_after_adapt()
Actions after adapt: Rebuild the mesh of traction elements.
TreeBasedRefineableMeshBase * Solid_mesh_pt
Pointer to refineable solid mesh.
void doc_solution()
Doc the solution.
void actions_before_adapt()
Actions before adapt: Wipe the mesh of traction elements.
DocInfo Doc_info
DocInfo object for output.
AnnularDiskProblem()
Constructor:
Mesh * Traction_mesh_pt
Pointer to mesh of traction elements.
void delete_traction_elements()
Delete traction elements.
void create_traction_elements()
Create traction elements.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
double Displacement_amplitude
Displacement amplitude on inner radius.
double H_annulus
Thickness of annulus.
unsigned Ntheta
Number of elements in azimuthal direction.
double Nu
Poisson's ratio.
string Directory
Output directory.
double P
Uniform pressure.
double BesselY(const double &n, const double &x)
Helper function to evaluate Y_n(x) from bloody maple output.
void constant_pressure(const Vector< double > &x, const Vector< double > &n, Vector< std::complex< double > > &traction)
Constant pressure load (real and imag part)
void solid_boundary_displacement(const Vector< double > &x, Vector< double > &u)
Real-valued, radial displacement field on inner boundary.
void exact_u(const Vector< double > &x, Vector< double > &u)
Exact solution as a Vector.
double BesselJ(const double &n, const double &x)
Helper function to evaluate J_n(x) from bloody maple output.
TimeHarmonicIsotropicElasticityTensor E(Nu)
The elasticity tensor.
unsigned Nr
Number of elements in radial direction.
double Omega_sq
Square of non-dim frequency.
int main(int argc, char **argv)
Driver for annular disk loaded by pressure.