RectangleWithHoleDomain Class Reference

Rectangular domain with circular whole. More...

+ Inheritance diagram for RectangleWithHoleDomain:

Public Member Functions

double centre_x ()
 
double centre_y ()
 
 RectangleWithHoleDomain (GeomObject *cylinder_pt, const double &length, const double &height)
 
 ~RectangleWithHoleDomain ()
 Destructor: Empty; cleanup done in base class. More...
 
void linear_interpolate (Vector< double > left, Vector< double > right, const 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)
 
double centre_x ()
 
double centre_y ()
 
 RectangleWithHoleDomain (GeomObject *cylinder_pt, const double &length, const double &height)
 
 ~RectangleWithHoleDomain ()
 Destructor: Empty; cleanup done in base class. More...
 
void linear_interpolate (Vector< double > left, Vector< double > right, const 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)
 
GeomObject *const & cylinder_pt ()
 
 RectangleWithHoleDomain (GeomObject *cylinder_pt, const double &length, const double &height)
 
 ~RectangleWithHoleDomain ()
 Destructor: Empty; cleanup done in base class. More...
 
void linear_interpolate (Vector< double > left, Vector< double > right, const 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...
 
virtual void macro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
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...
 
Vector< doubleUpper_1
 Coordinate of internal point in the boundaries of the domain. More...
 
Vector< doubleUpper_2
 Coordinate of internal point in the boundaries of the domain. More...
 
Vector< doubleUpper_3
 Coordinate of internal point in the boundaries of the domain. More...
 
Vector< doubleLower_1
 Coordinate of internal point in the boundaries of the domain. More...
 
Vector< doubleLower_2
 Coordinate of internal point in the boundaries of the domain. More...
 
Vector< doubleLower_3
 Coordinate of internal point in the boundaries of the domain. More...
 
double Centre_x
 x-coordinate of circle centre More...
 
double Centre_y
 y-coordinate of circle centre More...
 
GeomObjectCylinder_pt
 Pointer to geometric object that represents the central cylinder. More...
 

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.

///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ RectangleWithHoleDomain() [1/3]

RectangleWithHoleDomain::RectangleWithHoleDomain ( GeomObject cylinder_pt,
const double length,
const double height 
)
inline

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

155  :
157  {
158 
159  Centre_x = static_cast<GeneralEllipse*>(cylinder_pt)->centre_x();
160  Centre_y = static_cast<GeneralEllipse*>(cylinder_pt)->centre_y();
161 
162  double lower_wall = -0.5*height;
163  double upper_wall = 0.5*height;
164 
165  //Vertices of rectangle
166  Lower_left.resize(2);
167  Lower_left[0] = 0.0;
168  Lower_left[1] = lower_wall;
169 
170  Upper_left.resize(2);
171  Upper_left[0] = 0.0;
172  Upper_left[1] = upper_wall;
173 
174  Lower_right.resize(2);
175  Lower_right[0] = length;
176  Lower_right[1] = lower_wall;
177 
178  Upper_right.resize(2);
179  Upper_right[0] = length;
180  Upper_right[1] = upper_wall;
181 
182 
183  double left_cylinder_split = 3.5;
184  double right_cylinder_split = 5.5;
185 
186  // Coordinates of points where the "radial" lines from central
187  // cylinder meet the upper and lower boundaries
188  Lower_mid_left.resize(2);
189  Lower_mid_left[0] = left_cylinder_split;
190  Lower_mid_left[1] = lower_wall;
191 
192  Upper_mid_left.resize(2);
193  Upper_mid_left[0] = left_cylinder_split;
194  Upper_mid_left[1] = upper_wall;
195 
196  Lower_mid_right.resize(2);
197  Lower_mid_right[0] = right_cylinder_split;
198  Lower_mid_right[1] = lower_wall;
199 
200  Upper_mid_right.resize(2);
201  Upper_mid_right[0] = right_cylinder_split;
202  Upper_mid_right[1] = upper_wall;
203 
204 
205  // Coordinates of internal points for creation of macro elements
206 
207  double help = (length - right_cylinder_split)/4.;
208 
209  Upper_1.resize(2);
210  Upper_1[0] = right_cylinder_split + help;
211  Upper_1[1] = upper_wall;
212 
213  Upper_2.resize(2);
214  Upper_2[0] = right_cylinder_split + 2.*help;
215  Upper_2[1] = upper_wall;
216 
217  Upper_3.resize(2);
218  Upper_3[0] = right_cylinder_split + 3.*help;
219  Upper_3[1] = upper_wall;
220 
221  Lower_1.resize(2);
222  Lower_1[0] = right_cylinder_split + help;
223  Lower_1[1] = lower_wall;
224 
225  Lower_2.resize(2);
226  Lower_2[0] = right_cylinder_split + 2.*help;
227  Lower_2[1] = lower_wall;
228 
229  Lower_3.resize(2);
230  Lower_3[0] = right_cylinder_split + 3.*help;
231  Lower_3[1] = lower_wall;
232 
233  //There are nine macro elements
234  Macro_element_pt.resize(9);
235 
236  // Build the 2D macro elements
237  for (unsigned i=0;i<9;i++)
238  {Macro_element_pt[i]= new QMacroElement<2>(this,i);}
239  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
My own Ellipse class.
Definition: adaptive_hopf.cc:80
Vector< double > Upper_right
Upper right corner of rectangle.
Definition: adaptive_hopf.cc:619
Vector< double > Lower_3
Coordinate of internal point in the boundaries of the domain.
Definition: adaptive_hopf.cc:644
Vector< double > Upper_1
Coordinate of internal point in the boundaries of the domain.
Definition: adaptive_hopf.cc:629
double Centre_x
x-coordinate of circle centre
Definition: adaptive_hopf.cc:648
double centre_y()
Definition: adaptive_hopf.cc:147
double centre_x()
Definition: adaptive_hopf.cc:146
GeomObject *const & cylinder_pt()
Definition: adaptive_hopf_with_separate_meshes.cc:607
Vector< double > Upper_2
Coordinate of internal point in the boundaries of the domain.
Definition: adaptive_hopf.cc:632
Vector< double > Upper_3
Coordinate of internal point in the boundaries of the domain.
Definition: adaptive_hopf.cc:635
Vector< double > Lower_right
Lower right corner of rectangle.
Definition: adaptive_hopf.cc:607
Vector< double > Lower_2
Coordinate of internal point in the boundaries of the domain.
Definition: adaptive_hopf.cc:641
Vector< double > Lower_mid_right
Where the "radial" line from circle meets lower boundary on right.
Definition: adaptive_hopf.cc:613
Vector< double > Lower_1
Coordinate of internal point in the boundaries of the domain.
Definition: adaptive_hopf.cc:638
double Centre_y
y-coordinate of circle centre
Definition: adaptive_hopf.cc:651
Vector< double > Upper_left
Upper left corner of rectangle.
Definition: adaptive_hopf.cc:616
Vector< double > Lower_mid_left
Where the "radial" line from circle meets lower boundary on left.
Definition: adaptive_hopf.cc:610
Vector< double > Upper_mid_left
Where the "radial" line from circle meets upper boundary on left.
Definition: adaptive_hopf.cc:622
Vector< double > Upper_mid_right
Where the "radial" line from circle meets upper boundary on right.
Definition: adaptive_hopf.cc:625
Vector< double > Lower_left
Lower left corner of rectangle.
Definition: adaptive_hopf.cc:604
GeomObject * Cylinder_pt
Pointer to geometric object that represents the central cylinder.
Definition: adaptive_hopf.cc:654
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition: domain.h:301
Definition: macro_element.h:279
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
help
Definition: compute_granudrum_aor.py:141

References Global_Parameters::Centre_x, Global_Parameters::Centre_y, Global_Physical_Variables::height(), compute_granudrum_aor::help, and i.

◆ ~RectangleWithHoleDomain() [1/3]

RectangleWithHoleDomain::~RectangleWithHoleDomain ( )
inline

Destructor: Empty; cleanup done in base class.

242 {}

◆ RectangleWithHoleDomain() [2/3]

RectangleWithHoleDomain::RectangleWithHoleDomain ( GeomObject cylinder_pt,
const double length,
const double height 
)
inline

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

159  :
161  {
162 
163  Centre_x = static_cast<GeneralEllipse*>(cylinder_pt)->centre_x();
164  Centre_y = static_cast<GeneralEllipse*>(cylinder_pt)->centre_y();
165 
166  double lower_wall = -0.5*height;
167  double upper_wall = 0.5*height;
168 
169  //Vertices of rectangle
170  Lower_left.resize(2);
171  Lower_left[0] = 0.0;
172  Lower_left[1] = lower_wall;
173 
174  Upper_left.resize(2);
175  Upper_left[0] = 0.0;
176  Upper_left[1] = upper_wall;
177 
178  Lower_right.resize(2);
179  Lower_right[0] = length;
180  Lower_right[1] = lower_wall;
181 
182  Upper_right.resize(2);
183  Upper_right[0] = length;
184  Upper_right[1] = upper_wall;
185 
186 
187  double left_cylinder_split = 3.5;
188  double right_cylinder_split = 5.5;
189 
190  // Coordinates of points where the "radial" lines from central
191  // cylinder meet the upper and lower boundaries
192  Lower_mid_left.resize(2);
193  Lower_mid_left[0] = left_cylinder_split;
194  Lower_mid_left[1] = lower_wall;
195 
196  Upper_mid_left.resize(2);
197  Upper_mid_left[0] = left_cylinder_split;
198  Upper_mid_left[1] = upper_wall;
199 
200  Lower_mid_right.resize(2);
201  Lower_mid_right[0] = right_cylinder_split;
202  Lower_mid_right[1] = lower_wall;
203 
204  Upper_mid_right.resize(2);
205  Upper_mid_right[0] = right_cylinder_split;
206  Upper_mid_right[1] = upper_wall;
207 
208 
209  // Coordinates of internal points for creation of macro elements
210 
211  double help = (length - right_cylinder_split)/4.;
212 
213  Upper_1.resize(2);
214  Upper_1[0] = right_cylinder_split + help;
215  Upper_1[1] = upper_wall;
216 
217  Upper_2.resize(2);
218  Upper_2[0] = right_cylinder_split + 2.*help;
219  Upper_2[1] = upper_wall;
220 
221  Upper_3.resize(2);
222  Upper_3[0] = right_cylinder_split + 3.*help;
223  Upper_3[1] = upper_wall;
224 
225  Lower_1.resize(2);
226  Lower_1[0] = right_cylinder_split + help;
227  Lower_1[1] = lower_wall;
228 
229  Lower_2.resize(2);
230  Lower_2[0] = right_cylinder_split + 2.*help;
231  Lower_2[1] = lower_wall;
232 
233  Lower_3.resize(2);
234  Lower_3[0] = right_cylinder_split + 3.*help;
235  Lower_3[1] = lower_wall;
236 
237  //There are nine macro elements
238  Macro_element_pt.resize(9);
239 
240  // Build the 2D macro elements
241  for (unsigned i=0;i<9;i++)
242  {Macro_element_pt[i]= new QMacroElement<2>(this,i);}
243  }

References Global_Parameters::Centre_x, Global_Parameters::Centre_y, Global_Physical_Variables::height(), compute_granudrum_aor::help, and i.

◆ ~RectangleWithHoleDomain() [2/3]

RectangleWithHoleDomain::~RectangleWithHoleDomain ( )
inline

Destructor: Empty; cleanup done in base class.

248 {}

◆ RectangleWithHoleDomain() [3/3]

RectangleWithHoleDomain::RectangleWithHoleDomain ( GeomObject cylinder_pt,
const double length,
const double height 
)
inline

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

145  :
147  {
148 
149  //Vertices of rectangle
150  Lower_left.resize(2);
151  Lower_left[0] = 0.0;
152  Lower_left[1] = 0.0;
153 
154  Upper_left.resize(2);
155  Upper_left[0] = 0.0;
156  Upper_left[1] = height;
157 
158  Lower_right.resize(2);
159  Lower_right[0] = length;
160  Lower_right[1] = 0.0;
161 
162  Upper_right.resize(2);
163  Upper_right[0] = length;
164  Upper_right[1] = height;
165 
166 
167  // Coordinates of points where the "radial" lines from central
168  // cylinder meet the upper and lower boundaries
169  Lower_mid_left.resize(2);
170  Lower_mid_left[0] = 0.0;
171  Lower_mid_left[1] = 0.0;
172 
173  Upper_mid_left.resize(2);
174  Upper_mid_left[0] = 0.0;
175  Upper_mid_left[1] = height;
176 
177  Lower_mid_right.resize(2);
178  Lower_mid_right[0] = height;
179  Lower_mid_right[1] = 0.0;
180 
181  Upper_mid_right.resize(2);
182  Upper_mid_right[0] = height;
183  Upper_mid_right[1] = height;
184 
185 
186  // Coordinates of internal points for creation of macro elements
187 
188  double help = (length - height)/4.;
189 
190  Upper_1.resize(2);
191  Upper_1[0] = height + help;
192  Upper_1[1] = height;
193 
194  Upper_2.resize(2);
195  Upper_2[0] = height + 2.*help;
196  Upper_2[1] = height;
197 
198  Upper_3.resize(2);
199  Upper_3[0] = height + 3.*help;
200  Upper_3[1] = height;
201 
202  Lower_1.resize(2);
203  Lower_1[0] = height + help;
204  Lower_1[1] = 0.;
205 
206  Lower_2.resize(2);
207  Lower_2[0] = height + 2.*help;
208  Lower_2[1] = 0.;
209 
210  Lower_3.resize(2);
211  Lower_3[0] = height + 3.*help;
212  Lower_3[1] = 0.;
213 
214  //There are eight macro elements
215  Macro_element_pt.resize(8);
216 
217  // Build the 2D macro elements
218  for (unsigned i=0;i<8;i++)
219  {Macro_element_pt[i]= new QMacroElement<2>(this,i);}
220  }

References Global_Physical_Variables::height(), compute_granudrum_aor::help, and i.

◆ ~RectangleWithHoleDomain() [3/3]

RectangleWithHoleDomain::~RectangleWithHoleDomain ( )
inline

Destructor: Empty; cleanup done in base class.

225 {}

Member Function Documentation

◆ centre_x() [1/2]

double RectangleWithHoleDomain::centre_x ( )
inline
146 {return Centre_x;}

References Global_Parameters::Centre_x.

◆ centre_x() [2/2]

double RectangleWithHoleDomain::centre_x ( )
inline
150 {return Centre_x;}

References Global_Parameters::Centre_x.

◆ centre_y() [1/2]

double RectangleWithHoleDomain::centre_y ( )
inline
147 {return Centre_y;}

References Global_Parameters::Centre_y.

◆ centre_y() [2/2]

double RectangleWithHoleDomain::centre_y ( )
inline
151 {return Centre_y;}

References Global_Parameters::Centre_y.

◆ cylinder_pt()

GeomObject* const& RectangleWithHoleDomain::cylinder_pt ( )
inline
607 {return Cylinder_pt;}

References GlobalParameters::Cylinder_pt.

◆ linear_interpolate() [1/3]

void RectangleWithHoleDomain::linear_interpolate ( Vector< double left,
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] \)

248  {
249  for(unsigned i=0;i<2;i++)
250  {
251  f[i] = left[i] + (right[i] - left[i])*0.5*(s+1.0);
252  }
253  }
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.

◆ linear_interpolate() [2/3]

void RectangleWithHoleDomain::linear_interpolate ( Vector< double left,
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] \)

255  {
256  for(unsigned i=0;i<2;i++)
257  {
258  f[i] = left[i] + (right[i] - left[i])*0.5*(s+1.0);
259  }
260  }

References f(), i, and s.

◆ linear_interpolate() [3/3]

void RectangleWithHoleDomain::linear_interpolate ( Vector< double left,
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] \)

231  {
232  for(unsigned i=0;i<2;i++)
233  {
234  f[i] = left[i] + (right[i] - left[i])*0.5*(s+1.0);
235  }
236  }

References f(), i, and s.

◆ macro_element_boundary() [1/3]

void RectangleWithHoleDomain::macro_element_boundary ( const unsigned time,
const unsigned m,
const unsigned direction,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

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 specfied discrete time level (time=0: present; time>0: previous)

Implements oomph::Domain.

265  {
266 
267 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
268  // Warn about time argument being moved to the front
270  "Order of function arguments has changed between versions 0.8 and 0.85",
271  "RectangleWithHoleDomain::macro_element_boundary(...)",
273 #endif
274 
275  // Lagrangian coordinate along surface of cylinder
276  Vector<double> xi(1);
277 
278  // Point on circle
279  Vector<double> point_on_circle(2);
280 
281  //Switch on the macro element
282  switch(m)
283  {
284 
285  //Macro element 0, is is immediately left of the cylinder
286  case 0:
287 
288  switch(direction)
289  {
290  case N:
291  xi[0] = 3.0*atan(1.0);
292  Cylinder_pt->position(time,xi,point_on_circle);
293  linear_interpolate(Upper_mid_left,point_on_circle,s[0],f);
294  break;
295 
296  case S:
297  xi[0] = -3.0*atan(1.0);
298  Cylinder_pt->position(time,xi,point_on_circle);
299  linear_interpolate(Lower_mid_left,point_on_circle,s[0],f);
300  break;
301 
302  case W:
304  break;
305 
306  case E:
307  xi[0] = 5.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
308  Cylinder_pt->position(time,xi,f);
309  break;
310 
311  default:
312 
313  std::ostringstream error_stream;
314  error_stream << "Direction is incorrect: " << direction << std::endl;
315  throw OomphLibError(error_stream.str(),
318  }
319 
320  break;
321 
322  //Macro element 1, is immediately above the cylinder
323  case 1:
324 
325  switch(direction)
326  {
327  case N:
329  break;
330 
331  case S:
332  xi[0] = 3.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
333  Cylinder_pt->position(time,xi,f);
334  break;
335 
336  case W:
337  xi[0] = 3.0*atan(1.0);
338  Cylinder_pt->position(time,xi,point_on_circle);
339  linear_interpolate(point_on_circle,Upper_mid_left,s[0],f);
340  break;
341 
342  case E:
343  xi[0] = 1.0*atan(1.0);
344  Cylinder_pt->position(time,xi,point_on_circle);
345  linear_interpolate(point_on_circle,Upper_mid_right,s[0],f);
346  break;
347 
348  default:
349 
350  std::ostringstream error_stream;
351  error_stream << "Direction is incorrect: " << direction << std::endl;
352  throw OomphLibError(error_stream.str(),
355  }
356 
357  break;
358 
359  //Macro element 2, is immediately right of the cylinder
360  case 2:
361 
362  switch(direction)
363  {
364  case N:
365  xi[0] = 1.0*atan(1.0);
366  Cylinder_pt->position(time,xi,point_on_circle);
367  linear_interpolate(point_on_circle,Upper_mid_right,s[0],f);
368  break;
369 
370  case S:
371  xi[0] = -1.0*atan(1.0);
372  Cylinder_pt->position(time,xi,point_on_circle);
373  linear_interpolate(point_on_circle,Lower_mid_right,s[0],f);
374  break;
375 
376  case W:
377  xi[0] = -atan(1.0) + 2.0*atan(1.0)*0.5*(1.0+s[0]);
378  Cylinder_pt->position(time,xi,f);
379  break;
380 
381  case E:
383  break;
384 
385  default:
386 
387  std::ostringstream error_stream;
388  error_stream << "Direction is incorrect: " << direction << std::endl;
389  throw OomphLibError(error_stream.str(),
392  }
393 
394  break;
395 
396  //Macro element 3, is immediately below cylinder
397  case 3:
398 
399  switch(direction)
400  {
401  case N:
402  xi[0] = -3.0*atan(1.0) + 2.0*atan(1.0)*0.5*(1.0+s[0]);
403  Cylinder_pt->position(time,xi,f);
404  break;
405 
406  case S:
408  break;
409 
410  case W:
411  xi[0] = -3.0*atan(1.0);
412  Cylinder_pt->position(time,xi,point_on_circle);
413  linear_interpolate(Lower_mid_left,point_on_circle,s[0],f);
414  break;
415 
416  case E:
417  xi[0] = -1.0*atan(1.0);
418  Cylinder_pt->position(time,xi,point_on_circle);
419  linear_interpolate(Lower_mid_right,point_on_circle,s[0],f);
420  break;
421 
422  default:
423 
424  std::ostringstream error_stream;
425  error_stream << "Direction is incorrect: " << direction << std::endl;
426  throw OomphLibError(error_stream.str(),
429  }
430 
431  break;
432 
433  //Macro element 4, is right hand block 1
434  case 4:
435 
436  switch(direction)
437  {
438  case N:
440  break;
441 
442  case S:
444  break;
445 
446  case W:
448  break;
449 
450  case E:
452  break;
453 
454  default:
455 
456  std::ostringstream error_stream;
457  error_stream << "Direction is incorrect: " << direction << std::endl;
458  throw OomphLibError(error_stream.str(),
461  }
462 
463  break;
464 
465  //Macro element 5, is right hand block 2
466  case 5:
467 
468  switch(direction)
469  {
470  case N:
472  break;
473 
474  case S:
476  break;
477 
478  case W:
480  break;
481 
482  case E:
484  break;
485 
486  default:
487 
488  std::ostringstream error_stream;
489  error_stream << "Direction is incorrect: " << direction << std::endl;
490  throw OomphLibError(error_stream.str(),
493  }
494 
495  break;
496 
497  //Macro element 6, is right hand block 3
498  case 6:
499 
500  switch(direction)
501  {
502  case N:
504  break;
505 
506  case S:
508  break;
509 
510  case W:
512  break;
513 
514  case E:
516  break;
517 
518  default:
519 
520  std::ostringstream error_stream;
521  error_stream << "Direction is incorrect: " << direction << std::endl;
522  throw OomphLibError(error_stream.str(),
525  }
526 
527  break;
528 
529  //Macro element 7, is right hand block 4
530  case 7:
531 
532  switch(direction)
533  {
534  case N:
536  break;
537 
538  case S:
540  break;
541 
542  case W:
544  break;
545 
546  case E:
548  break;
549 
550  default:
551 
552  std::ostringstream error_stream;
553  error_stream << "Direction is incorrect: " << direction << std::endl;
554  throw OomphLibError(error_stream.str(),
557  }
558  break;
559 
560  //Macro element 8, is inlet region
561  case 8:
562  switch(direction)
563  {
564  case N:
566  break;
567 
568  case S:
570  break;
571 
572  case W:
574  break;
575 
576  case E:
578  break;
579 
580  default:
581 
582  std::ostringstream error_stream;
583  error_stream << "Direction is incorrect: " << direction << std::endl;
584  throw OomphLibError(error_stream.str(),
587  }
588  break;
589 
590  default:
591 
592  std::ostringstream error_stream;
593  error_stream << "Wrong macro element number" << m << std::endl;
594  throw OomphLibError(error_stream.str(),
597  }
598  }
void linear_interpolate(Vector< double > left, Vector< double > right, const double &s, Vector< double > &f)
Definition: adaptive_hopf.cc:246
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
@ 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
@ 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(), GlobalParameters::Cylinder_pt, oomph::QuadTreeNames::E, f(), m, oomph::QuadTreeNames::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, OscillatingCylinder::position(), s, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

◆ macro_element_boundary() [2/3]

void RectangleWithHoleDomain::macro_element_boundary ( const unsigned time,
const unsigned m,
const unsigned direction,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

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 specfied discrete time level (time=0: present; time>0: previous)

Implements oomph::Domain.

272  {
273 
274 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
275  // Warn about time argument being moved to the front
277  "Order of function arguments has changed between versions 0.8 and 0.85",
278  "RectangleWithHoleDomain::macro_element_boundary(...)",
280 #endif
281 
282  // Lagrangian coordinate along surface of cylinder
283  Vector<double> xi(1);
284 
285  // Point on circle
286  Vector<double> point_on_circle(2);
287 
288  //Switch on the macro element
289  switch(m)
290  {
291 
292  //Macro element 0, is is immediately left of the cylinder
293  case 0:
294 
295  switch(direction)
296  {
297  case N:
298  xi[0] = 3.0*atan(1.0);
299  Cylinder_pt->position(time,xi,point_on_circle);
300  linear_interpolate(Upper_mid_left,point_on_circle,s[0],f);
301  break;
302 
303  case S:
304  xi[0] = -3.0*atan(1.0);
305  Cylinder_pt->position(time,xi,point_on_circle);
306  linear_interpolate(Lower_mid_left,point_on_circle,s[0],f);
307  break;
308 
309  case W:
311  break;
312 
313  case E:
314  xi[0] = 5.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
315  Cylinder_pt->position(time,xi,f);
316  break;
317 
318  default:
319 
320  std::ostringstream error_stream;
321  error_stream << "Direction is incorrect: " << direction << std::endl;
322  throw OomphLibError(error_stream.str(),
325  }
326 
327  break;
328 
329  //Macro element 1, is immediately above the cylinder
330  case 1:
331 
332  switch(direction)
333  {
334  case N:
336  break;
337 
338  case S:
339  xi[0] = 3.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
340  Cylinder_pt->position(time,xi,f);
341  break;
342 
343  case W:
344  xi[0] = 3.0*atan(1.0);
345  Cylinder_pt->position(time,xi,point_on_circle);
346  linear_interpolate(point_on_circle,Upper_mid_left,s[0],f);
347  break;
348 
349  case E:
350  xi[0] = 1.0*atan(1.0);
351  Cylinder_pt->position(time,xi,point_on_circle);
352  linear_interpolate(point_on_circle,Upper_mid_right,s[0],f);
353  break;
354 
355  default:
356 
357  std::ostringstream error_stream;
358  error_stream << "Direction is incorrect: " << direction << std::endl;
359  throw OomphLibError(error_stream.str(),
362  }
363 
364  break;
365 
366  //Macro element 2, is immediately right of the cylinder
367  case 2:
368 
369  switch(direction)
370  {
371  case N:
372  xi[0] = 1.0*atan(1.0);
373  Cylinder_pt->position(time,xi,point_on_circle);
374  linear_interpolate(point_on_circle,Upper_mid_right,s[0],f);
375  break;
376 
377  case S:
378  xi[0] = -1.0*atan(1.0);
379  Cylinder_pt->position(time,xi,point_on_circle);
380  linear_interpolate(point_on_circle,Lower_mid_right,s[0],f);
381  break;
382 
383  case W:
384  xi[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 E:
390  break;
391 
392  default:
393 
394  std::ostringstream error_stream;
395  error_stream << "Direction is incorrect: " << direction << std::endl;
396  throw OomphLibError(error_stream.str(),
399  }
400 
401  break;
402 
403  //Macro element 3, is immediately below cylinder
404  case 3:
405 
406  switch(direction)
407  {
408  case N:
409  xi[0] = -3.0*atan(1.0) + 2.0*atan(1.0)*0.5*(1.0+s[0]);
410  Cylinder_pt->position(time,xi,f);
411  break;
412 
413  case S:
415  break;
416 
417  case W:
418  xi[0] = -3.0*atan(1.0);
419  Cylinder_pt->position(time,xi,point_on_circle);
420  linear_interpolate(Lower_mid_left,point_on_circle,s[0],f);
421  break;
422 
423  case E:
424  xi[0] = -1.0*atan(1.0);
425  Cylinder_pt->position(time,xi,point_on_circle);
426  linear_interpolate(Lower_mid_right,point_on_circle,s[0],f);
427  break;
428 
429  default:
430 
431  std::ostringstream error_stream;
432  error_stream << "Direction is incorrect: " << direction << std::endl;
433  throw OomphLibError(error_stream.str(),
436  }
437 
438  break;
439 
440  //Macro element 4, is right hand block 1
441  case 4:
442 
443  switch(direction)
444  {
445  case N:
447  break;
448 
449  case S:
451  break;
452 
453  case W:
455  break;
456 
457  case E:
459  break;
460 
461  default:
462 
463  std::ostringstream error_stream;
464  error_stream << "Direction is incorrect: " << direction << std::endl;
465  throw OomphLibError(error_stream.str(),
468  }
469 
470  break;
471 
472  //Macro element 5, is right hand block 2
473  case 5:
474 
475  switch(direction)
476  {
477  case N:
479  break;
480 
481  case S:
483  break;
484 
485  case W:
487  break;
488 
489  case E:
491  break;
492 
493  default:
494 
495  std::ostringstream error_stream;
496  error_stream << "Direction is incorrect: " << direction << std::endl;
497  throw OomphLibError(error_stream.str(),
500  }
501 
502  break;
503 
504  //Macro element 6, is right hand block 3
505  case 6:
506 
507  switch(direction)
508  {
509  case N:
511  break;
512 
513  case S:
515  break;
516 
517  case W:
519  break;
520 
521  case E:
523  break;
524 
525  default:
526 
527  std::ostringstream error_stream;
528  error_stream << "Direction is incorrect: " << direction << std::endl;
529  throw OomphLibError(error_stream.str(),
532  }
533 
534  break;
535 
536  //Macro element 7, is right hand block 4
537  case 7:
538 
539  switch(direction)
540  {
541  case N:
543  break;
544 
545  case S:
547  break;
548 
549  case W:
551  break;
552 
553  case E:
555  break;
556 
557  default:
558 
559  std::ostringstream error_stream;
560  error_stream << "Direction is incorrect: " << direction << std::endl;
561  throw OomphLibError(error_stream.str(),
564  }
565  break;
566 
567  //Macro element 8, is inlet region
568  case 8:
569  switch(direction)
570  {
571  case N:
573  break;
574 
575  case S:
577  break;
578 
579  case W:
581  break;
582 
583  case E:
585  break;
586 
587  default:
588 
589  std::ostringstream error_stream;
590  error_stream << "Direction is incorrect: " << direction << std::endl;
591  throw OomphLibError(error_stream.str(),
594  }
595  break;
596 
597  default:
598 
599  std::ostringstream error_stream;
600  error_stream << "Wrong macro element number" << m << std::endl;
601  throw OomphLibError(error_stream.str(),
604  }
605  }

References Eigen::bfloat16_impl::atan(), GlobalParameters::Cylinder_pt, oomph::QuadTreeNames::E, f(), m, oomph::QuadTreeNames::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, OscillatingCylinder::position(), s, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

◆ macro_element_boundary() [3/3]

void RectangleWithHoleDomain::macro_element_boundary ( const unsigned time,
const unsigned m,
const unsigned direction,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

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 specfied discrete time level (time=0: present; time>0: previous)

Implements oomph::Domain.

248  {
249 
250 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
251  // Warn about time argument being moved to the front
253  "Order of function arguments has changed between versions 0.8 and 0.85",
254  "RectangleWithHoleDomain::macro_element_boundary(...)",
256 #endif
257 
258  // Lagrangian coordinate along surface of cylinder
259  Vector<double> xi(1);
260 
261  // Point on circle
262  Vector<double> point_on_circle(2);
263 
264  //Switch on the macro element
265  switch(m)
266  {
267 
268  //Macro element 0, is is immediately left of the cylinder
269  case 0:
270 
271  switch(direction)
272  {
273  case N:
274  xi[0] = 3.0*atan(1.0);
275  Cylinder_pt->position(time,xi,point_on_circle);
276  linear_interpolate(Upper_mid_left,point_on_circle,s[0],f);
277  break;
278 
279  case S:
280  xi[0] = -3.0*atan(1.0);
281  Cylinder_pt->position(time,xi,point_on_circle);
282  linear_interpolate(Lower_mid_left,point_on_circle,s[0],f);
283  break;
284 
285  case W:
287  break;
288 
289  case E:
290  xi[0] = 5.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
291  Cylinder_pt->position(time,xi,f);
292  break;
293 
294  default:
295 
296  std::ostringstream error_stream;
297  error_stream << "Direction is incorrect: " << direction << std::endl;
298  throw OomphLibError(error_stream.str(),
301  }
302 
303  break;
304 
305  //Macro element 1, is immediately above the cylinder
306  case 1:
307 
308  switch(direction)
309  {
310  case N:
312  break;
313 
314  case S:
315  xi[0] = 3.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
316  Cylinder_pt->position(time,xi,f);
317  break;
318 
319  case W:
320  xi[0] = 3.0*atan(1.0);
321  Cylinder_pt->position(time,xi,point_on_circle);
322  linear_interpolate(point_on_circle,Upper_mid_left,s[0],f);
323  break;
324 
325  case E:
326  xi[0] = 1.0*atan(1.0);
327  Cylinder_pt->position(time,xi,point_on_circle);
328  linear_interpolate(point_on_circle,Upper_mid_right,s[0],f);
329  break;
330 
331  default:
332 
333  std::ostringstream error_stream;
334  error_stream << "Direction is incorrect: " << direction << std::endl;
335  throw OomphLibError(error_stream.str(),
338  }
339 
340  break;
341 
342  //Macro element 2, is immediately right of the cylinder
343  case 2:
344 
345  switch(direction)
346  {
347  case N:
348  xi[0] = 1.0*atan(1.0);
349  Cylinder_pt->position(time,xi,point_on_circle);
350  linear_interpolate(point_on_circle,Upper_mid_right,s[0],f);
351  break;
352 
353  case S:
354  xi[0] = -1.0*atan(1.0);
355  Cylinder_pt->position(time,xi,point_on_circle);
356  linear_interpolate(point_on_circle,Lower_mid_right,s[0],f);
357  break;
358 
359  case W:
360  xi[0] = -atan(1.0) + 2.0*atan(1.0)*0.5*(1.0+s[0]);
361  Cylinder_pt->position(time,xi,f);
362  break;
363 
364  case E:
366  break;
367 
368  default:
369 
370  std::ostringstream error_stream;
371  error_stream << "Direction is incorrect: " << direction << std::endl;
372  throw OomphLibError(error_stream.str(),
375  }
376 
377  break;
378 
379  //Macro element 3, is immediately below cylinder
380  case 3:
381 
382  switch(direction)
383  {
384  case N:
385  xi[0] = -3.0*atan(1.0) + 2.0*atan(1.0)*0.5*(1.0+s[0]);
386  Cylinder_pt->position(time,xi,f);
387  break;
388 
389  case S:
391  break;
392 
393  case W:
394  xi[0] = -3.0*atan(1.0);
395  Cylinder_pt->position(time,xi,point_on_circle);
396  linear_interpolate(Lower_mid_left,point_on_circle,s[0],f);
397  break;
398 
399  case E:
400  xi[0] = -1.0*atan(1.0);
401  Cylinder_pt->position(time,xi,point_on_circle);
402  linear_interpolate(Lower_mid_right,point_on_circle,s[0],f);
403  break;
404 
405  default:
406 
407  std::ostringstream error_stream;
408  error_stream << "Direction is incorrect: " << direction << std::endl;
409  throw OomphLibError(error_stream.str(),
412  }
413 
414  break;
415 
416  //Macro element 4, is right hand block 1
417  case 4:
418 
419  switch(direction)
420  {
421  case N:
423  break;
424 
425  case S:
427  break;
428 
429  case W:
431  break;
432 
433  case E:
435  break;
436 
437  default:
438 
439  std::ostringstream error_stream;
440  error_stream << "Direction is incorrect: " << direction << std::endl;
441  throw OomphLibError(error_stream.str(),
444  }
445 
446  break;
447 
448  //Macro element 5, is right hand block 2
449  case 5:
450 
451  switch(direction)
452  {
453  case N:
455  break;
456 
457  case S:
459  break;
460 
461  case W:
463  break;
464 
465  case E:
467  break;
468 
469  default:
470 
471  std::ostringstream error_stream;
472  error_stream << "Direction is incorrect: " << direction << std::endl;
473  throw OomphLibError(error_stream.str(),
476  }
477 
478  break;
479 
480  //Macro element 6, is right hand block 3
481  case 6:
482 
483  switch(direction)
484  {
485  case N:
487  break;
488 
489  case S:
491  break;
492 
493  case W:
495  break;
496 
497  case E:
499  break;
500 
501  default:
502 
503  std::ostringstream error_stream;
504  error_stream << "Direction is incorrect: " << direction << std::endl;
505  throw OomphLibError(error_stream.str(),
508  }
509 
510  break;
511 
512  //Macro element 7, is right hand block 4
513  case 7:
514 
515  switch(direction)
516  {
517  case N:
519  break;
520 
521  case S:
523  break;
524 
525  case W:
527  break;
528 
529  case E:
531  break;
532 
533  default:
534 
535  std::ostringstream error_stream;
536  error_stream << "Direction is incorrect: " << direction << std::endl;
537  throw OomphLibError(error_stream.str(),
540  }
541 
542  break;
543 
544  default:
545 
546  std::ostringstream error_stream;
547  error_stream << "Wrong macro element number" << m << std::endl;
548  throw OomphLibError(error_stream.str(),
551  }
552  }

References Eigen::bfloat16_impl::atan(), GlobalParameters::Cylinder_pt, Global_Physical_Variables::E, f(), m, N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, OscillatingCylinder::position(), s, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

Member Data Documentation

◆ Centre_x

double RectangleWithHoleDomain::Centre_x
private

x-coordinate of circle centre

◆ Centre_y

double RectangleWithHoleDomain::Centre_y
private

y-coordinate of circle centre

◆ Cylinder_pt

GeomObject* RectangleWithHoleDomain::Cylinder_pt
private

Pointer to geometric object that represents the central cylinder.

◆ Lower_1

Vector< double > RectangleWithHoleDomain::Lower_1
private

Coordinate of internal point in the boundaries of the domain.

◆ Lower_2

Vector< double > RectangleWithHoleDomain::Lower_2
private

Coordinate of internal point in the boundaries of the domain.

◆ Lower_3

Vector< double > RectangleWithHoleDomain::Lower_3
private

Coordinate of internal point in the boundaries of the domain.

◆ Lower_left

Vector<double> RectangleWithHoleDomain::Lower_left
private

Lower left corner of rectangle.

◆ Lower_mid_left

Vector<double> RectangleWithHoleDomain::Lower_mid_left
private

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

◆ Lower_mid_right

Vector<double> RectangleWithHoleDomain::Lower_mid_right
private

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

◆ Lower_right

Vector<double> RectangleWithHoleDomain::Lower_right
private

Lower right corner of rectangle.

◆ Upper_1

Vector< double > RectangleWithHoleDomain::Upper_1
private

Coordinate of internal point in the boundaries of the domain.

◆ Upper_2

Vector< double > RectangleWithHoleDomain::Upper_2
private

Coordinate of internal point in the boundaries of the domain.

◆ Upper_3

Vector< double > RectangleWithHoleDomain::Upper_3
private

Coordinate of internal point in the boundaries of the domain.

◆ Upper_left

Vector<double> RectangleWithHoleDomain::Upper_left
private

Upper left corner of rectangle.

◆ Upper_mid_left

Vector<double> RectangleWithHoleDomain::Upper_mid_left
private

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

◆ Upper_mid_right

Vector<double> RectangleWithHoleDomain::Upper_mid_right
private

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

◆ Upper_right

Vector<double> RectangleWithHoleDomain::Upper_right
private

Upper right corner of rectangle.


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