194 double azimuthal_fraction_of_coating=0.5;
195 double phi=0.5*MathematicalConstants::Pi;
210 TwoDAnnularMesh<ELASTICITY_ELEMENT>(periodic,azimuthal_fraction_of_coating,
211 ntheta_solid,nr_solid,a,
231 Helmholtz_mesh_pt =
new TwoDAnnularMesh<HELMHOLTZ_ELEMENT>
232 (periodic,azimuthal_fraction_of_coating,
233 ntheta_helmholtz,nr_helmholtz,a,h_thick_helmholtz,phi);
237 unsigned nfourier=20;
238 Helmholtz_DtN_mesh_pt=
239 new FourierDecomposedHelmholtzDtNMesh<HELMHOLTZ_ELEMENT>(
243 unsigned nel=Solid_mesh_pt->nelement();
244 for (
unsigned e=0;e<nel;e++)
247 ELASTICITY_ELEMENT* el_pt=
dynamic_cast<ELASTICITY_ELEMENT*
>(
248 Solid_mesh_pt->element_pt(e));
261 unsigned n_element = Helmholtz_mesh_pt->nelement();
262 for(
unsigned i=0;i<n_element;i++)
265 HELMHOLTZ_ELEMENT *el_pt =
dynamic_cast<HELMHOLTZ_ELEMENT*
>(
266 Helmholtz_mesh_pt->element_pt(i));
277 Solid_mesh_pt->output(
"solid_mesh.dat");
278 Helmholtz_mesh_pt->output(
"helmholtz_mesh.dat");
279 Solid_mesh_pt->output_boundaries(
"solid_mesh_boundary.dat");
280 Helmholtz_mesh_pt->output_boundaries(
"helmholtz_mesh_boundary.dat");
286 FSI_traction_mesh_pt=
new Mesh;
287 create_fsi_traction_elements();
290 Helmholtz_fsi_flux_mesh_pt=
new Mesh;
291 create_helmholtz_fsi_flux_elements();
294 create_helmholtz_DtN_elements();
299 add_sub_mesh(Solid_mesh_pt);
300 add_sub_mesh(FSI_traction_mesh_pt);
301 add_sub_mesh(Helmholtz_mesh_pt);
302 add_sub_mesh(Helmholtz_fsi_flux_mesh_pt);
303 add_sub_mesh(Helmholtz_DtN_mesh_pt);
314 unsigned n_node = Solid_mesh_pt->nboundary_node(b);
316 Vector<std::complex<double> > u(2);
321 for(
unsigned i=0;i<n_node;i++)
323 Node* nod_pt=Solid_mesh_pt->boundary_node_pt(b,i);
337 nod_pt->set_value(0,u[0].real());
339 nod_pt->set_value(1,u[1].real());
341 nod_pt->set_value(2,0.0);
343 nod_pt->set_value(3,u[0].imag());
345 nod_pt->set_value(4,u[1].imag());
347 nod_pt->set_value(5,0.0);
354 unsigned num_nod= Solid_mesh_pt->nboundary_node(ibound);
355 for (
unsigned inod=0;inod<num_nod;inod++)
358 Node* nod_pt=Solid_mesh_pt->boundary_node_pt(ibound,inod);
362 nod_pt->set_value(0,0.0);
364 nod_pt->set_value(3,0.0);
368 nod_pt->set_value(2,0.0);
370 nod_pt->set_value(5,0.0);
380 unsigned num_nod= Solid_mesh_pt->nboundary_node(ibound);
381 for (
unsigned inod=0;inod<num_nod;inod++)
384 Node* nod_pt=Solid_mesh_pt->boundary_node_pt(ibound,inod);
388 nod_pt->set_value(0,0.0);
390 nod_pt->set_value(3,0.0);
394 nod_pt->set_value(2,0.0);
396 nod_pt->set_value(5,0.0);
408 Trace_file.open(filename);
411 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
428 unsigned n_element = Helmholtz_mesh_pt->nboundary_element(b);
429 for(
unsigned e=0;e<n_element;e++)
432 HELMHOLTZ_ELEMENT* bulk_elem_pt =
dynamic_cast<HELMHOLTZ_ELEMENT*
>(
433 Helmholtz_mesh_pt->boundary_element_pt(b,e));
436 int face_index = Helmholtz_mesh_pt->face_index_at_boundary(b,e);
439 FourierDecomposedHelmholtzDtNBoundaryElement<HELMHOLTZ_ELEMENT>*
440 flux_element_pt =
new
441 FourierDecomposedHelmholtzDtNBoundaryElement<HELMHOLTZ_ELEMENT>
442 (bulk_elem_pt,face_index);
445 Helmholtz_DtN_mesh_pt->add_element_pt(flux_element_pt);
449 flux_element_pt->set_outer_boundary_mesh_pt(Helmholtz_DtN_mesh_pt);
467 unsigned boundary_in_helmholtz_mesh=0;
471 the_file.open(
"boundary_coordinate_hh.dat");
472 Helmholtz_mesh_pt->Mesh::template doc_boundary_coordinates<HELMHOLTZ_ELEMENT>
473 (boundary_in_helmholtz_mesh, the_file);
477 Multi_domain_functions::setup_bulk_elements_adjacent_to_face_mesh
478 <HELMHOLTZ_ELEMENT,2>
479 (
this,boundary_in_helmholtz_mesh,Helmholtz_mesh_pt,FSI_traction_mesh_pt);
482 unsigned boundary_in_solid_mesh=2;
485 the_file.open(
"boundary_coordinate_solid.dat");
486 Solid_mesh_pt->Mesh::template doc_boundary_coordinates<ELASTICITY_ELEMENT>
487 (boundary_in_solid_mesh, the_file);
491 Multi_domain_functions::setup_bulk_elements_adjacent_to_face_mesh
492 <ELASTICITY_ELEMENT,2>(
493 this,boundary_in_solid_mesh,Solid_mesh_pt,Helmholtz_fsi_flux_mesh_pt);
512 unsigned n_element = Solid_mesh_pt->nboundary_element(b);
515 for(
unsigned e=0;e<n_element;e++)
518 ELASTICITY_ELEMENT* bulk_elem_pt =
dynamic_cast<ELASTICITY_ELEMENT*
>(
519 Solid_mesh_pt->boundary_element_pt(b,e));
522 int face_index = Solid_mesh_pt->face_index_at_boundary(b,e);
525 FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement
526 <ELASTICITY_ELEMENT,HELMHOLTZ_ELEMENT>* el_pt=
527 new FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement
528 <ELASTICITY_ELEMENT,HELMHOLTZ_ELEMENT>(bulk_elem_pt,
531 FSI_traction_mesh_pt->add_element_pt(el_pt);
535 el_pt->set_boundary_number_in_bulk_mesh(b);
557 unsigned n_element = Helmholtz_mesh_pt->nboundary_element(b);
560 for(
unsigned e=0;e<n_element;e++)
563 HELMHOLTZ_ELEMENT* bulk_elem_pt =
dynamic_cast<HELMHOLTZ_ELEMENT*
>(
564 Helmholtz_mesh_pt->boundary_element_pt(b,e));
567 int face_index = Helmholtz_mesh_pt->face_index_at_boundary(b,e);
570 FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement
571 <HELMHOLTZ_ELEMENT,ELASTICITY_ELEMENT>* el_pt=
572 new FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement
573 <HELMHOLTZ_ELEMENT,ELASTICITY_ELEMENT>(bulk_elem_pt,
577 Helmholtz_fsi_flux_mesh_pt->add_element_pt(el_pt);
581 el_pt->set_boundary_number_in_bulk_mesh(b);
597 oomph_info <<
"Writing result for step " << doc_info.number()
598 <<
". Parameters: "<< std::endl;
599 oomph_info <<
"Fourier mode number : N = "
607 << std::endl << std::endl;
610 ofstream some_file,some_file2;
618 snprintf(filename,
sizeof(filename),
"%s/power%i.dat",doc_info.directory().c_str(),
620 some_file.open(filename);
624 unsigned nn_element=Helmholtz_DtN_mesh_pt->nelement();
625 for(
unsigned e=0;e<nn_element;e++)
627 FourierDecomposedHelmholtzBCElementBase<HELMHOLTZ_ELEMENT> *el_pt =
628 dynamic_cast<FourierDecomposedHelmholtzBCElementBase<HELMHOLTZ_ELEMENT>*
>(
629 Helmholtz_DtN_mesh_pt->element_pt(e));
630 power += el_pt->global_power_contribution(some_file);
633 oomph_info <<
"Radiated power: " << power << std::endl;
637 snprintf(filename,
sizeof(filename),
"%s/elast_soln%i.dat",doc_info.directory().c_str(),
639 some_file.open(filename);
640 Solid_mesh_pt->output(some_file,n_plot);
645 snprintf(filename,
sizeof(filename),
"%s/helmholtz_soln%i.dat",doc_info.directory().c_str(),
647 some_file.open(filename);
648 Helmholtz_mesh_pt->output(some_file,n_plot);
654 snprintf(filename,
sizeof(filename),
"%s/fsi_traction_soln%i.dat",doc_info.directory().c_str(),
656 some_file.open(filename);
657 FSI_traction_mesh_pt->output(some_file,n_plot);
663 snprintf(filename,
sizeof(filename),
"%s/fsi_flux_bc_soln%i.dat",doc_info.directory().c_str(),
665 some_file.open(filename);
666 Helmholtz_fsi_flux_mesh_pt->output(some_file,n_plot);
691 CommandLineArgs::setup(argc,argv);
697 CommandLineArgs::specify_command_line_flag(
"--dir",
701 CommandLineArgs::specify_command_line_flag(
"--k_squared",
705 CommandLineArgs::specify_command_line_flag(
"--q_initial",
710 CommandLineArgs::specify_command_line_flag(
"--nstep",&nstep);
713 double q_increment=5.0;
714 CommandLineArgs::specify_command_line_flag(
"--q_increment",&q_increment);
719 CommandLineArgs::specify_command_line_flag(
"--M",
723 CommandLineArgs::specify_command_line_flag(
"--el_multiplier",
727 CommandLineArgs::parse_and_assign();
730 CommandLineArgs::doc_specified_flags();
743 QFourierDecomposedHelmholtzElement<3> > problem;
746 for(
unsigned i=0;i<nstep;i++)
749 problem.newton_solve();