31 #ifndef OOMPH_EIGHTH_SPHERE_DOMAIN_HEADER 32 #define OOMPH_EIGHTH_SPHERE_DOMAIN_HEADER 35 #include "../generic/quadtree.h" 36 #include "../generic/domain.h" 37 #include "../generic/geom_objects.h" 59 Macro_element_pt.resize(nmacro);
62 for (
unsigned i=0;i<nmacro;i++)
64 Macro_element_pt[i]=
new QMacroElement<3>(
this,i);
71 BrokenCopy::broken_copy(
"EighthSphereDomain");
77 BrokenCopy::broken_assign(
"EighthSphereDomain");
84 for (
unsigned i=0;i<4;i++)
86 delete Macro_element_pt[i];
96 const unsigned& imacro,
97 const unsigned& idirect,
98 const Vector<double>& s,
102 using namespace OcTreeNames;
104 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES 107 "Order of function arguments has changed between versions 0.8 and 0.85",
108 "EighthSphereDomain::macro_element_boundary(...)",
109 OOMPH_EXCEPTION_LOCATION);
124 else if (idirect == R)
128 else if (idirect == D)
132 else if (idirect == U)
136 else if (idirect == B)
140 else if (idirect == F)
146 std::ostringstream error_message;
147 error_message <<
"idirect is " 148 << OcTree::Direct_string[idirect]
149 <<
"not one of L, R, U, D, B, F" << std::endl;
151 throw OomphLibError(error_message.str(),
152 OOMPH_CURRENT_FUNCTION,
153 OOMPH_EXCEPTION_LOCATION);
189 std::ostringstream error_message;
190 error_message <<
"idirect is " 191 << OcTree::Direct_string[idirect]
192 <<
"not one of L, R, U, D, B, F" << std::endl;
194 throw OomphLibError(error_message.str(),
195 OOMPH_CURRENT_FUNCTION,
196 OOMPH_EXCEPTION_LOCATION);
231 std::ostringstream error_message;
232 error_message <<
"idirect is " 233 << OcTree::Direct_string[idirect]
234 <<
"not one of L, R, U, D, B, F" << std::endl;
236 throw OomphLibError(error_message.str(),
237 OOMPH_CURRENT_FUNCTION,
238 OOMPH_EXCEPTION_LOCATION);
272 std::ostringstream error_message;
273 error_message <<
"idirect is " 274 << OcTree::Direct_string[idirect]
275 <<
"not one of L, R, U, D, B, F" << std::endl;
277 throw OomphLibError(error_message.str(),
278 OOMPH_CURRENT_FUNCTION,
279 OOMPH_EXCEPTION_LOCATION);
286 std::ostringstream error_message;
287 error_message <<
"imacro is " 288 << OcTree::Direct_string[idirect]
289 <<
", but should be in the range 0-3" << std::endl;
291 throw OomphLibError(error_message.str(),
292 OOMPH_CURRENT_FUNCTION,
293 OOMPH_EXCEPTION_LOCATION);
306 void r_centr_L(
const unsigned& t,
const Vector<double>& zeta,
311 void r_centr_R(
const unsigned& t,
const Vector<double>& zeta,
316 void r_centr_D(
const unsigned& t,
const Vector<double>& zeta,
321 void r_centr_U(
const unsigned& t,
const Vector<double>& zeta,
326 void r_centr_B(
const unsigned& t,
const Vector<double>& zeta,
331 void r_centr_F(
const unsigned& t,
const Vector<double>& zeta,
336 void r_right_L(
const unsigned& t,
const Vector<double>& zeta,
341 void r_right_R(
const unsigned& t,
const Vector<double>& zeta,
346 void r_right_D(
const unsigned& t,
const Vector<double>& zeta,
351 void r_right_U(
const unsigned& t,
const Vector<double>& zeta,
356 void r_right_B(
const unsigned& t,
const Vector<double>& zeta,
361 void r_right_F(
const unsigned& t,
const Vector<double>& zeta,
366 void r_up_L(
const unsigned& t,
const Vector<double>& zeta,
371 void r_up_R(
const unsigned& t,
const Vector<double>& zeta,
376 void r_up_D(
const unsigned& t,
const Vector<double>& zeta,
381 void r_up_U(
const unsigned& t,
const Vector<double>& zeta,
386 void r_up_B(
const unsigned& t,
const Vector<double>& zeta,
391 void r_up_F(
const unsigned& t,
const Vector<double>& zeta,
396 void r_front_L(
const unsigned& t,
const Vector<double>& zeta,
401 void r_front_R(
const unsigned& t,
const Vector<double>& zeta,
406 void r_front_D(
const unsigned& t,
const Vector<double>& zeta,
411 void r_front_U(
const unsigned& t,
const Vector<double>& zeta,
416 void r_front_B(
const unsigned& t,
const Vector<double>& zeta,
421 void r_front_F(
const unsigned& t,
const Vector<double>& zeta,
437 const Vector<double>& zeta,
441 f[1]=
Radius*0.25*(1.0+zeta[0]);
442 f[2]=
Radius*0.25*(1.0+zeta[1]);
451 const Vector<double>& zeta,
455 f[1]=
Radius*0.25*(1.0+zeta[0]);
456 f[2]=
Radius*0.25*(1.0+zeta[1]);
467 const Vector<double>& zeta,
470 f[0]=
Radius*0.25*(1.0+zeta[0]);
472 f[2]=
Radius*0.25*(1.0+zeta[1]);
481 const Vector<double>& zeta,
484 f[0]=
Radius*0.25*(1.0+zeta[0]);
486 f[2]=
Radius*0.25*(1.0+zeta[1]);
496 const Vector<double>& zeta,
499 f[0]=
Radius*0.25*(1.0+zeta[0]);
500 f[1]=
Radius*0.25*(1.0+zeta[1]);
509 const Vector<double>& zeta,
512 f[0]=
Radius*0.25*(1.0+zeta[0]);
513 f[1]=
Radius*0.25*(1.0+zeta[1]);
524 const Vector<double>& zeta,
536 const Vector<double>& zeta,
539 double k0=0.5*(1.0+zeta[0]);
540 double k1=0.5*(1.0+zeta[1]);
542 Vector<double> point1(3);
543 Vector<double> point2(3);
552 for(
unsigned i=0; i<3; i++)
554 p[i]=point1[i]+k1*(point2[i]-point1[i]);
556 double alpha=
Radius/std::sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
558 for(
unsigned i=0; i<3; i++)
570 const Vector<double>& zeta,
574 Vector<double> on_sphere(3);
575 Vector<double> temp_zeta(2);
577 temp_zeta[1]=zeta[1];
581 Vector<double> on_center(3);
584 on_center[2]=0.5*
Radius*0.5*(zeta[1]+1.0);
586 for(
unsigned i=0; i<3; i++)
588 f[i]=on_center[i]+0.5*(zeta[0]+1.0)*(on_sphere[i]-on_center[i]);
598 const Vector<double>& zeta,
602 Vector<double> on_sphere(3);
603 Vector<double> temp_zeta(2);
605 temp_zeta[1]=zeta[1];
609 Vector<double> on_center(3);
612 on_center[2]=0.5*
Radius*0.5*(zeta[1]+1.0);
614 for(
unsigned i=0; i<3; i++)
616 f[i]=on_center[i]+0.5*(zeta[0]+1.0)*(on_sphere[i]-on_center[i]);
625 const Vector<double>& zeta,
629 Vector<double> on_sphere(3);
630 Vector<double> temp_zeta(2);
631 temp_zeta[0]=zeta[1];
636 Vector<double> on_center(3);
638 on_center[1]=0.5*
Radius*0.5*(zeta[1]+1.0);
641 for(
unsigned i=0; i<3; i++)
643 f[i]=on_center[i]+0.5*(zeta[0]+1.0)*(on_sphere[i]-on_center[i]);
653 const Vector<double>& zeta,
658 Vector<double> on_sphere(3);
659 Vector<double> temp_zeta(2);
660 temp_zeta[0]=zeta[1];
665 Vector<double> on_center(3);
667 on_center[1]=0.5*
Radius*0.5*(zeta[1]+1.0);
670 for(
unsigned i=0; i<3; i++)
672 f[i]=on_center[i]+0.5*(zeta[0]+1.0)*(on_sphere[i]-on_center[i]);
681 const Vector<double>& zeta,
685 Vector<double> on_sphere(3);
686 Vector<double> temp_zeta(2);
688 temp_zeta[1]=zeta[1];
689 r_up_U(t,temp_zeta,on_sphere);
692 Vector<double> on_center(3);
695 on_center[2]=0.5*
Radius*0.5*(zeta[1]+1.0);
697 for(
unsigned i=0; i<3; i++)
699 f[i]=on_center[i]+0.5*(zeta[0]+1.0)*(on_sphere[i]-on_center[i]);
709 const Vector<double>& zeta,
721 const Vector<double>& zeta,
732 const Vector<double>& zeta,
736 double k0=0.5*(1.0+zeta[0]);
737 double k1=0.5*(1.0+zeta[1]);
739 Vector<double> point1(3);
740 Vector<double> point2(3);
749 for(
unsigned i=0; i<3; i++)
751 p[i]=point1[i]+k1*(point2[i]-point1[i]);
753 double alpha=
Radius/std::sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
755 for(
unsigned i=0; i<3; i++)
767 const Vector<double>& zeta,
771 Vector<double> on_sphere(3);
772 Vector<double> temp_zeta(2);
773 temp_zeta[0]=zeta[0];
775 r_up_U(t,temp_zeta,on_sphere);
778 Vector<double> on_center(3);
779 on_center[0]=0.5*
Radius*0.5*(zeta[0]+1.0);
783 for(
unsigned i=0; i<3; i++)
785 f[i]=on_center[i]+0.5*(zeta[1]+1.0)*(on_sphere[i]-on_center[i]);
796 const Vector<double>& zeta,
800 Vector<double> on_sphere(3);
801 Vector<double> temp_zeta(2);
802 temp_zeta[0]=zeta[0];
804 r_up_U(t,temp_zeta,on_sphere);
807 Vector<double> on_center(3);
808 on_center[0]=0.5*
Radius*0.5*(zeta[0]+1.0);
812 for(
unsigned i=0; i<3; i++)
814 f[i]=on_center[i]+0.5*(zeta[1]+1.0)*(on_sphere[i]-on_center[i]);
824 const Vector<double>& zeta,
829 Vector<double> on_sphere(3);
830 Vector<double> temp_zeta(2);
832 temp_zeta[1]=zeta[0];
836 Vector<double> on_center(3);
838 on_center[1]=0.5*
Radius*0.5*(zeta[0]+1.0);
841 for(
unsigned i=0; i<3; i++)
843 f[i]=on_center[i]+0.5*(zeta[1]+1.0)*(on_sphere[i]-on_center[i]);
853 const Vector<double>& zeta,
856 Vector<double> zeta2(2);
868 const Vector<double>& zeta,
873 Vector<double> on_sphere(3);
874 Vector<double> temp_zeta(2);
875 temp_zeta[0]=zeta[0];
880 Vector<double> on_center(3);
881 on_center[0]=0.5*
Radius*0.5*(zeta[0]+1.0);
885 for(
unsigned i=0; i<3; i++)
887 f[i]=on_center[i]+0.5*(zeta[1]+1.0)*(on_sphere[i]-on_center[i]);
897 const Vector<double>& zeta,
909 const Vector<double>& zeta,
921 const Vector<double>& zeta,
924 double k0=0.5*(1.0+zeta[0]);
925 double k1=0.5*(1.0+zeta[1]);
927 Vector<double> point1(3);
928 Vector<double> point2(3);
937 for(
unsigned i=0; i<3; i++)
939 p[i]=point1[i]+k1*(point2[i]-point1[i]);
941 double alpha=
Radius/std::sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
943 for(
unsigned i=0; i<3; i++)
EighthSphereDomain(const EighthSphereDomain &)
Broken copy constructor.
void r_centr_D(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central 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_right_B(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right 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_up_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_F(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left 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_right_U(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right 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 operator=(const EighthSphereDomain &)
Broken assignment operator.
void r_right_F(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
~EighthSphereDomain()
Destructor: Kill macro elements.
void r_up_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left 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_centr_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of central 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_up_B(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .
Eighth sphere as domain. Domain is parametrised by four macro elements.
void r_up_U(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left 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_right_L(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right box macro element zeta .
void r_up_F(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 .
void r_right_D(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of right 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 .
EighthSphereDomain(const double &radius)
Constructor: Pass the radius of the sphere.
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_front_R(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of top left box macro element zeta .