channel_with_leaflet_domain.h
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-2025 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#ifndef OOMPH_CHANNEL_WITH_LEAFLET_DOMAIN_HEADER
27#define OOMPH_CHANNEL_WITH_LEAFLET_DOMAIN_HEADER
28
29// Generic includes
31#include "generic/domain.h"
33
34namespace oomph
35{
36 //===========================================================
37 /// Rectangular domain with a leaflet blocking the lower
38 /// half
39 //===========================================================
41 {
42 public:
43 /// Constructor: Pass pointer to GeomObject that represents the
44 /// leaflet,
45 /// the length of the domain to left and right of the leaflet, the
46 /// height of the leaflet and the overall height of the channel,
47 /// the number of element columns to the left and right of the leaflet,
48 /// the number of rows of elements from the bottom of the channel to
49 /// the end of the leaflet, the number of rows of elements above the
50 /// end of the leaflet.
52 const double& lleft,
53 const double& lright,
54 const double& hleaflet,
55 const double& htot,
56 const unsigned& nleft,
57 const unsigned& nright,
58 const unsigned& ny1,
59 const unsigned& ny2)
60 {
61 // Copy assignments into private storage
62 Lleft = lleft;
63 Lright = lright;
65 Htot = htot;
66 Nleft = nleft;
67 Nright = nright;
68 Ny1 = ny1;
69 Ny2 = ny2;
71
72 // Store origin of leaflet for fast reference
74 zeta[0] = 0.0;
77 X_0 = r[0];
78
79 // Number of macro elements
80 unsigned nmacro = (Ny1 + Ny2) * (Nleft + Nright);
82
83 // Build the 2D macro elements
84 for (unsigned i = 0; i < nmacro; i++)
85 {
87 }
88 }
89
90 /// Destructor: Empty; cleanup done in base class
92
93 /// Total height of domain (width of channel)
94 double htot()
95 {
96 return Htot;
97 }
98
99 /// Height of leaflet
100 double hleaflet()
101 {
102 return Hleaflet;
103 }
104
105 /// Length of domain to the left of leaflet
106 double lleft()
107 {
108 return Lleft;
109 }
110
111 /// Length of domain to the right of leaflet
112 double lright()
113 {
114 return Lright;
115 }
116
117 /// Pointer to the wall
119 {
120 return Leaflet_pt;
121 };
122
123 /// Parametrisation of macro element boundaries
124 void macro_element_boundary(const unsigned& t,
125 const unsigned& imacro,
126 const unsigned& idirect,
127 const Vector<double>& zeta,
129
130 protected:
131 /// Helper function
132 void macro_bound_I_N(const unsigned& t,
133 const Vector<double>& zeta,
135 const unsigned& i,
136 const unsigned& j);
137
138 /// Helper function
139 void macro_bound_I_S(const unsigned& t,
140 const Vector<double>& zeta,
142 const unsigned& i,
143 const unsigned& j);
144
145 /// Helper function
146 void macro_bound_I_W(const unsigned& t,
147 const Vector<double>& zeta,
149 const unsigned& i,
150 const unsigned& j);
151
152 /// Helper function
153 void macro_bound_I_E(const unsigned& t,
154 const Vector<double>& zeta,
156 const unsigned& i,
157 const unsigned& j);
158
159 /// Helper function
160 void macro_bound_II_N(const unsigned& t,
161 const Vector<double>& zeta,
163 const unsigned& i,
164 const unsigned& j);
165
166 /// Helper function
167 void macro_bound_II_S(const unsigned& t,
168 const Vector<double>& zeta,
170 const unsigned& i,
171 const unsigned& j);
172
173 /// Helper function
174 void macro_bound_II_W(const unsigned& t,
175 const Vector<double>& zeta,
177 const unsigned& i,
178 const unsigned& j);
179
180 /// Helper function
181 void macro_bound_II_E(const unsigned& t,
182 const Vector<double>& zeta,
184 const unsigned& i,
185 const unsigned& j);
186
187 /// Helper function
188 void macro_bound_III_N(const unsigned& t,
189 const Vector<double>& zeta,
191 const unsigned& i,
192 const unsigned& j);
193
194 /// Helper function
195 void macro_bound_III_S(const unsigned& t,
196 const Vector<double>& zeta,
198 const unsigned& i,
199 const unsigned& j);
200
201 /// Helper function
202 void macro_bound_III_W(const unsigned& t,
203 const Vector<double>& zeta,
205 const unsigned& i,
206 const unsigned& j);
207
208 /// Helper function
209 void macro_bound_III_E(const unsigned& t,
210 const Vector<double>& zeta,
212 const unsigned& i,
213 const unsigned& j);
214
215 /// Helper function
216 void macro_bound_IV_N(const unsigned& t,
217 const Vector<double>& zeta,
219 const unsigned& i,
220 const unsigned& j);
221
222 /// Helper function
223 void macro_bound_IV_S(const unsigned& t,
224 const Vector<double>& zeta,
226 const unsigned& i,
227 const unsigned& j);
228
229 /// Helper function
230 void macro_bound_IV_W(const unsigned& t,
231 const Vector<double>& zeta,
233 const unsigned& i,
234 const unsigned& j);
235
236 /// Helper function
237 void macro_bound_IV_E(const unsigned& t,
238 const Vector<double>& zeta,
240 const unsigned& i,
241 const unsigned& j);
242 /// Helper function
243 void slanted_bound_up(const unsigned& t,
244 const Vector<double>& zeta,
246
247 /// Length of the domain to the right of the leaflet
248 double Lright;
249
250 /// Length of the domain to the left of the leaflet
251 double Lleft;
252
253 /// Lagrangian coordinate at end of leaflet
254 double Hleaflet;
255
256 /// Total width of the channel
257 double Htot;
258
259 /// Number of macro element columnns to the right of the leaflet
260 unsigned Nright;
261
262 /// Number of macro element columns to the left of the leaflet
263 unsigned Nleft;
264
265 /// Number of macro element rows up to the end of the leaflet
266 unsigned Ny1;
267
268 /// Number of macro element rows above the leaflet
269 unsigned Ny2;
270
271 /// Center of the domain : origin of the leaflet, extracted
272 /// from GeomObject and stored for fast access.
273 double X_0;
274
275 /// Pointer to leaflet
277 };
278
279 //===================================================================
280 /// Parametrisation of macro element boundaries
281 //===================================================================
283 const unsigned& t,
284 const unsigned& imacro,
285 const unsigned& idirect,
286 const Vector<double>& zeta,
288 {
289#ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
290 // Warn about time argument being moved to the front
292 "Order of function arguments has changed between versions 0.8 and 0.85",
293 "ChannelWithLeafletDomain::macro_element_boundary(...)",
295#endif
296
297 using namespace QuadTreeNames;
298
299 // Number of the line and of the colum in the whole domain
300 // Beware : iline starts on zero
301 unsigned iline = int(floor(double(imacro) / double(Nleft + Nright)));
302 unsigned icol = imacro % (Nright + Nleft);
303
304 // Number of the line and of the colum in the part considered
305 unsigned i, j;
306
307 // Left low part of the domain : Part I
308 //------------------------------------
309 if ((iline < Ny1) && (icol < Nleft))
310 {
311 i = iline;
312 j = icol;
313
314 switch (idirect)
315 {
316 case N:
317 macro_bound_I_N(t, zeta, r, i, j);
318 break;
319 case S:
320 macro_bound_I_S(t, zeta, r, i, j);
321 break;
322 case W:
323 macro_bound_I_W(t, zeta, r, i, j);
324 break;
325 case E:
326 macro_bound_I_E(t, zeta, r, i, j);
327 break;
328 }
329 }
330 // Right low part of the domain : Part II
331 //--------------------------------------
332 else if ((iline < Ny1) && (icol >= Nleft))
333 {
334 i = iline;
335 j = icol - Nleft;
336
337 switch (idirect)
338 {
339 case N:
340 macro_bound_II_N(t, zeta, r, i, j);
341 break;
342 case S:
343 macro_bound_II_S(t, zeta, r, i, j);
344 break;
345 case W:
346 macro_bound_II_W(t, zeta, r, i, j);
347 break;
348 case E:
349 macro_bound_II_E(t, zeta, r, i, j);
350 break;
351 }
352 }
353 // Left upper part of the domain : Part III
354 //----------------------------------------
355 else if ((iline >= Ny1) && (icol < Nleft))
356 {
357 i = iline - Ny1;
358 j = icol;
359
360 switch (idirect)
361 {
362 case N:
364 break;
365 case S:
367 break;
368 case W:
370 break;
371 case E:
373 break;
374 }
375 }
376 // Right upper part of the domain : Part IV
377 //-----------------------------------------
378 else if ((iline >= Ny1) && (icol >= Nleft))
379 {
380 i = iline - Ny1;
381 j = icol - Nleft;
382
383 switch (idirect)
384 {
385 case N:
386 macro_bound_IV_N(t, zeta, r, i, j);
387 break;
388 case S:
389 macro_bound_IV_S(t, zeta, r, i, j);
390 break;
391 case W:
392 macro_bound_IV_W(t, zeta, r, i, j);
393 break;
394 case E:
395 macro_bound_IV_E(t, zeta, r, i, j);
396 break;
397 }
398 }
399 }
400
401
402 /////////////////////////////////////////////////////////////////////
403 /////////////////////////////////////////////////////////////////////
404 // Helper functions for region I (lower left region)
405 /////////////////////////////////////////////////////////////////////
406 /////////////////////////////////////////////////////////////////////
407
408 //=====================================================================
409 /// Helper function for eastern boundary in lower left region
410 //=====================================================================
412 const Vector<double>& zeta,
414 const unsigned& i,
415 const unsigned& j)
416 {
417 // Find x,y on the wall corresponding to the position of the macro element
418
419 // xi_wall varies from xi0 to xi1 on the wall
420 double xi0, xi1;
421 xi0 = double(i) * Hleaflet / double(Ny1);
422 xi1 = double(i + 1) * Hleaflet / double(Ny1);
423
425 xi_wall[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
426
429
430 // Find x,y on a vertical line corresponding
431 // to the position of the macro element
432
433 // the vertical line goes from y0 to y1
434 double y0, y1;
435 y0 = double(i) * Hleaflet / double(Ny1);
436 y1 = double(i + 1) * Hleaflet / double(Ny1);
437
439 r_vert[0] = -Lleft + X_0;
440 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
441
442 // Parameter with value 0 in -Lleft and value 1 on the wall.
443 double s = double(j + 1) / double(Nleft);
444
445 /// Final expression of r
446 r[0] = r_vert[0] + s * (r_wall[0] - r_vert[0]);
447 r[1] = r_vert[1] + s * (r_wall[1] - r_vert[1]);
448 }
449
450 //=====================================================================
451 /// Helper function for western boundary in lower left region
452 //=====================================================================
454 const Vector<double>& zeta,
456 const unsigned& i,
457 const unsigned& j)
458 {
459 // Find x,y on the wall corresponding to the position of the macro element
460
461 // xi_wall varies from xi0 to xi1 on the wall
462 double xi0, xi1;
463 xi0 = double(i) * Hleaflet / double(Ny1);
464 xi1 = double(i + 1) * Hleaflet / double(Ny1);
465
467 xi_wall[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
468
471
472 // Find x,y on a vertical line corresponding
473 // to the position of the macro element
474
475 // the vertical line goes from y0 to y1
476 double y0, y1;
477 y0 = double(i) * Hleaflet / double(Ny1);
478 y1 = double(i + 1) * Hleaflet / double(Ny1);
479
481 r_vert[0] = -Lleft + X_0;
482 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
483
484 // Parameter with value 0 in -Lleft and value 1 on the wall.
485 double s = double(j) / double(Nleft);
486
487 /// Final expression of r
488 r[0] = r_vert[0] + s * (r_wall[0] - r_vert[0]);
489 r[1] = r_vert[1] + s * (r_wall[1] - r_vert[1]);
490 }
491
492 //=====================================================================
493 /// Helper function for northern boundary in lower left region
494 //=====================================================================
496 const Vector<double>& zeta,
498 const unsigned& i,
499 const unsigned& j)
500 {
501 // Find the coordinates of the two corners of the north boundary
502 Vector<double> xi(1);
505 xi[0] = 1;
506 macro_bound_I_W(t, xi, r_left, i, j);
507 macro_bound_I_E(t, xi, r_right, i, j);
508
509 // Connect those two points with a straight line
510 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
511 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
512 }
513
514 //=====================================================================
515 /// Helper function for southern boundary in lower left region
516 //=====================================================================
518 const Vector<double>& zeta,
520 const unsigned& i,
521 const unsigned& j)
522 {
523 /// Find the coordinates of the two corners of the south boundary
524 Vector<double> xi(1);
527 xi[0] = -1.0;
528 macro_bound_I_W(t, xi, r_left, i, j);
529 macro_bound_I_E(t, xi, r_right, i, j);
530
531 // Connect those two points with a straight line
532 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
533 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
534 }
535
536
537 /////////////////////////////////////////////////////////////////////
538 /////////////////////////////////////////////////////////////////////
539 // Helper functions for region II (lower right region)
540 /////////////////////////////////////////////////////////////////////
541 /////////////////////////////////////////////////////////////////////
542
543 //=====================================================================
544 /// Helper function for eastern boundary in lower right region
545 //=====================================================================
547 const Vector<double>& zeta,
549 const unsigned& i,
550 const unsigned& j)
551
552 {
553 // Find x,y on the wall corresponding to the position of the macro element
554
555 // xi_wall varies from xi0 to xi1 on the wall
556 double xi0, xi1;
557 xi0 = double(i) * Hleaflet / double(Ny1);
558 xi1 = double(i + 1) * Hleaflet / double(Ny1);
559
561 xi_wall[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
562
565
566 // Find x,y on a vertical line corresponding
567 // to the position of the macro element
568
569 // the vertical line goes from y0 to y1
570 double y0, y1;
571 y0 = double(i) * Hleaflet / double(Ny1);
572 y1 = double(i + 1) * Hleaflet / double(Ny1);
573
575 r_vert[0] = Lright + X_0;
576 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
577
578 // Parameter with value 0 in Lright and value 1 on the wall.
579 double s = double(Nright - j - 1) / double(Nright); /***Change****/
580
581 /// Final expression of r
582 r[0] = r_vert[0] + s * (r_wall[0] - r_vert[0]);
583 r[1] = r_vert[1] + s * (r_wall[1] - r_vert[1]);
584 }
585
586 //=====================================================================
587 /// Helper function for western boundary in lower right region
588 //=====================================================================
590 const Vector<double>& zeta,
592 const unsigned& i,
593 const unsigned& j)
594 {
595 // Abscissa of the origin of the boudary east
596
597 // Find x,y on the wall corresponding to the position of the macro element
598
599 // xi_wall varies from xi0 to xi1 on the wall
600 double xi0, xi1;
601 xi0 = double(i) * Hleaflet / double(Ny1);
602 xi1 = double(i + 1) * Hleaflet / double(Ny1);
603
605 xi_wall[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
606
609
610 // Find x,y on a vertical line corresponding
611 // to the position of the macro element
612
613 // the vertical line goes from y0 to y1
614 double y0, y1;
615 y0 = double(i) * Hleaflet / double(Ny1);
616 y1 = double(i + 1) * Hleaflet / double(Ny1);
617
619 r_vert[0] = Lright + X_0;
620 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
621
622 // Parameter with value 0 in -Lleft and value 1 on the wall.
623 double s = double(Nright - j) / double(Nright); /***Change****/
624
625 // Final expression of r
626 r[0] = r_vert[0] + s * (r_wall[0] - r_vert[0]);
627 r[1] = r_vert[1] + s * (r_wall[1] - r_vert[1]);
628 }
629
630 //=====================================================================
631 /// Helper function for northern boundary in lower right region
632 //=====================================================================
634 const Vector<double>& zeta,
636 const unsigned& i,
637 const unsigned& j)
638 {
639 // Find the coordinates of the two corners of the north boundary
640 Vector<double> xi(1);
643 xi[0] = 1;
644 macro_bound_II_W(t, xi, r_left, i, j);
645 macro_bound_II_E(t, xi, r_right, i, j);
646
647 // Connect those two points with a straight line
648 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
649 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
650 }
651
652 //=====================================================================
653 /// Helper function for southern boundary in lower right region
654 //=====================================================================
656 const Vector<double>& zeta,
658 const unsigned& i,
659 const unsigned& j)
660 {
661 // Find the coordinates of the two corners of the south boundary
662 Vector<double> xi(1);
665 xi[0] = -1.0;
666 macro_bound_II_W(t, xi, r_left, i, j);
667 macro_bound_II_E(t, xi, r_right, i, j);
668
669 // Connect those two points with a straight line
670 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
671 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
672 }
673
674
675 /////////////////////////////////////////////////////////////////////
676 /////////////////////////////////////////////////////////////////////
677 // Helper functions for region III (upper left region)
678 /////////////////////////////////////////////////////////////////////
679 /////////////////////////////////////////////////////////////////////
680
681 //=====================================================================
682 /// Describe the line between the boundary north of the domain (at x=X_0)
683 /// and the top of the wall, when zeta goes from 0 to 1.
684 //=====================================================================
686 const Vector<double>& zeta,
688 {
689 // Coordinates of the point on the boundary beetween the upper
690 // and the lower part, in the same column, at the east.
691 Vector<double> xi(1);
692 xi[0] = Hleaflet;
693
695
697
698 r[0] = r_join[0] + zeta[0] * (X_0 - r_join[0]);
699 r[1] = r_join[1] + zeta[0] * (Htot - r_join[1]);
700 }
701
702 //=====================================================================
703 /// Helper function for eastern boundary in upper left region
704 //=====================================================================
706 const Vector<double>& zeta,
708 const unsigned& i,
709 const unsigned& j)
710 {
711 // Find x,y on the slanted straight line (SSL) corresponding to
712 // the position of the macro element
713
714 // xi_line varies from xi0 to xi1 on the SSL
715 double xi0, xi1;
716 xi0 = double(i) / double(Ny2);
717 xi1 = double(i + 1) / double(Ny2);
718
720 xi_line[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
721
724
725 // Find x,y on a vertical line corresponding
726 // to the position of the macro element
727
728 // the vertical line goes from y0 to y1
729 double y0, y1;
730 y0 = double(i) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
731 y1 = double(i + 1) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
732 ;
733
735 r_vert[0] = -Lleft + X_0;
736 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
737
738 // Parameter with value 0 in Lright and value 1 on the wall.
739 double s = double(j + 1) / double(Nleft); /***Change****/
740
741 /// Final expression of r
742 r[0] = r_vert[0] + s * (r_line[0] - r_vert[0]);
743 r[1] = r_vert[1] + s * (r_line[1] - r_vert[1]);
744 }
745
746 //=====================================================================
747 /// Helper function for western boundary in upper left region
748 //=====================================================================
750 const Vector<double>& zeta,
752 const unsigned& i,
753 const unsigned& j)
754 {
755 // Find x,y on the slanted straight line (SSL) corresponding to
756 // the position of the macro element
757
758 // xi_line varies from xi0 to xi1 on the SSL
759 double xi0, xi1;
760 xi0 = double(i) / double(Ny2);
761 xi1 = double(i + 1) / double(Ny2);
762
764 xi_line[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
765
768
769 // Find x,y on a vertical line corresponding
770 // to the position of the macro element
771
772 // the vertical line goes from y0 to y1
773 double y0, y1;
774 y0 = double(i) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
775 y1 = double(i + 1) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
776 ;
777
779 r_vert[0] = -Lleft + X_0;
780 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
781
782 // Parameter with value 0 in Lright and value 1 on the wall.
783 double s = double(j) / double(Nleft); /***Change****/
784
785 // Final expression of r
786 r[0] = r_vert[0] + s * (r_line[0] - r_vert[0]);
787 r[1] = r_vert[1] + s * (r_line[1] - r_vert[1]);
788 }
789
790 //=====================================================================
791 /// Helper function for northern boundary in upper left region
792 //=====================================================================
794 const Vector<double>& zeta,
796 const unsigned& i,
797 const unsigned& j)
798 {
799 // Find the coordinates of the two corners of the north boundary
800 Vector<double> xi(1);
803 xi[0] = 1;
804 macro_bound_III_W(t, xi, r_left, i, j);
805 macro_bound_III_E(t, xi, r_right, i, j);
806
807 // Connect those two points with a straight line
808 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
809 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
810 }
811
812 //=====================================================================
813 /// Helper function for southern boundary in upper left region
814 //=====================================================================
816 const Vector<double>& zeta,
818 const unsigned& i,
819 const unsigned& j)
820 {
821 // Find the coordinates of the two corners of the south boundary
822 Vector<double> xi(1);
825 xi[0] = -1;
826 macro_bound_III_W(t, xi, r_left, i, j);
827 macro_bound_III_E(t, xi, r_right, i, j);
828
829 // Connect those two points with a straight line
830 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
831 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
832 }
833
834
835 /////////////////////////////////////////////////////////////////////
836 /////////////////////////////////////////////////////////////////////
837 // Helper functions for region IV (upper right region)
838 /////////////////////////////////////////////////////////////////////
839 /////////////////////////////////////////////////////////////////////
840
841 //=====================================================================
842 /// Helper function for eastern boundary in upper right region
843 //=====================================================================
845 const Vector<double>& zeta,
847 const unsigned& i,
848 const unsigned& j)
849 {
850 // Find x,y on the slanted straight line (SSL) corresponding to
851 // the position of the macro element
852
853 // xi_line varies from xi0 to xi1 on the SSL
854 double xi0, xi1;
855 xi0 = double(i) / double(Ny2);
856 xi1 = double(i + 1) / double(Ny2);
857
859 xi_line[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
860
863
864 // Find x,y on a vertical line corresponding
865 // to the position of the macro element
866
867 // the vertical line goes from y0 to y1
868 double y0, y1;
869 y0 = double(i) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
870 y1 = double(i + 1) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
871 ;
872
874 r_vert[0] = Lright + X_0;
875 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
876
877 // Parameter with value 0 in Lright and value 1 on the wall.
878 double s = double(Nright - j - 1) / double(Nright); /***Change****/
879
880 // Final expression of r
881 r[0] = r_vert[0] + s * (r_line[0] - r_vert[0]);
882 r[1] = r_vert[1] + s * (r_line[1] - r_vert[1]);
883 }
884
885 //=====================================================================
886 /// Helper function for western boundary in upper right region
887 //=====================================================================
889 const Vector<double>& zeta,
891 const unsigned& i,
892 const unsigned& j)
893 {
894 // Find x,y on the slanted straight line (SSL) corresponding to
895 // the position of the macro element
896
897 // xi_line varies from xi0 to xi1 on the SSL
898 double xi0, xi1;
899 xi0 = double(i) / double(Ny2);
900 xi1 = double(i + 1) / double(Ny2);
901
903 xi_line[0] = xi0 + (1.0 + zeta[0]) / 2.0 * (xi1 - xi0);
904
907
908 // Find x,y on a vertical line corresponding
909 // to the position of the macro element
910
911 // The vertical line goes from y0 to y1
912 double y0, y1;
913 y0 = double(i) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
914 y1 = double(i + 1) * (Htot - Hleaflet) / double(Ny2) + Hleaflet;
915 ;
916
918 r_vert[0] = Lright + X_0;
919 r_vert[1] = y0 + (1.0 + zeta[0]) / 2.0 * (y1 - y0);
920
921 // Parameter with value 0 in Lright and value 1 on the wall.
922 double s = double(Nright - j) / double(Nright); /***Change****/
923
924 // Final expression of r
925 r[0] = r_vert[0] + s * (r_line[0] - r_vert[0]);
926 r[1] = r_vert[1] + s * (r_line[1] - r_vert[1]);
927 }
928
929 //=====================================================================
930 /// Helper function for northern boundary in upper right region
931 //=====================================================================
933 const Vector<double>& zeta,
935 const unsigned& i,
936 const unsigned& j)
937 {
938 // Find the coordinates of the two corners of the north boundary
939 Vector<double> xi(1);
942 xi[0] = 1;
943 macro_bound_IV_W(t, xi, r_left, i, j);
944 macro_bound_IV_E(t, xi, r_right, i, j);
945
946 // Connect those two points with a straight line
947 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
948 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
949 }
950
951 //=====================================================================
952 /// Helper function for southern boundary in upper right region
953 //=====================================================================
955 const Vector<double>& zeta,
957 const unsigned& i,
958 const unsigned& j)
959 {
960 // Find the coordinates of the two corners of the south boundary
961 Vector<double> xi(1);
964 xi[0] = -1;
965 macro_bound_IV_W(t, xi, r_left, i, j);
966 macro_bound_IV_E(t, xi, r_right, i, j);
967
968 // Connect those two points with a straight line
969 r[0] = r_left[0] + (1.0 + zeta[0]) / 2.0 * (r_right[0] - r_left[0]);
970 r[1] = r_left[1] + (1.0 + zeta[0]) / 2.0 * (r_right[1] - r_left[1]);
971 }
972
973} // namespace oomph
974
975#endif
static char t char * s
Definition cfortran.h:568
cstr elem_len * i
Definition cfortran.h:603
char t
Definition cfortran.h:568
Rectangular domain with a leaflet blocking the lower half.
void macro_bound_IV_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
void macro_bound_III_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
GeomObject * Leaflet_pt
Pointer to leaflet.
void macro_bound_I_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
double Lleft
Length of the domain to the left of the leaflet.
unsigned Nright
Number of macro element columnns to the right of the leaflet.
void macro_bound_II_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
unsigned Ny2
Number of macro element rows above the leaflet.
void macro_bound_I_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
double X_0
Center of the domain : origin of the leaflet, extracted from GeomObject and stored for fast access.
void macro_bound_IV_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
void macro_bound_I_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
unsigned Ny1
Number of macro element rows up to the end of the leaflet.
double lleft()
Length of domain to the left of leaflet.
void macro_bound_II_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
GeomObject *& leaflet_pt()
Pointer to the wall.
double Lright
Length of the domain to the right of the leaflet.
ChannelWithLeafletDomain(GeomObject *leaflet_pt, const double &lleft, const double &lright, const double &hleaflet, const double &htot, const unsigned &nleft, const unsigned &nright, const unsigned &ny1, const unsigned &ny2)
Constructor: Pass pointer to GeomObject that represents the leaflet, the length of the domain to left...
double Hleaflet
Lagrangian coordinate at end of leaflet.
~ChannelWithLeafletDomain()
Destructor: Empty; cleanup done in base class.
void macro_bound_III_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
void macro_bound_II_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
void slanted_bound_up(const unsigned &t, const Vector< double > &zeta, Vector< double > &r)
Helper function.
void macro_bound_III_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
double htot()
Total height of domain (width of channel)
void macro_bound_IV_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
void macro_bound_I_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
unsigned Nleft
Number of macro element columns to the left of the leaflet.
double Htot
Total width of the channel.
void macro_element_boundary(const unsigned &t, const unsigned &imacro, const unsigned &idirect, const Vector< double > &zeta, Vector< double > &r)
Parametrisation of macro element boundaries.
void macro_bound_IV_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
double lright()
Length of domain to the right of leaflet.
void macro_bound_III_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
void macro_bound_II_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &i, const unsigned &j)
Helper function.
Base class for Domains with curvilinear and/or time-dependent boundaries. Domain boundaries are typic...
Definition domain.h:67
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition domain.h:301
A geometric object is an object that provides a parametrised description of its shape via the functio...
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
An OomphLibWarning object which should be created as a temporary object to issue a warning....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).