342 string fluid_node_file_name=
"fluid.fig.1.node";
343 string fluid_element_file_name=
"fluid.fig.1.ele";
344 string fluid_poly_file_name=
"fluid.fig.1.poly";
346 fluid_element_file_name,
347 fluid_poly_file_name);
350 std::ofstream pseudo_solid_bc_file(
"pinned_pseudo_solid_nodes.dat");
355 unsigned nbound=Fluid_mesh_pt->nboundary();
356 for(
unsigned ibound=0;ibound<nbound;ibound++)
358 unsigned num_nod=Fluid_mesh_pt->nboundary_node(ibound);
359 for (
unsigned inod=0;inod<num_nod;inod++)
365 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->pin(0);
367 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->pin(1);
371 if ((ibound==0)||(ibound==1)||(ibound==2))
373 for(
unsigned i=0;i<2;i++)
376 SolidNode* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
377 nod_pt->pin_position(i);
380 pseudo_solid_bc_file << nod_pt->x(i) <<
" ";
382 pseudo_solid_bc_file << std::endl;
388 pseudo_solid_bc_file.close();
392 unsigned n_element = Fluid_mesh_pt->nelement();
393 for(
unsigned e=0;e<n_element;e++)
396 FLUID_ELEMENT* el_pt =
397 dynamic_cast<FLUID_ELEMENT*
>(Fluid_mesh_pt->element_pt(e));
403 el_pt->constitutive_law_pt() =
414 double y_min=fluid_mesh_pt()->boundary_node_pt(ibound,0)->x(1);;
418 unsigned num_nod= fluid_mesh_pt()->nboundary_node(ibound);
419 for (
unsigned inod=1;inod<num_nod;inod++)
421 double y=fluid_mesh_pt()->boundary_node_pt(ibound,inod)->x(1);
431 double y_mid=0.5*(y_min+y_max);
434 const unsigned n_boundary = fluid_mesh_pt()->nboundary();
435 for (
unsigned ibound=0;ibound<n_boundary;ibound++)
437 const unsigned num_nod= fluid_mesh_pt()->nboundary_node(ibound);
438 for (
unsigned inod=0;inod<num_nod;inod++)
443 double y=fluid_mesh_pt()->boundary_node_pt(ibound,inod)->x(1);
444 double veloc=1.5/(y_max-y_min)*
445 (y-y_min)*(y_max-y)/((y_mid-y_min)*(y_max-y_mid));
446 fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,veloc);
447 fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1,0.0);
452 fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
453 fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1,0.0);
463 string solid_node_file_name=
"solid.fig.1.node";
464 string solid_element_file_name=
"solid.fig.1.ele";
465 string solid_poly_file_name=
"solid.fig.1.poly";
467 solid_element_file_name,
468 solid_poly_file_name);
472 n_element = Solid_mesh_pt->nelement();
473 for(
unsigned i=0;i<n_element;i++)
476 SOLID_ELEMENT *el_pt =
477 dynamic_cast<SOLID_ELEMENT*
>(Solid_mesh_pt->element_pt(i));
480 el_pt->constitutive_law_pt() =
489 num_nod=Solid_mesh_pt->nboundary_node(ibound);
490 for (
unsigned inod=0;inod<num_nod;inod++)
492 Solid_mesh_pt->boundary_node_pt(ibound,inod)->pin_position(0);
493 Solid_mesh_pt->boundary_node_pt(ibound,inod)->pin_position(1);
501 Traction_mesh_pt=
new SolidMesh;
504 create_fsi_traction_elements();
511 Lagrange_multiplier_mesh_pt=
new SolidMesh;
512 create_lagrange_multiplier_elements();
519 add_sub_mesh(Fluid_mesh_pt);
520 add_sub_mesh(Solid_mesh_pt);
521 add_sub_mesh(Traction_mesh_pt);
522 add_sub_mesh(Lagrange_multiplier_mesh_pt);
534 Multi_domain_functions::Doc_boundary_coordinate_file.open(
535 "fluid_boundary_test.dat");
541 FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
542 (
this,3,Fluid_mesh_pt,Traction_mesh_pt);
545 Multi_domain_functions::Doc_boundary_coordinate_file.close();
548 doc_solid_boundary_coordinates();
551 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
567 std::ofstream the_file(
"solid_boundary_test.dat");
570 double zeta_min= 1.0e40;
571 double zeta_max=-1.0e40;
574 unsigned n_face_element = Traction_mesh_pt->nelement();
575 for(
unsigned e=0;e<n_face_element;e++)
578 FSISolidTractionElement<SOLID_ELEMENT,2>* el_pt=
579 dynamic_cast<FSISolidTractionElement<SOLID_ELEMENT,2>*
>
580 (Traction_mesh_pt->element_pt(e));
584 Vector<double> zeta(1);
587 the_file << el_pt->tecplot_zone_string(n_plot);
590 unsigned num_plot_points=el_pt->nplot_points(n_plot);
591 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
594 el_pt->get_s_plot(iplot,n_plot,s);
595 el_pt->interpolated_zeta(s,zeta);
596 el_pt->interpolated_x(s,x);
597 for (
unsigned i=0;i<2;i++)
599 the_file << x[i] <<
" ";
601 the_file << zeta[0] <<
" ";
604 if (zeta[0]<zeta_min) zeta_min=zeta[0];
605 if (zeta[0]>zeta_max) zeta_max=zeta[0];
607 the_file << std::endl;
616 the_file.open(
"fsi_geom_object.dat");
617 unsigned nplot=10000;
618 Vector<double> zeta(1);
620 for (
unsigned i=0;i<nplot;i++)
622 zeta[0]=zeta_min+(zeta_max-zeta_min)*
double(i)/double(nplot-1);
623 Solid_fsi_boundary_pt->position(zeta,r);
624 the_file << r[0] <<
" " << r[1] << std::endl;
644 unsigned n_element = solid_mesh_pt()->nboundary_element(b);
647 for(
unsigned e=0;e<n_element;e++)
650 SOLID_ELEMENT* bulk_elem_pt =
dynamic_cast<SOLID_ELEMENT*
>(
651 solid_mesh_pt()->boundary_element_pt(b,e));
654 int face_index = solid_mesh_pt()->face_index_at_boundary(b,e);
657 FSISolidTractionElement<SOLID_ELEMENT,2>* el_pt=
658 new FSISolidTractionElement<SOLID_ELEMENT,2>(bulk_elem_pt,face_index);
661 Traction_mesh_pt->add_element_pt(el_pt);
664 el_pt->set_boundary_number_in_bulk_mesh(b);
684 Solid_fsi_boundary_pt=
692 unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
695 for(
unsigned e=0;e<n_element;e++)
698 FLUID_ELEMENT* bulk_elem_pt =
dynamic_cast<FLUID_ELEMENT*
>(
699 Fluid_mesh_pt->boundary_element_pt(b,e));
702 int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
705 ImposeDisplacementByLagrangeMultiplierElement<FLUID_ELEMENT>* el_pt =
706 new ImposeDisplacementByLagrangeMultiplierElement<FLUID_ELEMENT>(
707 bulk_elem_pt,face_index);
710 Lagrange_multiplier_mesh_pt->add_element_pt(el_pt);
715 el_pt->set_boundary_shape_geom_object_pt(Solid_fsi_boundary_pt,b);
718 unsigned nnod=el_pt->nnode();
719 for (
unsigned j=0;j<nnod;j++)
721 Node* nod_pt = el_pt->node_pt(j);
724 if (nod_pt->is_on_boundary(0))
728 unsigned n_bulk_value=el_pt->nbulk_value(j);
731 unsigned nval=nod_pt->nvalue();
732 for (
unsigned j=n_bulk_value;j<nval;j++)