fourier_decomposed_acoustic_fsi.cc
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Copyright (C) 2006-2024 Matthias Heil and Andrew Hazel
7 //LIC//
8 //LIC// This library is free software; you can redistribute it and/or
9 //LIC// modify it under the terms of the GNU Lesser General Public
10 //LIC// License as published by the Free Software Foundation; either
11 //LIC// version 2.1 of the License, or (at your option) any later version.
12 //LIC//
13 //LIC// This library is distributed in the hope that it will be useful,
14 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 //LIC// Lesser General Public License for more details.
17 //LIC//
18 //LIC// You should have received a copy of the GNU Lesser General Public
19 //LIC// License along with this library; if not, write to the Free Software
20 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 //LIC// 02110-1301 USA.
22 //LIC//
23 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 //LIC//
25 //LIC//====================================================================
26 // Driver for Helmholtz/TimeHarmonicTimeHarmonicLinElast coupling
27 #include <complex>
28 #include <cmath>
29 
30 //Oomph-lib includes
31 #include "generic.h"
32 
33 //The Helmholtz equation
34 #include "fourier_decomposed_helmholtz.h"
35 
36 //The Elasticity equation
37 #include "time_harmonic_fourier_decomposed_linear_elasticity.h"
38 
39 // The interaction elements
40 #include "multi_physics.h"
41 
42 // The mesh
43 #include "meshes/annular_mesh.h"
44 
45 // Get the Bessel functions
46 #include "oomph_crbond_bessel.h"
47 
48 using namespace oomph;
49 using namespace std;
50 
51 
52 /// ///////////////////////////////////////////////////////////////////
53 /// ///////////////////////////////////////////////////////////////////
54 /// ///////////////////////////////////////////////////////////////////
55 
56 
57 //=======start_of_namespace==========================================
58 /// Global variables
59 //===================================================================
61 {
62 
63  /// Square of wavenumber for the Helmholtz equation
64  double K_squared=10.0;
65 
66  /// Radius of outer boundary of Helmholtz domain
67  double Outer_radius=2.0;
68 
69  /// FSI parameter
70  double Q=10.0;
71 
72  /// Non-dim thickness of elastic coating
73  double H_coating=0.2;
74 
75  /// Define azimuthal Fourier wavenumber
77 
78  /// Poisson's ratio Nu
79  std::complex<double> Nu(std::complex<double>(0.3,0.0));
80 
81  /// Non-dim square of frequency for solid -- dependent variable!
82  std::complex<double> Omega_sq(std::complex<double>(100.0,0.0));
83 
84  /// Density ratio: solid to fluid
85  double Density_ratio=1.0;
86 
87  /// Function to update dependent parameter values
89  {
91  }
92 
93  /// Wavenumber "zenith"-variation of imposed displacement of coating
94  /// on inner boundary
95  unsigned M=4;
96 
97  /// Displacement field on inner boundary of solid
98  void solid_boundary_displacement(const Vector<double>& x,
99  Vector<std::complex<double> >& u)
100  {
101  Vector<double> normal(2);
102  double norm=sqrt(x[0]*x[0]+x[1]*x[1]);
103  double theta=atan2(x[1],x[0]);
104  normal[0]=x[0]/norm;
105  normal[1]=x[1]/norm;
106 
107  u[0]=complex<double>(normal[0]*cos(double(M)*theta),0.0);
108  u[1]=complex<double>(normal[1]*cos(double(M)*theta),0.0);
109  }
110 
111 
112  /// Output directory
113  string Directory="RESLT";
114 
115  /// Multiplier for number of elements
116  unsigned El_multiplier=1;
117 
118 } //end_of_namespace
119 
120 
121 
122 //=============start_of_problem_class===================================
123 /// Coated sphere FSI
124 //======================================================================
125 template<class ELASTICITY_ELEMENT, class HELMHOLTZ_ELEMENT>
126 class CoatedSphereProblem : public Problem
127 {
128 
129 public:
130 
131  /// Constructor:
133 
134  /// Update function (empty)
136 
137  /// Update function (empty)
139 
140  /// Recompute gamma integral before checking Newton residuals
142  {
143  Helmholtz_DtN_mesh_pt->setup_gamma();
144  }
145 
146  /// Doc the solution
147  void doc_solution(DocInfo& doc_info);
148 
149 private:
150 
151  /// Create FSI traction elements
152  void create_fsi_traction_elements();
153 
154  /// Create Helmholtz FSI flux elements
155  void create_helmholtz_fsi_flux_elements();
156 
157  /// Setup interaction
158  void setup_interaction();
159 
160  /// Create DtN elements on outer boundary
161  void create_helmholtz_DtN_elements();
162 
163  /// Pointer to solid mesh
164  TwoDAnnularMesh<ELASTICITY_ELEMENT>* Solid_mesh_pt;
165 
166  /// Pointer to mesh of FSI traction elements
168 
169  /// Pointer to Helmholtz mesh
170  TwoDAnnularMesh<HELMHOLTZ_ELEMENT>* Helmholtz_mesh_pt;
171 
172  /// Pointer to mesh of Helmholtz FSI flux elements
174 
175  /// Pointer to mesh containing the DtN elements
176  FourierDecomposedHelmholtzDtNMesh<HELMHOLTZ_ELEMENT>* Helmholtz_DtN_mesh_pt;
177 
178  /// Trace file
179  ofstream Trace_file;
180 
181 };// end_of_problem_class
182 
183 
184 //===========start_of_constructor=======================================
185 /// Constructor:
186 //======================================================================
187 template<class ELASTICITY_ELEMENT, class HELMHOLTZ_ELEMENT>
190 {
191 
192  // Parameters for meshes
193  bool periodic=false;
194  double azimuthal_fraction_of_coating=0.5;
195  double phi=0.5*MathematicalConstants::Pi;
196 
197  // Solid mesh
198  //-----------
199  // Number of elements in azimuthal direction
200  unsigned ntheta_solid=10*Global_Parameters::El_multiplier;
201 
202  // Number of elements in radial direction
203  unsigned nr_solid=3*Global_Parameters::El_multiplier;
204 
205  // Innermost radius for solid mesh
206  double a=1.0-Global_Parameters::H_coating;
207 
208  // Build solid mesh
209  Solid_mesh_pt = new
210  TwoDAnnularMesh<ELASTICITY_ELEMENT>(periodic,azimuthal_fraction_of_coating,
211  ntheta_solid,nr_solid,a,
213 
214 
215  // Helmholtz mesh
216  //---------------
217 
218  // Number of elements in azimuthal direction in Helmholtz mesh
219  unsigned ntheta_helmholtz=11*Global_Parameters::El_multiplier;
220 
221  // Number of elements in radial direction in Helmholtz mesh
222  unsigned nr_helmholtz=3*Global_Parameters::El_multiplier;
223 
224  // Innermost radius of Helmholtz mesh
225  a=1.0;
226 
227  // Thickness of Helmholtz mesh
228  double h_thick_helmholtz=Global_Parameters::Outer_radius-a;
229 
230  // Build mesh
231  Helmholtz_mesh_pt = new TwoDAnnularMesh<HELMHOLTZ_ELEMENT>
232  (periodic,azimuthal_fraction_of_coating,
233  ntheta_helmholtz,nr_helmholtz,a,h_thick_helmholtz,phi);
234 
235 
236  // Create mesh for DtN elements on outer boundary
237  unsigned nfourier=20;
238  Helmholtz_DtN_mesh_pt=
239  new FourierDecomposedHelmholtzDtNMesh<HELMHOLTZ_ELEMENT>(
241 
242  // Complete the solid problem setup to make the elements fully functional
243  unsigned nel=Solid_mesh_pt->nelement();
244  for (unsigned e=0;e<nel;e++)
245  {
246  // Cast to a bulk element
247  ELASTICITY_ELEMENT* el_pt=dynamic_cast<ELASTICITY_ELEMENT*>(
248  Solid_mesh_pt->element_pt(e));
249 
250  // Set the pointer to Fourier wavenumber
251  el_pt->fourier_wavenumber_pt() = &Global_Parameters::Fourier_wavenumber;
252 
253  // Set the pointer to Poisson's ratio
254  el_pt->nu_pt() = &Global_Parameters::Nu;
255 
256  // Set the pointer to square of the angular frequency
257  el_pt->omega_sq_pt() = &Global_Parameters::Omega_sq;
258  }
259 
260  // Complete the build of all Helmholtz elements so they are fully functional
261  unsigned n_element = Helmholtz_mesh_pt->nelement();
262  for(unsigned i=0;i<n_element;i++)
263  {
264  // Upcast from GeneralsedElement to the present element
265  HELMHOLTZ_ELEMENT *el_pt = dynamic_cast<HELMHOLTZ_ELEMENT*>(
266  Helmholtz_mesh_pt->element_pt(i));
267 
268  //Set the k_squared pointer
269  el_pt->k_squared_pt()=&Global_Parameters::K_squared;
270 
271  // Set pointer to Fourier wave number
272  el_pt->fourier_wavenumber_pt()=&Global_Parameters::Fourier_wavenumber;
273  }
274 
275  // Output meshes and their boundaries so far so we can double
276  // check the boundary enumeration
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");
281 
282  // Create FaceElement meshes for boundary conditions
283  //--------------------------------------------------
284 
285  // Construct the fsi traction element mesh
286  FSI_traction_mesh_pt=new Mesh;
287  create_fsi_traction_elements();
288 
289  // Construct the Helmholtz fsi flux element mesh
290  Helmholtz_fsi_flux_mesh_pt=new Mesh;
291  create_helmholtz_fsi_flux_elements();
292 
293  // Create DtN elements
294  create_helmholtz_DtN_elements();
295 
296 
297  // Combine sub meshes
298  //-------------------
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);
304 
305  // Build the Problem's global mesh from its various sub-meshes
306  build_global_mesh();
307 
308 
309  // Solid boundary conditions:
310  //---------------------------
311 
312  // Pin the solid inner boundary (boundary 0) in all directions
313  unsigned b=0;
314  unsigned n_node = Solid_mesh_pt->nboundary_node(b);
315 
316  Vector<std::complex<double> > u(2);
317  Vector<double> x(2);
318 
319  //Loop over the nodes to pin and assign boundary displacements on
320  //solid boundary
321  for(unsigned i=0;i<n_node;i++)
322  {
323  Node* nod_pt=Solid_mesh_pt->boundary_node_pt(b,i);
324  nod_pt->pin(0);
325  nod_pt->pin(1);
326  nod_pt->pin(2);
327  nod_pt->pin(3);
328  nod_pt->pin(4);
329  nod_pt->pin(5);
330 
331  // Assign prescribed displacements
332  x[0]=nod_pt->x(0);
333  x[1]=nod_pt->x(1);
335 
336  // Real part of radial displacement
337  nod_pt->set_value(0,u[0].real());
338  // Real part of axial displacement
339  nod_pt->set_value(1,u[1].real());
340  // Real part of azimuthal displacement
341  nod_pt->set_value(2,0.0);
342  // Imag part of radial displacement
343  nod_pt->set_value(3,u[0].imag());
344  // Imag part of axial displacement
345  nod_pt->set_value(4,u[1].imag());
346  // Imag part of azimuthal displacement
347  nod_pt->set_value(5,0.0);
348  }
349 
350  // Vertical Symmetry boundary (r=0 and z<0)
351  {
352  unsigned ibound=1;
353  {
354  unsigned num_nod= Solid_mesh_pt->nboundary_node(ibound);
355  for (unsigned inod=0;inod<num_nod;inod++)
356  {
357  // Get pointer to node
358  Node* nod_pt=Solid_mesh_pt->boundary_node_pt(ibound,inod);
359 
360  // Pin radial displacement (u_0 (real) and u_3 (imag))
361  nod_pt->pin(0);
362  nod_pt->set_value(0,0.0);
363  nod_pt->pin(3);
364  nod_pt->set_value(3,0.0);
365 
366  // Pin azimuthal displacement (u_2 (real) and u_5 (imag))
367  nod_pt->pin(2);
368  nod_pt->set_value(2,0.0);
369  nod_pt->pin(5);
370  nod_pt->set_value(5,0.0);
371  }
372  }
373  }
374 
375 
376  // Vertical Symmetry boundary (r=0 and z>0)
377  {
378  unsigned ibound=3;
379  {
380  unsigned num_nod= Solid_mesh_pt->nboundary_node(ibound);
381  for (unsigned inod=0;inod<num_nod;inod++)
382  {
383  // Get pointer to node
384  Node* nod_pt=Solid_mesh_pt->boundary_node_pt(ibound,inod);
385 
386  // Pin radial displacement (u_0 (real) and u_3 (imag))
387  nod_pt->pin(0);
388  nod_pt->set_value(0,0.0);
389  nod_pt->pin(3);
390  nod_pt->set_value(3,0.0);
391 
392  // Pin azimuthal displacement (u_2 (real) and u_5 (imag))
393  nod_pt->pin(2);
394  nod_pt->set_value(2,0.0);
395  nod_pt->pin(5);
396  nod_pt->set_value(5,0.0);
397  }
398  }
399  } // done sym bc
400 
401  // Setup fluid-structure interaction
402  //----------------------------------
403  setup_interaction();
404 
405  // Open trace file
406  char filename[100];
407  sprintf(filename,"%s/trace.dat",Global_Parameters::Directory.c_str());
408  Trace_file.open(filename);
409 
410  // Setup equation numbering scheme
411  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
412 
413 }//end_of_constructor
414 
415 
416 
417 //============start_of_create_outer_bc_elements===========================
418 /// Create BC elements on outer boundary
419 //========================================================================
420 template<class ELASTICITY_ELEMENT, class HELMHOLTZ_ELEMENT>
423 {
424  // Outer boundary is boundary 2:
425  unsigned b=2;
426 
427  // Loop over the bulk elements adjacent to boundary b?
428  unsigned n_element = Helmholtz_mesh_pt->nboundary_element(b);
429  for(unsigned e=0;e<n_element;e++)
430  {
431  // Get pointer to the bulk element that is adjacent to boundary b
432  HELMHOLTZ_ELEMENT* bulk_elem_pt = dynamic_cast<HELMHOLTZ_ELEMENT*>(
433  Helmholtz_mesh_pt->boundary_element_pt(b,e));
434 
435  //Find the index of the face of element e along boundary b
436  int face_index = Helmholtz_mesh_pt->face_index_at_boundary(b,e);
437 
438  // Build the corresponding DtN element
439  FourierDecomposedHelmholtzDtNBoundaryElement<HELMHOLTZ_ELEMENT>*
440  flux_element_pt = new
441  FourierDecomposedHelmholtzDtNBoundaryElement<HELMHOLTZ_ELEMENT>
442  (bulk_elem_pt,face_index);
443 
444  //Add the flux boundary element to the helmholtz_DtN_mesh
445  Helmholtz_DtN_mesh_pt->add_element_pt(flux_element_pt);
446 
447  // Set pointer to the mesh that contains all the boundary condition
448  // elements on this boundary
449  flux_element_pt->set_outer_boundary_mesh_pt(Helmholtz_DtN_mesh_pt);
450  }
451 
452 } // end_of_create_outer_bc_elements
453 
454 
455 
456 
457 
458 //=====================start_of_setup_interaction======================
459 /// Setup interaction between two fields
460 //========================================================================
461 template<class ELASTICITY_ELEMENT, class HELMHOLTZ_ELEMENT>
464 {
465 
466  // Setup Helmholtz "pressure" load on traction elements
467  unsigned boundary_in_helmholtz_mesh=0;
468 
469  // Doc boundary coordinate for Helmholtz
470  ofstream the_file;
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);
474  the_file.close();
475 
476  // Setup interaction
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);
480 
481  // Setup Helmholtz flux from normal displacement interaction
482  unsigned boundary_in_solid_mesh=2;
483 
484  // Doc boundary coordinate for solid mesh
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);
488  the_file.close();
489 
490  // Setup interaction
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);
494 
495 }// end_of_setup_interaction
496 
497 
498 
499 
500 
501 //============start_of_create_fsi_traction_elements======================
502 /// Create fsi traction elements
503 //=======================================================================
504 template<class ELASTICITY_ELEMENT, class HELMHOLTZ_ELEMENT>
507 {
508  // We're on boundary 2 of the solid mesh
509  unsigned b=2;
510 
511  // How many bulk elements are adjacent to boundary b?
512  unsigned n_element = Solid_mesh_pt->nboundary_element(b);
513 
514  // Loop over the bulk elements adjacent to boundary b
515  for(unsigned e=0;e<n_element;e++)
516  {
517  // Get pointer to the bulk element that is adjacent to boundary b
518  ELASTICITY_ELEMENT* bulk_elem_pt = dynamic_cast<ELASTICITY_ELEMENT*>(
519  Solid_mesh_pt->boundary_element_pt(b,e));
520 
521  //Find the index of the face of element e along boundary b
522  int face_index = Solid_mesh_pt->face_index_at_boundary(b,e);
523 
524  // Create element
525  FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement
526  <ELASTICITY_ELEMENT,HELMHOLTZ_ELEMENT>* el_pt=
527  new FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement
528  <ELASTICITY_ELEMENT,HELMHOLTZ_ELEMENT>(bulk_elem_pt,
529  face_index);
530  // Add to mesh
531  FSI_traction_mesh_pt->add_element_pt(el_pt);
532 
533  // Associate element with bulk boundary (to allow it to access
534  // the boundary coordinates in the bulk mesh)
535  el_pt->set_boundary_number_in_bulk_mesh(b);
536 
537  // Set FSI parameter
538  el_pt->q_pt()=&Global_Parameters::Q;
539  }
540 
541 } // end_of_create_fsi_traction_elements
542 
543 
544 
545 //============start_of_create_helmholtz_fsi_flux_elements================
546 /// Create Helmholtz fsi flux elements
547 //=======================================================================
548 template<class ELASTICITY_ELEMENT, class HELMHOLTZ_ELEMENT>
551 {
552 
553  // Attach to inner boundary of Helmholtz mesh (0)
554  unsigned b=0;
555 
556  // How many bulk elements are adjacent to boundary b?
557  unsigned n_element = Helmholtz_mesh_pt->nboundary_element(b);
558 
559  // Loop over the bulk elements adjacent to boundary b
560  for(unsigned e=0;e<n_element;e++)
561  {
562  // Get pointer to the bulk element that is adjacent to boundary b
563  HELMHOLTZ_ELEMENT* bulk_elem_pt = dynamic_cast<HELMHOLTZ_ELEMENT*>(
564  Helmholtz_mesh_pt->boundary_element_pt(b,e));
565 
566  //Find the index of the face of element e along boundary b
567  int face_index = Helmholtz_mesh_pt->face_index_at_boundary(b,e);
568 
569  // Create element
570  FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement
571  <HELMHOLTZ_ELEMENT,ELASTICITY_ELEMENT>* el_pt=
572  new FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement
573  <HELMHOLTZ_ELEMENT,ELASTICITY_ELEMENT>(bulk_elem_pt,
574  face_index);
575 
576  // Add to mesh
577  Helmholtz_fsi_flux_mesh_pt->add_element_pt(el_pt);
578 
579  // Associate element with bulk boundary (to allow it to access
580  // the boundary coordinates in the bulk mesh)
581  el_pt->set_boundary_number_in_bulk_mesh(b);
582  }
583 
584 } // end_of_create_helmholtz_fsi_flux_elements
585 
586 
587 
588 //==============start_of_doc_solution===============================
589 /// Doc the solution
590 //==================================================================
591 template<class ELASTICITY_ELEMENT, class HELMHOLTZ_ELEMENT>
593 doc_solution(DocInfo& doc_info)
594 {
595 
596  // Doc parameters
597  oomph_info << "Writing result for step " << doc_info.number()
598  << ". Parameters: "<< std::endl;
599  oomph_info << "Fourier mode number : N = "
601  oomph_info << "FSI parameter : Q = " << Global_Parameters::Q << std::endl;
602  oomph_info << "Fluid outer radius : R = " << Global_Parameters::Outer_radius
603  << std::endl;
604  oomph_info << "Fluid wavenumber : k^2 = " << Global_Parameters::K_squared
605  << std::endl;
606  oomph_info << "Solid wavenumber : Omega_sq = " << Global_Parameters::Omega_sq
607  << std::endl << std::endl;
608 
609 
610  ofstream some_file,some_file2;
611  char filename[100];
612 
613  // Number of plot points
614  unsigned n_plot=5;
615 
616  // Compute/output the radiated power
617  //----------------------------------
618  sprintf(filename,"%s/power%i.dat",doc_info.directory().c_str(),
619  doc_info.number());
620  some_file.open(filename);
621 
622  // Accumulate contribution from elements
623  double power=0.0;
624  unsigned nn_element=Helmholtz_DtN_mesh_pt->nelement();
625  for(unsigned e=0;e<nn_element;e++)
626  {
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);
631  }
632  some_file.close();
633  oomph_info << "Radiated power: " << power << std::endl;
634 
635  // Output displacement field
636  //--------------------------
637  sprintf(filename,"%s/elast_soln%i.dat",doc_info.directory().c_str(),
638  doc_info.number());
639  some_file.open(filename);
640  Solid_mesh_pt->output(some_file,n_plot);
641  some_file.close();
642 
643  // Output Helmholtz
644  //-----------------
645  sprintf(filename,"%s/helmholtz_soln%i.dat",doc_info.directory().c_str(),
646  doc_info.number());
647  some_file.open(filename);
648  Helmholtz_mesh_pt->output(some_file,n_plot);
649  some_file.close();
650 
651 
652  // Output fsi traction elements
653  //-----------------------------
654  sprintf(filename,"%s/fsi_traction_soln%i.dat",doc_info.directory().c_str(),
655  doc_info.number());
656  some_file.open(filename);
657  FSI_traction_mesh_pt->output(some_file,n_plot);
658  some_file.close();
659 
660 
661  // Output Helmholtz fsi flux elements
662  //-----------------------------------
663  sprintf(filename,"%s/fsi_flux_bc_soln%i.dat",doc_info.directory().c_str(),
664  doc_info.number());
665  some_file.open(filename);
666  Helmholtz_fsi_flux_mesh_pt->output(some_file,n_plot);
667  some_file.close();
668 
669  // Write trace file
670  Trace_file << Global_Parameters::Q << " "
673  << Global_Parameters::Omega_sq.real() << " "
674  << power << " "
675  << std::endl;
676 
677  // Bump up counter
678  doc_info.number()++;
679 
680 } //end_of_doc_solution
681 
682 
683 
684 //=======start_of_main==================================================
685 /// Driver for coated sphere loaded by lineared fluid loading
686 //======================================================================
687 int main(int argc, char **argv)
688 {
689 
690  // Store command line arguments
691  CommandLineArgs::setup(argc,argv);
692 
693  // Define possible command line arguments and parse the ones that
694  // were actually specified
695 
696  // Output directory
697  CommandLineArgs::specify_command_line_flag("--dir",
699 
700  // Parameter for the Helmholtz equation
701  CommandLineArgs::specify_command_line_flag("--k_squared",
703 
704  // Initial value of Q
705  CommandLineArgs::specify_command_line_flag("--q_initial",
707 
708  // Number of steps in parameter study
709  unsigned nstep=2;
710  CommandLineArgs::specify_command_line_flag("--nstep",&nstep);
711 
712  // Increment in FSI parameter in parameter study
713  double q_increment=5.0;
714  CommandLineArgs::specify_command_line_flag("--q_increment",&q_increment);
715 
716 
717  // Wavenumber "zenith"-variation of imposed displacement of coating
718  // on inner boundary
719  CommandLineArgs::specify_command_line_flag("--M",
721 
722  // Multiplier for number of elements
723  CommandLineArgs::specify_command_line_flag("--el_multiplier",
725 
726  // Parse command line
727  CommandLineArgs::parse_and_assign();
728 
729  // Doc what has actually been specified on the command line
730  CommandLineArgs::doc_specified_flags();
731 
732  // Update dependent parameters values
734 
735  // Set up doc info
736  DocInfo doc_info;
737 
738  // Set output directory
739  doc_info.set_directory(Global_Parameters::Directory);
740 
741  // Set up the problem
743  QFourierDecomposedHelmholtzElement<3> > problem;
744 
745  //Parameter incrementation
746  for(unsigned i=0;i<nstep;i++)
747  {
748  // Solve the problem with Newton's method
749  problem.newton_solve();
750 
751  // Doc solution
752  problem.doc_solution(doc_info);
753 
754  // Increment FSI parameter
755  Global_Parameters::Q+=q_increment;
757  }
758 
759 } //end_of_main
760 
761 
762 
763 
764 
765 
766 
767 
void create_fsi_traction_elements()
Create FSI traction elements.
void actions_before_newton_convergence_check()
Recompute gamma integral before checking Newton residuals.
Mesh * FSI_traction_mesh_pt
Pointer to mesh of FSI traction elements.
TwoDAnnularMesh< ELASTICITY_ELEMENT > * Solid_mesh_pt
Pointer to solid mesh.
TwoDAnnularMesh< HELMHOLTZ_ELEMENT > * Helmholtz_mesh_pt
Pointer to Helmholtz mesh.
void create_helmholtz_DtN_elements()
Create DtN elements on outer boundary.
void create_helmholtz_fsi_flux_elements()
Create Helmholtz FSI flux elements.
void actions_before_newton_solve()
Update function (empty)
void doc_solution(DocInfo &doc_info)
Doc the solution.
FourierDecomposedHelmholtzDtNMesh< HELMHOLTZ_ELEMENT > * Helmholtz_DtN_mesh_pt
Pointer to mesh containing the DtN elements.
void actions_after_newton_solve()
Update function (empty)
void setup_interaction()
Setup interaction.
Mesh * Helmholtz_fsi_flux_mesh_pt
Pointer to mesh of Helmholtz FSI flux elements.
int main(int argc, char **argv)
Driver for coated sphere loaded by lineared fluid loading.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
string Directory
Output directory.
unsigned El_multiplier
Multiplier for number of elements.
std::complex< double > Nu(std::complex< double >(0.3, 0.0))
Poisson's ratio Nu.
double Density_ratio
Density ratio: solid to fluid.
double Outer_radius
Radius of outer boundary of Helmholtz domain.
std::complex< double > Omega_sq(std::complex< double >(100.0, 0.0))
Non-dim square of frequency for solid – dependent variable!
double K_squared
Square of wavenumber for the Helmholtz equation.
void solid_boundary_displacement(const Vector< double > &x, Vector< std::complex< double > > &u)
Displacement field on inner boundary of solid.
unsigned M
Wavenumber "zenith"-variation of imposed displacement of coating on inner boundary.
void update_parameter_values()
Function to update dependent parameter values.
int Fourier_wavenumber
Define azimuthal Fourier wavenumber.
double H_coating
Non-dim thickness of elastic coating.