oomph::RectangleWithHoleAndAnnularRegionDomain Class Reference

#include <rectangle_with_moving_cylinder_mesh.template.h>

+ Inheritance diagram for oomph::RectangleWithHoleAndAnnularRegionDomain:

Public Member Functions

 RectangleWithHoleAndAnnularRegionDomain (GeomObject *cylinder_pt, const double &annular_region_radius, const double &length)
 
 ~RectangleWithHoleAndAnnularRegionDomain ()
 Destructor: Empty; macro elements are deleted in base class destructor. More...
 
void project_point_on_cylinder_to_annular_boundary (const unsigned &time, const Vector< double > &xi, Vector< double > &r)
 Rectangular domain with circular whole. More...
 
void project_point_on_cylinder_to_annular_boundary (const double &time, const Vector< double > &xi, Vector< double > &r)
 
void linear_interpolate (const Vector< double > &left, const Vector< double > &right, const double &s, Vector< double > &f)
 
void macro_element_boundary (const double &time, const unsigned &m, const unsigned &direction, const Vector< double > &s, Vector< double > &f)
 
void macro_element_boundary (const unsigned &time, const unsigned &m, const unsigned &direction, const Vector< double > &s, Vector< double > &f)
 
- Public Member Functions inherited from oomph::Domain
 Domain ()
 Constructor. More...
 
 Domain (const Domain &)=delete
 Broken copy constructor. More...
 
void operator= (const Domain &)=delete
 Broken assignment operator. More...
 
virtual ~Domain ()
 
MacroElementmacro_element_pt (const unsigned &i)
 Access to i-th macro element. More...
 
unsigned nmacro_element ()
 Number of macro elements in domain. More...
 
void output (const std::string &filename, const unsigned &nplot)
 Output macro elements. More...
 
void output (std::ostream &outfile, const unsigned &nplot)
 Output macro elements. More...
 
void macro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void output_macro_element_boundaries (const std::string &filename, const unsigned &nplot)
 Output all macro element boundaries as tecplot zones. More...
 
void output_macro_element_boundaries (std::ostream &outfile, const unsigned &nplot)
 Output all macro element boundaries as tecplot zones. More...
 
virtual void dmacro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
virtual void dmacro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void dmacro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
virtual void d2macro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
virtual void d2macro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void d2macro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 

Private Attributes

Vector< doubleLower_left
 Lower left corner of rectangle. More...
 
Vector< doubleLower_right
 Lower right corner of rectangle. More...
 
Vector< doubleLower_mid_left
 Where the "radial" line from circle meets lower boundary on left. More...
 
Vector< doubleLower_mid_right
 Where the "radial" line from circle meets lower boundary on right. More...
 
Vector< doubleUpper_left
 Upper left corner of rectangle. More...
 
Vector< doubleUpper_right
 Upper right corner of rectangle. More...
 
Vector< doubleUpper_mid_left
 Where the "radial" line from circle meets upper boundary on left. More...
 
Vector< doubleUpper_mid_right
 Where the "radial" line from circle meets upper boundary on right. More...
 
GeomObjectCylinder_pt
 Pointer to geometric object that represents the central cylinder. More...
 
double Annular_region_radius
 

Additional Inherited Members

- Protected Attributes inherited from oomph::Domain
Vector< MacroElement * > Macro_element_pt
 Vector of pointers to macro elements. More...
 

Detailed Description

Rectangular domain with circular whole DRAIG: This looks like a redefinition of the RectangleWithHoleAndAnnularRegionDomain in src/meshes but it creates 8 macro-elements instead of 4 macro-elements and creates an annular region around the cylinder. It's probably a good idea to rename this class to avoid ambiguity and a name clash...

Constructor & Destructor Documentation

◆ RectangleWithHoleAndAnnularRegionDomain()

oomph::RectangleWithHoleAndAnnularRegionDomain::RectangleWithHoleAndAnnularRegionDomain ( GeomObject cylinder_pt,
const double annular_region_radius,
const double length 
)
inline

Constructor. Pass pointer to geometric object that represents the cylinder, the length of the (square) domain. The GeomObject must be parametrised such that \(\zeta \in [0,2\pi]\) sweeps around the circumference in anticlockwise direction.

64  : Cylinder_pt(cylinder_pt), Annular_region_radius(annular_region_radius)
65  {
66  // Vertices of rectangle
67  Lower_left.resize(2);
68  Lower_left[0] = -0.5 * length;
69  Lower_left[1] = -0.5 * length;
70 
71  Upper_left.resize(2);
72  Upper_left[0] = -0.5 * length;
73  Upper_left[1] = 0.5 * length;
74 
75  Lower_right.resize(2);
76  Lower_right[0] = 0.5 * length;
77  Lower_right[1] = -0.5 * length;
78 
79  Upper_right.resize(2);
80  Upper_right[0] = 0.5 * length;
81  Upper_right[1] = 0.5 * length;
82 
83  // Coordinates of points where the "radial" lines from central
84  // cylinder meet the upper and lower boundaries
85  Lower_mid_left.resize(2);
86  Lower_mid_left[0] = -0.5 * length;
87  Lower_mid_left[1] = -0.5 * length;
88 
89  Upper_mid_left.resize(2);
90  Upper_mid_left[0] = -0.5 * length;
91  Upper_mid_left[1] = 0.5 * length;
92 
93  Lower_mid_right.resize(2);
94  Lower_mid_right[0] = 0.5 * length;
95  Lower_mid_right[1] = -0.5 * length;
96 
97  Upper_mid_right.resize(2);
98  Upper_mid_right[0] = 0.5 * length;
99  Upper_mid_right[1] = 0.5 * length;
100 
101  // The number of macro elements
102  unsigned n_macro_element = 8;
103 
104  // There are four macro elements
105  Macro_element_pt.resize(n_macro_element);
106 
107  // Build the 2D macro elements
108  for (unsigned i = 0; i < n_macro_element; i++)
109  {
110  // Create the i-th macro element
111  Macro_element_pt[i] = new QMacroElement<2>(this, i);
112  }
113  } // End of RectangleWithHoleAndAnnularRegionDomain
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition: domain.h:301
Vector< double > Upper_mid_left
Where the "radial" line from circle meets upper boundary on left.
Definition: rectangle_with_moving_cylinder_mesh.template.h:193
Vector< double > Lower_right
Lower right corner of rectangle.
Definition: rectangle_with_moving_cylinder_mesh.template.h:178
Vector< double > Upper_right
Upper right corner of rectangle.
Definition: rectangle_with_moving_cylinder_mesh.template.h:190
GeomObject * Cylinder_pt
Pointer to geometric object that represents the central cylinder.
Definition: rectangle_with_moving_cylinder_mesh.template.h:199
Vector< double > Lower_mid_left
Where the "radial" line from circle meets lower boundary on left.
Definition: rectangle_with_moving_cylinder_mesh.template.h:181
Vector< double > Lower_mid_right
Where the "radial" line from circle meets lower boundary on right.
Definition: rectangle_with_moving_cylinder_mesh.template.h:184
double Annular_region_radius
Definition: rectangle_with_moving_cylinder_mesh.template.h:205
Vector< double > Upper_mid_right
Where the "radial" line from circle meets upper boundary on right.
Definition: rectangle_with_moving_cylinder_mesh.template.h:196
Vector< double > Lower_left
Lower left corner of rectangle.
Definition: rectangle_with_moving_cylinder_mesh.template.h:175
Vector< double > Upper_left
Upper left corner of rectangle.
Definition: rectangle_with_moving_cylinder_mesh.template.h:187

References i, Lower_left, Lower_mid_left, Lower_mid_right, Lower_right, oomph::Domain::Macro_element_pt, Upper_left, Upper_mid_left, Upper_mid_right, and Upper_right.

Referenced by oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT >::RectangleWithHoleAndAnnularRegionMesh().

◆ ~RectangleWithHoleAndAnnularRegionDomain()

oomph::RectangleWithHoleAndAnnularRegionDomain::~RectangleWithHoleAndAnnularRegionDomain ( )
inline

Destructor: Empty; macro elements are deleted in base class destructor.

117 {}

Member Function Documentation

◆ linear_interpolate()

void oomph::RectangleWithHoleAndAnnularRegionDomain::linear_interpolate ( const Vector< double > &  left,
const Vector< double > &  right,
const double s,
Vector< double > &  f 
)
inline

Helper function to interpolate linearly between the "right" and "left" points; \( s \in [-1,1] \)

143  {
144  // Loop over the coordinates
145  for (unsigned i = 0; i < 2; i++)
146  {
147  // Get the linear interpolation of the two points
148  f[i] = left[i] + (right[i] - left[i]) * 0.5 * (s + 1.0);
149  }
150  } // End of linear_interpolate
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar s
Definition: level1_cplx_impl.h:130

References f(), i, and s.

Referenced by macro_element_boundary(), and oomph::RefineableQuadMeshWithMovingCylinder< MyRefineableQTaylorHoodElement >::RefineableQuadMeshWithMovingCylinder().

◆ macro_element_boundary() [1/2]

void oomph::RectangleWithHoleAndAnnularRegionDomain::macro_element_boundary ( const double time,
const unsigned m,
const unsigned direction,
const Vector< double > &  s,
Vector< double > &  f 
)
virtual

Parametrisation of macro element boundaries: f(s) is the position vector to macro-element m's boundary in the specified direction [N/S/E/W] at the specified discrete time level (time=0: present; time>0: previous)

Reimplemented from oomph::Domain.

133  {
134 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
135  // Create warning about time argument being moved to the front
136  std::string error_message_string =
137  "Order of function arguments has changed ";
138 
139  // Finish the string off
140  error_message_string += "between versions 0.8 and 0.85";
141 
142  // Output a warning
143  OomphLibWarning(
144  error_message_string, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
145 #endif
146 
147  // Lagrangian coordinate along surface of cylinder
148  Vector<double> xi(1, 0.0);
149 
150  // Point on circle
151  Vector<double> point_on_circle(2, 0.0);
152 
153  // Point on the outer boundary of the annular region
154  Vector<double> point_on_annular_ring(2, 0.0);
155 
156  // Use the QuadTree enumeration for face directions
157  using namespace QuadTreeNames;
158 
159  // Switch on the macro element
160  switch (m)
161  {
162  // Macro element 0 is immediately to the left of the cylinder, outside
163  // the inner annular region
164  case 0:
165 
166  // Switch on the direction
167  switch (direction)
168  {
169  case N:
170  xi[0] = 3.0 * atan(1.0);
172  time, xi, point_on_annular_ring);
173  linear_interpolate(Upper_mid_left, point_on_annular_ring, s[0], f);
174  break;
175 
176  case S:
177  xi[0] = -3.0 * atan(1.0);
179  time, xi, point_on_annular_ring);
180  linear_interpolate(Lower_mid_left, point_on_annular_ring, s[0], f);
181  break;
182 
183  case W:
185  break;
186 
187  case E:
188  xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
190  break;
191 
192  default:
193 
194  std::ostringstream error_stream;
195  error_stream << "Direction is incorrect: " << direction
196  << std::endl;
197  throw OomphLibError(error_stream.str(),
200  }
201 
202  break;
203 
204  // Macro element 1 is immediately above the cylinder, outside
205  // the inner annular region
206  case 1:
207 
208  switch (direction)
209  {
210  case N:
212  break;
213 
214  case S:
215  xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
217  break;
218 
219  case W:
220  xi[0] = 3.0 * atan(1.0);
222  time, xi, point_on_annular_ring);
223  linear_interpolate(point_on_annular_ring, Upper_mid_left, s[0], f);
224  break;
225 
226  case E:
227  xi[0] = 1.0 * atan(1.0);
229  time, xi, point_on_annular_ring);
230  linear_interpolate(point_on_annular_ring, Upper_mid_right, s[0], f);
231  break;
232 
233  default:
234 
235  std::ostringstream error_stream;
236  error_stream << "Direction is incorrect: " << direction
237  << std::endl;
238  throw OomphLibError(error_stream.str(),
241  }
242 
243  break;
244 
245  // Macro element 2 is immediately to the right of the cylinder, outside
246  // the inner annular region
247  case 2:
248 
249  switch (direction)
250  {
251  case N:
252  xi[0] = 1.0 * atan(1.0);
254  time, xi, point_on_annular_ring);
255  linear_interpolate(point_on_annular_ring, Upper_mid_right, s[0], f);
256  break;
257 
258  case S:
259  xi[0] = -1.0 * atan(1.0);
261  time, xi, point_on_annular_ring);
262  linear_interpolate(point_on_annular_ring, Lower_mid_right, s[0], f);
263  break;
264 
265  case W:
266  xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
268  break;
269 
270  case E:
272  break;
273 
274  default:
275 
276  std::ostringstream error_stream;
277  error_stream << "Direction is incorrect: " << direction
278  << std::endl;
279  throw OomphLibError(error_stream.str(),
282  }
283 
284  break;
285 
286  // Macro element 3 is immediately below cylinder, outside
287  // the inner annular region
288  case 3:
289 
290  switch (direction)
291  {
292  case N:
293  xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
295  break;
296 
297  case S:
299  break;
300 
301  case W:
302  xi[0] = -3.0 * atan(1.0);
304  time, xi, point_on_annular_ring);
305  linear_interpolate(Lower_mid_left, point_on_annular_ring, s[0], f);
306  break;
307 
308  case E:
309  xi[0] = -1.0 * atan(1.0);
311  time, xi, point_on_annular_ring);
312  linear_interpolate(Lower_mid_right, point_on_annular_ring, s[0], f);
313  break;
314 
315  default:
316 
317  std::ostringstream error_stream;
318  error_stream << "Direction is incorrect: " << direction
319  << std::endl;
320  throw OomphLibError(error_stream.str(),
323  }
324 
325  break;
326 
327  // Macro element 4, is immediately to the left of the cylinder
328  // lying in the inner annular region
329  case 4:
330 
331  // Switch on the face of the m-th macro element
332  switch (direction)
333  {
334  case N:
335  xi[0] = 3.0 * atan(1.0);
336  Cylinder_pt->position(time, xi, point_on_circle);
338  time, xi, point_on_annular_ring);
339  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
340  break;
341 
342  case S:
343  xi[0] = -3.0 * atan(1.0);
344  Cylinder_pt->position(time, xi, point_on_circle);
346  time, xi, point_on_annular_ring);
347  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
348  break;
349 
350  case W:
351  xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
353  break;
354 
355  case E:
356  xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
357  Cylinder_pt->position(time, xi, f);
358  break;
359 
360  default:
361 
362  std::ostringstream error_stream;
363  error_stream << "Direction is incorrect: " << direction
364  << std::endl;
365  throw OomphLibError(error_stream.str(),
368  }
369 
370  break;
371 
372  // Macro element 5, is immediately above the cylinder in the
373  // inner annular region
374  case 5:
375 
376  switch (direction)
377  {
378  case N:
379  xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
381  break;
382 
383  case S:
384  xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
385  Cylinder_pt->position(time, xi, f);
386  break;
387 
388  case W:
389  xi[0] = 3.0 * atan(1.0);
390  Cylinder_pt->position(time, xi, point_on_circle);
392  time, xi, point_on_annular_ring);
393  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
394  break;
395 
396  case E:
397  xi[0] = 1.0 * atan(1.0);
398  Cylinder_pt->position(time, xi, point_on_circle);
400  time, xi, point_on_annular_ring);
401  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
402  break;
403 
404  default:
405 
406  std::ostringstream error_stream;
407  error_stream << "Direction is incorrect: " << direction
408  << std::endl;
409  throw OomphLibError(error_stream.str(),
412  }
413 
414  break;
415 
416  // Macro element 6, is immediately to the right of the cylinder
417  // lying in the inner annular region
418  case 6:
419 
420  switch (direction)
421  {
422  case N:
423  xi[0] = 1.0 * atan(1.0);
424  Cylinder_pt->position(time, xi, point_on_circle);
426  time, xi, point_on_annular_ring);
427  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
428  break;
429 
430  case S:
431  xi[0] = -1.0 * atan(1.0);
432  Cylinder_pt->position(time, xi, point_on_circle);
434  time, xi, point_on_annular_ring);
435  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
436  break;
437 
438  case W:
439  xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
440  Cylinder_pt->position(time, xi, f);
441  break;
442 
443  case E:
444  xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
446  break;
447 
448  default:
449 
450  std::ostringstream error_stream;
451  error_stream << "Direction is incorrect: " << direction
452  << std::endl;
453  throw OomphLibError(error_stream.str(),
456  }
457 
458  break;
459 
460  // Macro element 7, is immediately below the cylinder in the
461  // inner annular region
462  case 7:
463 
464  switch (direction)
465  {
466  case N:
467  xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
468  Cylinder_pt->position(time, xi, f);
469  break;
470 
471  case S:
472  xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
474  break;
475 
476  case W:
477  xi[0] = -3.0 * atan(1.0);
478  Cylinder_pt->position(time, xi, point_on_circle);
480  time, xi, point_on_annular_ring);
481  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
482  break;
483 
484  case E:
485  xi[0] = -1.0 * atan(1.0);
486  Cylinder_pt->position(time, xi, point_on_circle);
488  time, xi, point_on_annular_ring);
489  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
490  break;
491 
492  default:
493 
494  std::ostringstream error_stream;
495  error_stream << "Direction is incorrect: " << direction
496  << std::endl;
497  throw OomphLibError(error_stream.str(),
500  }
501 
502  break;
503 
504  default:
505 
506  std::ostringstream error_stream;
507  error_stream << "Wrong macro element number" << m << std::endl;
508  throw OomphLibError(
509  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
510  }
511  } // End of macro_element_boundary
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
void linear_interpolate(const Vector< double > &left, const Vector< double > &right, const double &s, Vector< double > &f)
Definition: rectangle_with_moving_cylinder_mesh.template.h:139
void project_point_on_cylinder_to_annular_boundary(const unsigned &time, const Vector< double > &xi, Vector< double > &r)
Rectangular domain with circular whole.
Definition: rectangle_with_moving_cylinder_mesh.template.cc:39
@ N
Definition: constructor.cpp:22
int * m
Definition: level2_cplx_impl.h:294
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atan(const bfloat16 &a)
Definition: BFloat16.h:636
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:68
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
@ S
Definition: quadtree.h:62
@ W
Definition: quadtree.h:63
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References Eigen::bfloat16_impl::atan(), Global_Physical_Variables::E, f(), linear_interpolate(), Lower_mid_left, Lower_mid_right, m, N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, project_point_on_cylinder_to_annular_boundary(), s, oomph::QuadTreeNames::S, oomph::Global_string_for_annotation::string(), Upper_mid_left, Upper_mid_right, and oomph::QuadTreeNames::W.

◆ macro_element_boundary() [2/2]

void oomph::RectangleWithHoleAndAnnularRegionDomain::macro_element_boundary ( const unsigned time,
const unsigned m,
const unsigned direction,
const Vector< double > &  s,
Vector< double > &  f 
)
virtual

Parametrisation of macro element boundaries: f(s) is the position vector to macro-element m's boundary in the specified direction [N/S/E/W] at the specified discrete time level (time=0: present; time>0: previous)

Implements oomph::Domain.

523  {
524 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
525  // Warn about time argument being moved to the front
526  OomphLibWarning(
527  "Order of function arguments has changed between versions 0.8 and 0.85",
528  "RectangleWithHoleAndAnnularRegionDomain::macro_element_boundary(...)",
530 #endif
531 
532  // Lagrangian coordinate along surface of cylinder
533  Vector<double> xi(1, 0.0);
534 
535  // Point on circle
536  Vector<double> point_on_circle(2, 0.0);
537 
538  // Point on the outer boundary of the annular region
539  Vector<double> point_on_annular_ring(2, 0.0);
540 
541  // Use the QuadTree enumeration for face directions
542  using namespace QuadTreeNames;
543 
544  // Switch on the macro element
545  switch (m)
546  {
547  // Macro element 0 is immediately to the left of the cylinder, outside
548  // the inner annular region
549  case 0:
550 
551  // Switch on the direction
552  switch (direction)
553  {
554  case N:
555  xi[0] = 3.0 * atan(1.0);
557  time, xi, point_on_annular_ring);
558  linear_interpolate(Upper_mid_left, point_on_annular_ring, s[0], f);
559  break;
560 
561  case S:
562  xi[0] = -3.0 * atan(1.0);
564  time, xi, point_on_annular_ring);
565  linear_interpolate(Lower_mid_left, point_on_annular_ring, s[0], f);
566  break;
567 
568  case W:
570  break;
571 
572  case E:
573  xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
575  break;
576 
577  default:
578 
579  std::ostringstream error_stream;
580  error_stream << "Direction is incorrect: " << direction
581  << std::endl;
582  throw OomphLibError(error_stream.str(),
585  }
586 
587  break;
588 
589  // Macro element 1 is immediately above the cylinder, outside
590  // the inner annular region
591  case 1:
592 
593  switch (direction)
594  {
595  case N:
597  break;
598 
599  case S:
600  xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
602  break;
603 
604  case W:
605  xi[0] = 3.0 * atan(1.0);
607  time, xi, point_on_annular_ring);
608  linear_interpolate(point_on_annular_ring, Upper_mid_left, s[0], f);
609  break;
610 
611  case E:
612  xi[0] = 1.0 * atan(1.0);
614  time, xi, point_on_annular_ring);
615  linear_interpolate(point_on_annular_ring, Upper_mid_right, s[0], f);
616  break;
617 
618  default:
619 
620  std::ostringstream error_stream;
621  error_stream << "Direction is incorrect: " << direction
622  << std::endl;
623  throw OomphLibError(error_stream.str(),
626  }
627 
628  break;
629 
630  // Macro element 2 is immediately to the right of the cylinder, outside
631  // the inner annular region
632  case 2:
633 
634  switch (direction)
635  {
636  case N:
637  xi[0] = 1.0 * atan(1.0);
639  time, xi, point_on_annular_ring);
640  linear_interpolate(point_on_annular_ring, Upper_mid_right, s[0], f);
641  break;
642 
643  case S:
644  xi[0] = -1.0 * atan(1.0);
646  time, xi, point_on_annular_ring);
647  linear_interpolate(point_on_annular_ring, Lower_mid_right, s[0], f);
648  break;
649 
650  case W:
651  xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
653  break;
654 
655  case E:
657  break;
658 
659  default:
660 
661  std::ostringstream error_stream;
662  error_stream << "Direction is incorrect: " << direction
663  << std::endl;
664  throw OomphLibError(error_stream.str(),
667  }
668 
669  break;
670 
671  // Macro element 3 is immediately below cylinder, outside
672  // the inner annular region
673  case 3:
674 
675  switch (direction)
676  {
677  case N:
678  xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
680  break;
681 
682  case S:
684  break;
685 
686  case W:
687  xi[0] = -3.0 * atan(1.0);
689  time, xi, point_on_annular_ring);
690  linear_interpolate(Lower_mid_left, point_on_annular_ring, s[0], f);
691  break;
692 
693  case E:
694  xi[0] = -1.0 * atan(1.0);
696  time, xi, point_on_annular_ring);
697  linear_interpolate(Lower_mid_right, point_on_annular_ring, s[0], f);
698  break;
699 
700  default:
701 
702  std::ostringstream error_stream;
703  error_stream << "Direction is incorrect: " << direction
704  << std::endl;
705  throw OomphLibError(error_stream.str(),
708  }
709 
710  break;
711 
712  // Macro element 4, is immediately to the left of the cylinder
713  // lying in the inner annular region
714  case 4:
715 
716  // Switch on the face of the m-th macro element
717  switch (direction)
718  {
719  case N:
720  xi[0] = 3.0 * atan(1.0);
721  Cylinder_pt->position(time, xi, point_on_circle);
723  time, xi, point_on_annular_ring);
724  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
725  break;
726 
727  case S:
728  xi[0] = -3.0 * atan(1.0);
729  Cylinder_pt->position(time, xi, point_on_circle);
731  time, xi, point_on_annular_ring);
732  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
733  break;
734 
735  case W:
736  xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
738  break;
739 
740  case E:
741  xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
742  Cylinder_pt->position(time, xi, f);
743  break;
744 
745  default:
746 
747  std::ostringstream error_stream;
748  error_stream << "Direction is incorrect: " << direction
749  << std::endl;
750  throw OomphLibError(error_stream.str(),
753  }
754 
755  break;
756 
757  // Macro element 5, is immediately above the cylinder in the
758  // inner annular region
759  case 5:
760 
761  switch (direction)
762  {
763  case N:
764  xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
766  break;
767 
768  case S:
769  xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
770  Cylinder_pt->position(time, xi, f);
771  break;
772 
773  case W:
774  xi[0] = 3.0 * atan(1.0);
775  Cylinder_pt->position(time, xi, point_on_circle);
777  time, xi, point_on_annular_ring);
778  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
779  break;
780 
781  case E:
782  xi[0] = 1.0 * atan(1.0);
783  Cylinder_pt->position(time, xi, point_on_circle);
785  time, xi, point_on_annular_ring);
786  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
787  break;
788 
789  default:
790 
791  std::ostringstream error_stream;
792  error_stream << "Direction is incorrect: " << direction
793  << std::endl;
794  throw OomphLibError(error_stream.str(),
797  }
798 
799  break;
800 
801  // Macro element 6, is immediately to the right of the cylinder
802  // lying in the inner annular region
803  case 6:
804 
805  switch (direction)
806  {
807  case N:
808  xi[0] = 1.0 * atan(1.0);
809  Cylinder_pt->position(time, xi, point_on_circle);
811  time, xi, point_on_annular_ring);
812  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
813  break;
814 
815  case S:
816  xi[0] = -1.0 * atan(1.0);
817  Cylinder_pt->position(time, xi, point_on_circle);
819  time, xi, point_on_annular_ring);
820  linear_interpolate(point_on_circle, point_on_annular_ring, s[0], f);
821  break;
822 
823  case W:
824  xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
825  Cylinder_pt->position(time, xi, f);
826  break;
827 
828  case E:
829  xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
831  break;
832 
833  default:
834 
835  std::ostringstream error_stream;
836  error_stream << "Direction is incorrect: " << direction
837  << std::endl;
838  throw OomphLibError(error_stream.str(),
841  }
842 
843  break;
844 
845  // Macro element 7, is immediately below the cylinder in the
846  // inner annular region
847  case 7:
848 
849  switch (direction)
850  {
851  case N:
852  xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
853  Cylinder_pt->position(time, xi, f);
854  break;
855 
856  case S:
857  xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 + s[0]);
859  break;
860 
861  case W:
862  xi[0] = -3.0 * atan(1.0);
863  Cylinder_pt->position(time, xi, point_on_circle);
865  time, xi, point_on_annular_ring);
866  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
867  break;
868 
869  case E:
870  xi[0] = -1.0 * atan(1.0);
871  Cylinder_pt->position(time, xi, point_on_circle);
873  time, xi, point_on_annular_ring);
874  linear_interpolate(point_on_annular_ring, point_on_circle, s[0], f);
875  break;
876 
877  default:
878 
879  std::ostringstream error_stream;
880  error_stream << "Direction is incorrect: " << direction
881  << std::endl;
882  throw OomphLibError(error_stream.str(),
885  }
886 
887  break;
888 
889  default:
890 
891  std::ostringstream error_stream;
892  error_stream << "Wrong macro element number" << m << std::endl;
893  throw OomphLibError(
894  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
895  }
896  } // End of macro_element_boundary

References Eigen::bfloat16_impl::atan(), Cylinder_pt, Global_Physical_Variables::E, f(), linear_interpolate(), Lower_mid_left, Lower_mid_right, m, N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), project_point_on_cylinder_to_annular_boundary(), s, oomph::QuadTreeNames::S, Upper_mid_left, Upper_mid_right, and oomph::QuadTreeNames::W.

◆ project_point_on_cylinder_to_annular_boundary() [1/2]

void oomph::RectangleWithHoleAndAnnularRegionDomain::project_point_on_cylinder_to_annular_boundary ( const double time,
const Vector< double > &  xi,
Vector< double > &  r 
)

Helper function that, given the Lagrangian coordinate, xi, (associated with a point on the cylinder), returns the corresponding point on the outer boundary of the annular region (where the inner boundary is prescribed by the boundary of the cylinder)

87  {
88  // Lagrangian coordinate corresponds to theta=pi on the circle
89  Vector<double> xi_left(1, 4.0 * atan(1.0));
90 
91  // Point on circle corresponding to theta=pi
92  Vector<double> point_left(2, 0.0);
93 
94  // Get the position of the point on the circle
95  Cylinder_pt->position(time, xi_left, point_left);
96 
97  // Lagrangian coordinate corresponds to theta=0 on the circle
98  Vector<double> xi_right(1, 0.0);
99 
100  // Point on circle corresponding to theta=0
101  Vector<double> point_right(2, 0.0);
102 
103  // Get the position of the point on the circle
104  Cylinder_pt->position(time, xi_right, point_right);
105 
106  // Storage for the coordinates of the centre
107  Vector<double> point_centre(2, 0.0);
108 
109  // Loop over the coordinates
110  for (unsigned i = 0; i < 2; i++)
111  {
112  // Calculate the i-th coordinate of the central point
113  point_centre[i] = 0.5 * (point_left[i] + point_right[i]);
114  }
115 
116  // Calculate the x-coordinate of the projectd point
117  r[0] = point_centre[0] + Annular_region_radius * cos(xi[0]);
118 
119  // Calculate the y-coordinate of the projectd point
120  r[1] = point_centre[1] + Annular_region_radius * sin(xi[0]);
121  } // End of project_point_on_cylinder_to_annular_boundary
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
r
Definition: UniformPSDSelfTest.py:20

References Annular_region_radius, Eigen::bfloat16_impl::atan(), cos(), Cylinder_pt, i, oomph::GeomObject::position(), UniformPSDSelfTest::r, and sin().

◆ project_point_on_cylinder_to_annular_boundary() [2/2]

void oomph::RectangleWithHoleAndAnnularRegionDomain::project_point_on_cylinder_to_annular_boundary ( const unsigned time,
const Vector< double > &  xi,
Vector< double > &  r 
)

Rectangular domain with circular whole.

Helper function that, given the Lagrangian coordinate, xi, (associated with a point on the cylinder), returns the corresponding point on the outer boundary of the annular region (where the inner boundary is prescribed by the boundary of the cylinder)

42  {
43  // Lagrangian coordinate corresponds to theta=pi on the circle
44  Vector<double> xi_left(1, 4.0 * atan(1.0));
45 
46  // Point on circle corresponding to theta=pi
47  Vector<double> point_left(2, 0.0);
48 
49  // Get the position of the point on the circle
50  Cylinder_pt->position(time, xi_left, point_left);
51 
52  // Lagrangian coordinate corresponds to theta=0 on the circle
53  Vector<double> xi_right(1, 0.0);
54 
55  // Point on circle corresponding to theta=0
56  Vector<double> point_right(2, 0.0);
57 
58  // Get the position of the point on the circle
59  Cylinder_pt->position(time, xi_right, point_right);
60 
61  // Storage for the coordinates of the centre
62  Vector<double> point_centre(2, 0.0);
63 
64  // Loop over the coordinates
65  for (unsigned i = 0; i < 2; i++)
66  {
67  // Calculate the i-th coordinate of the central point
68  point_centre[i] = 0.5 * (point_left[i] + point_right[i]);
69  }
70 
71  // Calculate the x-coordinate of the projectd point
72  r[0] = point_centre[0] + Annular_region_radius * cos(xi[0]);
73 
74  // Calculate the y-coordinate of the projectd point
75  r[1] = point_centre[1] + Annular_region_radius * sin(xi[0]);
76  } // End of project_point_on_cylinder_to_annular_boundary

References Annular_region_radius, Eigen::bfloat16_impl::atan(), cos(), Cylinder_pt, i, oomph::GeomObject::position(), UniformPSDSelfTest::r, and sin().

Referenced by macro_element_boundary(), and oomph::RefineableQuadMeshWithMovingCylinder< MyRefineableQTaylorHoodElement >::RefineableQuadMeshWithMovingCylinder().

Member Data Documentation

◆ Annular_region_radius

double oomph::RectangleWithHoleAndAnnularRegionDomain::Annular_region_radius
private

The radius of the outer boundary of the annular region whose inner boundary is described by Cylinder_pt and outer boundary is a circle with radius lying between half the length of the bounding box and the radius cylinder

Referenced by project_point_on_cylinder_to_annular_boundary().

◆ Cylinder_pt

GeomObject* oomph::RectangleWithHoleAndAnnularRegionDomain::Cylinder_pt
private

◆ Lower_left

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Lower_left
private

Lower left corner of rectangle.

Referenced by RectangleWithHoleAndAnnularRegionDomain().

◆ Lower_mid_left

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Lower_mid_left
private

Where the "radial" line from circle meets lower boundary on left.

Referenced by macro_element_boundary(), and RectangleWithHoleAndAnnularRegionDomain().

◆ Lower_mid_right

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Lower_mid_right
private

Where the "radial" line from circle meets lower boundary on right.

Referenced by macro_element_boundary(), and RectangleWithHoleAndAnnularRegionDomain().

◆ Lower_right

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Lower_right
private

Lower right corner of rectangle.

Referenced by RectangleWithHoleAndAnnularRegionDomain().

◆ Upper_left

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Upper_left
private

Upper left corner of rectangle.

Referenced by RectangleWithHoleAndAnnularRegionDomain().

◆ Upper_mid_left

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Upper_mid_left
private

Where the "radial" line from circle meets upper boundary on left.

Referenced by macro_element_boundary(), and RectangleWithHoleAndAnnularRegionDomain().

◆ Upper_mid_right

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Upper_mid_right
private

Where the "radial" line from circle meets upper boundary on right.

Referenced by macro_element_boundary(), and RectangleWithHoleAndAnnularRegionDomain().

◆ Upper_right

Vector<double> oomph::RectangleWithHoleAndAnnularRegionDomain::Upper_right
private

Upper right corner of rectangle.

Referenced by RectangleWithHoleAndAnnularRegionDomain().


The documentation for this class was generated from the following files: