immersed_rigid_body_elements.cc
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //Non-inline functions for Rigid Body Elements
32 
33 namespace oomph
34 {
35 
36 /// \short Static default value for physical constants
37 /// Zero gives instantaneous force and torque balances --- no solid intertia
39 
40 /// \short Static default value for physical ratio
42 
43 /// \short Static default gravity direction vector
45 
46 //=======================================================================
47 /// Work out the position derivative taking into account the movement
48 /// relative to the original centre of mass
49 //======================================================================
51  const unsigned &j,
52  Vector<double> &drdt)
53  {
54  //Switch on time level
55  switch(j)
56  {
57  //Current time, just return the position
58  case 0:
59  return position(zeta,drdt);
60  break;
61 
62  //Time derivative
63  case 1:
64  {
65  //Get the initial position of the underlying geometric object
66  Vector<double> initial_x(2);
67  Geom_object_pt->position(zeta,initial_x);
68  //Scale relative to the centre of mass
69  double X = initial_x[0] - Initial_centre_of_mass[0];
70  double Y = initial_x[1] - Initial_centre_of_mass[1];
71 
72  //Now calculate the original angle and radius
73  double phi_orig=atan2(Y,X);
74  double r_orig=sqrt(X*X+Y*Y);
75 
76  // Get first time derivatives of all displacement data
77  Vector<double> veloc(3);
78  // Get the velocity of the data
81  veloc);
82 
83  //Now use the chain rule to specify the boundary velocities
84  drdt[0] = veloc[0];
85  drdt[1] = veloc[1];
86 
88  {
89  drdt[0] += - r_orig*sin(
90  phi_orig + this->Centre_displacement_data_pt->value(2))*veloc[2];
91  drdt[1] += r_orig*cos(
92  phi_orig + this->Centre_displacement_data_pt->value(2))*veloc[2];
93  }
94  }
95  //Done
96  return;
97  break;
98 
99  default:
100  std::ostringstream warning_stream;
101  warning_stream
102  << "Using default (static) assignment " << j
103  << "-th time derivative in GeomObject::dposition_dt(...) is zero\n"
104  << "Overload for your specific geometric object if this is not \n"
105  << "appropriate. \n";
106  OomphLibWarning(warning_stream.str(),
107  "GeomObject::dposition_dt()",
108  OOMPH_EXCEPTION_LOCATION);
109 
110  unsigned n=drdt.size();
111  for (unsigned i=0;i<n;i++) {drdt[i]=0.0;}
112  break;
113  }
114  }
115 
116 //=======================================================================
117 /// Output the position of the centre of gravity including velocities
118 /// and accelerations
119 //======================================================================
121  {
122  // Get timestepper
125 
126  // Get first time derivatives of all displacement data
127  Vector<double> veloc(3);
128  time_stepper_pt->time_derivative(1,this->Centre_displacement_data_pt,
129  veloc);
130 
131  // Get second time derivatives of all displacement data
132  Vector<double> accel(3);
133  time_stepper_pt->time_derivative(2,this->Centre_displacement_data_pt,
134  accel);
135 
136  outfile << time_stepper_pt->time() << " "
137  << Initial_centre_of_mass[0] +
138  this->Centre_displacement_data_pt->value(0) << " "
139  << Initial_centre_of_mass[1] +
140  this->Centre_displacement_data_pt->value(1) << " "
141  << Initial_Phi + this->Centre_displacement_data_pt->value(2) << " "
142  << veloc[0] << " " << veloc[1] << " " << veloc[2] << " "
143  << accel[0] << " " << accel[1] << " " << accel[2] << std::endl;
144  }
145 
146 
147 //======================================================================
148 /// Obtain the external force and torque on the body from specified
149 /// function pointers and also from a drag mesh, if there is one
150 //=====================================================================
152  Vector<double>& force,
153  double& torque)
154  {
155  // Get external force
156  if (External_force_fct_pt==0)
157  {
158  force[0]=0.0;
159  force[1]=0.0;
160  }
161  else
162  {
163  External_force_fct_pt(time,force);
164  }
165 
166  // Get external torque
167  if (External_torque_fct_pt==0)
168  {
169  torque=0.0;
170  }
171  else
172  {
173  External_torque_fct_pt(time,torque);
174  }
175 
176  // Add drag from any (fluid) mesh attached to surface of body
177  Vector<double> element_drag_force(2);
178  Vector<double> element_drag_torque(1);
179  if (Drag_mesh_pt==0)
180  {
181  return;
182  }
183  else
184  {
185  unsigned nel=Drag_mesh_pt->nelement();
186 
187  for (unsigned e=0;e<nel;e++)
188  {
190  get_drag_and_torque(element_drag_force,
191  element_drag_torque);
192  force[0]+=element_drag_force[0];
193  force[1]+=element_drag_force[1];
194  torque+=element_drag_torque[0];
195  }
196  }
197  }
198 
199 //=======================================================================
200 /// Set the external drag mesh, which should consist of
201 /// NavierStokesSurfaceDragTorqueElements and then read out the
202 /// appropriate load and geometric data from those elements and set
203 /// as external data for this element.
204 //=======================================================================
206  {
207  //Delete the external hijacked data
209  //Flush any existing external data
210  this->flush_external_data();
211  //Set the pointer
213 
214  //Allocate storage for all geometric data in the mesh
215  std::set<Data*> bulk_geometric_data_pt;
216  //Allocate storage for all load data in the mesh
217  std::set<std::pair<Data*,unsigned> > bulk_load_data_pt;
218 
219  //Loop over all elements in the drag mesh
220  const unsigned n_element = drag_mesh_pt->nelement();
221  for(unsigned e=0;e<n_element;++e)
222  {
223  //Cast the bulk element associated with each FaceElement to
224  //an FSIFluidElement
225  FSIFluidElement* bulk_elem_pt =
226  dynamic_cast<FSIFluidElement*>(
227  dynamic_cast<FaceElement*>(drag_mesh_pt->element_pt(e))
228  ->bulk_element_pt());
229  //Check that the cast worked
230  if(bulk_elem_pt==0)
231  {
232  throw OomphLibError("Drag mesh must consist of FSIFluidElements\n",
233  OOMPH_CURRENT_FUNCTION,
234  OOMPH_EXCEPTION_LOCATION);
235  }
236 
237  //Add the geometric and load data from the bulk element to the
238  //set allocated above
239  bulk_elem_pt->identify_geometric_data(bulk_geometric_data_pt);
240  bulk_elem_pt->identify_load_data(bulk_load_data_pt);
241  }
242 
243  //Need to add all these data as external data to this (Rigid Body) object
244  for(std::set<Data*>::iterator it = bulk_geometric_data_pt.begin();
245  it!=bulk_geometric_data_pt.end();++it)
246  {
247  this->add_external_data(*it);
248  }
249 
250  //Now do the same but make custom data for the load data
251  for(std::set<std::pair<Data*,unsigned> >::iterator it =
252  bulk_load_data_pt.begin();
253  it!=bulk_load_data_pt.end();++it)
254  {
255  Data* temp_data_pt = new HijackedData(it->second,it->first);
257  this->add_external_data(temp_data_pt));
258  }
259  }
260 
261 //======================================================================
262 /// Initialise the internal data
263 //=====================================================================
264  void ImmersedRigidBodyElement::initialise(TimeStepper* const &time_stepper_pt)
265  {
266  //This could be calculated by an integral around the boundary
267  Initial_centre_of_mass.resize(2,0.0);
268 
269  //Temporary hack
270  if(time_stepper_pt==0) {return;}
271 
272  // Provide Data for centre-of-mass displacement internally
274  {
275  Centre_displacement_data_pt=new Data(time_stepper_pt,3);
276 
277  // I've created it so I have to tidy up too!
279 
280  // Centre displacement is internal Data for this element
283  }
284  // Data created externally, so somebody else will clean up
285  else
286  {
288 
289  // Centre displacement is external Data for this element
292  }
293  }
294 
295 
296 
297 //=======================================================================
298 /// Calculate the contributions to the residuals and the jacobian
299 //======================================================================
301  Vector<double> &residuals,
302  DenseMatrix<double> &jacobian,
303  const bool& flag)
304  {
305  // Get timestepper and time
306  TimeStepper* timestepper_pt=
308  double time=timestepper_pt->time();
309 
310  // Get second time derivatives of all displacement data
311  Vector<double> accel(3);
312  timestepper_pt->time_derivative(2,this->Centre_displacement_data_pt,
313  accel);
314 
315  // Get force and torque
316  Vector<double> external_force(2);
317  double external_torque;
318  get_force_and_torque(time,external_force,external_torque);
319 
320  //Get the timescale ratio product of Reynolds number
321  //and Strouhal number squared
322  const double Lambda_sq =
323  this->re()*this->st()*this->st()*this->density_ratio();
324 
325  //Get the effective ReInvFr which must be multiplied by the
326  //density ratio to compute the gravitational load on the rigid body
327  const double scaled_re_inv_fr =
328  this->re_invfr()*this->density_ratio();
329  //Get the gravitational load
330  Vector<double> G = g();
331 
332  // Newton's law
333  int local_eqn=0;
334  local_eqn = this->centre_displacement_local_eqn(0);
335  if(local_eqn >= 0)
336  {
337  residuals[local_eqn]=
338  Lambda_sq*Mass*accel[0]- external_force[0] - Mass*scaled_re_inv_fr*G[0];
339 
340  // Get Jacobian too?
341  if (flag)
342  {
343  jacobian(local_eqn,local_eqn)=
344  Lambda_sq*Mass*timestepper_pt->weight(2,0);
345  }
346  }
347 
348  local_eqn = this->centre_displacement_local_eqn(1);
349  if(local_eqn >= 0)
350  {
351  residuals[local_eqn]=Lambda_sq*Mass*accel[1] -
352  external_force[1] - Mass*scaled_re_inv_fr*G[1];
353  // Get Jacobian too?
354  if (flag)
355  {
356  jacobian(local_eqn,local_eqn)=
357  Lambda_sq*Mass*timestepper_pt->weight(2,0);
358  }
359  }
360 
361  local_eqn = this->centre_displacement_local_eqn(2);
362  if(local_eqn >= 0)
363  {
364  residuals[local_eqn]=Lambda_sq*Moment_of_inertia*accel[2]-external_torque;
365  // Get Jacobian too?
366  if (flag)
367  {
368  jacobian(local_eqn,local_eqn)=
369  Lambda_sq*Moment_of_inertia*timestepper_pt->weight(2,0);
370  }
371  }
372  }
373 
374 
375 //=======================================================================
376 /// \short Constructor: Specify coordinates of a point inside the hole
377 /// and a vector of pointers to TriangleMeshPolyLines
378 /// that define the boundary segments of the polygon.
379 /// Each TriangleMeshPolyLine has its own boundary ID and can contain
380 /// multiple (straight-line) segments. The optional final argument
381 /// is a pointer to a Data object whose three values represent
382 /// the two displacements of and the rotation angle about the polygon's
383 /// centre of mass.
384 //=======================================================================
387  const Vector<double>& hole_center,
389  boundary_polyline_pt,
390  TimeStepper* const &time_stepper_pt,
391  Data* const &centre_displacement_data_pt) :
392  TriangleMeshCurve(boundary_polyline_pt),
393  TriangleMeshClosedCurve(boundary_polyline_pt, hole_center),
394  TriangleMeshPolygon(boundary_polyline_pt, hole_center),
395  ImmersedRigidBodyElement(time_stepper_pt,centre_displacement_data_pt)
396  {
397  //The underlying geometric object can be used to update the configuration
398  //internally before a remesh
399  this->Can_update_configuration = true;
400 
401  // Original rotation angle is zero
402  Initial_Phi=0.0;
403 
404  // Compute coordinates of centre of gravity etc
405  Vector<double> r_left(2);
406  Vector<double> r_right(2);
407  Mass=0.0;
408  Initial_centre_of_mass[0]=0.0;
409  Initial_centre_of_mass[1]=0.0;
410  double inertia_x=0.0;
411  double inertia_y=0.0;
412 
413  // Loop over polylines
414  unsigned nboundary=boundary_polyline_pt.size();
415  for (unsigned i=0;i<nboundary;i++)
416  {
417  // Loop over the segments to get the vertex coordinates
418  unsigned nseg=boundary_polyline_pt[i]->nsegment();
419  for(unsigned j=0;j<nseg;j++)
420  {
421  // Get the vertex coordinates
422  r_left =this->polyline_pt(i)->vertex_coordinate(j);
423  r_right=this->polyline_pt(i)->vertex_coordinate(j+1);
424 
425  // Mass (area)
426  Mass+=0.5*(r_left[0]*r_right[1]-r_right[0]*r_left[1]);
427 
428  // Centroid
429  Initial_centre_of_mass[0]+=(r_left[0]+r_right[0])*
430  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
431  Initial_centre_of_mass[1]+=(r_left[1]+r_right[1])*
432  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
433  }
434  if (nboundary==1)
435  {
436  // Get the vertex coordinates
437  r_left =this->polyline_pt(0)->vertex_coordinate(nseg);
438  r_right=this->polyline_pt(0)->vertex_coordinate(0);
439 
440  // Mass (area)
441  Mass+=0.5*(r_left[0]*r_right[1]-r_right[0]*r_left[1]);
442 
443  // Centroid
444  Initial_centre_of_mass[0]+=(r_left[0]+r_right[0])*
445  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
446  Initial_centre_of_mass[1]+=(r_left[1]+r_right[1])*
447  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
448  }
449  }
450 
451  // Normalise
452  Initial_centre_of_mass[0]/=(6.0*Mass);
453  Initial_centre_of_mass[1]/=(6.0*Mass);
454 
455  // Another loop over polylines for moment of inertia
456  for (unsigned i=0;i<nboundary;i++)
457  {
458  // Loop over the segments to get the vertex coordinates
459  unsigned nseg=boundary_polyline_pt[i]->nsegment();
460  for(unsigned j=0;j<nseg;j++)
461  {
462  // Get the vertex coordinates
463  r_left =this->polyline_pt(i)->vertex_coordinate(j);
464  r_right=this->polyline_pt(i)->vertex_coordinate(j+1);
465 
466  // Get moment about centroid
467  r_left[0]-=Initial_centre_of_mass[0];
468  r_left[1]-=Initial_centre_of_mass[1];
469  r_right[0]-=Initial_centre_of_mass[0];
470  r_right[1]-=Initial_centre_of_mass[1];
471 
472  // Moment of inertia
473  inertia_x+=1.0/12.0*(r_left[1]*r_left[1]+
474  r_left[1]*r_right[1]+
475  r_right[1]*r_right[1])*
476  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
477 
478  inertia_y+=1.0/12.0*(r_left[0]*r_left[0]+
479  r_left[0]*r_right[0]+
480  r_right[0]*r_right[0])*
481  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
482  }
483 
484  if (nboundary==1)
485  {
486  // Get the vertex coordinates
487  r_left =this->polyline_pt(0)->vertex_coordinate(nseg);
488  r_right=this->polyline_pt(0)->vertex_coordinate(0);
489 
490  // Get moment about centroid
491  r_left[0]-=Initial_centre_of_mass[0];
492  r_left[1]-=Initial_centre_of_mass[1];
493  r_right[0]-=Initial_centre_of_mass[0];
494  r_right[1]-=Initial_centre_of_mass[1];
495 
496  // Moment of inertia
497  inertia_x+=1.0/12.0*(r_left[1]*r_left[1]+
498  r_left[1]*r_right[1]+
499  r_right[1]*r_right[1])*
500  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
501 
502  inertia_y+=1.0/12.0*(r_left[0]*r_left[0]+
503  r_left[0]*r_right[0]+
504  r_right[0]*r_right[0])*
505  (r_left[0]*r_right[1]-r_right[0]*r_left[1]);
506  }
507  }
508 
509  // Polar moment of inertia is sum of two orthogonal planar moments
510  Moment_of_inertia=inertia_x+inertia_y;
511 
512 // // Tested for circular and elliptical cross section
513 // cout << "Mass : " << Mass << std::endl;
514 // cout << "Moment of inertia: " << Moment_of_inertia << std::endl;
515 // cout << "X_c : " << Initial_centre_of_mass[0] << std::endl;
516 // cout << "Y_c : " << Initial_centre_of_mass[1] << std::endl;
517 // pause("done");
518 
519 
520  //Assign the intrinsic coordinate
521  this->assign_zeta();
522 
523 // {
524 // unsigned n_poly = this->npolyline();
525 // for(unsigned p=0;p<n_poly;++p)
526 // {
527 // std::cout << "Polyline " << p << "\n";
528 // std::cout << "-----------------------\n";
529 // unsigned n_vertex = Zeta_vertex[p].size();
530 // for(unsigned v=0;v<n_vertex;v++)
531 // {
532 // std::cout << v << " " << Zeta_vertex[p][v] << "\n";
533 // }
534 // }
535 // }
536 
537 }
538 
539 
540 
541 //===============================================================
542 /// \short Update the reference configuration by re-setting the original
543 /// position of the vertices to their current ones, re-set the
544 /// original position of the centre of mass, and the displacements
545 /// and rotations relative to it
546 //===============================================================
549 {
550  Vector<double> x_orig(2);
551  Vector<double> r(2);
552 
553  // Loop over the polylines and update their vertex positions
554  unsigned npoly=this->ncurve_section();
555  for (unsigned i=0;i<npoly;i++)
556  {
557  TriangleMeshPolyLine* poly_line_pt=this->polyline_pt(i);
558  unsigned nvertex=poly_line_pt->nvertex();
559  for (unsigned j=0;j<nvertex;j++)
560  {
561  x_orig=poly_line_pt->vertex_coordinate(j);
562  this->apply_rigid_body_motion(0,x_orig,r);
563  poly_line_pt->vertex_coordinate(j)=r;
564  }
565  }
566 
567  // Update coordinates of hole
568  Vector<double> orig_hole_coord(this->internal_point());
569  this->apply_rigid_body_motion(0,orig_hole_coord,this->internal_point());
570 
571  // Update centre of gravity
572  double x_displ=Centre_displacement_data_pt->value(0);
573  double y_displ=Centre_displacement_data_pt->value(1);
574  double phi_displ=Centre_displacement_data_pt->value(2);
575  Initial_centre_of_mass[0]+=x_displ;
576  Initial_centre_of_mass[1]+=y_displ;
577  Initial_Phi+=phi_displ;
578 
579  // Reset displacement and rotation ("non-previous-value"
580  // history values stay)
582  unsigned nprev=timestepper_pt->nprev_values();
583  for (unsigned t=0;t<nprev;t++)
584  {
586  set_value(t,0,Centre_displacement_data_pt->value(t,0)-x_displ);
587 
589  set_value(t,1,Centre_displacement_data_pt->value(t,1)-y_displ);
590 
592  set_value(t,2,Centre_displacement_data_pt->value(t,2)-phi_displ);
593  }
594 }
595 
596 }
GeomObject * Geom_object_pt
Underlying geometric object.
int centre_displacement_local_eqn(const unsigned &i)
Return the equation number associated with the i-th centre of gravity displacment 0: x-displ; 1: y-di...
void delete_external_hijacked_data()
Delete the storage for the external data formed from hijacked data.
double Initial_Phi
Original rotation angle.
void dposition_dt(const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
Work out the position derivative, including rigid body motion.
void set_drag_mesh(Mesh *const &drag_mesh_pt)
Function to set the drag mesh and add the appropriate load and geometric data as external data to the...
Vector< double > Initial_centre_of_mass
X-coordinate of initial centre of gravity.
void reset_reference_configuration()
Update the reference configuration by re-setting the original position of the vertices to their curre...
Mesh *const & drag_mesh_pt()
Access fct to mesh containing face elements that allow the computation of the drag on the body...
ImmersedRigidBodyTriangleMeshPolygon(const Vector< double > &hole_center, const Vector< TriangleMeshCurveSection * > &boundary_polyline_pt, TimeStepper *const &time_stepper_pt, Data *const &centre_displacement_data_pt=0)
Constructor: Specify coordinates of a point inside the hole and a vector of pointers to TriangleMeshP...
cstr elem_len * i
Definition: cfortran.h:607
double & time()
Return current value of continous time.
Definition: timesteppers.h:324
const Vector< double > & g() const
Access function for gravity.
void get_residuals_rigid_body_generic(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &flag)
Get residuals and/or Jacobian.
static double Default_Physical_Ratio_Value
Static default value for physical ratios.
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:557
const double & re_invfr()
Access to the fluid inverse Froude number.
char t
Definition: cfortran.h:572
Custom Data class that is used when HijackingData. The class always contains a single value that is c...
Definition: nodes.h:530
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
unsigned Index_for_centre_displacement
Index for the data (internal or external) that contains the centre-of-gravity displacement.
static Vector< double > Default_Gravity_vector
Static default value for gravity.
e
Definition: cfortran.h:575
virtual void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)=0
Add to the set paired_load_data pairs containing.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:293
void flush_external_data()
Flush all external data.
Definition: elements.cc:365
unsigned nvertex() const
Number of vertices.
const double & re() const
Access function for the fluid Reynolds number.
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:587
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Definition: geom_objects.h:197
void get_force_and_torque(const double &time, Vector< double > &force, double &torque)
Get force and torque from specified fct pointers and drag mesh.
Class defining a polyline for use in Triangle Mesh generation.
virtual void identify_geometric_data(std::set< Data * > &geometric_data_pt)
The purpose of this function is to identify all Data objects that affect the elements' geometry...
Definition: elements.h:2627
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:462
double Moment_of_inertia
Polar moment of inertia of body.
const double & st() const
Access function for the fluid Strouhal number.
Vector< double > vertex_coordinate(const unsigned &i) const
Coordinate vector of i-th vertex (const version)
ExternalForceFctPt External_force_fct_pt
Function pointer to function that specifies external force.
Data * Centre_displacement_data_pt
Data for centre of gravity displacement. Values: 0: x-displ; 1: y-displ; 2: rotation angle...
unsigned ncurve_section() const
Number of constituent curves.
A class that represents a collection of data; each Data object may contain many different individual ...
Definition: nodes.h:89
ExternalTorqueFctPt External_torque_fct_pt
Function pointer to function that specifies external torque.
Base class defining a closed curve for the Triangle mesh generation.
static double Default_Physical_Constant_Value
Static default value for physical constants.
bool Displacement_data_is_internal
Boolean flag to indicate whether data is internal.
void initialise(TimeStepper *const &time_stepper_pt)
Initialisation function.
bool Can_update_configuration
Boolean flag to indicate whether the polygon can update its own reference configuration after it has ...
TriangleMeshPolyLine * polyline_pt(const unsigned &i) const
Pointer to i-th constituent polyline.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:246
Vector< double > internal_point() const
Coordinates of the internal point.
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
Definition: elements.cc:66
const double & density_ratio() const
Access function for the the density ratio.
Mesh * Drag_mesh_pt
Mesh containing face elements that allow the computation of the drag on the body. ...
void time_derivative(const unsigned &i, Data *const &data_pt, Vector< double > &deriv)
Evaluate i-th derivative of all values in Data and return in Vector deriv[].
Definition: timesteppers.h:474
void apply_rigid_body_motion(const unsigned &t, const Vector< double > &initial_x, Vector< double > &r) const
Helper function to adjust the position in response to changes in position and angle of the solid abou...
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
Definition: nodes.h:291
void output_centre_of_gravity(std::ostream &outfile)
Output position velocity and acceleration of centre of gravity.
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
A general mesh class.
Definition: mesh.h:74
The FSIFluidElement class is a base class for all fluid finite elements that apply a load (traction) ...
Definition: fsi.h:67
void position(const Vector< double > &xi, Vector< double > &r) const
Overload the position to apply the rotation and translation.
Class defining a closed polygon for the Triangle mesh generation.