500 double x_inlet = 0.0;
501 double channel_height = 1.0;
502 double channel_length = 4.0;
503 double x_leaflet = 1.0;
504 double leaflet_width = 0.2;
505 double leaflet_height = 0.5;
514 Vector<TriangleMeshCurveSection*> solid_boundary_segment_pt(4);
517 Vector<Vector<double> > bound_seg(2);
518 for(
unsigned i=0;i<2;i++) {bound_seg[i].resize(2);}
521 bound_seg[0][0]=x_leaflet - 0.5*leaflet_width;
523 bound_seg[1][0]=x_leaflet - 0.5*leaflet_width;
524 bound_seg[1][1]=leaflet_height;
527 unsigned bound_id = 0;
530 solid_boundary_segment_pt[0] =
new TriangleMeshPolyLine(bound_seg,bound_id);
533 bound_seg[0][0]=x_leaflet - 0.5*leaflet_width;
534 bound_seg[0][1]=leaflet_height;
535 bound_seg[1][0]=x_leaflet + 0.5*leaflet_width;
536 bound_seg[1][1]=leaflet_height;
542 solid_boundary_segment_pt[1] =
new TriangleMeshPolyLine(bound_seg,bound_id);
545 bound_seg[0][0]=x_leaflet + 0.5*leaflet_width;
546 bound_seg[0][1]=leaflet_height;
547 bound_seg[1][0]=x_leaflet + 0.5*leaflet_width;
554 solid_boundary_segment_pt[2] =
new TriangleMeshPolyLine(bound_seg,bound_id);
557 bound_seg[0][0]=x_leaflet + 0.5*leaflet_width;
559 bound_seg[1][0]=x_leaflet - 0.5*leaflet_width;
566 solid_boundary_segment_pt[3] =
new TriangleMeshPolyLine(bound_seg,bound_id);
569 Solid_outer_boundary_polyline_pt =
570 new TriangleMeshPolygon(solid_boundary_segment_pt);
579 double uniform_element_area= leaflet_width*leaflet_height/20.0;
581 TriangleMeshClosedCurve* solid_closed_curve_pt=
582 Solid_outer_boundary_polyline_pt;
586 TriangleMeshParameters triangle_mesh_parameters_solid(
587 solid_closed_curve_pt);
590 triangle_mesh_parameters_solid.element_area() =
591 uniform_element_area;
595 new RefineableSolidTriangleMesh<SOLID_ELEMENT>(
596 triangle_mesh_parameters_solid);
599 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
600 Solid_mesh_pt->spatial_error_estimator_pt()=error_estimator_pt;
603 Solid_mesh_pt->max_permitted_error()=0.0001;
604 Solid_mesh_pt->min_permitted_error()=0.001;
605 Solid_mesh_pt->max_element_size()=0.2;
606 Solid_mesh_pt->min_element_size()=0.001;
609 this->Solid_mesh_pt->output_boundaries(
"solid_boundaries.dat");
610 this->Solid_mesh_pt->output(
"solid_mesh.dat");
614 unsigned num_nod= Solid_mesh_pt->nboundary_node(ibound);
615 for (
unsigned inod=0;inod<num_nod;inod++)
619 SolidNode* nod_pt=Solid_mesh_pt->boundary_node_pt(ibound,inod);
622 for (
unsigned i=0;i<2;i++)
624 nod_pt->pin_position(i);
629 unsigned n_element = Solid_mesh_pt->nelement();
630 for(
unsigned i=0;i<n_element;i++)
633 SOLID_ELEMENT *el_pt =
634 dynamic_cast<SOLID_ELEMENT*
>(Solid_mesh_pt->element_pt(i));
637 el_pt->constitutive_law_pt() =
649 Vector<TriangleMeshCurveSection*> fluid_boundary_segment_pt(8);
652 for(
unsigned b=0;b<3;b++)
654 fluid_boundary_segment_pt[b] = solid_boundary_segment_pt[b];
659 bound_seg[0][0]=x_leaflet + 0.5*leaflet_width;
661 bound_seg[1][0]=x_inlet + channel_length;
668 fluid_boundary_segment_pt[3] =
new TriangleMeshPolyLine(bound_seg,bound_id);
671 bound_seg[0][0]=x_inlet + channel_length;
673 bound_seg[1][0]=x_inlet + channel_length;
674 bound_seg[1][1]=channel_height;
680 fluid_boundary_segment_pt[4] =
new TriangleMeshPolyLine(bound_seg,bound_id);
683 bound_seg[0][0]=x_inlet + channel_length;
684 bound_seg[0][1]=channel_height;
685 bound_seg[1][0]=x_inlet;
686 bound_seg[1][1]=channel_height;
692 fluid_boundary_segment_pt[5] =
new TriangleMeshPolyLine(bound_seg,bound_id);
695 bound_seg[0][0]=x_inlet;
696 bound_seg[0][1]=channel_height;
697 bound_seg[1][0]=x_inlet;
704 fluid_boundary_segment_pt[6] =
new TriangleMeshPolyLine(bound_seg,bound_id);
707 bound_seg[0][0]=x_inlet;
709 bound_seg[1][0]=x_leaflet - 0.5*leaflet_width;
716 fluid_boundary_segment_pt[7] =
new TriangleMeshPolyLine(bound_seg,bound_id);
719 Fluid_outer_boundary_polyline_pt =
720 new TriangleMeshPolygon(fluid_boundary_segment_pt);
729 uniform_element_area= channel_length*channel_height/40.0;;
731 TriangleMeshClosedCurve* fluid_closed_curve_pt=
732 Fluid_outer_boundary_polyline_pt;
736 TriangleMeshParameters triangle_mesh_parameters_fluid(
737 fluid_closed_curve_pt);
740 triangle_mesh_parameters_fluid.element_area() =
741 uniform_element_area;
745 new RefineableSolidTriangleMesh<FLUID_ELEMENT>(
746 triangle_mesh_parameters_fluid);
749 Z2ErrorEstimator* fluid_error_estimator_pt=
new Z2ErrorEstimator;
750 Fluid_mesh_pt->spatial_error_estimator_pt()=fluid_error_estimator_pt;
753 Fluid_mesh_pt->max_permitted_error()=0.0001;
754 Fluid_mesh_pt->min_permitted_error()=0.001;
755 Fluid_mesh_pt->max_element_size()=0.2;
756 Fluid_mesh_pt->min_element_size()=0.001;
759 this->Fluid_mesh_pt->output_boundaries(
"fluid_boundaries.dat");
760 this->Fluid_mesh_pt->output(
"fluid_mesh.dat");
767 unsigned nbound=Fluid_mesh_pt->nboundary();
768 for(
unsigned ibound=0;ibound<nbound;ibound++)
770 unsigned num_nod=Fluid_mesh_pt->nboundary_node(ibound);
771 for (
unsigned inod=0;inod<num_nod;inod++)
777 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->pin(0);
779 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->pin(1);
785 for(
unsigned i=0;i<2;i++)
788 SolidNode* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
789 nod_pt->pin_position(i);
797 n_element = Fluid_mesh_pt->nelement();
798 for(
unsigned e=0;e<n_element;e++)
801 FLUID_ELEMENT* el_pt =
802 dynamic_cast<FLUID_ELEMENT*
>(Fluid_mesh_pt->element_pt(e));
808 el_pt->constitutive_law_pt() =
815 const unsigned n_boundary = Fluid_mesh_pt->nboundary();
816 for (
unsigned ibound=0;ibound<n_boundary;ibound++)
818 const unsigned num_nod= Fluid_mesh_pt->nboundary_node(ibound);
819 for (
unsigned inod=0;inod<num_nod;inod++)
824 double y=Fluid_mesh_pt->boundary_node_pt(ibound,inod)->x(1);
825 double veloc = y*(1.0-y);
826 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->set_value(0,veloc);
827 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->set_value(1,0.0);
832 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->set_value(0,0.0);
833 Fluid_mesh_pt->boundary_node_pt(ibound,inod)->set_value(1,0.0);
843 Traction_mesh_pt.resize(3);
844 for(
unsigned m=0;m<3;m++) {Traction_mesh_pt[m] =
new SolidMesh;}
845 this->create_fsi_traction_elements();
848 Lagrange_multiplier_mesh_pt.resize(3);
849 Solid_fsi_boundary_pt.resize(3);
850 for(
unsigned m=0;m<3;m++) {Lagrange_multiplier_mesh_pt[m] =
new SolidMesh;}
851 this->create_lagrange_multiplier_elements();
854 add_sub_mesh(Fluid_mesh_pt);
855 add_sub_mesh(Solid_mesh_pt);
856 for(
unsigned m=0;m<3;m++)
858 add_sub_mesh(Traction_mesh_pt[m]);
859 add_sub_mesh(Lagrange_multiplier_mesh_pt[m]);
871 for(
unsigned b=0;b<3;b++)
873 FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
874 (
this,b,Fluid_mesh_pt,Traction_mesh_pt[b]);
878 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;