27 #ifndef OOMPH_QUARTER_TUBE_DOMAIN_HEADER
28 #define OOMPH_QUARTER_TUBE_DOMAIN_HEADER
31 #include "../generic/quadtree.h"
32 #include "../generic/domain.h"
33 #include "../generic/geom_objects.h"
49 const Vector<double>& xi_lo,
50 const double& fract_mid,
51 const Vector<double>& xi_hi,
52 const unsigned& nlayer)
57 Wall_pt(boundary_geom_object_pt),
62 unsigned nmacro = 3 * nlayer;
65 Macro_element_pt.resize(nmacro);
68 for (
unsigned i = 0; i < nmacro; i++)
70 Macro_element_pt[i] =
new QMacroElement<3>(
this, i);
134 const unsigned& i_macro,
135 const unsigned& i_direct,
136 const Vector<double>& s,
189 const Vector<double>& zeta,
190 const unsigned& i_layer,
196 const Vector<double>& zeta,
197 const unsigned& i_layer,
203 const Vector<double>& zeta,
204 const unsigned& i_layer,
210 const Vector<double>& zeta,
211 const unsigned& i_layer,
217 const Vector<double>& zeta,
218 const unsigned& i_layer,
224 const Vector<double>& zeta,
225 const unsigned& i_layer,
232 const Vector<double>& zeta,
233 const unsigned& i_layer,
239 const Vector<double>& zeta,
240 const unsigned& i_layer,
246 const Vector<double>& zeta,
247 const unsigned& i_layer,
253 const Vector<double>& zeta,
254 const unsigned& i_layer,
260 const Vector<double>& zeta,
261 const unsigned& i_layer,
267 const Vector<double>& zeta,
268 const unsigned& i_layer,
275 const Vector<double>& zeta,
276 const unsigned& i_layer,
282 const Vector<double>& zeta,
283 const unsigned& i_layer,
289 const Vector<double>& zeta,
290 const unsigned& i_layer,
296 const Vector<double>& zeta,
297 const unsigned& i_layer,
303 const Vector<double>& zeta,
304 const unsigned& i_layer,
310 const Vector<double>& zeta,
311 const unsigned& i_layer,
327 const unsigned& imacro,
328 const unsigned& idirect,
329 const Vector<double>& s,
332 using namespace OcTreeNames;
334 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
337 "Order of function arguments has changed between versions 0.8 and 0.85",
338 "QuarterTubeDomain::macro_element_boundary(...)",
339 OOMPH_EXCEPTION_LOCATION);
343 unsigned ilayer = unsigned(imacro / 3);
357 else if (idirect == R)
361 else if (idirect == D)
365 else if (idirect == U)
369 else if (idirect == B)
373 else if (idirect == F)
379 std::ostringstream error_stream;
380 error_stream <<
"idirect is " << idirect
381 <<
" not one of L, R, D, U, B, F" << std::endl;
383 throw OomphLibError(error_stream.str(),
384 OOMPH_CURRENT_FUNCTION,
385 OOMPH_EXCEPTION_LOCATION);
399 else if (idirect == R)
403 else if (idirect == D)
407 else if (idirect == U)
411 else if (idirect == B)
415 else if (idirect == F)
421 std::ostringstream error_stream;
422 error_stream <<
"idirect is " << idirect
423 <<
" not one of L, R, D, U, B, F" << std::endl;
425 throw OomphLibError(error_stream.str(),
426 OOMPH_CURRENT_FUNCTION,
427 OOMPH_EXCEPTION_LOCATION);
441 else if (idirect == R)
445 else if (idirect == D)
449 else if (idirect == U)
453 else if (idirect == B)
457 else if (idirect == F)
463 std::ostringstream error_stream;
464 error_stream <<
"idirect is " << idirect
465 <<
" not one of L, R, D, U, B, F" << std::endl;
467 throw OomphLibError(error_stream.str(),
468 OOMPH_CURRENT_FUNCTION,
469 OOMPH_EXCEPTION_LOCATION);
477 std::ostringstream error_stream;
478 error_stream <<
"Wrong imacro " << imacro << std::endl;
480 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
490 const Vector<double>& zeta,
491 const unsigned& i_layer,
503 Vector<double> r_top(3);
504 Wall_pt->position(t, x, r_top);
508 f[1] = r_top[1] * 0.25 * (1.0 + zeta[0]);
511 f[2] = x[0] + rho * (r_top[2] - x[0]);
522 const Vector<double>& zeta,
523 const unsigned& i_layer,
538 Vector<double> r_top(3);
539 Wall_pt->position(t, x, r_top);
549 Vector<double> r_bottom(3);
550 Wall_pt->position(t, x, r_bottom);
553 f[0] = 0.5 * r_bottom[0];
554 f[1] = r_top[1] * 0.25 * (1.0 + zeta[0]);
558 f[2] = x[0] + rho * (r_top[2] - x[0]);
568 const Vector<double>& zeta,
569 const unsigned& i_layer,
581 Vector<double> r_bottom(3);
582 Wall_pt->position(t, x, r_bottom);
585 f[0] = r_bottom[0] * 0.25 * (1.0 + zeta[0]);
590 f[2] = x[0] + rho * (r_bottom[2] - x[0]);
600 const Vector<double>& zeta,
601 const unsigned& i_layer,
613 Vector<double> r_top(3);
614 Wall_pt->position(t, x, r_top);
624 Vector<double> r_bottom(3);
625 Wall_pt->position(t, x, r_bottom);
628 f[0] = r_bottom[0] * 0.25 * (1.0 + zeta[0]);
629 f[1] = 0.5 * r_top[1];
633 f[2] = x[0] + rho * (r_bottom[2] - x[0]);
643 const Vector<double>& zeta,
644 const unsigned& i_layer,
654 Vector<double> r_bottom(3);
655 Wall_pt->position(t, x, r_bottom);
664 Vector<double> r_top(3);
665 Wall_pt->position(t, x, r_top);
668 f[0] = r_bottom[0] * 0.25 * (1.0 + zeta[0]);
669 f[1] = r_top[1] * 0.25 * (1.0 + zeta[1]);
673 f[2] = x[0] + rho * (r_top[2] - x[0]);
683 const Vector<double>& zeta,
684 const unsigned& i_layer,
694 Vector<double> r_bottom(3);
695 Wall_pt->position(t, x, r_bottom);
704 Vector<double> r_top(3);
705 Wall_pt->position(t, x, r_top);
708 f[0] = r_bottom[0] * 0.25 * (1.0 + zeta[0]);
709 f[1] = r_top[1] * 0.25 * (1.0 + zeta[1]);
713 f[2] = x[0] + rho * (r_top[2] - x[0]);
726 const Vector<double>& zeta,
727 const unsigned& i_layer,
739 const Vector<double>& zeta,
740 const unsigned& i_layer,
761 const Vector<double>& zeta,
762 const unsigned& i_layer,
774 Vector<double> r_bottom(3);
775 Wall_pt->position(t, x, r_bottom);
778 f[0] = 0.5 * r_bottom[0] * (1.0 +
s_squashed(0.5 * (1.0 + zeta[0])));
782 double rho =
s_squashed(0.5 * (1.0 + zeta[0]));
783 f[2] = x[0] + rho * (r_bottom[2] - x[0]);
793 const Vector<double>& zeta,
794 const unsigned& i_layer,
806 Vector<double> r_div(3);
807 Wall_pt->position(t, x, r_div);
811 Vector<double> zeta_central(2);
812 Vector<double> r_central(3);
813 zeta_central[0] = 1.0;
814 zeta_central[1] = zeta[1];
815 r_centr_R(t, zeta_central, i_layer, r_central);
819 f[0] = r_central[0] +
820 (r_div[0] - r_central[0]) *
s_squashed(0.5 * (1.0 + zeta[0]));
821 f[1] = r_central[1] +
822 (r_div[1] - r_central[1]) *
s_squashed(0.5 * (1.0 + zeta[0]));
823 f[2] = r_central[2] +
824 (r_div[2] - r_central[2]) *
s_squashed(0.5 * (1.0 + zeta[0]));
833 const Vector<double>& zeta,
834 const unsigned& i_layer,
844 Vector<double> r_wall(3);
845 Wall_pt->position(t, x, r_wall);
848 Vector<double> zeta_central(2);
849 Vector<double> r_central(3);
850 zeta_central[0] = zeta[1];
851 zeta_central[1] = -1.0;
852 r_centr_R(t, zeta_central, i_layer, r_central);
856 f[0] = r_central[0] +
857 (r_wall[0] - r_central[0]) *
s_squashed(0.5 * (1.0 + zeta[0]));
858 f[1] = r_central[1] +
859 (r_wall[1] - r_central[1]) *
s_squashed(0.5 * (1.0 + zeta[0]));
860 f[2] = r_central[2] +
861 (r_wall[2] - r_central[2]) *
s_squashed(0.5 * (1.0 + zeta[0]));
870 const Vector<double>& zeta,
871 const unsigned& i_layer,
881 Vector<double> r_wall(3);
882 Wall_pt->position(t, x, r_wall);
885 Vector<double> zeta_central(2);
886 Vector<double> r_central(3);
887 zeta_central[0] = zeta[1];
888 zeta_central[1] = 1.0;
889 r_centr_R(t, zeta_central, i_layer, r_central);
893 f[0] = r_central[0] +
894 (r_wall[0] - r_central[0]) *
s_squashed(0.5 * (1.0 + zeta[0]));
895 f[1] = r_central[1] +
896 (r_wall[1] - r_central[1]) *
s_squashed(0.5 * (1.0 + zeta[0]));
897 f[2] = r_central[2] +
898 (r_wall[2] - r_central[2]) *
s_squashed(0.5 * (1.0 + zeta[0]));
910 const Vector<double>& zeta,
911 const unsigned& i_layer,
923 Vector<double> r_top(3);
924 Wall_pt->position(t, x, r_top);
928 f[1] = 0.5 * r_top[1] * (1.0 +
s_squashed(0.5 * (1.0 + zeta[0])));
931 double rho =
s_squashed(0.5 * (1.0 + zeta[0]));
932 f[2] = x[0] + rho * (r_top[2] - x[0]);
942 const Vector<double>& zeta,
943 const unsigned& i_layer,
947 Vector<double> zeta_br(2);
948 zeta_br[0] = zeta[0];
949 zeta_br[1] = zeta[1];
959 const Vector<double>& zeta,
960 const unsigned& i_layer,
972 const Vector<double>& zeta,
973 const unsigned& i_layer,
995 const Vector<double>& zeta,
996 const unsigned& i_layer,
1000 Vector<double> x(2);
1008 Vector<double> r_wall(3);
1009 Wall_pt->position(t, x, r_wall);
1013 Vector<double> zeta_central(2);
1014 Vector<double> r_central(3);
1015 zeta_central[0] = zeta[0];
1016 zeta_central[1] = -1.0;
1017 r_centr_U(t, zeta_central, i_layer, r_central);
1020 f[0] = r_central[0] +
1021 (r_wall[0] - r_central[0]) *
s_squashed(0.5 * (1.0 + zeta[1]));
1022 f[1] = r_central[1] +
1023 (r_wall[1] - r_central[1]) *
s_squashed(0.5 * (1.0 + zeta[1]));
1024 f[2] = r_central[2] +
1025 (r_wall[2] - r_central[2]) *
s_squashed(0.5 * (1.0 + zeta[1]));
1034 const Vector<double>& zeta,
1035 const unsigned& i_layer,
1039 Vector<double> x(2);
1047 Vector<double> r_wall(3);
1048 Wall_pt->position(t, x, r_wall);
1052 Vector<double> zeta_central(2);
1053 Vector<double> r_central(3);
1054 zeta_central[0] = zeta[0];
1055 zeta_central[1] = 1.0;
1056 r_centr_U(t, zeta_central, i_layer, r_central);
1059 f[0] = r_central[0] +
1060 (r_wall[0] - r_central[0]) *
s_squashed(0.5 * (1.0 + zeta[1]));
1061 f[1] = r_central[1] +
1062 (r_wall[1] - r_central[1]) *
s_squashed(0.5 * (1.0 + zeta[1]));
1063 f[2] = r_central[2] +
1064 (r_wall[2] - r_central[2]) *
s_squashed(0.5 * (1.0 + zeta[1]));
Quarter tube as domain. Domain is bounded by curved boundary which is represented by a GeomObject....
QuarterTubeDomain(const QuarterTubeDomain &)=delete
Broken copy constructor.
AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that implements axial spacing of macro elements.
void r_top_left_D(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of top left box macro element in layer i_layer zeta .
BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the outer two macro elements towards the wall by mapping ...
void r_top_left_L(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of top left box macro element in layer i_layer zeta .
~QuarterTubeDomain()
Destructor: empty; cleanup done in base class.
void r_top_left_R(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of top left box macro element in layer i_layer zeta .
void r_bot_right_L(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of bottom right box macro element in layer i_layer zeta .
BLSquashFctPt BL_squash_fct_pt
Function pointer for function that squashes the outer two macro elements towards the wall by mapping ...
void r_centr_B(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of central box macro element in layer i_layer zeta .
double axial_spacing_fct(const double &xi)
Function that implements axial spacing of macro elements.
double(* BLSquashFctPt)(const double &s)
Typedef for function pointer for function that squashes the outer two macro elements towards the wall...
static double default_BL_squash_fct(const double &s)
Default for function that squashes the outer two macro elements towards the wall by mapping the input...
void r_centr_D(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of central box macro element in layer i_layer zeta .
QuarterTubeDomain(GeomObject *boundary_geom_object_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer)
Constructor: Pass boundary object and start and end coordinates and fraction along boundary object wh...
Vector< double > Xi_lo
Lower limit for the coordinates along the wall.
unsigned Nlayer
Number of layers.
double s_squashed(const double &s)
Function that squashes the outer two macro elements towards the wall by mapping the input value of th...
void r_bot_right_F(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of bottom right box macro element in layer i_layer zeta .
void r_bot_right_D(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of bottom right box macro element in layer i_layer zeta .
void r_bot_right_U(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of bottom right box macro element in layer i_layer zeta .
Vector< double > Xi_hi
Upper limit for the coordinates along the wall.
void r_top_left_B(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of top left box macro element in layer i_layer zeta .
void r_top_left_U(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of top left box macro element in layer i_layer zeta .
void r_bot_right_R(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of bottom right box macro element in layer i_layer zeta .
void r_centr_F(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of central box macro element in layer i_layer zeta .
AxialSpacingFctPt Axial_spacing_fct_pt
Function pointer for function that implements axial spacing of macro elements.
void r_centr_L(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of central box macro element in layer i_layer zeta .
void operator=(const QuarterTubeDomain &)=delete
Broken assignment operator.
double(* AxialSpacingFctPt)(const double &xi)
Typedef for function pointer for function that implements axial spacing of macro elements.
static double default_axial_spacing_fct(const double &xi)
Default for function that implements axial spacing of macro elements.
void r_centr_R(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of central box macro element in layer i_layer zeta .
double Fract_mid
Fraction along wall where outer ring is to be divided.
void r_top_left_F(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of top left box macro element in layer i_layer zeta .
void r_bot_right_B(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of bottom right box macro element in layer i_layer zeta .
GeomObject * Wall_pt
Pointer to geometric object that represents the curved wall.
void macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
Vector representation of the i_macro-th macro element boundary i_direct (L/R/D/U/B/F) at time level t...
void r_centr_U(const unsigned &t, const Vector< double > &zeta, const unsigned &i_layer, Vector< double > &f)
Boundary of central box macro element in layer i_layer zeta .
////////////////////////////////////////////////////////////////////// //////////////////////////////...