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"
51 Macro_element_pt.resize(nmacro);
54 for (
unsigned i = 0; i < nmacro; i++)
56 Macro_element_pt[i] =
new QMacroElement<3>(
this, i);
75 const unsigned& imacro,
76 const unsigned& idirect,
77 const Vector<double>& s,
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;
124 error_message <<
"idirect is " << OcTree::Direct_string[idirect]
125 <<
"not one of L, R, U, D, B, F" << std::endl;
127 throw OomphLibError(error_message.str(),
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;
166 error_message <<
"idirect is " << OcTree::Direct_string[idirect]
167 <<
"not one of L, R, U, D, B, F" << std::endl;
169 throw OomphLibError(error_message.str(),
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;
207 error_message <<
"idirect is " << OcTree::Direct_string[idirect]
208 <<
"not one of L, R, U, D, B, F" << std::endl;
210 throw OomphLibError(error_message.str(),
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;
247 error_message <<
"idirect is " << OcTree::Direct_string[idirect]
248 <<
"not one of L, R, U, D, B, F" << std::endl;
250 throw OomphLibError(error_message.str(),
251 OOMPH_CURRENT_FUNCTION,
252 OOMPH_EXCEPTION_LOCATION);
259 std::ostringstream error_message;
260 error_message <<
"imacro is " << OcTree::Direct_string[idirect]
261 <<
", but should be in the range 0-3" << std::endl;
263 throw OomphLibError(error_message.str(),
264 OOMPH_CURRENT_FUNCTION,
265 OOMPH_EXCEPTION_LOCATION);
277 const Vector<double>& zeta,
283 const Vector<double>& zeta,
289 const Vector<double>& zeta,
295 const Vector<double>& zeta,
301 const Vector<double>& zeta,
307 const Vector<double>& zeta,
313 const Vector<double>& zeta,
319 const Vector<double>& zeta,
325 const Vector<double>& zeta,
331 const Vector<double>& zeta,
337 const Vector<double>& zeta,
343 const Vector<double>& zeta,
348 void r_up_L(
const unsigned& t,
349 const Vector<double>& zeta,
354 void r_up_R(
const unsigned& t,
355 const Vector<double>& zeta,
360 void r_up_D(
const unsigned& t,
361 const Vector<double>& zeta,
366 void r_up_U(
const unsigned& t,
367 const Vector<double>& zeta,
372 void r_up_B(
const unsigned& t,
373 const Vector<double>& zeta,
378 void r_up_F(
const unsigned& t,
379 const Vector<double>& zeta,
385 const Vector<double>& zeta,
391 const Vector<double>& zeta,
397 const Vector<double>& zeta,
403 const Vector<double>& zeta,
409 const Vector<double>& zeta,
415 const Vector<double>& zeta,
429 const Vector<double>& zeta,
433 f[1] =
Radius * 0.25 * (1.0 + zeta[0]);
434 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
443 const Vector<double>& zeta,
447 f[1] =
Radius * 0.25 * (1.0 + zeta[0]);
448 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
457 const Vector<double>& zeta,
460 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
462 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
471 const Vector<double>& zeta,
474 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
476 f[2] =
Radius * 0.25 * (1.0 + zeta[1]);
485 const Vector<double>& zeta,
488 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
489 f[1] =
Radius * 0.25 * (1.0 + zeta[1]);
498 const Vector<double>& zeta,
501 f[0] =
Radius * 0.25 * (1.0 + zeta[0]);
502 f[1] =
Radius * 0.25 * (1.0 + zeta[1]);
512 const Vector<double>& zeta,
524 const Vector<double>& zeta,
527 double k0 = 0.5 * (1.0 + zeta[0]);
528 double k1 = 0.5 * (1.0 + zeta[1]);
530 Vector<double> point1(3);
531 Vector<double> point2(3);
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++)
557 const Vector<double>& zeta,
561 Vector<double> on_sphere(3);
562 Vector<double> temp_zeta(2);
564 temp_zeta[1] = zeta[1];
568 Vector<double> on_center(3);
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]);
586 const Vector<double>& zeta,
590 Vector<double> on_sphere(3);
591 Vector<double> temp_zeta(2);
593 temp_zeta[1] = zeta[1];
597 Vector<double> on_center(3);
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]);
614 const Vector<double>& zeta,
618 Vector<double> on_sphere(3);
619 Vector<double> temp_zeta(2);
620 temp_zeta[0] = zeta[1];
625 Vector<double> on_center(3);
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]);
643 const Vector<double>& zeta,
647 Vector<double> on_sphere(3);
648 Vector<double> temp_zeta(2);
649 temp_zeta[0] = zeta[1];
654 Vector<double> on_center(3);
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]);
671 const Vector<double>& zeta,
675 Vector<double> on_sphere(3);
676 Vector<double> temp_zeta(2);
678 temp_zeta[1] = zeta[1];
679 r_up_U(t, temp_zeta, on_sphere);
682 Vector<double> on_center(3);
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]);
700 const Vector<double>& zeta,
712 const Vector<double>& zeta,
723 const Vector<double>& zeta,
726 double k0 = 0.5 * (1.0 + zeta[0]);
727 double k1 = 0.5 * (1.0 + zeta[1]);
729 Vector<double> point1(3);
730 Vector<double> point2(3);
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++)
756 const Vector<double>& zeta,
760 Vector<double> on_sphere(3);
761 Vector<double> temp_zeta(2);
762 temp_zeta[0] = zeta[0];
764 r_up_U(t, temp_zeta, on_sphere);
767 Vector<double> on_center(3);
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]);
785 const Vector<double>& zeta,
789 Vector<double> on_sphere(3);
790 Vector<double> temp_zeta(2);
791 temp_zeta[0] = zeta[0];
793 r_up_U(t, temp_zeta, on_sphere);
796 Vector<double> on_center(3);
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]);
814 const Vector<double>& zeta,
818 Vector<double> on_sphere(3);
819 Vector<double> temp_zeta(2);
821 temp_zeta[1] = zeta[0];
825 Vector<double> on_center(3);
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]);
843 const Vector<double>& zeta,
846 Vector<double> zeta2(2);
858 const Vector<double>& zeta,
862 Vector<double> on_sphere(3);
863 Vector<double> temp_zeta(2);
864 temp_zeta[0] = zeta[0];
869 Vector<double> on_center(3);
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]);
887 const Vector<double>& zeta,
899 const Vector<double>& zeta,
911 const Vector<double>& zeta,
914 double k0 = 0.5 * (1.0 + zeta[0]);
915 double k1 = 0.5 * (1.0 + zeta[1]);
917 Vector<double> point1(3);
918 Vector<double> point2(3);
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++)
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 .
////////////////////////////////////////////////////////////////////// //////////////////////////////...