26 #ifndef OOMPH_CYLINDER_WITH_FLAG_MESH_TEMPLATE_CC
27 #define OOMPH_CYLINDER_WITH_FLAG_MESH_TEMPLATE_CC
42 template<
class ELEMENT>
50 const double& flag_length,
51 const double& flag_height,
52 const double& centre_x,
53 const double& centre_y,
58 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
74 unsigned long node_count = 0;
85 unsigned nmacro_element = Domain_pt->nmacro_element();
86 for (
unsigned e = 0;
e < nmacro_element;
e++)
89 Element_pt.push_back(
new ELEMENT);
93 dynamic_cast<ELEMENT*
>(this->finite_element_pt(
e))->nnode_1d();
96 for (
unsigned l1 = 0; l1 < np; l1++)
99 for (
unsigned l2 = 0; l2 < np; l2++)
102 tmp_node_pt.push_back(
103 this->finite_element_pt(
e)->construct_boundary_node(
104 l1 * np + l2, time_stepper_pt));
107 s[0] = -1.0 + 2.0 * (double)l2 / (
double)(np - 1);
108 s[1] = -1.0 + 2.0 * (double)l1 / (
double)(np - 1);
109 Domain_pt->macro_element_pt(
e)->macro_map(
s, r);
112 tmp_node_pt[node_count]->x(0) = r[0];
113 tmp_node_pt[node_count]->x(1) = r[1];
127 dynamic_cast<ELEMENT*
>(this->finite_element_pt(0))->nnode_1d();
130 for (
unsigned n = 0; n < np; n++)
133 this->finite_element_pt(1)->node_pt(n * np) =
134 this->finite_element_pt(0)->node_pt((np - 1) * np + np - 1 - n);
137 delete tmp_node_pt[np * np + n * np];
138 tmp_node_pt[np * np + n * np] = 0;
142 for (
unsigned n = 0; n < np; n++)
145 this->finite_element_pt(2)->node_pt(n * np) =
146 this->finite_element_pt(1)->node_pt(np * n + np - 1);
149 delete tmp_node_pt[2 * np * np + n * np];
150 tmp_node_pt[2 * np * np + n * np] = 0;
154 for (
unsigned n = 0; n < np; n++)
157 this->finite_element_pt(3)->node_pt(np * (np - 1) + n) =
158 this->finite_element_pt(2)->node_pt(np * n + np - 1);
161 delete tmp_node_pt[3 * np * np + np * (np - 1) + n];
162 tmp_node_pt[3 * np * np + np * (np - 1) + n] = 0;
166 for (
unsigned n = 0; n < np; n++)
169 this->finite_element_pt(4)->node_pt(n) =
170 this->finite_element_pt(5)->node_pt(np * (np - n - 1) + np - 1);
173 delete tmp_node_pt[4 * np * np + n];
174 tmp_node_pt[4 * np * np + n] = 0;
178 for (
unsigned n = 0; n < np; n++)
181 this->finite_element_pt(5)->node_pt(n * np) =
182 this->finite_element_pt(6)->node_pt(np * n + np - 1);
185 delete tmp_node_pt[5 * np * np + n * np];
186 tmp_node_pt[5 * np * np + n * np] = 0;
190 for (
unsigned n = 0; n < np; n++)
193 this->finite_element_pt(6)->node_pt(n * np) =
194 this->finite_element_pt(0)->node_pt(n);
197 delete tmp_node_pt[6 * np * np + n * np];
198 tmp_node_pt[6 * np * np + n * np] = 0;
202 for (
unsigned n = 0; n < np; n++)
205 this->finite_element_pt(7)->node_pt(n * np) =
206 this->finite_element_pt(2)->node_pt((np - 1) * np + np - 1 - n);
209 delete tmp_node_pt[7 * np * np + n * np];
210 tmp_node_pt[7 * np * np + n * np] = 0;
214 for (
unsigned n = 0; n < np; n++)
217 this->finite_element_pt(8)->node_pt(n * np) =
218 this->finite_element_pt(3)->node_pt(np * n + np - 1);
221 delete tmp_node_pt[8 * np * np + n * np];
222 tmp_node_pt[8 * np * np + n * np] = 0;
226 for (
unsigned n = 0; n < np; n++)
229 this->finite_element_pt(9)->node_pt(n * np) =
230 this->finite_element_pt(4)->node_pt(np * n + np - 1);
233 delete tmp_node_pt[9 * np * np + n * np];
234 tmp_node_pt[9 * np * np + n * np] = 0;
239 for (
unsigned n = 0; n < np; n++)
242 this->finite_element_pt(10)->node_pt(n * np) =
243 this->finite_element_pt(5)->node_pt(n);
246 delete tmp_node_pt[10 * np * np + n * np];
247 tmp_node_pt[10 * np * np + n * np] = 0;
252 for (
unsigned n = 0; n < np; n++)
255 this->finite_element_pt(11)->node_pt(n * np) =
256 this->finite_element_pt(7)->node_pt(np * n + np - 1);
259 delete tmp_node_pt[11 * np * np + n * np];
260 tmp_node_pt[11 * np * np + n * np] = 0;
264 for (
unsigned n = 0; n < np; n++)
267 this->finite_element_pt(12)->node_pt(n * np) =
268 this->finite_element_pt(8)->node_pt(np * n + np - 1);
271 delete tmp_node_pt[12 * np * np + n * np];
272 tmp_node_pt[12 * np * np + n * np] = 0;
276 for (
unsigned n = 0; n < np; n++)
279 this->finite_element_pt(13)->node_pt(n * np) =
280 this->finite_element_pt(9)->node_pt(np * n + np - 1);
283 delete tmp_node_pt[13 * np * np + n * np];
284 tmp_node_pt[13 * np * np + n * np] = 0;
288 for (
unsigned n = 0; n < np; n++)
291 this->finite_element_pt(14)->node_pt(n * np) =
292 this->finite_element_pt(10)->node_pt(np * n + np - 1);
295 delete tmp_node_pt[14 * np * np + n * np];
296 tmp_node_pt[14 * np * np + n * np] = 0;
301 for (
unsigned n = 0; n < np; n++)
304 this->finite_element_pt(8)->node_pt(np * (np - 1) + n) =
305 this->finite_element_pt(7)->node_pt(n);
308 delete tmp_node_pt[8 * np * np + np * (np - 1) + n];
309 tmp_node_pt[8 * np * np + np * (np - 1) + n] = 0;
314 for (
unsigned n = 0; n < np; n++)
317 this->finite_element_pt(10)->node_pt(np * (np - 1) + n) =
318 this->finite_element_pt(9)->node_pt(n);
321 delete tmp_node_pt[10 * np * np + np * (np - 1) + n];
322 tmp_node_pt[10 * np * np + np * (np - 1) + n] = 0;
327 for (
unsigned n = 0; n < np; n++)
330 this->finite_element_pt(15)->node_pt(n * np) =
331 this->finite_element_pt(11)->node_pt(np * n + np - 1);
334 delete tmp_node_pt[15 * np * np + n * np];
335 tmp_node_pt[15 * np * np + n * np] = 0;
339 for (
unsigned n = 0; n < np; n++)
342 this->finite_element_pt(16)->node_pt(n * np) =
343 this->finite_element_pt(12)->node_pt(np * n + np - 1);
346 delete tmp_node_pt[16 * np * np + n * np];
347 tmp_node_pt[16 * np * np + n * np] = 0;
351 for (
unsigned n = 0; n < np; n++)
354 this->finite_element_pt(17)->node_pt(n * np) =
355 this->finite_element_pt(13)->node_pt(np * n + np - 1);
358 delete tmp_node_pt[17 * np * np + n * np];
359 tmp_node_pt[17 * np * np + n * np] = 0;
363 for (
unsigned n = 0; n < np; n++)
366 this->finite_element_pt(18)->node_pt(n * np) =
367 this->finite_element_pt(14)->node_pt(np * n + np - 1);
370 delete tmp_node_pt[18 * np * np + n * np];
371 tmp_node_pt[18 * np * np + n * np] = 0;
376 for (
unsigned n = 0; n < np; n++)
379 this->finite_element_pt(12)->node_pt(np * (np - 1) + n) =
380 this->finite_element_pt(11)->node_pt(n);
383 delete tmp_node_pt[12 * np * np + np * (np - 1) + n];
384 tmp_node_pt[12 * np * np + np * (np - 1) + n] = 0;
389 for (
unsigned n = 0; n < np; n++)
392 this->finite_element_pt(14)->node_pt(np * (np - 1) + n) =
393 this->finite_element_pt(13)->node_pt(n);
396 delete tmp_node_pt[14 * np * np + np * (np - 1) + n];
397 tmp_node_pt[14 * np * np + np * (np - 1) + n] = 0;
402 for (
unsigned n = 0; n < np; n++)
405 this->finite_element_pt(19)->node_pt(np * (np - 1) + n) =
406 this->finite_element_pt(15)->node_pt(np * n + np - 1);
409 delete tmp_node_pt[19 * np * np + np * (np - 1) + n];
410 tmp_node_pt[19 * np * np + np * (np - 1) + n] = 0;
415 for (
unsigned n = 0; n < np; n++)
418 this->finite_element_pt(16)->node_pt(np * n + np - 1) =
419 this->finite_element_pt(19)->node_pt(n * np);
422 delete tmp_node_pt[16 * np * np + np * (np - 1) + n];
423 tmp_node_pt[16 * np * np + np * (np - 1) + n] = 0;
428 for (
unsigned n = 0; n < np; n++)
431 this->finite_element_pt(16)->node_pt(np * (np - 1) + n) =
432 this->finite_element_pt(15)->node_pt(n);
435 delete tmp_node_pt[16 * np * np + np * (np - 1) + n];
436 tmp_node_pt[16 * np * np + np * (np - 1) + n] = 0;
441 for (
unsigned n = 0; n < np; n++)
444 this->finite_element_pt(20)->node_pt(n) =
445 this->finite_element_pt(18)->node_pt(np * (np - n - 1) + np - 1);
448 delete tmp_node_pt[20 * np * np + n];
449 tmp_node_pt[20 * np * np + n] = 0;
454 for (
unsigned n = 0; n < np; n++)
457 this->finite_element_pt(20)->node_pt(n * np) =
458 this->finite_element_pt(17)->node_pt(np * n + np - 1);
461 delete tmp_node_pt[20 * np * np + n * np];
462 tmp_node_pt[20 * np * np + n * np] = 0;
467 for (
unsigned n = 0; n < np; n++)
470 this->finite_element_pt(18)->node_pt(np * (np - 1) + n) =
471 this->finite_element_pt(17)->node_pt(n);
474 delete tmp_node_pt[18 * np * np + np * (np - 1) + n];
475 tmp_node_pt[18 * np * np + np * (np - 1) + n] = 0;
480 for (
unsigned n = 0; n < np; n++)
483 this->finite_element_pt(21)->node_pt(n * np) =
484 this->finite_element_pt(19)->node_pt(np * n + np - 1);
487 delete tmp_node_pt[21 * np * np + n * np];
488 tmp_node_pt[21 * np * np + n * np] = 0;
493 for (
unsigned n = 0; n < np; n++)
496 this->finite_element_pt(22)->node_pt(np * (np - 1) + n) =
497 this->finite_element_pt(21)->node_pt(n);
500 delete tmp_node_pt[22 * np * np + np * (np - 1) + n];
501 tmp_node_pt[22 * np * np + np * (np - 1) + n] = 0;
506 for (
unsigned n = 0; n < np; n++)
509 this->finite_element_pt(23)->node_pt(n * np) =
510 this->finite_element_pt(20)->node_pt(np * n + np - 1);
513 delete tmp_node_pt[23 * np * np + n * np];
514 tmp_node_pt[23 * np * np + n * np] = 0;
519 for (
unsigned n = 0; n < np; n++)
522 this->finite_element_pt(22)->node_pt(n) =
523 this->finite_element_pt(23)->node_pt(np * (np - 1) + n);
526 delete tmp_node_pt[22 * np * np + np * (np - 1) + n];
527 tmp_node_pt[22 * np * np + np * (np - 1) + n] = 0;
532 for (
unsigned n = 0; n < np; n++)
535 this->finite_element_pt(24)->node_pt(n * np) =
536 this->finite_element_pt(21)->node_pt(np * n + np - 1);
539 delete tmp_node_pt[24 * np * np + n * np];
540 tmp_node_pt[24 * np * np + n * np] = 0;
545 for (
unsigned n = 0; n < np; n++)
548 this->finite_element_pt(25)->node_pt(n * np) =
549 this->finite_element_pt(22)->node_pt(np * n + np - 1);
552 delete tmp_node_pt[25 * np * np + n * np];
553 tmp_node_pt[25 * np * np + n * np] = 0;
558 for (
unsigned n = 0; n < np; n++)
561 this->finite_element_pt(26)->node_pt(n * np) =
562 this->finite_element_pt(23)->node_pt(np * n + np - 1);
565 delete tmp_node_pt[26 * np * np + n * np];
566 tmp_node_pt[26 * np * np + n * np] = 0;
571 for (
unsigned n = 0; n < np; n++)
574 this->finite_element_pt(25)->node_pt(np * (np - 1) + n) =
575 this->finite_element_pt(24)->node_pt(n);
578 delete tmp_node_pt[25 * np * np + np * (np - 1) + n];
579 tmp_node_pt[25 * np * np + np * (np - 1) + n] = 0;
584 for (
unsigned n = 0; n < np; n++)
587 this->finite_element_pt(26)->node_pt(np * (np - 1) + n) =
588 this->finite_element_pt(25)->node_pt(n);
591 delete tmp_node_pt[26 * np * np + np * (np - 1) + n];
592 tmp_node_pt[26 * np * np + np * (np - 1) + n] = 0;
597 for (
unsigned n = 0; n < np; n++)
600 this->finite_element_pt(27)->node_pt(np * (np - 1) + n) =
601 this->finite_element_pt(24)->node_pt(np * n + np - 1);
604 delete tmp_node_pt[27 * np * np + np * (np - 1) + n];
605 tmp_node_pt[27 * np * np + np * (np - 1) + n] = 0;
610 for (
unsigned n = 0; n < np; n++)
613 this->finite_element_pt(27)->node_pt(n * np) =
614 this->finite_element_pt(25)->node_pt(np * n + np - 1);
617 delete tmp_node_pt[27 * np * np + n * np];
618 tmp_node_pt[27 * np * np + n * np] = 0;
623 for (
unsigned n = 0; n < np; n++)
626 this->finite_element_pt(27)->node_pt(n) =
627 this->finite_element_pt(26)->node_pt(np * (np - n - 1) + np - 1);
630 delete tmp_node_pt[27 * np * np + n];
631 tmp_node_pt[27 * np * np + n] = 0;
636 for (
unsigned n = 0; n < np; n++)
639 this->finite_element_pt(28)->node_pt(n * np) =
640 this->finite_element_pt(27)->node_pt(np * n + np - 1);
643 delete tmp_node_pt[28 * np * np + n * np];
644 tmp_node_pt[28 * np * np + n * np] = 0;
649 for (
unsigned n = 0; n < np; n++)
652 this->finite_element_pt(29)->node_pt(n * np) =
653 this->finite_element_pt(28)->node_pt(np * n + np - 1);
656 delete tmp_node_pt[29 * np * np + n * np];
657 tmp_node_pt[29 * np * np + n * np] = 0;
662 for (
unsigned n = 0; n < np; n++)
665 this->finite_element_pt(30)->node_pt(n * np) =
666 this->finite_element_pt(29)->node_pt(np * n + np - 1);
669 delete tmp_node_pt[30 * np * np + n * np];
670 tmp_node_pt[30 * np * np + n * np] = 0;
674 for (
unsigned long n = 0; n < node_count; n++)
676 if (tmp_node_pt[n] != 0)
678 Node_pt.push_back(tmp_node_pt[n]);
683 this->set_nboundary(8);
685 for (
unsigned n = 0; n < np; n++)
688 this->add_boundary_node(3, this->finite_element_pt(0)->node_pt(n * np));
690 this->add_boundary_node(
691 1, this->finite_element_pt(30)->node_pt(n * np + np - 1));
694 this->add_boundary_node(0, this->finite_element_pt(6)->node_pt(n));
697 this->add_boundary_node(
698 2, this->finite_element_pt(1)->node_pt(np * (np - 1) + n));
701 this->add_boundary_node(4, this->finite_element_pt(3)->node_pt(np * n));
704 this->add_boundary_node(
705 5, this->finite_element_pt(4)->node_pt(np * (np - 1) + n));
708 this->add_boundary_node(6, this->finite_element_pt(3)->node_pt(n));
711 this->add_boundary_node(7, this->finite_element_pt(22)->node_pt(n * np));
714 for (
unsigned n = 1; n < np; n++)
717 this->add_boundary_node(0, this->finite_element_pt(10)->node_pt(n));
720 this->add_boundary_node(
721 2, this->finite_element_pt(7)->node_pt(np * (np - 1) + n));
724 this->add_boundary_node(
725 5, this->finite_element_pt(9)->node_pt(np * (np - 1) + n));
728 this->add_boundary_node(6, this->finite_element_pt(8)->node_pt(n));
731 for (
unsigned n = np - 2; n > 0; n--)
734 this->add_boundary_node(4, this->finite_element_pt(2)->node_pt(n));
737 for (
unsigned n = 1; n < np; n++)
740 this->add_boundary_node(0, this->finite_element_pt(14)->node_pt(n));
743 this->add_boundary_node(
744 2, this->finite_element_pt(11)->node_pt(np * (np - 1) + n));
747 this->add_boundary_node(
748 5, this->finite_element_pt(13)->node_pt(np * (np - 1) + n));
751 this->add_boundary_node(6, this->finite_element_pt(12)->node_pt(n));
754 for (
unsigned n = np - 1; n > 0; n--)
757 this->add_boundary_node(4, this->finite_element_pt(1)->node_pt(n));
760 for (
unsigned n = 1; n < np; n++)
763 this->add_boundary_node(0, this->finite_element_pt(18)->node_pt(n));
765 this->add_boundary_node(
766 2, this->finite_element_pt(15)->node_pt(np * (np - 1) + n));
769 this->add_boundary_node(
770 5, this->finite_element_pt(17)->node_pt(np * (np - 1) + n));
773 this->add_boundary_node(6, this->finite_element_pt(16)->node_pt(n));
776 for (
unsigned n = np - 1; n > 0; n--)
779 this->add_boundary_node(
780 4, this->finite_element_pt(0)->node_pt(n * np + np - 1));
784 for (
unsigned n = 1; n < np; n++)
787 this->add_boundary_node(0, this->finite_element_pt(23)->node_pt(n));
789 this->add_boundary_node(
790 2, this->finite_element_pt(21)->node_pt(np * (np - 1) + n));
793 this->add_boundary_node(
794 4, this->finite_element_pt(6)->node_pt(np * (np - 1) + n));
797 this->add_boundary_node(
798 5, this->finite_element_pt(20)->node_pt(np * (np - 1) + n));
801 this->add_boundary_node(6, this->finite_element_pt(19)->node_pt(n));
804 for (
unsigned n = 0; n < np; n++)
807 this->add_boundary_node(
808 4, this->finite_element_pt(6)->node_pt(np * (np - 1) + n));
812 for (
unsigned n = 1; n < np; n++)
815 this->add_boundary_node(0, this->finite_element_pt(26)->node_pt(n));
817 this->add_boundary_node(
818 2, this->finite_element_pt(24)->node_pt(np * (np - 1) + n));
821 this->add_boundary_node(
822 4, this->finite_element_pt(5)->node_pt(np * (np - 1) + n));
826 for (
unsigned n = 1; n < np; n++)
829 this->add_boundary_node(0, this->finite_element_pt(28)->node_pt(n));
831 this->add_boundary_node(
832 2, this->finite_element_pt(28)->node_pt(np * (np - 1) + n));
835 this->add_boundary_node(4, this->finite_element_pt(4)->node_pt(np * n));
838 for (
unsigned n = 1; n < np; n++)
841 this->add_boundary_node(0, this->finite_element_pt(29)->node_pt(n));
843 this->add_boundary_node(
844 2, this->finite_element_pt(29)->node_pt(np * (np - 1) + n));
847 for (
unsigned n = 1; n < np; n++)
850 this->add_boundary_node(0, this->finite_element_pt(30)->node_pt(n));
852 this->add_boundary_node(
853 2, this->finite_element_pt(30)->node_pt(np * (np - 1) + n));
858 setup_boundary_element_info();
866 unsigned nnode = this->nboundary_node(5);
867 for (
unsigned k = 0; k < nnode; k++)
869 Node* nod_pt = this->boundary_node_pt(5, k);
870 zeta[0] = double(k) * flag_length / double(nnode - 1);
875 nnode = this->nboundary_node(6);
876 for (
unsigned k = 0; k < nnode; k++)
878 Node* nod_pt = this->boundary_node_pt(6, k);
879 zeta[0] = double(k) * flag_length / double(nnode - 1);
884 nnode = this->nboundary_node(7);
885 for (
unsigned k = 0; k < nnode; k++)
887 Node* nod_pt = this->boundary_node_pt(7, k);
888 zeta[0] = -flag_height / 2. + double(k) / double(nnode - 1) * flag_height;
893 this->Boundary_coordinate_exists[5] =
true;
894 this->Boundary_coordinate_exists[6] =
true;
895 this->Boundary_coordinate_exists[7] =
true;
898 for (
unsigned e = 0;
e < 31;
e++)
900 dynamic_cast<ELEMENT*
>(this->element_pt(
e))
901 ->set_macro_elem_pt(this->Domain_pt->macro_element_pt(
e));
914 template<
class ELEMENT>
919 for (
unsigned i = 0;
i < 5;
i++)
925 for (
unsigned k = 0; k < 3; k++)
928 unsigned nnode = el_pt->
nnode();
929 for (
unsigned i = 0;
i < nnode;
i++)
936 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
939 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
942 ref_value[2] = double(k + 1) / 5. * Flag_length +
943 ref_value[0] * 1. / 5. * Flag_length;
949 zeta[0] = ref_value[2];
950 Top_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
954 geom_object_pt[0] = geom_obj_pt;
965 ->add_node_update_info(1,
973 for (
unsigned k = 0; k < 3; k++)
976 unsigned nnode = el_pt->
nnode();
977 for (
unsigned i = 0;
i < nnode;
i++)
984 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
987 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
990 ref_value[2] = double(k + 1) / 5. * Flag_length +
991 ref_value[0] * 1. / 5. * Flag_length;
997 zeta[0] = ref_value[2];
998 Bottom_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1002 geom_object_pt[0] = geom_obj_pt;
1005 ref_value[3] =
s[0];
1013 ->add_node_update_info(2,
1022 unsigned nnode = el_pt->
nnode();
1023 for (
unsigned i = 0;
i < nnode;
i++)
1030 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
1033 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
1036 ref_value[2] = coord_loc[1] * Flag_height / 2.;
1042 zeta[0] = ref_value[2];
1043 Tip_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1047 geom_object_pt[0] = geom_obj_pt;
1050 ref_value[3] =
s[0];
1055 ->add_node_update_info(3,
1062 el_pt = this->finite_element_pt(21);
1063 nnode = el_pt->
nnode();
1064 for (
unsigned i = 0;
i < nnode;
i++)
1071 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
1074 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
1080 zeta[0] = Flag_height / 2.;
1081 Tip_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1085 geom_object_pt[0] = geom_obj_pt;
1088 ref_value[2] =
s[0];
1093 ->add_node_update_info(4,
1100 el_pt = this->finite_element_pt(23);
1101 nnode = el_pt->
nnode();
1102 for (
unsigned i = 0;
i < nnode;
i++)
1109 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
1112 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
1118 zeta[0] = -Flag_height / 2.;
1119 Tip_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1123 geom_object_pt[0] = geom_obj_pt;
1126 ref_value[2] =
s[0];
1131 ->add_node_update_info(5,
1138 el_pt = this->finite_element_pt(19);
1139 nnode = el_pt->
nnode();
1140 for (
unsigned i = 0;
i < nnode;
i++)
1147 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
1150 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
1154 4. / 5. * Flag_length + ref_value[0] * 1. / 5. * Flag_length;
1160 zeta[0] = ref_value[2];
1161 Top_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1165 geom_object_pt[0] = geom_obj_pt;
1168 ref_value[3] =
s[0];
1173 ->add_node_update_info(6,
1181 el_pt = this->finite_element_pt(20);
1182 nnode = el_pt->
nnode();
1183 for (
unsigned i = 0;
i < nnode;
i++)
1190 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
1193 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
1197 4. / 5. * Flag_length + ref_value[0] * 1. / 5. * Flag_length;
1203 zeta[0] = ref_value[2];
1204 Bottom_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1208 geom_object_pt[0] = geom_obj_pt;
1211 ref_value[3] =
s[0];
1216 ->add_node_update_info(7,
1223 el_pt = this->finite_element_pt(3);
1224 nnode = el_pt->
nnode();
1225 for (
unsigned i = 0;
i < nnode;
i++)
1232 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
1235 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
1238 ref_value[2] = ref_value[0] * 1. / 5. * Flag_length;
1245 zeta[0] = ref_value[2];
1246 Top_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1249 ref_value[3] =
s[0];
1253 geom_object_pt[0] = geom_obj_pt;
1256 ref_value[4] = 1. / 5. * Flag_length;
1260 zeta[0] = ref_value[4];
1261 Top_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1264 geom_object_pt[1] = geom_obj_pt;
1267 ref_value[5] =
s[0];
1273 ->add_node_update_info(8,
1281 el_pt = this->finite_element_pt(4);
1282 nnode = el_pt->
nnode();
1283 for (
unsigned i = 0;
i < nnode;
i++)
1290 ref_value[0] = 0.5 * (coord_loc[0] + 1.0);
1293 ref_value[1] = 0.5 * (coord_loc[1] + 1.0);
1296 ref_value[2] = ref_value[0] * 1. / 5. * Flag_length;
1303 zeta[0] = ref_value[2];
1304 Bottom_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1307 ref_value[3] =
s[0];
1311 geom_object_pt[0] = geom_obj_pt;
1314 ref_value[4] = 1. / 5. * Flag_length;
1318 zeta[0] = ref_value[4];
1319 Bottom_flag_pt->locate_zeta(zeta, geom_obj_pt,
s);
1322 geom_object_pt[1] = geom_obj_pt;
1325 ref_value[5] =
s[0];
1330 ->add_node_update_info(9,
1343 template<
class ELEMENT>
1352 node_update_I(
t, node_pt);
1356 node_update_II(
t, node_pt);
1360 node_update_III(
t, node_pt);
1364 node_update_IV(
t, node_pt);
1368 node_update_V(
t, node_pt);
1372 node_update_VI(
t, node_pt);
1376 node_update_VII(
t, node_pt);
1380 node_update_VIII(
t, node_pt);
1384 node_update_IX(
t, node_pt);
1388 std::ostringstream error_message;
1389 error_message <<
"Wrong id " <<
id << std::endl;
1391 OOMPH_CURRENT_FUNCTION,
1392 OOMPH_EXCEPTION_LOCATION);
1401 template<
class ELEMENT>
1416 ref_point[0] = ref_value[4];
1417 ref_point[1] = 0.778024390 * Height;
1422 zeta[0] = ref_value[3];
1427 double r = ref_value[1];
1431 ref_point[0] + (1.0 - r) * (flag_point[0] - ref_point[0]);
1433 ref_point[1] + (1.0 - r) * (flag_point[1] - ref_point[1]);
1440 template<
class ELEMENT>
1455 ref_point[0] = ref_value[4];
1456 ref_point[1] = 0.197585366 * Height;
1461 zeta[0] = ref_value[3];
1466 double r = ref_value[1];
1469 node_pt->
x(
t, 0) = ref_point[0] + r * (flag_point[0] - ref_point[0]);
1470 node_pt->
x(
t, 1) = ref_point[1] + r * (flag_point[1] - ref_point[1]);
1476 template<
class ELEMENT>
1484 p15[0] = 0.285123967 * Length;
1485 p15[1] = 0.625 * Height;
1487 p35[0] = 0.285123967 * Length;
1488 p35[1] = 0.350609756 * Height;
1501 ref_point[0] = p15[0];
1502 ref_point[1] = p35[1] + ref_value[1] * (p15[1] - p35[1]);
1507 zeta[0] = ref_value[3];
1512 double r = ref_value[0];
1515 node_pt->
x(
t, 0) = flag_point[0] + r * (ref_point[0] - flag_point[0]);
1516 node_pt->
x(
t, 1) = flag_point[1] + r * (ref_point[1] - flag_point[1]);
1522 template<
class ELEMENT>
1531 p15[0] = 0.285123967 * Length;
1532 p15[1] = 0.625 * Height;
1535 A * sqrt(1.0 - Flag_height * Flag_height / (4.0 * A * A)) +
1537 p25[1] = Centre_y + Flag_height / 2.0;
1549 zeta[0] = ref_value[2];
1554 p1[0] = top_flag[0] + ref_value[0] * (p15[0] - top_flag[0]);
1555 p1[1] = top_flag[1] + ref_value[0] * (p15[1] - top_flag[1]);
1559 p2[0] = p25[0] + ref_value[0] * (p15[0] - p25[0]);
1563 node_pt->
x(
t, 0) = p1[0] + ref_value[1] * (p2[0] - p1[0]);
1564 node_pt->
x(
t, 1) = p1[1] + ref_value[1] * (p2[1] - p1[1]);
1570 template<
class ELEMENT>
1580 A * sqrt(1.0 - Flag_height * Flag_height / (4.0 * A * A)) +
1582 p31[1] = Centre_y - Flag_height / 2.;
1584 p35[0] = 0.285123967 * Length;
1585 p35[1] = 0.350609756 * Height;
1597 zeta[0] = ref_value[2];
1603 p1[0] = top_flag[0] + ref_value[0] * (p35[0] - top_flag[0]);
1604 p1[1] = top_flag[1] + ref_value[0] * (p35[1] - top_flag[1]);
1608 p2[0] = p31[0] + ref_value[0] * (p35[0] - p31[0]);
1612 node_pt->
x(
t, 0) = p2[0] + ref_value[1] * (p1[0] - p2[0]);
1613 node_pt->
x(
t, 1) = p2[1] + ref_value[1] * (p1[1] - p2[1]);
1619 template<
class ELEMENT>
1631 p14[0] = 0.211596 * Length;
1632 p14[1] = 0.778024390 * Height;
1634 p5[0] = 0.239596 * Length;
1644 zeta[0] = ref_value[3];
1649 p1[0] = p14[0] + ref_value[0] * (p5[0] - p14[0]);
1650 p1[1] = p14[1] + ref_value[0] * (p5[1] - p14[1]);
1654 node_pt->
x(
t, 0) = point_flag[0] + ref_value[1] * (p1[0] - point_flag[0]);
1655 node_pt->
x(
t, 1) = point_flag[1] + ref_value[1] * (p1[1] - point_flag[1]);
1661 template<
class ELEMENT>
1673 p40[0] = 0.211596 * Length;
1674 p40[1] = 0.197585366 * Height;
1676 p45[0] = 0.239596 * Length;
1686 zeta[0] = ref_value[3];
1691 p1[0] = p40[0] + ref_value[0] * (p45[0] - p40[0]);
1692 p1[1] = p40[1] + ref_value[0] * (p45[1] - p40[1]);
1697 point_flag[0] + (1 - ref_value[1]) * (p1[0] - point_flag[0]);
1699 point_flag[1] + (1 - ref_value[1]) * (p1[1] - point_flag[1]);
1706 template<
class ELEMENT>
1712 p11[0] = 0.127596 * Length;
1713 p11[1] = 0.778024390 * Height;
1716 double zeta_circle_top = atan(1.0);
1717 double zeta_circle_bot = asin(Flag_height / 2. / A);
1731 double omega_horizontal = ref_value[0];
1732 double omega_vertical = ref_value[1];
1737 zeta[0] = ref_value[5];
1738 flag_end_pt->
position(
t, zeta, flag_end);
1745 zeta_circle_bot + (zeta_circle_top - zeta_circle_bot) * omega_vertical;
1746 Cylinder_pt->position(zeta, ref_point_on_circle);
1750 ref_point_on_right_line[0] =
1751 outer_point[0] + (flag_end[0] - outer_point[0]) * (1.0 - omega_vertical);
1752 ref_point_on_right_line[1] =
1753 outer_point[1] + (flag_end[1] - outer_point[1]) * (1.0 - omega_vertical);
1757 zeta[0] = ref_value[3];
1758 flag_ref_pt->
position(
t, zeta, ref_point_on_flag);
1762 zeta[0] = zeta_circle_bot;
1763 Cylinder_pt->position(zeta, circle_bot);
1768 r_bot[0] = circle_bot[0] + (flag_end[0] - circle_bot[0]) * omega_horizontal;
1769 r_bot[1] = circle_bot[1] + (flag_end[1] - circle_bot[1]) * omega_horizontal;
1775 ref_point_on_circle[0] +
1776 (ref_point_on_right_line[0] - ref_point_on_circle[0]) * omega_horizontal;
1778 ref_point_on_circle[1] +
1779 (ref_point_on_right_line[1] - ref_point_on_circle[1]) * omega_horizontal;
1784 (ref_point_on_flag[0] - r_bot[0]) * (1.0 - omega_vertical);
1786 (ref_point_on_flag[1] - r_bot[1]) * (1.0 - omega_vertical);
1792 template<
class ELEMENT>
1798 p37[0] = 0.127596 * Length;
1799 p37[1] = 0.197585366 * Height;
1802 double zeta_circle_top = -asin(Flag_height / 2. / A);
1803 double zeta_circle_bot = -atan(1.0);
1817 double omega_horizontal = ref_value[0];
1818 double omega_vertical = ref_value[1];
1823 zeta[0] = ref_value[5];
1824 flag_end_pt->
position(
t, zeta, flag_end);
1831 zeta_circle_bot + (zeta_circle_top - zeta_circle_bot) * omega_vertical;
1832 Cylinder_pt->position(zeta, ref_point_on_circle);
1836 ref_point_on_right_line[0] =
1837 outer_point[0] + (flag_end[0] - outer_point[0]) * omega_vertical;
1838 ref_point_on_right_line[1] =
1839 outer_point[1] + (flag_end[1] - outer_point[1]) * omega_vertical;
1843 zeta[0] = ref_value[3];
1844 flag_ref_pt->
position(
t, zeta, ref_point_on_flag);
1848 zeta[0] = zeta_circle_top;
1849 Cylinder_pt->position(zeta, circle_top);
1854 r_top[0] = circle_top[0] + (flag_end[0] - circle_top[0]) * omega_horizontal;
1855 r_top[1] = circle_top[1] + (flag_end[1] - circle_top[1]) * omega_horizontal;
1861 ref_point_on_circle[0] +
1862 (ref_point_on_right_line[0] - ref_point_on_circle[0]) * omega_horizontal;
1864 ref_point_on_circle[1] +
1865 (ref_point_on_right_line[1] - ref_point_on_circle[1]) * omega_horizontal;
1869 node_pt->
x(
t, 0) += (ref_point_on_flag[0] - r_top[0]) * omega_vertical;
1870 node_pt->
x(
t, 1) += (ref_point_on_flag[1] - r_top[1]) * omega_vertical;
1882 template<
class ELEMENT>
1900 zeta_ref_flag[0] = ref_value[2];
1906 this->Top_flag_pt->
locate_zeta(zeta_ref_flag, geom_obj_pt,
s);
1911 geom_object_pt[0] = geom_obj_pt;
1915 ref_value[3] =
s[0];
1920 zeta_end_flag[0] = ref_value[4];
1924 this->Top_flag_pt->locate_zeta(zeta_end_flag, geom_obj_pt,
s);
1929 geom_object_pt[1] = geom_obj_pt;
1933 ref_value[5] =
s[0];
1954 zeta_ref_flag[0] = ref_value[2];
1960 this->Bottom_flag_pt->
locate_zeta(zeta_ref_flag, geom_obj_pt,
s);
1964 geom_object_pt[0] = geom_obj_pt;
1968 ref_value[3] =
s[0];
1973 zeta_end_flag[0] = ref_value[4];
1977 this->Bottom_flag_pt->locate_zeta(zeta_end_flag, geom_obj_pt,
s);
1981 geom_object_pt[1] = geom_obj_pt;
1985 ref_value[5] =
s[0];
1998 if ((
id == 1) || (
id == 6))
2005 zeta_flag[0] = ref_value[2];
2010 this->Top_flag_pt->
locate_zeta(zeta_flag, geom_obj_pt,
s);
2019 geom_object_pt[0] = geom_obj_pt;
2023 ref_value[3] =
s[0];
2050 if ((
id == 2) || (
id == 7))
2057 zeta_flag[0] = ref_value[2];
2062 this->Bottom_flag_pt->
locate_zeta(zeta_flag, geom_obj_pt,
s);
2071 geom_object_pt[0] = geom_obj_pt;
2075 ref_value[3] =
s[0];
2101 if ((
id == 3) || (
id == 4) || (
id == 5))
2110 zeta_flag[0] = ref_value[2];
2114 zeta_flag[0] = this->Flag_height / 2.;
2118 zeta_flag[0] = -this->Flag_height / 2.;
2124 this->Tip_flag_pt->
locate_zeta(zeta_flag, geom_obj_pt,
s);
2133 geom_object_pt[0] = geom_obj_pt;
2140 ref_value[3] =
s[0];
2155 ref_value[2] =
s[0];
2170 ref_value[2] =
s[0];
void node_update_V(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_II(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_III(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
void node_update_IV(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_I(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_VIII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_VI(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_VII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void setup_algebraic_node_update()
Function to setup the algebraic node update.
void node_update_IX(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
////////////////////////////////////////////////////////////////////
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
void kill_node_update_info(const int &id=0)
Erase algebraic node update information for id-th node update function. Id defaults to 0.
Vector< GeomObject * > & vector_geom_object_pt(const int &id)
Return vector of geometric objects involved in id-th update function.
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 ...
Vector< double > & vector_ref_value()
Return vector of reference values involved in default (usually first) update function.
////////////////////////////////////////////////////////////////////
Domain for cylinder with flag as in Turek benchmark.
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...
A general Finite Element class.
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)
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned nnode() const
Return the number of nodes.
/////////////////////////////////////////////////////////////////////
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
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...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
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...
An OomphLibError object which should be thrown when an run-time error is encountered....
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...