CylinderAndInterfaceDomain Class Reference
+ Inheritance diagram for CylinderAndInterfaceDomain:

Public Member Functions

 CylinderAndInterfaceDomain (const double &Length, const double &Height)
 
 ~CylinderAndInterfaceDomain ()
 
void linear_interpolate (double Left[2], double Right[2], 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)
 

Public Attributes

double centre_x
 
double centre_y
 

Private Attributes

double Lower_left [2]
 
double Lower_right [2]
 
double Lower_mid_left [2]
 
double Lower_mid_right [2]
 
double Upper_left [2]
 
double Upper_right [2]
 
double Upper_mid_left [2]
 
double Upper_mid_right [2]
 
double Lower_centre_left [2]
 
double Lower_centre_right [2]
 
double Upper_centre_left [2]
 
double Upper_centre_right [2]
 
GeomObjectCylinder_pt
 Geometric object that represents the rotating cylinder. More...
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ CylinderAndInterfaceDomain()

CylinderAndInterfaceDomain::CylinderAndInterfaceDomain ( const double Length,
const double Height 
)
inline
118  {
119 
120  centre_x = Length/2.0;
121  centre_y = Height/2.0; //3.0*Height/4.0;
122  //Create a new ellipse object to represent the rotating cylinder
124 
125  //Set some basic coordinates
126 
127  Lower_left[0] = 0.0;
128  Lower_left[1] = 0.0;
129 
130  Upper_left[0] = 0.0;
131  Upper_left[1] = Height;
132 
133  Lower_right[0] = Length;
134  Lower_right[1] = 0.0;
135 
136  Upper_right[0] = Length;
137  Upper_right[1] = Height;
138 
139 
140  //Let's just do some mid coordinates
141  Lower_mid_left[0] = Length/10.0;
142  Lower_mid_left[1] = 0.0;
143 
144  Upper_mid_left[0] = Length/10.0;
145  Upper_mid_left[1] = Height;
146 
147  Vector<double> xi(1), f(2);
148  xi[0] = -3.0*atan(1.0);
149  Cylinder_pt->position(xi,f);
150 
151  Lower_centre_left[0] = f[0];
152  Lower_centre_left[1] = f[1];
153 
154  xi[0] = 3.0*atan(1.0);
155  Cylinder_pt->position(xi,f);
156 
157  Upper_centre_left[0] = f[0];
158  Upper_centre_left[1] = f[1];
159 
160 
161  Lower_mid_right[0] = 9.0*Length/10.0;
162  Lower_mid_right[1] = 0.0;
163 
164  Upper_mid_right[0] = 9.0*Length/10.0;
165  Upper_mid_right[1] = Height;
166 
167 
168  xi[0] = -1.0*atan(1.0);
169  Cylinder_pt->position(xi,f);
170 
171  Lower_centre_right[0] = f[0];
172  Lower_centre_right[1] = f[1];
173 
174  xi[0] = 1.0*atan(1.0);
175  Cylinder_pt->position(xi,f);
176 
177  Upper_centre_right[0] = f[0];
178  Upper_centre_right[1] = f[1];
179 
180  //There are six macro elements
181  Macro_element_pt.resize(6);
182 
183  // Build the macro elements
184  for (unsigned i=0;i<6;i++)
185  {Macro_element_pt[i]= new QMacroElement<2>(this,i);}
186  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
double Upper_mid_left[2]
Definition: adaptive_interface.cc:106
double Lower_right[2]
Definition: adaptive_interface.cc:105
double centre_x
Definition: adaptive_interface.cc:101
double Lower_centre_right[2]
Definition: adaptive_interface.cc:107
double Upper_centre_right[2]
Definition: adaptive_interface.cc:108
double Upper_centre_left[2]
Definition: adaptive_interface.cc:108
double Lower_left[2]
Definition: adaptive_interface.cc:105
double Upper_left[2]
Definition: adaptive_interface.cc:106
double Lower_centre_left[2]
Definition: adaptive_interface.cc:107
double Lower_mid_right[2]
Definition: adaptive_interface.cc:105
double Lower_mid_left[2]
Definition: adaptive_interface.cc:105
double Upper_right[2]
Definition: adaptive_interface.cc:106
GeomObject * Cylinder_pt
Geometric object that represents the rotating cylinder.
Definition: adaptive_interface.cc:112
double centre_y
Definition: adaptive_interface.cc:101
double Upper_mid_right[2]
Definition: adaptive_interface.cc:106
My own Ellipse class.
Definition: adaptive_hopf.cc:80
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition: domain.h:301
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
Definition: macro_element.h:279
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atan(const bfloat16 &a)
Definition: BFloat16.h:636
double Height
Height of domain.
Definition: flow_past_oscillating_cylinder.cc:316
double Length
Length of the pipe.
Definition: pipe.cc:52

References Eigen::bfloat16_impl::atan(), GlobalParameters::Cylinder_pt, f(), GlobalParameters::Height, i, Global_Physical_Variables::Length, and OscillatingCylinder::position().

◆ ~CylinderAndInterfaceDomain()

CylinderAndInterfaceDomain::~CylinderAndInterfaceDomain ( )
inline
189 {}

Member Function Documentation

◆ linear_interpolate()

void CylinderAndInterfaceDomain::linear_interpolate ( double  Left[2],
double  Right[2],
const double s,
Vector< double > &  f 
)
inline
194  {
195  for(unsigned i=0;i<2;i++)
196  {
197  f[i] = Left[i] + (Right[i] - Left[i])*0.5*(s+1.0);
198  }
199  }
RealScalar s
Definition: level1_cplx_impl.h:130

References f(), i, and s.

◆ macro_element_boundary()

void CylinderAndInterfaceDomain::macro_element_boundary ( const unsigned t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

Vector representation of the i_macro-th macro element boundary i_direct (e.g. N/S/W/E in 2D) at time level t (t=0: present; t>0: previous): f(s)

Implements oomph::Domain.

209  {
210 
211  using namespace QuadTreeNames;
212 
213 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
214  // Warn about time argument being moved to the front
216  "Order of function arguments has changed between versions 0.8 and 0.85",
217  "CylinderAndInterfaceDomain::macro_element_boundary(...)",
219 #endif
220 
221  Vector<double> xi(1);
222 
223  //Switch on the macro element
224  switch(m)
225  {
226  //Macro element 0, is the left-hand film
227  case 0:
228 
229  switch(direction)
230  {
231  case N:
233  break;
234 
235  case S:
237  break;
238 
239  case W:
241  break;
242 
243  case E:
245  break;
246 
247  default:
248  std::ostringstream error_stream;
249  error_stream << "Direction is incorrect: " << direction << std::endl;
250 
251  throw OomphLibError(error_stream.str(),
254  }
255 
256  break;
257 
258  //Macro element 1, is immediately left of the cylinder
259  case 1:
260 
261  switch(direction)
262  {
263  case N:
265  break;
266 
267  case S:
269  break;
270 
271  case W:
273  break;
274 
275  case E:
276  xi[0] = 5.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
277  Cylinder_pt->position(xi,f);
278  break;
279 
280  default:
281  std::ostringstream error_stream;
282  error_stream << "Direction is incorrect: " << direction << std::endl;
283 
284  throw OomphLibError(error_stream.str(),
287  }
288 
289  break;
290 
291  //Macro element 2, is immediately above the cylinder
292  case 2:
293 
294  switch(direction)
295  {
296  case N:
298  break;
299 
300  case S:
301  xi[0] = 3.0*atan(1.0) - 2.0*atan(1.0)*0.5*(1.0+s[0]);
302  Cylinder_pt->position(xi,f);
303  break;
304 
305  case W:
307  break;
308 
309  case E:
311  break;
312 
313  default:
314  std::ostringstream error_stream;
315  error_stream << "Direction is incorrect: " << direction << std::endl;
316 
317  throw OomphLibError(error_stream.str(),
320  }
321 
322  break;
323 
324  //Macro element 3, is immediately right of the cylinder
325  case 3:
326 
327  switch(direction)
328  {
329  case N:
331  break;
332 
333  case S:
335  break;
336 
337  case W:
338  xi[0] = -atan(1.0) + 2.0*atan(1.0)*0.5*(1.0+s[0]);
339  Cylinder_pt->position(xi,f);
340  break;
341 
342  case E:
344  break;
345 
346  default:
347  std::ostringstream error_stream;
348  error_stream << "Direction is incorrect: " << direction << std::endl;
349 
350  throw OomphLibError(error_stream.str(),
353  }
354 
355  break;
356 
357  //Macro element 4, is immediately below cylinder
358  case 4:
359 
360  switch(direction)
361  {
362  case N:
363  //linear_interpolate(Lower_centre_left,Lower_centre_right,s[0],f);
364  xi[0] = -3.0*atan(1.0) + 2.0*atan(1.0)*0.5*(1.0+s[0]);
365  Cylinder_pt->position(xi,f);
366  break;
367 
368  case S:
370  break;
371 
372  case W:
374  break;
375 
376  case E:
378  break;
379 
380  default:
381  std::ostringstream error_stream;
382  error_stream << "Direction is incorrect: " << direction << std::endl;
383 
384  throw OomphLibError(error_stream.str(),
387  }
388 
389  break;
390 
391  //Macro element 5, is right film
392  case 5:
393 
394  switch(direction)
395  {
396  case N:
398  break;
399 
400  case S:
402  break;
403 
404  case W:
406  break;
407 
408  case E:
410  break;
411 
412  default:
413  std::ostringstream error_stream;
414  error_stream << "Direction is incorrect: " << direction << std::endl;
415 
416  throw OomphLibError(error_stream.str(),
419  }
420 
421  break;
422 
423  default:
424  std::ostringstream error_stream;
425  error_stream << "Wrong domain number: " << m<< std::endl;
426 
427  throw OomphLibError(error_stream.str(),
430  }
431 
432  }
void linear_interpolate(double Left[2], double Right[2], const double &s, Vector< double > &f)
Definition: adaptive_interface.cc:192
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
@ N
Definition: constructor.cpp:22
int * m
Definition: level2_cplx_impl.h:294
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, 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 CylinderAndInterfaceDomain::centre_x

◆ centre_y

double CylinderAndInterfaceDomain::centre_y

◆ Cylinder_pt

GeomObject* CylinderAndInterfaceDomain::Cylinder_pt
private

Geometric object that represents the rotating cylinder.

◆ Lower_centre_left

double CylinderAndInterfaceDomain::Lower_centre_left[2]
private

◆ Lower_centre_right

double CylinderAndInterfaceDomain::Lower_centre_right[2]
private

◆ Lower_left

double CylinderAndInterfaceDomain::Lower_left[2]
private

◆ Lower_mid_left

double CylinderAndInterfaceDomain::Lower_mid_left[2]
private

◆ Lower_mid_right

double CylinderAndInterfaceDomain::Lower_mid_right[2]
private

◆ Lower_right

double CylinderAndInterfaceDomain::Lower_right[2]
private

◆ Upper_centre_left

double CylinderAndInterfaceDomain::Upper_centre_left[2]
private

◆ Upper_centre_right

double CylinderAndInterfaceDomain::Upper_centre_right[2]
private

◆ Upper_left

double CylinderAndInterfaceDomain::Upper_left[2]
private

◆ Upper_mid_left

double CylinderAndInterfaceDomain::Upper_mid_left[2]
private

◆ Upper_mid_right

double CylinderAndInterfaceDomain::Upper_mid_right[2]
private

◆ Upper_right

double CylinderAndInterfaceDomain::Upper_right[2]
private

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