30 #ifndef OOMPH_CYLINDER_WITH_FLAG_MESH_TEMPLATE_CC 31 #define OOMPH_CYLINDER_WITH_FLAG_MESH_TEMPLATE_CC 47 template <
class ELEMENT>
54 const double &flag_length,
55 const double &flag_height,
56 const double ¢re_x,
57 const double ¢re_y,
63 MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(2);
79 unsigned long node_count=0;
90 unsigned nmacro_element = Domain_pt->nmacro_element();
91 for(
unsigned e=0;
e<nmacro_element;
e++)
94 Element_pt.push_back(
new ELEMENT);
98 dynamic_cast<ELEMENT*
>(this->finite_element_pt(
e))->nnode_1d();
101 for(
unsigned l1=0;l1<np;l1++)
104 for(
unsigned l2=0;l2<np;l2++)
107 tmp_node_pt.push_back(this->finite_element_pt(
e)->
108 construct_boundary_node(l1*np+l2,time_stepper_pt));
111 s[0] = -1.0 + 2.0*(double)l2/(
double)(np-1);
112 s[1] = -1.0 + 2.0*(double)l1/(
double)(np-1);
113 Domain_pt->macro_element_pt(
e)->macro_map(s,r);
116 tmp_node_pt[node_count]->x(0) = r[0];
117 tmp_node_pt[node_count]->x(1) = r[1];
130 unsigned np=
dynamic_cast<ELEMENT*
>(this->finite_element_pt(0))->nnode_1d();
133 for(
unsigned n=0;n<np;n++)
136 this->finite_element_pt(1)->node_pt(n*np)
137 = this->finite_element_pt(0)->node_pt((np-1)*np+np-1-n);
140 delete tmp_node_pt[np*np + n*np];
141 tmp_node_pt[np*np + n*np] = 0;
145 for(
unsigned n=0;n<np;n++)
148 this->finite_element_pt(2)->node_pt(n*np)
149 = this->finite_element_pt(1)->node_pt(np*n+np-1);
152 delete tmp_node_pt[2*np*np + n*np];
153 tmp_node_pt[2*np*np + n*np] = 0;
157 for(
unsigned n=0;n<np;n++)
160 this->finite_element_pt(3)->node_pt(np*(np-1)+n)
161 = this->finite_element_pt(2)->node_pt(np*n+np-1);
164 delete tmp_node_pt[3*np*np + np*(np-1)+n];
165 tmp_node_pt[3*np*np + np*(np-1)+n] = 0;
169 for(
unsigned n=0;n<np;n++)
172 this->finite_element_pt(4)->node_pt(n)
173 = this->finite_element_pt(5)->node_pt(np*(np-n-1)+np-1);
176 delete tmp_node_pt[4*np*np + n];
177 tmp_node_pt[4*np*np + n] = 0;
181 for(
unsigned n=0;n<np;n++)
184 this->finite_element_pt(5)->node_pt(n*np)
185 = this->finite_element_pt(6)->node_pt(np*n+np-1);
188 delete tmp_node_pt[5*np*np + n*np];
189 tmp_node_pt[5*np*np + n*np] = 0;
193 for(
unsigned n=0;n<np;n++)
196 this->finite_element_pt(6)->node_pt(n*np)
197 = this->finite_element_pt(0)->node_pt(n);
200 delete tmp_node_pt[6*np*np + n*np];
201 tmp_node_pt[6*np*np + n*np] = 0;
205 for(
unsigned n=0;n<np;n++)
208 this->finite_element_pt(7)->node_pt(n*np)
209 = this->finite_element_pt(2)->node_pt((np-1)*np+np-1-n);
212 delete tmp_node_pt[7*np*np + n*np];
213 tmp_node_pt[7*np*np + n*np] = 0;
217 for(
unsigned n=0;n<np;n++)
220 this->finite_element_pt(8)->node_pt(n*np)
221 = this->finite_element_pt(3)->node_pt(np*n+np-1);
224 delete tmp_node_pt[8*np*np + n*np];
225 tmp_node_pt[8*np*np + n*np] = 0;
229 for(
unsigned n=0;n<np;n++)
232 this->finite_element_pt(9)->node_pt(n*np)
233 = this->finite_element_pt(4)->node_pt(np*n+np-1);
236 delete tmp_node_pt[9*np*np + n*np];
237 tmp_node_pt[9*np*np + n*np] = 0;
242 for(
unsigned n=0;n<np;n++)
245 this->finite_element_pt(10)->node_pt(n*np)
246 = this->finite_element_pt(5)->node_pt(n);
249 delete tmp_node_pt[10*np*np + n*np];
250 tmp_node_pt[10*np*np + n*np] = 0;
255 for(
unsigned n=0;n<np;n++)
258 this->finite_element_pt(11)->node_pt(n*np)
259 = this->finite_element_pt(7)->node_pt(np*n+np-1);
262 delete tmp_node_pt[11*np*np + n*np];
263 tmp_node_pt[11*np*np + n*np] = 0;
267 for(
unsigned n=0;n<np;n++)
270 this->finite_element_pt(12)->node_pt(n*np)
271 = this->finite_element_pt(8)->node_pt(np*n+np-1);
274 delete tmp_node_pt[12*np*np + n*np];
275 tmp_node_pt[12*np*np + n*np] = 0;
279 for(
unsigned n=0;n<np;n++)
282 this->finite_element_pt(13)->node_pt(n*np)
283 = this->finite_element_pt(9)->node_pt(np*n+np-1);
286 delete tmp_node_pt[13*np*np + n*np];
287 tmp_node_pt[13*np*np + n*np] = 0;
291 for(
unsigned n=0;n<np;n++)
294 this->finite_element_pt(14)->node_pt(n*np)
295 = this->finite_element_pt(10)->node_pt(np*n+np-1);
298 delete tmp_node_pt[14*np*np + n*np];
299 tmp_node_pt[14*np*np + n*np] = 0;
305 for(
unsigned n=0;n<np;n++)
308 this->finite_element_pt(8)->node_pt(np*(np-1)+n)
309 = this->finite_element_pt(7)->node_pt(n);
312 delete tmp_node_pt[8*np*np + np*(np-1)+n];
313 tmp_node_pt[8*np*np + np*(np-1)+n] = 0;
318 for(
unsigned n=0;n<np;n++)
321 this->finite_element_pt(10)->node_pt(np*(np-1)+n)
322 = this->finite_element_pt(9)->node_pt(n);
325 delete tmp_node_pt[10*np*np + np*(np-1)+n];
326 tmp_node_pt[10*np*np + np*(np-1)+n] = 0;
331 for(
unsigned n=0;n<np;n++)
334 this->finite_element_pt(15)->node_pt(n*np)
335 = this->finite_element_pt(11)->node_pt(np*n+np-1);
338 delete tmp_node_pt[15*np*np + n*np];
339 tmp_node_pt[15*np*np + n*np] = 0;
343 for(
unsigned n=0;n<np;n++)
346 this->finite_element_pt(16)->node_pt(n*np)
347 = this->finite_element_pt(12)->node_pt(np*n+np-1);
350 delete tmp_node_pt[16*np*np + n*np];
351 tmp_node_pt[16*np*np + n*np] = 0;
355 for(
unsigned n=0;n<np;n++)
358 this->finite_element_pt(17)->node_pt(n*np)
359 = this->finite_element_pt(13)->node_pt(np*n+np-1);
362 delete tmp_node_pt[17*np*np + n*np];
363 tmp_node_pt[17*np*np + n*np] = 0;
367 for(
unsigned n=0;n<np;n++)
370 this->finite_element_pt(18)->node_pt(n*np)
371 = this->finite_element_pt(14)->node_pt(np*n+np-1);
374 delete tmp_node_pt[18*np*np + n*np];
375 tmp_node_pt[18*np*np + n*np] = 0;
381 for(
unsigned n=0;n<np;n++)
384 this->finite_element_pt(12)->node_pt(np*(np-1)+n)
385 = this->finite_element_pt(11)->node_pt(n);
388 delete tmp_node_pt[12*np*np + np*(np-1)+n];
389 tmp_node_pt[12*np*np + np*(np-1)+n] = 0;
394 for(
unsigned n=0;n<np;n++)
397 this->finite_element_pt(14)->node_pt(np*(np-1)+n)
398 = this->finite_element_pt(13)->node_pt(n);
401 delete tmp_node_pt[14*np*np + np*(np-1)+n];
402 tmp_node_pt[14*np*np + np*(np-1)+n] = 0;
407 for(
unsigned n=0;n<np;n++)
410 this->finite_element_pt(19)->node_pt(np*(np-1)+n)
411 = this->finite_element_pt(15)->node_pt(np*n+np-1);
414 delete tmp_node_pt[19*np*np + np*(np-1)+n];
415 tmp_node_pt[19*np*np + np*(np-1)+n] = 0;
420 for(
unsigned n=0;n<np;n++)
423 this->finite_element_pt(16)->node_pt(np*n+np-1)
424 = this->finite_element_pt(19)->node_pt(n*np);
427 delete tmp_node_pt[16*np*np + np*(np-1)+n];
428 tmp_node_pt[16*np*np + np*(np-1)+n] = 0;
434 for(
unsigned n=0;n<np;n++)
437 this->finite_element_pt(16)->node_pt(np*(np-1)+n)
438 = this->finite_element_pt(15)->node_pt(n);
441 delete tmp_node_pt[16*np*np + np*(np-1)+n];
442 tmp_node_pt[16*np*np + np*(np-1)+n] = 0;
447 for(
unsigned n=0;n<np;n++)
450 this->finite_element_pt(20)->node_pt(n)
451 = this->finite_element_pt(18)->node_pt(np*(np-n-1)+np-1);
454 delete tmp_node_pt[20*np*np + n];
455 tmp_node_pt[20*np*np + n] = 0;
461 for(
unsigned n=0;n<np;n++)
464 this->finite_element_pt(20)->node_pt(n*np)
465 = this->finite_element_pt(17)->node_pt(np*n+np-1);
468 delete tmp_node_pt[20*np*np + n*np];
469 tmp_node_pt[20*np*np + n*np] = 0;
475 for(
unsigned n=0;n<np;n++)
478 this->finite_element_pt(18)->node_pt(np*(np-1)+n)
479 = this->finite_element_pt(17)->node_pt(n);
482 delete tmp_node_pt[18*np*np + np*(np-1)+n];
483 tmp_node_pt[18*np*np + np*(np-1)+n] = 0;
490 for(
unsigned n=0;n<np;n++)
493 this->finite_element_pt(21)->node_pt(n*np)
494 = this->finite_element_pt(19)->node_pt(np*n+np-1);
497 delete tmp_node_pt[21*np*np + n*np];
498 tmp_node_pt[21*np*np + n*np] = 0;
504 for(
unsigned n=0;n<np;n++)
507 this->finite_element_pt(22)->node_pt(np*(np-1)+n)
508 = this->finite_element_pt(21)->node_pt(n);
511 delete tmp_node_pt[22*np*np + np*(np-1)+n];
512 tmp_node_pt[22*np*np + np*(np-1)+n] = 0;
518 for(
unsigned n=0;n<np;n++)
521 this->finite_element_pt(23)->node_pt(n*np)
522 = this->finite_element_pt(20)->node_pt(np*n+np-1);
525 delete tmp_node_pt[23*np*np + n*np];
526 tmp_node_pt[23*np*np + n*np] = 0;
532 for(
unsigned n=0;n<np;n++)
535 this->finite_element_pt(22)->node_pt(n)
536 = this->finite_element_pt(23)->node_pt(np*(np-1)+n);
539 delete tmp_node_pt[22*np*np + np*(np-1)+n];
540 tmp_node_pt[22*np*np + np*(np-1)+n] = 0;
545 for(
unsigned n=0;n<np;n++)
548 this->finite_element_pt(24)->node_pt(n*np)
549 = this->finite_element_pt(21)->node_pt(np*n+np-1);
552 delete tmp_node_pt[24*np*np + n*np];
553 tmp_node_pt[24*np*np + n*np] = 0;
559 for(
unsigned n=0;n<np;n++)
562 this->finite_element_pt(25)->node_pt(n*np)
563 = this->finite_element_pt(22)->node_pt(np*n+np-1);
566 delete tmp_node_pt[25*np*np + n*np];
567 tmp_node_pt[25*np*np + n*np] = 0;
573 for(
unsigned n=0;n<np;n++)
576 this->finite_element_pt(26)->node_pt(n*np)
577 = this->finite_element_pt(23)->node_pt(np*n+np-1);
580 delete tmp_node_pt[26*np*np + n*np];
581 tmp_node_pt[26*np*np + n*np] = 0;
587 for(
unsigned n=0;n<np;n++)
590 this->finite_element_pt(25)->node_pt(np*(np-1)+n)
591 = this->finite_element_pt(24)->node_pt(n);
594 delete tmp_node_pt[25*np*np + np*(np-1)+n];
595 tmp_node_pt[25*np*np + np*(np-1)+n] = 0;
600 for(
unsigned n=0;n<np;n++)
603 this->finite_element_pt(26)->node_pt(np*(np-1)+n)
604 = this->finite_element_pt(25)->node_pt(n);
607 delete tmp_node_pt[26*np*np + np*(np-1)+n];
608 tmp_node_pt[26*np*np + np*(np-1)+n] = 0;
613 for(
unsigned n=0;n<np;n++)
616 this->finite_element_pt(27)->node_pt(np*(np-1)+n)
617 = this->finite_element_pt(24)->node_pt(np*n+np-1);
620 delete tmp_node_pt[27*np*np + np*(np-1)+n];
621 tmp_node_pt[27*np*np + np*(np-1)+n] = 0;
627 for(
unsigned n=0;n<np;n++)
630 this->finite_element_pt(27)->node_pt(n*np)
631 = this->finite_element_pt(25)->node_pt(np*n+np-1);
634 delete tmp_node_pt[27*np*np + n*np];
635 tmp_node_pt[27*np*np + n*np] = 0;
640 for(
unsigned n=0;n<np;n++)
643 this->finite_element_pt(27)->node_pt(n)
644 = this->finite_element_pt(26)->node_pt(np*(np-n-1)+np-1);
647 delete tmp_node_pt[27*np*np + n];
648 tmp_node_pt[27*np*np + n] = 0;
653 for(
unsigned n=0;n<np;n++)
656 this->finite_element_pt(28)->node_pt(n*np)
657 = this->finite_element_pt(27)->node_pt(np*n+np-1);
660 delete tmp_node_pt[28*np*np + n*np];
661 tmp_node_pt[28*np*np + n*np] = 0;
666 for(
unsigned n=0;n<np;n++)
669 this->finite_element_pt(29)->node_pt(n*np)
670 = this->finite_element_pt(28)->node_pt(np*n+np-1);
673 delete tmp_node_pt[29*np*np + n*np];
674 tmp_node_pt[29*np*np + n*np] = 0;
679 for(
unsigned n=0;n<np;n++)
682 this->finite_element_pt(30)->node_pt(n*np)
683 = this->finite_element_pt(29)->node_pt(np*n+np-1);
686 delete tmp_node_pt[30*np*np + n*np];
687 tmp_node_pt[30*np*np + n*np] = 0;
691 for(
unsigned long n=0;n<node_count;n++)
693 if(tmp_node_pt[n]!=0) {Node_pt.push_back(tmp_node_pt[n]);}
697 this->set_nboundary(8);
699 for(
unsigned n=0;n<np;n++)
702 this->add_boundary_node(3,this->finite_element_pt(0)->node_pt(n*np));
704 this->add_boundary_node(1,this->finite_element_pt(30)->node_pt(n*np+np-1));
707 this->add_boundary_node(0,this->finite_element_pt(6)->node_pt(n));
710 this->add_boundary_node(2,this->finite_element_pt(1)->node_pt(np*(np-1)+n));
713 this->add_boundary_node(4,this->finite_element_pt(3)->node_pt(np*n));
716 this->add_boundary_node(5,this->finite_element_pt(4)->node_pt(np*(np-1)+n));
719 this->add_boundary_node(6,this->finite_element_pt(3)->node_pt(n));
722 this->add_boundary_node(7,this->finite_element_pt(22)->node_pt(n*np));
726 for(
unsigned n=1;n<np;n++)
729 this->add_boundary_node(0,this->finite_element_pt(10)->node_pt(n));
732 this->add_boundary_node(2,this->finite_element_pt(7)->node_pt(np*(np-1)+n));
735 this->add_boundary_node(5,this->finite_element_pt(9)->node_pt(np*(np-1)+n));
738 this->add_boundary_node(6,this->finite_element_pt(8)->node_pt(n));
742 for(
unsigned n=np-2;n>0;n--)
746 this->add_boundary_node(4,this->finite_element_pt(2)->node_pt(n));
749 for(
unsigned n=1;n<np;n++)
752 this->add_boundary_node(0,this->finite_element_pt(14)->node_pt(n));
755 this->add_boundary_node(2,this->finite_element_pt(11)->
756 node_pt(np*(np-1)+n));
759 this->add_boundary_node(5,this->finite_element_pt(13)->
760 node_pt(np*(np-1)+n));
763 this->add_boundary_node(6,this->finite_element_pt(12)->node_pt(n));
767 for(
unsigned n=np-1;n>0;n--)
770 this->add_boundary_node(4,this->finite_element_pt(1)->node_pt(n));
774 for(
unsigned n=1;n<np;n++)
777 this->add_boundary_node(0,this->finite_element_pt(18)->node_pt(n));
779 this->add_boundary_node(2,this->finite_element_pt(15)->
780 node_pt(np*(np-1)+n));
783 this->add_boundary_node(5,this->finite_element_pt(17)->
784 node_pt(np*(np-1)+n));
787 this->add_boundary_node(6,this->finite_element_pt(16)->node_pt(n));
791 for(
unsigned n=np-1;n>0;n--)
795 this->add_boundary_node(4,this->finite_element_pt(0)->node_pt(n*np+np-1));
799 for(
unsigned n=1;n<np;n++)
802 this->add_boundary_node(0,this->finite_element_pt(23)->node_pt(n));
804 this->add_boundary_node(2,this->finite_element_pt(21)->
805 node_pt(np*(np-1)+n));
808 this->add_boundary_node(4,this->finite_element_pt(6)->node_pt(np*(np-1)+n));
811 this->add_boundary_node(5,this->finite_element_pt(20)->
812 node_pt(np*(np-1)+n));
815 this->add_boundary_node(6,this->finite_element_pt(19)->node_pt(n));
819 for(
unsigned n=0;n<np;n++)
822 this->add_boundary_node(4,this->finite_element_pt(6)->node_pt(np*(np-1)+n));
826 for(
unsigned n=1;n<np;n++)
829 this->add_boundary_node(0,this->finite_element_pt(26)->node_pt(n));
831 this->add_boundary_node(2,this->finite_element_pt(24)->
832 node_pt(np*(np-1)+n));
835 this->add_boundary_node(4,this->finite_element_pt(5)->node_pt(np*(np-1)+n));
840 for(
unsigned n=1;n<np;n++)
843 this->add_boundary_node(0,this->finite_element_pt(28)->node_pt(n));
845 this->add_boundary_node(2,this->finite_element_pt(28)->
846 node_pt(np*(np-1)+n));
849 this->add_boundary_node(4,this->finite_element_pt(4)->node_pt(np*n));
853 for(
unsigned n=1;n<np;n++)
856 this->add_boundary_node(0,this->finite_element_pt(29)->node_pt(n));
858 this->add_boundary_node(2,this->finite_element_pt(29)->
859 node_pt(np*(np-1)+n));
862 for(
unsigned n=1;n<np;n++)
865 this->add_boundary_node(0,this->finite_element_pt(30)->node_pt(n));
867 this->add_boundary_node(2,this->finite_element_pt(30)->
868 node_pt(np*(np-1)+n));
873 setup_boundary_element_info();
881 unsigned nnode=this->nboundary_node(5);
882 for(
unsigned k=0;k<nnode;k++)
884 Node* nod_pt=this->boundary_node_pt(5,k);
885 zeta[0]=double(k)*flag_length/double(nnode-1);
890 nnode=this->nboundary_node(6);
891 for(
unsigned k=0;k<nnode;k++)
893 Node* nod_pt=this->boundary_node_pt(6,k);
894 zeta[0]=double(k)*flag_length/double(nnode-1);
899 nnode=this->nboundary_node(7);
900 for(
unsigned k=0;k<nnode;k++)
902 Node* nod_pt=this->boundary_node_pt(7,k);
903 zeta[0]=-flag_height/2.+double(k)/double(nnode-1)*flag_height;
908 this->Boundary_coordinate_exists[5] =
true;
909 this->Boundary_coordinate_exists[6] =
true;
910 this->Boundary_coordinate_exists[7] =
true;
913 for (
unsigned e=0;
e<31;
e++)
915 dynamic_cast<ELEMENT*
>(this->element_pt(
e))->
916 set_macro_elem_pt(this->Domain_pt->macro_element_pt(
e));
934 template<
class ELEMENT>
940 for(
unsigned i=0;
i<5;
i++)
946 for(
unsigned k=0;k<3;k++)
949 unsigned nnode= el_pt->
nnode();
950 for(
unsigned i = 0;
i<nnode;
i++)
957 ref_value[0] = 0.5*(coord_loc[0]+1.0);
960 ref_value[1] = 0.5*(coord_loc[1]+1.0);
963 ref_value[2]=double(k+1)/5.*Flag_length+ ref_value[0]*1./5.*Flag_length;
969 zeta[0]= ref_value[2] ;
970 Top_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
974 geom_object_pt[0]=geom_obj_pt;
993 for(
unsigned k=0;k<3;k++)
996 unsigned nnode= el_pt->
nnode();
997 for(
unsigned i = 0;
i<nnode;
i++)
1004 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1007 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1010 ref_value[2]=double(k+1)/5.*Flag_length+ ref_value[0]*1./5.*Flag_length;
1016 zeta[0]= ref_value[2] ;
1017 Bottom_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1021 geom_object_pt[0]=geom_obj_pt;
1024 ref_value[3] = s[0];
1041 unsigned nnode= el_pt->
nnode();
1042 for(
unsigned i = 0;
i<nnode;
i++)
1049 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1052 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1055 ref_value[2] = coord_loc[1]*Flag_height/2.;
1061 zeta[0]= ref_value[2] ;
1062 Tip_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1066 geom_object_pt[0]=geom_obj_pt;
1069 ref_value[3] = s[0];
1081 el_pt = this->finite_element_pt(21);
1082 nnode= el_pt->
nnode();
1083 for(
unsigned i = 0;
i<nnode;
i++)
1090 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1093 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1099 zeta[0]= Flag_height/2.;
1100 Tip_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1104 geom_object_pt[0]=geom_obj_pt;
1107 ref_value[2] = s[0];
1119 el_pt = this->finite_element_pt(23);
1120 nnode= el_pt->
nnode();
1121 for(
unsigned i = 0;
i<nnode;
i++)
1128 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1131 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1137 zeta[0]= -Flag_height/2.;
1138 Tip_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1142 geom_object_pt[0]=geom_obj_pt;
1145 ref_value[2] = s[0];
1157 el_pt = this->finite_element_pt(19);
1158 nnode= el_pt->
nnode();
1159 for(
unsigned i = 0;
i<nnode;
i++)
1166 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1169 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1172 ref_value[2]=4./5.*Flag_length+ref_value[0]*1./5.*Flag_length;
1178 zeta[0]= ref_value[2];
1179 Top_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1183 geom_object_pt[0]=geom_obj_pt;
1186 ref_value[3] = s[0];
1199 el_pt = this->finite_element_pt(20);
1200 nnode= el_pt->
nnode();
1201 for(
unsigned i = 0;
i<nnode;
i++)
1208 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1211 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1214 ref_value[2]=4./5.*Flag_length+ref_value[0]*1./5.*Flag_length;
1220 zeta[0]= ref_value[2];
1221 Bottom_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1225 geom_object_pt[0]=geom_obj_pt;
1228 ref_value[3] = s[0];
1240 el_pt = this->finite_element_pt(3);
1241 nnode= el_pt->
nnode();
1242 for(
unsigned i = 0;
i<nnode;
i++)
1249 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1252 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1255 ref_value[2] = ref_value[0]*1./5.*Flag_length;
1262 zeta[0]= ref_value[2] ;
1263 Top_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1266 ref_value[3] = s[0];
1270 geom_object_pt[0]=geom_obj_pt;
1273 ref_value[4] = 1./5.*Flag_length;
1277 zeta[0]= ref_value[4] ;
1278 Top_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1281 geom_object_pt[1]=geom_obj_pt;
1284 ref_value[5] = s[0];
1299 el_pt = this->finite_element_pt(4);
1300 nnode= el_pt->
nnode();
1301 for(
unsigned i = 0;
i<nnode;
i++)
1308 ref_value[0] = 0.5*(coord_loc[0]+1.0);
1311 ref_value[1] = 0.5*(coord_loc[1]+1.0);
1314 ref_value[2] = ref_value[0]*1./5.*Flag_length;
1321 zeta[0]= ref_value[2] ;
1322 Bottom_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1325 ref_value[3] = s[0];
1329 geom_object_pt[0]=geom_obj_pt;
1332 ref_value[4] = 1./5.*Flag_length;
1336 zeta[0]= ref_value[4] ;
1337 Bottom_flag_pt->locate_zeta(zeta,geom_obj_pt,s);
1340 geom_object_pt[1]=geom_obj_pt;
1343 ref_value[5] = s[0];
1366 template<
class ELEMENT>
1375 node_update_I(t,node_pt);
1379 node_update_II(t,node_pt);
1383 node_update_III(t,node_pt);
1387 node_update_IV(t,node_pt);
1391 node_update_V(t,node_pt);
1395 node_update_VI(t,node_pt);
1399 node_update_VII(t,node_pt);
1403 node_update_VIII(t,node_pt);
1407 node_update_IX(t,node_pt);
1411 std::ostringstream error_message;
1412 error_message <<
"Wrong id " <<
id << std::endl;
1414 error_message.str(),
1415 OOMPH_CURRENT_FUNCTION,
1416 OOMPH_EXCEPTION_LOCATION);
1425 template<
class ELEMENT>
1441 ref_point[0]=ref_value[4];
1442 ref_point[1]=0.778024390*Height;
1447 zeta[0]=ref_value[3];
1448 flag_pt->position(t,zeta,flag_point);
1452 double r = ref_value[1];
1455 node_pt->
x(t,0)= ref_point[0]+ (1.0-r)*(flag_point[0]-ref_point[0]);
1456 node_pt->
x(t,1)= ref_point[1]+ (1.0-r)*(flag_point[1]-ref_point[1]);
1464 template<
class ELEMENT>
1479 ref_point[0]=ref_value[4];
1480 ref_point[1]=0.197585366*Height;
1485 zeta[0]=ref_value[3];
1486 flag_pt->position(t,zeta,flag_point);
1490 double r = ref_value[1];
1493 node_pt->
x(t,0)= ref_point[0]+ r*(flag_point[0]-ref_point[0]);
1494 node_pt->
x(t,1)= ref_point[1]+ r*(flag_point[1]-ref_point[1]);
1500 template<
class ELEMENT>
1509 p15[0] = 0.285123967*Length;
1510 p15[1] = 0.625*Height;
1512 p35[0] = 0.285123967*Length;
1513 p35[1] = 0.350609756*Height;
1526 ref_point[0]= p15[0];
1527 ref_point[1]= p35[1]+ ref_value[1]*(p15[1]-p35[1]);
1532 zeta[0]=ref_value[3];
1533 flag_pt->position(t,zeta,flag_point);
1537 double r = ref_value[0];
1540 node_pt->
x(t,0)= flag_point[0]+ r*(ref_point[0]-flag_point[0]);
1541 node_pt->
x(t,1)= flag_point[1]+ r*(ref_point[1]-flag_point[1]);
1548 template<
class ELEMENT>
1558 p15[0] = 0.285123967*Length;
1559 p15[1] = 0.625*Height;
1561 p25[0]=Centre_x+ A*sqrt(1.0-Flag_height*Flag_height/(4.0*A*A))+Flag_length;
1562 p25[1]=Centre_y+ Flag_height/2.0;
1574 zeta[0]= ref_value[2];
1575 flag_pt->position(t,zeta,top_flag);
1579 p1[0]= top_flag[0] + ref_value[0]*(p15[0]-top_flag[0]);
1580 p1[1]= top_flag[1] + ref_value[0]*(p15[1]-top_flag[1]);
1584 p2[0]=p25[0]+ref_value[0]*(p15[0]-p25[0]);
1588 node_pt->
x(t,0)= p1[0] + ref_value[1]*(p2[0]-p1[0]);
1589 node_pt->
x(t,1)= p1[1] + ref_value[1]*(p2[1]-p1[1]);
1595 template<
class ELEMENT>
1605 p31[0]=Centre_x+ A*sqrt(1.0-Flag_height*Flag_height/(4.0*A*A))+Flag_length;
1606 p31[1]=Centre_y- Flag_height/2.;
1608 p35[0] = 0.285123967*Length;
1609 p35[1] = 0.350609756*Height;
1621 zeta[0]= ref_value[2];
1623 flag_pt->position(t,zeta,top_flag);
1627 p1[0]= top_flag[0] + ref_value[0]*(p35[0]-top_flag[0]);
1628 p1[1]= top_flag[1] + ref_value[0]*(p35[1]-top_flag[1]);
1632 p2[0]=p31[0]+ref_value[0]*(p35[0]-p31[0]);
1636 node_pt->
x(t,0)= p2[0] + ref_value[1]*(p1[0]-p2[0]);
1637 node_pt->
x(t,1)= p2[1] + ref_value[1]*(p1[1]-p2[1]);
1644 template<
class ELEMENT>
1656 p14[0] = 0.211596*Length;
1657 p14[1] = 0.778024390*Height;
1659 p5[0] = 0.239596*Length;
1669 zeta[0]= ref_value[3];
1670 flag_pt->position(t,zeta,point_flag);
1674 p1[0]= p14[0] + ref_value[0]*(p5[0]-p14[0]);
1675 p1[1]= p14[1] + ref_value[0]*(p5[1]-p14[1]);
1679 node_pt->
x(t,0)= point_flag[0] + ref_value[1]*(p1[0]-point_flag[0]);
1680 node_pt->
x(t,1)= point_flag[1] + ref_value[1]*(p1[1]-point_flag[1]);
1687 template<
class ELEMENT>
1699 p40[0] = 0.211596*Length;
1700 p40[1] = 0.197585366*Height;
1702 p45[0] = 0.239596*Length;
1712 zeta[0]= ref_value[3];
1713 flag_pt->position(t,zeta,point_flag);
1717 p1[0]= p40[0] + ref_value[0]*(p45[0]-p40[0]);
1718 p1[1]= p40[1] + ref_value[0]*(p45[1]-p40[1]);
1722 node_pt->
x(t,0)= point_flag[0] + (1-ref_value[1])*(p1[0]-point_flag[0]);
1723 node_pt->
x(t,1)= point_flag[1] + (1-ref_value[1])*(p1[1]-point_flag[1]);
1731 template<
class ELEMENT>
1738 p11[0] = 0.127596*Length;
1739 p11[1] = 0.778024390*Height;
1742 double zeta_circle_top=atan(1.0);
1743 double zeta_circle_bot=asin(Flag_height/2./A);
1757 double omega_horizontal = ref_value[0];
1758 double omega_vertical = ref_value[1];
1763 zeta[0]=ref_value[5];
1764 flag_end_pt->
position(t,zeta,flag_end);
1770 zeta[0]=zeta_circle_bot+(zeta_circle_top-zeta_circle_bot)*omega_vertical;
1771 Cylinder_pt->position(zeta,ref_point_on_circle);
1775 ref_point_on_right_line[0]=
1776 outer_point[0]+(flag_end[0]-outer_point[0])*(1.0-omega_vertical);
1777 ref_point_on_right_line[1]=
1778 outer_point[1]+(flag_end[1]-outer_point[1])*(1.0-omega_vertical);
1782 zeta[0]=ref_value[3];
1783 flag_ref_pt->position(t,zeta,ref_point_on_flag);
1787 zeta[0]=zeta_circle_bot;
1788 Cylinder_pt->position(zeta,circle_bot);
1793 r_bot[0]=circle_bot[0]+(flag_end[0]-circle_bot[0])*omega_horizontal;
1794 r_bot[1]=circle_bot[1]+(flag_end[1]-circle_bot[1])*omega_horizontal;
1799 node_pt->
x(t,0)=ref_point_on_circle[0]+
1800 (ref_point_on_right_line[0]-ref_point_on_circle[0])*omega_horizontal;
1801 node_pt->
x(t,1)=ref_point_on_circle[1]+
1802 (ref_point_on_right_line[1]-ref_point_on_circle[1])*omega_horizontal;
1806 node_pt->
x(t,0)+=(ref_point_on_flag[0]-r_bot[0])*(1.0-omega_vertical);
1807 node_pt->
x(t,1)+=(ref_point_on_flag[1]-r_bot[1])*(1.0-omega_vertical);
1815 template<
class ELEMENT>
1821 p37[0] = 0.127596*Length;
1822 p37[1] = 0.197585366*Height;
1825 double zeta_circle_top=-asin(Flag_height/2./A);
1826 double zeta_circle_bot=-atan(1.0);
1840 double omega_horizontal = ref_value[0];
1841 double omega_vertical = ref_value[1];
1846 zeta[0]=ref_value[5];
1847 flag_end_pt->
position(t,zeta,flag_end);
1853 zeta[0]=zeta_circle_bot+(zeta_circle_top-zeta_circle_bot)*omega_vertical;
1854 Cylinder_pt->position(zeta,ref_point_on_circle);
1858 ref_point_on_right_line[0]=
1859 outer_point[0]+(flag_end[0]-outer_point[0])*omega_vertical;
1860 ref_point_on_right_line[1]=
1861 outer_point[1]+(flag_end[1]-outer_point[1])*omega_vertical;
1865 zeta[0]=ref_value[3];
1866 flag_ref_pt->position(t,zeta,ref_point_on_flag);
1870 zeta[0]=zeta_circle_top;
1871 Cylinder_pt->position(zeta,circle_top);
1876 r_top[0]=circle_top[0]+(flag_end[0]-circle_top[0])*omega_horizontal;
1877 r_top[1]=circle_top[1]+(flag_end[1]-circle_top[1])*omega_horizontal;
1882 node_pt->
x(t,0)=ref_point_on_circle[0]+
1883 (ref_point_on_right_line[0]-ref_point_on_circle[0])*omega_horizontal;
1884 node_pt->
x(t,1)=ref_point_on_circle[1]+
1885 (ref_point_on_right_line[1]-ref_point_on_circle[1])*omega_horizontal;
1889 node_pt->
x(t,0)+=(ref_point_on_flag[0]-r_top[0])*omega_vertical;
1890 node_pt->
x(t,1)+=(ref_point_on_flag[1]-r_top[1])*omega_vertical;
1903 template<
class ELEMENT>
1922 zeta_ref_flag[0]=ref_value[2];
1928 this->Top_flag_pt->
locate_zeta(zeta_ref_flag,geom_obj_pt,s);
1933 geom_object_pt[0]=geom_obj_pt;
1942 zeta_end_flag[0]=ref_value[4];
1946 this->Top_flag_pt->locate_zeta(zeta_end_flag,geom_obj_pt,s);
1951 geom_object_pt[1]=geom_obj_pt;
1977 zeta_ref_flag[0]=ref_value[2];
1983 this->Bottom_flag_pt->
locate_zeta(zeta_ref_flag,geom_obj_pt,s);
1987 geom_object_pt[0]=geom_obj_pt;
1996 zeta_end_flag[0]=ref_value[4];
2000 this->Bottom_flag_pt->locate_zeta(zeta_end_flag,geom_obj_pt,s);
2004 geom_object_pt[1]=geom_obj_pt;
2023 if( (
id==1) || (
id==6) )
2030 zeta_flag[0]=ref_value[2];
2035 this->Top_flag_pt->
locate_zeta(zeta_flag,geom_obj_pt,s);
2044 geom_object_pt[0]=geom_obj_pt;
2077 if( (
id==2) || (
id==7) )
2084 zeta_flag[0]=ref_value[2];
2089 this->Bottom_flag_pt->
locate_zeta(zeta_flag,geom_obj_pt,s);
2098 geom_object_pt[0]=geom_obj_pt;
2130 if( (
id==3) || (
id==4) || (
id==5) )
2139 zeta_flag[0]=ref_value[2];
2143 zeta_flag[0]=this->Flag_height/2.;
2147 zeta_flag[0]=-this->Flag_height/2.;
2153 this->Tip_flag_pt->
locate_zeta(zeta_flag,geom_obj_pt,s);
2162 geom_object_pt[0]=geom_obj_pt;
void node_update_II(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_I(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
virtual void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size (broken virtual) ...
virtual void set_coordinates_on_boundary(const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
Set the vector of the k-th generalised boundary coordinates on mesh boundary b. Broken virtual interf...
void node_update_IV(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_III(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void kill_node_update_info(const int &id=0)
Erase algebraic node update information for id-th node update function. Id defaults to 0...
void add_node_update_info(const int &id, AlgebraicMesh *mesh_pt, const Vector< GeomObject *> &geom_object_pt, const Vector< double > &ref_value, const bool &called_from_constructor=false)
Add algebraic update information for node: What's the ID of the mesh update function (typically used ...
A general Finite Element class.
void setup_algebraic_node_update()
Function to setup the algebraic node update.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
Vector< double > & vector_ref_value()
Return vector of reference values involved in default (usually first) update function.
double & x(const unsigned &i)
Return the i-th nodal coordinate.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present;.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Domain for cylinder with flag as in Turek benchmark.
void node_update_V(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_VIII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
CylinderWithFlagMesh(Circle *cylinder_pt, GeomObject *top_flag_pt, GeomObject *bottom_flag_pt, GeomObject *tip_flag_pt, const double &length, const double &height, const double &flag_length, const double &flag_height, const double ¢re_x, const double ¢re_y, const double &a, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Pass the pointers to the GeomObjects that parametrise the cylinder, the three edges of t...
void node_update_VI(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
A geometric object may be composed of may sub-objects (e.g. a finite-element representation of a boun...
void node_update_IX(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Vector< GeomObject * > & vector_geom_object_pt(const int &id)
Return vector of geometric objects involved in id-th update function.
void node_update_VII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.