27 #ifndef OOMPH_EIGHTH_SPHERE_DOMAIN_HEADER
28 #define OOMPH_EIGHTH_SPHERE_DOMAIN_HEADER
31 #include "../generic/quadtree.h"
32 #include "../generic/domain.h"
33 #include "../generic/geom_objects.h"
54 for (
unsigned i = 0;
i < nmacro;
i++)
75 const unsigned& imacro,
76 const unsigned& idirect,
80 using namespace OcTreeNames;
82 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
85 "Order of function arguments has changed between versions 0.8 and 0.85",
86 "EighthSphereDomain::macro_element_boundary(...)",
87 OOMPH_EXCEPTION_LOCATION);
101 else if (idirect ==
R)
105 else if (idirect ==
D)
109 else if (idirect ==
U)
113 else if (idirect ==
B)
117 else if (idirect ==
F)
123 std::ostringstream error_message;
125 <<
"not one of L, R, U, D, B, F" << std::endl;
128 OOMPH_CURRENT_FUNCTION,
129 OOMPH_EXCEPTION_LOCATION);
143 else if (idirect ==
R)
147 else if (idirect ==
D)
151 else if (idirect ==
U)
155 else if (idirect ==
B)
159 else if (idirect ==
F)
165 std::ostringstream error_message;
167 <<
"not one of L, R, U, D, B, F" << std::endl;
170 OOMPH_CURRENT_FUNCTION,
171 OOMPH_EXCEPTION_LOCATION);
184 else if (idirect ==
R)
188 else if (idirect ==
D)
192 else if (idirect ==
U)
196 else if (idirect ==
B)
200 else if (idirect ==
F)
206 std::ostringstream error_message;
208 <<
"not one of L, R, U, D, B, F" << std::endl;
211 OOMPH_CURRENT_FUNCTION,
212 OOMPH_EXCEPTION_LOCATION);
224 else if (idirect ==
R)
228 else if (idirect ==
D)
232 else if (idirect ==
U)
236 else if (idirect ==
B)
240 else if (idirect ==
F)
246 std::ostringstream error_message;
248 <<
"not one of L, R, U, D, B, F" << std::endl;
251 OOMPH_CURRENT_FUNCTION,
252 OOMPH_EXCEPTION_LOCATION);
259 std::ostringstream error_message;
261 <<
", but should be in the range 0-3" << std::endl;
264 OOMPH_CURRENT_FUNCTION,
265 OOMPH_EXCEPTION_LOCATION);
433 f[1] =
Radius * 0.25 * (1.0 + zeta[0]);
434 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
447 f[1] =
Radius * 0.25 * (1.0 + zeta[0]);
448 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
460 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
462 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
474 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
476 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
488 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
489 f[1] =
Radius * 0.25 * (1.0 + zeta[1]);
501 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
502 f[1] =
Radius * 0.25 * (1.0 + zeta[1]);
527 double k0 = 0.5 * (1.0 + zeta[0]);
528 double k1 = 0.5 * (1.0 + zeta[1]);
534 point1[1] = 0.5 *
Radius * k0;
537 point2[1] = k0 *
Radius / 3.0;
540 for (
unsigned i = 0;
i < 3;
i++)
542 p[
i] = point1[
i] + k1 * (point2[
i] - point1[
i]);
544 double alpha =
Radius / std::sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
546 for (
unsigned i = 0;
i < 3;
i++)
564 temp_zeta[1] = zeta[1];
569 on_center[0] = 0.5 *
Radius;
571 on_center[2] = 0.5 *
Radius * 0.5 * (zeta[1] + 1.0);
573 for (
unsigned i = 0;
i < 3;
i++)
576 on_center[
i] + 0.5 * (zeta[0] + 1.0) * (on_sphere[
i] - on_center[
i]);
593 temp_zeta[1] = zeta[1];
598 on_center[0] = 0.5 *
Radius;
599 on_center[1] = 0.5 *
Radius;
600 on_center[2] = 0.5 *
Radius * 0.5 * (zeta[1] + 1.0);
602 for (
unsigned i = 0;
i < 3;
i++)
605 on_center[
i] + 0.5 * (zeta[0] + 1.0) * (on_sphere[
i] - on_center[
i]);
620 temp_zeta[0] = zeta[1];
626 on_center[0] = 0.5 *
Radius;
627 on_center[1] = 0.5 *
Radius * 0.5 * (zeta[1] + 1.0);
630 for (
unsigned i = 0;
i < 3;
i++)
633 on_center[
i] + 0.5 * (zeta[0] + 1.0) * (on_sphere[
i] - on_center[
i]);
649 temp_zeta[0] = zeta[1];
655 on_center[0] = 0.5 *
Radius;
656 on_center[1] = 0.5 *
Radius * 0.5 * (zeta[1] + 1.0);
657 on_center[2] = 0.5 *
Radius;
659 for (
unsigned i = 0;
i < 3;
i++)
662 on_center[
i] + 0.5 * (zeta[0] + 1.0) * (on_sphere[
i] - on_center[
i]);
678 temp_zeta[1] = zeta[1];
679 r_up_U(
t, temp_zeta, on_sphere);
684 on_center[1] = 0.5 *
Radius;
685 on_center[2] = 0.5 *
Radius * 0.5 * (zeta[1] + 1.0);
687 for (
unsigned i = 0;
i < 3;
i++)
690 on_center[
i] + 0.5 * (zeta[0] + 1.0) * (on_sphere[
i] - on_center[
i]);
726 double k0 = 0.5 * (1.0 + zeta[0]);
727 double k1 = 0.5 * (1.0 + zeta[1]);
732 point1[0] = 0.5 *
Radius * k0;
735 point2[0] = k0 *
Radius / 3.0;
739 for (
unsigned i = 0;
i < 3;
i++)
741 p[
i] = point1[
i] + k1 * (point2[
i] - point1[
i]);
743 double alpha =
Radius / std::sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
745 for (
unsigned i = 0;
i < 3;
i++)
762 temp_zeta[0] = zeta[0];
764 r_up_U(
t, temp_zeta, on_sphere);
768 on_center[0] = 0.5 *
Radius * 0.5 * (zeta[0] + 1.0);
769 on_center[1] = 0.5 *
Radius;
772 for (
unsigned i = 0;
i < 3;
i++)
775 on_center[
i] + 0.5 * (zeta[1] + 1.0) * (on_sphere[
i] - on_center[
i]);
791 temp_zeta[0] = zeta[0];
793 r_up_U(
t, temp_zeta, on_sphere);
797 on_center[0] = 0.5 *
Radius * 0.5 * (zeta[0] + 1.0);
798 on_center[1] = 0.5 *
Radius;
799 on_center[2] = 0.5 *
Radius;
801 for (
unsigned i = 0;
i < 3;
i++)
804 on_center[
i] + 0.5 * (zeta[1] + 1.0) * (on_sphere[
i] - on_center[
i]);
821 temp_zeta[1] = zeta[0];
827 on_center[1] = 0.5 *
Radius * 0.5 * (zeta[0] + 1.0);
828 on_center[2] = 0.5 *
Radius;
830 for (
unsigned i = 0;
i < 3;
i++)
833 on_center[
i] + 0.5 * (zeta[1] + 1.0) * (on_sphere[
i] - on_center[
i]);
864 temp_zeta[0] = zeta[0];
870 on_center[0] = 0.5 *
Radius * 0.5 * (zeta[0] + 1.0);
872 on_center[2] = 0.5 *
Radius;
874 for (
unsigned i = 0;
i < 3;
i++)
877 on_center[
i] + 0.5 * (zeta[1] + 1.0) * (on_sphere[
i] - on_center[
i]);
914 double k0 = 0.5 * (1.0 + zeta[0]);
915 double k1 = 0.5 * (1.0 + zeta[1]);
920 point1[0] = 0.5 *
Radius * k0;
923 point2[0] = k0 *
Radius / 3.0;
927 for (
unsigned i = 0;
i < 3;
i++)
929 p[
i] = point1[
i] + k1 * (point2[
i] - point1[
i]);
931 double alpha =
Radius / std::sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
933 for (
unsigned i = 0;
i < 3;
i++)
Base class for Domains with curvilinear and/or time-dependent boundaries. Domain boundaries are typic...
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Eighth sphere as domain. Domain is parametrised by four macro elements.
void r_right_U(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
void r_centr_F(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central box macro element zeta .
void r_front_L(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_centr_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central box macro element zeta .
void macro_element_boundary(const unsigned &t, const unsigned &imacro, const unsigned &idirect, const Vector< double > &s, Vector< double > &f)
Vector representation of the imacro-th macro element boundary idirect (L/R/D/U/B/F) at time level t (...
void r_up_U(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_centr_B(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central box macro element zeta .
void r_front_D(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_right_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
void r_front_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
EighthSphereDomain(const EighthSphereDomain &)=delete
Broken copy constructor.
void r_front_F(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_right_D(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
EighthSphereDomain(const double &radius)
Constructor: Pass the radius of the sphere.
void operator=(const EighthSphereDomain &)=delete
Broken assignment operator.
void r_up_F(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_right_F(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
void r_front_B(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_centr_D(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central box macro element zeta .
void r_up_B(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
~EighthSphereDomain()
Destructor: Empty; cleanup done in base class.
void r_right_B(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
void r_right_L(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
void r_up_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_up_D(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_centr_L(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central box macro element zeta .
void r_front_U(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_up_L(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
void r_centr_U(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central box macro element zeta .
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
QMacroElement specialised to 3 spatial dimensions.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...