37 BoundaryFctPt north_pt,
38 BoundaryFctPt east_pt,
39 BoundaryFctPt south_pt,
40 BoundaryFctPt west_pt)
43 Macro_element_pt.resize(1);
46 Macro_element_pt[0] =
new QMacroElement<2>(
this, 0);
69 std::ostringstream error_message;
70 bool error_flag =
false;
73 Vector<double> x_N(2);
74 (*North_boundary_fn_pt)(1.0, x_N);
75 Vector<double> x_E(2);
76 (*East_boundary_fn_pt)(1.0, x_E);
77 if (x_N[0] != x_E[0] || x_N[1] != x_E[1])
79 error_message <<
"North and East Boundaries do not meet at the "
80 <<
"North East Corner.\n"
81 <<
"North Boundary : x[0] = " << x_N[0] <<
"\n"
82 <<
" x[1] = " << x_N[1] <<
"\n"
83 <<
"East Boundary : x[0] = " << x_E[0] <<
"\n"
84 <<
" x[1] = " << x_E[1] <<
"\n\n";
90 Vector<double> x_S(2);
91 (*South_boundary_fn_pt)(1.0, x_S);
92 Vector<double> x_E(2);
93 (*East_boundary_fn_pt)(-1.0, x_E);
94 if (x_S[0] != x_E[0] || x_S[1] != x_E[1])
96 error_message <<
"South and East Boundaries do not meet at the "
97 <<
"South East Corner.\n"
98 <<
"South Boundary : x[0] = " << x_S[0] <<
"\n"
99 <<
" x[1] = " << x_S[1] <<
"\n"
100 <<
"East Boundary : x[0] = " << x_E[0] <<
"\n"
101 <<
" x[1] = " << x_E[1] <<
"\n\n";
107 Vector<double> x_S(2);
108 (*South_boundary_fn_pt)(-1.0, x_S);
109 Vector<double> x_W(2);
110 (*West_boundary_fn_pt)(-1.0, x_W);
111 if (x_S[0] != x_W[0] || x_S[1] != x_W[1])
113 error_message <<
"South and West Boundaries do not meet at the "
114 <<
"South West Corner.\n"
115 <<
"South Boundary : x[0] = " << x_S[0] <<
"\n"
116 <<
" x[1] = " << x_S[1] <<
"\n"
117 <<
"West Boundary : x[0] = " << x_W[0] <<
"\n"
118 <<
" x[1] = " << x_W[1] <<
"\n\n";
124 Vector<double> x_N(2);
125 (*North_boundary_fn_pt)(-1.0, x_N);
126 Vector<double> x_W(2);
127 (*West_boundary_fn_pt)(1.0, x_W);
128 if (x_N[0] != x_W[0] || x_N[1] != x_W[1])
130 error_message <<
"North and West Boundaries do not meet at the "
131 <<
"North West Corner.\n"
132 <<
"North Boundary : x[0] = " << x_N[0] <<
"\n"
133 <<
" x[1] = " << x_N[1] <<
"\n"
134 <<
"West Boundary : x[0] = " << x_W[0] <<
"\n"
135 <<
" x[1] = " << x_W[1] <<
"\n\n";
142 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
153 const double& l_x,
const double& l_y)
156 Macro_element_pt.resize(1);
159 Macro_element_pt[0] =
new QMacroElement<2>(
this, 0);
203 Macro_element_pt.resize(1);
206 Macro_element_pt[0] =
new QMacroElement<2>(
this, 0);
249 BoundaryFctPt d_north_pt,
250 BoundaryFctPt d_east_pt,
251 BoundaryFctPt d_south_pt,
252 BoundaryFctPt d_west_pt)
275 BoundaryFctPt d2_north_pt,
276 BoundaryFctPt d2_east_pt,
277 BoundaryFctPt d2_south_pt,
278 BoundaryFctPt d2_west_pt)
294 const unsigned& i_macro,
295 const unsigned& i_direct,
296 const Vector<double>& s,
300 using namespace QuadTreeNames;
302 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
305 "Order of function arguments has changed between versions 0.8 and 0.85",
306 "TopologicallyRectangularDomain::macro_element_boundary(...)",
307 OOMPH_EXCEPTION_LOCATION);
311 if (i_direct == N)
r_N(s, f);
313 else if (i_direct == E)
316 else if (i_direct == S)
319 else if (i_direct == W)
330 const unsigned& i_macro,
331 const unsigned& i_direct,
332 const Vector<double>& s,
336 using namespace QuadTreeNames;
338 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
341 "Order of function arguments has changed between versions 0.8 and 0.85",
342 "TopologicallyRectangularDomain::dmacro_element_boundary(...)",
343 OOMPH_EXCEPTION_LOCATION);
347 if (i_direct == N)
dr_N(s, f);
349 else if (i_direct == E)
352 else if (i_direct == S)
355 else if (i_direct == W)
366 const unsigned& i_macro,
367 const unsigned& i_direct,
368 const Vector<double>& s,
372 using namespace QuadTreeNames;
375 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
378 "Order of function arguments has changed between versions 0.8 and 0.85",
379 "TopologicallyRectangularDomain::d2macro_element_boundary(...)",
380 OOMPH_EXCEPTION_LOCATION);
384 if (i_direct == N)
d2r_N(s, f);
386 else if (i_direct == E)
389 else if (i_direct == S)
392 else if (i_direct == W)
405 (*North_boundary_fn_pt)(s[0], f);
424 (*East_boundary_fn_pt)(s[0], f);
443 (*South_boundary_fn_pt)(s[0], f);
463 (*West_boundary_fn_pt)(s[0], f);
487 (*dNorth_boundary_fn_pt)(s[0], dr);
492 const double h = 10e-8;
493 Vector<double> x_N_left(2);
494 (*North_boundary_fn_pt)(s[0] - 0.5 * h, x_N_left);
495 Vector<double> x_N_right(2);
496 (*North_boundary_fn_pt)(s[0] + 0.5 * h, x_N_right);
497 dr[0] = (x_N_right[0] - x_N_left[0]) / h;
498 dr[1] = (x_N_right[1] - x_N_left[1]) / h;
523 (*dEast_boundary_fn_pt)(s[0], dr);
528 const double h = 10e-8;
529 Vector<double> x_E_down(2);
530 (*East_boundary_fn_pt)(s[0] - 0.5 * h, x_E_down);
531 Vector<double> x_E_up(2);
532 (*East_boundary_fn_pt)(s[0] + 0.5 * h, x_E_up);
533 dr[0] = (x_E_up[0] - x_E_down[0]) / h;
534 dr[1] = (x_E_up[1] - x_E_down[1]) / h;
559 (*dSouth_boundary_fn_pt)(s[0], dr);
564 const double h = 10e-8;
565 Vector<double> x_N_left(2);
566 (*South_boundary_fn_pt)(s[0] - 0.5 * h, x_N_left);
567 Vector<double> x_N_right(2);
568 (*South_boundary_fn_pt)(s[0] + 0.5 * h, x_N_right);
569 dr[0] = (x_N_right[0] - x_N_left[0]) / h;
570 dr[1] = (x_N_right[1] - x_N_left[1]) / h;
595 (*dWest_boundary_fn_pt)(s[0], dr);
600 const double h = 10e-8;
601 Vector<double> x_W_down(2);
602 (*West_boundary_fn_pt)(s[0] - 0.5 * h, x_W_down);
603 Vector<double> x_W_up(2);
604 (*West_boundary_fn_pt)(s[0] + 0.5 * h, x_W_up);
605 dr[0] = (x_W_up[0] - x_W_down[0]) / h;
606 dr[1] = (x_W_up[1] - x_W_down[1]) / h;
631 (*d2North_boundary_fn_pt)(s[0], d2r);
639 const double h = 10e-8;
640 Vector<double> dx_N_left(2);
641 (*dNorth_boundary_fn_pt)(s[0] - 0.5 * h, dx_N_left);
642 Vector<double> dx_N_right(2);
643 (*dNorth_boundary_fn_pt)(s[0] + 0.5 * h, dx_N_right);
644 d2r[0] = (dx_N_right[0] - dx_N_left[0]) / h;
645 d2r[1] = (dx_N_right[1] - dx_N_left[1]) / h;
650 const double h = 10e-8;
651 Vector<double> N_left(2);
652 (*North_boundary_fn_pt)(s[0] - h, N_left);
653 Vector<double> N_right(2);
654 (*North_boundary_fn_pt)(s[0] + h, N_right);
655 Vector<double> N_centre(2);
656 (*North_boundary_fn_pt)(s[0], N_centre);
657 d2r[0] = (N_right[0] + N_left[0] - 2 * N_centre[0]) / (h * h);
658 d2r[1] = (N_right[1] + N_left[1] - 2 * N_centre[1]) / (h * h);
684 (*d2East_boundary_fn_pt)(s[0], d2r);
692 const double h = 10e-8;
693 Vector<double> dx_E_lower(2);
694 (*dEast_boundary_fn_pt)(s[0] - 0.5 * h, dx_E_lower);
695 Vector<double> dx_E_upper(2);
696 (*dEast_boundary_fn_pt)(s[0] + 0.5 * h, dx_E_upper);
697 d2r[0] = (dx_E_upper[0] - dx_E_lower[0]) / h;
698 d2r[1] = (dx_E_upper[1] - dx_E_lower[1]) / h;
703 const double h = 10e-8;
704 Vector<double> E_left(2);
705 (*East_boundary_fn_pt)(s[0] - h, E_left);
706 Vector<double> E_right(2);
707 (*East_boundary_fn_pt)(s[0] + h, E_right);
708 Vector<double> E_centre(2);
709 (*East_boundary_fn_pt)(s[0], E_centre);
710 d2r[0] = (E_right[0] + E_left[0] - 2 * E_centre[0]) / (h * h);
711 d2r[1] = (E_right[1] + E_left[1] - 2 * E_centre[1]) / (h * h);
737 (*d2South_boundary_fn_pt)(s[0], d2r);
745 const double h = 10e-8;
746 Vector<double> dx_S_left(2);
747 (*dSouth_boundary_fn_pt)(s[0] - 0.5 * h, dx_S_left);
748 Vector<double> dx_S_right(2);
749 (*dSouth_boundary_fn_pt)(s[0] + 0.5 * h, dx_S_right);
750 d2r[0] = (dx_S_right[0] - dx_S_left[0]) / h;
751 d2r[1] = (dx_S_right[1] - dx_S_left[1]) / h;
756 const double h = 10e-8;
757 Vector<double> S_left(2);
758 (*South_boundary_fn_pt)(s[0] - h, S_left);
759 Vector<double> S_right(2);
760 (*South_boundary_fn_pt)(s[0] + h, S_right);
761 Vector<double> S_centre(2);
762 (*South_boundary_fn_pt)(s[0], S_centre);
763 d2r[0] = (S_right[0] + S_left[0] - 2 * S_centre[0]) / (h * h);
764 d2r[1] = (S_right[1] + S_left[1] - 2 * S_centre[1]) / (h * h);
790 (*d2West_boundary_fn_pt)(s[0], d2r);
798 const double h = 10e-8;
799 Vector<double> dx_W_lower(2);
800 (*dWest_boundary_fn_pt)(s[0] - 0.5 * h, dx_W_lower);
801 Vector<double> dx_W_upper(2);
802 (*dWest_boundary_fn_pt)(s[0] + 0.5 * h, dx_W_upper);
803 d2r[0] = (dx_W_upper[0] - dx_W_lower[0]) / h;
804 d2r[1] = (dx_W_upper[1] - dx_W_lower[1]) / h;
809 const double h = 10e-8;
810 Vector<double> W_left(2);
811 (*West_boundary_fn_pt)(s[0] - h, W_left);
812 Vector<double> W_right(2);
813 (*West_boundary_fn_pt)(s[0] + h, W_right);
814 Vector<double> W_centre(2);
815 (*West_boundary_fn_pt)(s[0], W_centre);
816 d2r[0] = (W_right[0] + W_left[0] - 2 * W_centre[0]) / (h * h);
817 d2r[1] = (W_right[1] + W_left[1] - 2 * W_centre[1]) / (h * h);
void r_E(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the east boundary and returns the global coordinate...
void d2macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
returns the second derivates of the global coordinate position (f) wrt to the macro element coordinat...
BoundaryFctPt d2North_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void dmacro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
returns the derivates of the global coordinate position (f) wrt to the macro element coordinate at ma...
void dr_E(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the E boundary and returns the derivates of the glo...
void dr_S(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the south boundary and returns the derivates of the...
Vector< double > x_south_west
coordinate position of south west corner of domain (only used if boundary functions are not used)
BoundaryFctPt d2East_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void d2r_W(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the west boundary and returns the second derivates ...
BoundaryFctPt South_boundary_fn_pt
Function pointer to prescribe the north boundary of this topologically rectangular domain.
void macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
returns the global coordinate position (f) of macro element position s on boundary i_direct (e....
BoundaryFctPt dEast_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
BoundaryFctPt d2West_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void set_boundary_second_derivative_functions(BoundaryFctPt d2_north_pt, BoundaryFctPt d2_east_pt, BoundaryFctPt d2_south_pt, BoundaryFctPt d2_west_pt)
allows the boundary second derivate function pointers to be set. To compute the second derivatives of...
void r_N(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the north boundary and returns the global coordinat...
void d2r_N(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the north boundary and returns the second derivates...
BoundaryFctPt d2South_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void r_S(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the south boundary and returns the global coordinat...
BoundaryFctPt North_boundary_fn_pt
Function pointer to prescribe the north boundary of this topologically rectangular domain.
void set_boundary_derivative_functions(BoundaryFctPt d_north_pt, BoundaryFctPt d_east_pt, BoundaryFctPt d_south_pt, BoundaryFctPt d_west_pt)
allows the boundary derivate function pointers to be set. To compute the derivatives of the problem d...
BoundaryFctPt dWest_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
void dr_W(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the W boundary and returns the derivates of the glo...
void r_W(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the west boundary and returns the global coordinate...
void d2r_E(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the east boundary and returns the second derivates ...
BoundaryFctPt West_boundary_fn_pt
Function pointer to prescribe the west boundary of this topologically rectangular domain.
BoundaryFctPt East_boundary_fn_pt
Function pointer to prescribe the east boundary of this topologically rectangular domain.
TopologicallyRectangularDomain(BoundaryFctPt north_pt, BoundaryFctPt east_pt, BoundaryFctPt south_pt, BoundaryFctPt west_pt)
Constructor - domain boundaries are described with four boundary function pointers describing the top...
void dr_N(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the north boundary and returns the derivates of the...
void d2r_S(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the south boundary and returns the second derivates...
Vector< double > x_north_east
coordinate position of north east corner of domain (only used if boundary functions are not used)
BoundaryFctPt dSouth_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
BoundaryFctPt dNorth_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
////////////////////////////////////////////////////////////////////// //////////////////////////////...