27 #ifndef OOMPH_FISH_DOMAIN_HEADER
28 #define OOMPH_FISH_DOMAIN_HEADER
31 #include "../generic/quadtree.h"
32 #include "../generic/domain.h"
33 #include "../generic/geom_objects.h"
62 Macro_element_pt.resize(nmacro);
65 for (
unsigned i = 0; i < nmacro; i++)
67 Macro_element_pt[i] =
new QMacroElement<2>(
this, i);
120 const unsigned& i_macro,
121 const unsigned& i_direct,
122 const Vector<double>& zeta,
146 const Vector<double>& zeta,
151 const Vector<double>& zeta,
156 const Vector<double>& zeta,
161 const Vector<double>& zeta,
166 const Vector<double>& zeta,
171 const Vector<double>& zeta,
176 const Vector<double>& zeta,
181 const Vector<double>& zeta,
187 const Vector<double>& zeta,
200 const Vector<double>& zeta,
205 Vector<double> zeta_new(1);
206 zeta_new[0] = -zeta[0];
214 const Vector<double>& zeta,
226 const Vector<double>& zeta,
231 Vector<double> zeta_new(1);
232 zeta_new[0] = -zeta[0];
241 const Vector<double>& zeta,
254 const Vector<double>& zeta,
259 Vector<double> zeta_new(1);
260 zeta_new[0] = -zeta[0];
268 const Vector<double>& zeta,
280 const Vector<double>& zeta,
285 Vector<double> zeta_new(1);
286 zeta_new[0] = -zeta[0];
309 const unsigned& imacro,
310 const unsigned& idirect,
311 const Vector<double>& zeta,
314 using namespace QuadTreeNames;
317 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
320 "Order of function arguments has changed between versions 0.8 and 0.85",
321 "FishDomain::macro_element_boundary(...)",
322 OOMPH_EXCEPTION_LOCATION);
338 else if (idirect == S)
342 else if (idirect == W)
346 else if (idirect == E)
352 std::ostringstream error_stream;
353 error_stream <<
"idirect is " << idirect <<
" not one of N, S, E, W"
356 throw OomphLibError(error_stream.str(),
357 OOMPH_CURRENT_FUNCTION,
358 OOMPH_EXCEPTION_LOCATION);
371 else if (idirect == S)
375 else if (idirect == W)
379 else if (idirect == E)
385 std::ostringstream error_stream;
386 error_stream <<
"idirect is " << idirect <<
" not one of N, S, E, W"
389 throw OomphLibError(error_stream.str(),
390 OOMPH_CURRENT_FUNCTION,
391 OOMPH_EXCEPTION_LOCATION);
405 else if (idirect == S)
409 else if (idirect == W)
413 else if (idirect == E)
419 std::ostringstream error_stream;
420 error_stream <<
"idirect is " << idirect <<
" not one of N, S, E, W"
423 throw OomphLibError(error_stream.str(),
424 OOMPH_CURRENT_FUNCTION,
425 OOMPH_EXCEPTION_LOCATION);
439 else if (idirect == S)
443 else if (idirect == W)
447 else if (idirect == E)
453 std::ostringstream error_stream;
454 error_stream <<
"idirect is " << idirect <<
" not one of N, S, E, W"
457 throw OomphLibError(error_stream.str(),
458 OOMPH_CURRENT_FUNCTION,
459 OOMPH_EXCEPTION_LOCATION);
467 std::ostringstream error_stream;
468 error_stream <<
"Wrong imacro " << imacro << std::endl;
471 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
481 const Vector<double>& zeta,
487 Vector<double> r_fish(2);
488 Back_pt->position(t, x, r_fish);
491 Vector<double> r_fin(2);
497 r[0] = r_fish[0] + (r_fin[0] - r_fish[0]) * 0.5 * (zeta[0] + 1.0);
498 r[1] = r_fish[1] + (r_fin[1] - r_fish[1]) * 0.5 * (zeta[0] + 1.0);
506 const Vector<double>& zeta,
512 Vector<double> r_fish(2);
513 Back_pt->position(t, x, r_fish);
516 r[1] = r_fish[1] * 0.5 * (zeta[0] + 1.0);
524 const Vector<double>& zeta,
530 Vector<double> r_fish(2);
531 Back_pt->position(t, x, r_fish);
534 r[0] = r_fish[0] * 0.5 * (zeta[0] + 1.0);
543 const Vector<double>& zeta,
548 r[1] =
Y_fin * 0.5 * (zeta[0] + 1.0);
556 const Vector<double>& zeta,
573 const Vector<double>& zeta,
577 Vector<double> r_top(2);
580 Back_pt->position(t, x, r_top);
583 Vector<double> r_back(2);
584 r_back[0] = r_top[0];
587 r[0] = r_back[0] + (r_top[0] - r_back[0]) * 0.5 * (zeta[0] + 1.0);
588 r[1] = r_back[1] + (r_top[1] - r_back[1]) * 0.5 * (zeta[0] + 1.0);
598 const Vector<double>& zeta,
602 Vector<double> r_top(2);
605 Back_pt->position(t, x, r_top);
618 const Vector<double>& zeta,
622 Vector<double> r_top(2);
625 Back_pt->position(t, x, r_top);
628 Vector<double> r_mouth(2);
634 r[0] = r_mouth[0] + (r_top[0] - r_mouth[0]) * 0.5 * (zeta[0] + 1.0);
635 r[1] = r_mouth[1] + (r_top[1] - r_mouth[1]) * 0.5 * (zeta[0] + 1.0);
Fish shaped domain, represented by four MacroElements. Shape is parametrised by GeomObject that repre...
void r_upper_fin_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper fin macro element zeta .
double Y_fin
Y coordinate of fin tip.
void r_lower_fin_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of lower fin macro element zeta .
void macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &zeta, Vector< double > &r)
Vector representation of the i_macro-th macro element boundary i_direct (N/S/W/E) at the discrete tim...
double Xi_tail
"Tail" limit for the (1D) coordinates along the wall
void operator=(const FishDomain &)=delete
Broken assignment operator.
void r_lower_body_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of lower body macro element zeta .
void r_upper_body_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper body macro element zeta .
void r_upper_body_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper body macro element zeta .
void r_upper_fin_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper fin macro element zeta .
void r_lower_fin_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of lower fin macro element zeta .
void r_upper_fin_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper fin macro element zeta .
void r_lower_body_N(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of lower body macro element zeta .
double & xi_nose()
Start coordinate on wall (near nose)
FishDomain(const FishDomain &)=delete
Broken copy constructor.
void r_lower_fin_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of lower fin macro element zeta .
FishDomain(GeomObject *back_pt, const double &xi_nose, const double &xi_tail)
Constructor: Pass pointer to GeomObject that represents the (upper) curved boundary of the fish's bod...
double X_mouth
X coordinate of corner of mouth.
void r_lower_body_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Southern boundary of lower body macro element zeta .
void r_lower_fin_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of lower fin macro element zeta .
virtual ~FishDomain()
Destructor for FishDomain: Empty; cleanup done in base class.
void r_lower_body_E(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of lower body macro element zeta .
void r_upper_body_W(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper body macro element zeta .
void r_upper_fin_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper fin macro element zeta .
double & x_mouth()
x-position of mouth
double & y_fin()
y-position of fin tip
double & xi_tail()
End coordinate on wall (near tail)
double & x_fin()
x-position of fin tip
GeomObject * Back_pt
Pointer to the fish's back.
double X_fin
X coordinate of fin tip.
void r_upper_body_S(const unsigned &t, const Vector< double > &zeta, Vector< double > &f)
Boundary of upper body macro element zeta .
double Xi_nose
"Nose" limit for the (1D) coordinates along the wall
////////////////////////////////////////////////////////////////////// //////////////////////////////...