27 #ifndef OOMPH_QUARTER_PIPE_DOMAIN_HEADER 
   28 #define OOMPH_QUARTER_PIPE_DOMAIN_HEADER 
   31 #include "../generic/octree.h" 
   32 #include "../generic/domain.h" 
   33 #include "../generic/geom_objects.h" 
   60       unsigned nmacro = nr * ntheta * nz;
 
   63       Macro_element_pt.resize(nmacro);
 
   66       for (
unsigned i = 0; i < nmacro; i++)
 
   68         Macro_element_pt[i] = 
new QMacroElement<3>(
this, i);
 
  113                                 const unsigned& i_macro,
 
  114                                 const unsigned& i_direct,
 
  115                                 const Vector<double>& s,
 
  157     void r_U(
const unsigned& t,
 
  158              const Vector<double>& zeta,
 
  162              const double& thetamin,
 
  163              const double& thetamax,
 
  168     void r_L(
const unsigned& t,
 
  169              const Vector<double>& zeta,
 
  173              const double& thetamin,
 
  174              const double& thetamax,
 
  179     void r_D(
const unsigned& t,
 
  180              const Vector<double>& zeta,
 
  184              const double& thetamin,
 
  185              const double& thetamax,
 
  190     void r_R(
const unsigned& t,
 
  191              const Vector<double>& zeta,
 
  195              const double& thetamin,
 
  196              const double& thetamax,
 
  201     void r_F(
const unsigned& t,
 
  202              const Vector<double>& zeta,
 
  206              const double& thetamin,
 
  207              const double& thetamax,
 
  212     void r_B(
const unsigned& t,
 
  213              const Vector<double>& zeta,
 
  217              const double& thetamin,
 
  218              const double& thetamax,
 
  231                                                  const unsigned& imacro,
 
  232                                                  const unsigned& idirect,
 
  233                                                  const Vector<double>& s,
 
  236     using namespace OcTreeNames;
 
  238     const double pi = MathematicalConstants::Pi;
 
  241     unsigned num_z = imacro / (
Nr * 
Ntheta);
 
  243     unsigned num_x = imacro % 
Ntheta;
 
  249     double rmax = 
Rmin + (
Rmax - 
Rmin) * 
double(num_y + 1) / double(
Nr);
 
  252     double thetamin = (pi / 2.0) * (1.0 - 
double(num_x + 1) / double(
Ntheta));
 
  253     double thetamax = (pi / 2.0) * (1.0 - 
double(num_x) / double(
Ntheta));
 
  256     double zmin = double(num_z) * 
Length / double(
Nz);
 
  257     double zmax = double(num_z + 1) * 
Length / double(
Nz);
 
  263       r_U(t, s, f, rmin, rmax, thetamin, thetamax, zmin, zmax);
 
  265     else if (idirect == D)
 
  267       r_D(t, s, f, rmin, rmax, thetamin, thetamax, zmin, zmax);
 
  269     else if (idirect == L)
 
  271       r_L(t, s, f, rmin, rmax, thetamin, thetamax, zmin, zmax);
 
  273     else if (idirect == R)
 
  275       r_R(t, s, f, rmin, rmax, thetamin, thetamax, zmin, zmax);
 
  277     else if (idirect == F)
 
  279       r_F(t, s, f, rmin, rmax, thetamin, thetamax, zmin, zmax);
 
  281     else if (idirect == B)
 
  283       r_B(t, s, f, rmin, rmax, thetamin, thetamax, zmin, zmax);
 
  287       std::ostringstream error_stream;
 
  288       error_stream << 
"idirect is " << idirect << 
" not one of U, D, L, R, F, B" 
  292         error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
 
  296     double z_frac = f[2] / 
Length;
 
  305                               const Vector<double>& s,
 
  309                               const double& thetamin,
 
  310                               const double& thetamax,
 
  318     Vector<double> r_outer(2);
 
  322     Vector<double> r_inner(2);
 
  326     Vector<double> r_top(2);
 
  327     Vector<double> r_bot(2);
 
  328     for (
unsigned i = 0; i < 2; i++)
 
  331         r_inner[i] + (r_outer[i] - r_inner[i]) * (rmax - 
Rmin) / (
Rmax - 
Rmin);
 
  333         r_inner[i] + (r_outer[i] - r_inner[i]) * (rmin - 
Rmin) / (
Rmax - 
Rmin);
 
  337     f[0] = r_bot[0] + (0.5 * (s[0] + 1.0)) * (r_top[0] - r_bot[0]);
 
  338     f[1] = r_bot[1] + (0.5 * (s[0] + 1.0)) * (r_top[1] - r_bot[1]);
 
  339     f[2] = zmin + (zmax - zmin) * (0.5 * (s[1] + 1.0));
 
  346                               const Vector<double>& s,
 
  350                               const double& thetamin,
 
  351                               const double& thetamax,
 
  359     Vector<double> r_outer(2);
 
  363     Vector<double> r_inner(2);
 
  367     Vector<double> r_top(2);
 
  368     Vector<double> r_bot(2);
 
  369     for (
unsigned i = 0; i < 2; i++)
 
  372         r_inner[i] + (r_outer[i] - r_inner[i]) * (rmax - 
Rmin) / (
Rmax - 
Rmin);
 
  374         r_inner[i] + (r_outer[i] - r_inner[i]) * (rmin - 
Rmin) / (
Rmax - 
Rmin);
 
  378     f[0] = r_bot[0] + (0.5 * (s[0] + 1.0)) * (r_top[0] - r_bot[0]);
 
  379     f[1] = r_bot[1] + (0.5 * (s[0] + 1.0)) * (r_top[1] - r_bot[1]);
 
  380     f[2] = zmin + (zmax - zmin) * (0.5 * (s[1] + 1.0));
 
  388                               const Vector<double>& s,
 
  392                               const double& thetamin,
 
  393                               const double& thetamax,
 
  398     x[0] = thetamax + (0.5 * (s[0] + 1.0)) * (thetamin - thetamax);
 
  401     Vector<double> r_outer(2);
 
  405     Vector<double> r_inner(2);
 
  409     for (
unsigned i = 0; i < 2; i++)
 
  412         r_inner[i] + (r_outer[i] - r_inner[i]) * (rmin - 
Rmin) / (
Rmax - 
Rmin);
 
  414     f[2] = zmin + (zmax - zmin) * (0.5 * (s[1] + 1.0));
 
  422                               const Vector<double>& s,
 
  426                               const double& thetamin,
 
  427                               const double& thetamax,
 
  432     x[0] = thetamax + (0.5 * (s[0] + 1.0)) * (thetamin - thetamax);
 
  435     Vector<double> r_outer(2);
 
  439     Vector<double> r_inner(2);
 
  443     for (
unsigned i = 0; i < 2; i++)
 
  446         r_inner[i] + (r_outer[i] - r_inner[i]) * (rmax - 
Rmin) / (
Rmax - 
Rmin);
 
  448     f[2] = zmin + (zmax - zmin) * (0.5 * (s[1] + 1.0));
 
  456                               const Vector<double>& s,
 
  460                               const double& thetamin,
 
  461                               const double& thetamax,
 
  466     x[0] = thetamax + (0.5 * (s[0] + 1.0)) * (thetamin - thetamax);
 
  469     Vector<double> r_outer(2);
 
  473     Vector<double> r_inner(2);
 
  477     double rad = rmin + (0.5 * (s[1] + 1.0)) * (rmax - rmin);
 
  478     for (
unsigned i = 0; i < 2; i++)
 
  481         r_inner[i] + (r_outer[i] - r_inner[i]) * (rad - 
Rmin) / (
Rmax - 
Rmin);
 
  491                               const Vector<double>& s,
 
  495                               const double& thetamin,
 
  496                               const double& thetamax,
 
  501     x[0] = thetamax + (0.5 * (s[0] + 1.0)) * (thetamin - thetamax);
 
  504     Vector<double> r_outer(2);
 
  508     Vector<double> r_inner(2);
 
  512     double rad = rmin + (0.5 * (s[1] + 1.0)) * (rmax - rmin);
 
  513     for (
unsigned i = 0; i < 2; i++)
 
  516         r_inner[i] + (r_outer[i] - r_inner[i]) * (rad - 
Rmin) / (
Rmax - 
Rmin);
 
Domain representing a quarter pipe.
double axial_spacing_fct(const double &xi)
Function that implements axial spacing of macro elements.
unsigned Nr
Number of elements radial direction.
void r_L(const unsigned &t, const Vector< double > &zeta, Vector< double > &f, const double &rmin, const double &rmax, const double &thetamin, const double &thetamax, const double &zmin, const double &zmax)
Boundary of macro element zeta .
GeomObject * Inner_boundary_cross_section_pt
Geom object representing the inner boundary of the cross section.
static double default_axial_spacing_fct(const double &xi)
Default for function that implements axial spacing of macro elements.
double(* AxialSpacingFctPt)(const double &xi)
Typedef for function pointer for function that implements axial spacing of macro elements.
void r_U(const unsigned &t, const Vector< double > &zeta, Vector< double > &f, const double &rmin, const double &rmax, const double &thetamin, const double &thetamax, const double &zmin, const double &zmax)
Boundary of macro element zeta .
QuarterPipeDomain(const QuarterPipeDomain &)=delete
Broken copy constructor.
void r_F(const unsigned &t, const Vector< double > &zeta, Vector< double > &f, const double &rmin, const double &rmax, const double &thetamin, const double &thetamax, const double &zmin, const double &zmax)
Boundary of macro element zeta .
~QuarterPipeDomain()
Destructor:
AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that implements axial spacing of macro elements.
unsigned Nz
Number of elements axial direction.
void r_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f, const double &rmin, const double &rmax, const double &thetamin, const double &thetamax, const double &zmin, const double &zmax)
Boundary of macro element zeta .
void operator=(const QuarterPipeDomain &)=delete
Broken assignment operator.
void r_B(const unsigned &t, const Vector< double > &zeta, Vector< double > &f, const double &rmin, const double &rmax, const double &thetamin, const double &thetamax, const double &zmin, const double &zmax)
Boundary of macro element zeta .
AxialSpacingFctPt Axial_spacing_fct_pt
Function pointer for function that implements axial spacing of macro elements.
GeomObject * Outer_boundary_cross_section_pt
Geom object representing the outer boundary of the cross section.
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 (U/D/L/R/F/B) at time level t...
void r_D(const unsigned &t, const Vector< double > &zeta, Vector< double > &f, const double &rmin, const double &rmax, const double &thetamin, const double &thetamax, const double &zmin, const double &zmax)
Boundary of macro element zeta .
unsigned Ntheta
Number of elements azimuthal direction.
QuarterPipeDomain(const unsigned &ntheta, const unsigned &nr, const unsigned &nz, const double &rmin, const double &rmax, const double &length)
Constructor: Pass number of elements in various directions, the inner and outer radius and the length...
////////////////////////////////////////////////////////////////////// //////////////////////////////...