oomph::ImmersedRigidBodyElement Class Reference

#include <immersed_rigid_body_elements.h>

+ Inheritance diagram for oomph::ImmersedRigidBodyElement:

Public Types

typedef void(* ExternalForceFctPt) (const double &time, Vector< double > &external_force)
 
typedef void(* ExternalTorqueFctPt) (const double &time, double &external_torque)
 

Public Member Functions

 ImmersedRigidBodyElement (GeomObject *const &geom_object_pt, TimeStepper *const &time_stepper_pt, Data *const &centre_displacement_data_pt=0)
 
void set_geometric_rotation ()
 Set the rotation of the object to be included. More...
 
void unset_geometric_rotation ()
 
doubleinitial_phi ()
 Access function for the initial angle. More...
 
doubleinitial_centre_of_mass (const unsigned &i)
 Access function for the initial centre of mass. More...
 
const doubleinitial_centre_of_mass (const unsigned &i) const
 Access function for the initial centre of mass (const version) More...
 
void position (const Vector< double > &xi, Vector< double > &r) const
 Overload the position to apply the rotation and translation. More...
 
void position (const unsigned &t, const Vector< double > &xi, Vector< double > &r) const
 Overload to include the time history of the motion of the object. More...
 
void dposition_dt (const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
 Work out the position derivative, including rigid body motion. More...
 
 ~ImmersedRigidBodyElement ()
 Destuctor: Cleanup if required. More...
 
doublemass_shape ()
 
doublemoment_of_inertia_shape ()
 Access to dimensionless polar "moment of inertia" shape parameter. More...
 
Data *& centre_displacement_data_pt ()
 
doublecentre_x_displacement ()
 x-displacement of centre of mass More...
 
doublecentre_y_displacement ()
 y-displacement of centre of mass More...
 
doublecentre_rotation_angle ()
 rotation of centre of mass More...
 
Vector< doublecentre_of_gravity ()
 Get current centre of gravity. More...
 
void pin_centre_of_mass_coordinate (const unsigned &i)
 Pin the i-th coordinate of the centre of mass. More...
 
void unpin_centre_of_mass_coordinate (const unsigned &i)
 Unpin the i-th coordinate of the centre of mass. More...
 
void pin_rotation_angle ()
 Pin the rotation angle. More...
 
void unpin_rotation_angle ()
 Unpin the rotation angle. More...
 
void output_centre_of_gravity (std::ostream &outfile)
 Output position velocity and acceleration of centre of gravity. More...
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Get the contribution to the residuals. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Get residuals including contribution to jacobian. More...
 
void node_update_adjacent_fluid_elements ()
 
void update_in_external_fd (const unsigned &i)
 After an external data change, update the nodal positions. More...
 
void reset_in_external_fd (const unsigned &i)
 Do nothing to reset within finite-differencing of external data. More...
 
void reset_after_external_fd ()
 
void update_in_internal_fd (const unsigned &i)
 After an internal data change, update the nodal positions. More...
 
void reset_in_internal_fd (const unsigned &i)
 Do nothing to reset within finite-differencing of internal data. More...
 
void reset_after_internal_fd ()
 
void get_force_and_torque (const double &time, Vector< double > &force, double &torque)
 
ExternalForceFctPtexternal_force_fct_pt ()
 
ExternalTorqueFctPtexternal_torque_fct_pt ()
 
Mesh *const & drag_mesh_pt ()
 
void set_drag_mesh (Mesh *const &drag_mesh_pt)
 
void flush_drag_mesh ()
 Function to clear the drag mesh and all associated external data. More...
 
unsigned ngeom_data () const
 The position of the object depends on one data item. More...
 
Datageom_data_pt (const unsigned &j)
 
Vector< double > *& g_pt ()
 Access function to the direction of gravity. More...
 
const Vector< double > & g () const
 Access function for gravity. More...
 
double *& re_pt ()
 Access function for the pointer to the fluid Reynolds number. More...
 
const doublere () const
 Access function for the fluid Reynolds number. More...
 
double *& st_pt ()
 Access function for the pointer to the fluid Strouhal number. More...
 
const doublest () const
 Access function for the fluid Strouhal number. More...
 
double *& re_invfr_pt ()
 
const doublere_invfr ()
 Access to the fluid inverse Froude number. More...
 
double *& density_ratio_pt ()
 Access function for the pointer to the density ratio. More...
 
const doubledensity_ratio () const
 Access function for the the density ratio. More...
 
- Public Member Functions inherited from oomph::GeneralisedElement
 GeneralisedElement ()
 Constructor: Initialise all pointers and all values to zero. More...
 
virtual ~GeneralisedElement ()
 Virtual destructor to clean up any memory allocated by the object. More...
 
 GeneralisedElement (const GeneralisedElement &)=delete
 Broken copy constructor. More...
 
void operator= (const GeneralisedElement &)=delete
 Broken assignment operator. More...
 
Data *& internal_data_pt (const unsigned &i)
 Return a pointer to i-th internal data object. More...
 
Data *const & internal_data_pt (const unsigned &i) const
 Return a pointer to i-th internal data object (const version) More...
 
Data *& external_data_pt (const unsigned &i)
 Return a pointer to i-th external data object. More...
 
Data *const & external_data_pt (const unsigned &i) const
 Return a pointer to i-th external data object (const version) More...
 
unsigned long eqn_number (const unsigned &ieqn_local) const
 
int local_eqn_number (const unsigned long &ieqn_global) const
 
unsigned add_external_data (Data *const &data_pt, const bool &fd=true)
 
bool external_data_fd (const unsigned &i) const
 
void exclude_external_data_fd (const unsigned &i)
 
void include_external_data_fd (const unsigned &i)
 
void flush_external_data ()
 Flush all external data. More...
 
void flush_external_data (Data *const &data_pt)
 Flush the object addressed by data_pt from the external data array. More...
 
unsigned ninternal_data () const
 Return the number of internal data objects. More...
 
unsigned nexternal_data () const
 Return the number of external data objects. More...
 
unsigned ndof () const
 Return the number of equations/dofs in the element. More...
 
void dof_vector (const unsigned &t, Vector< double > &dof)
 Return the vector of dof values at time level t. More...
 
void dof_pt_vector (Vector< double * > &dof_pt)
 Return the vector of pointers to dof values. More...
 
void set_internal_data_time_stepper (const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void assign_internal_eqn_numbers (unsigned long &global_number, Vector< double * > &Dof_pt)
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
void add_internal_value_pt_to_map (std::map< unsigned, double * > &map_of_value_pt)
 
virtual void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void complete_setup_of_dependencies ()
 
virtual void get_residuals (Vector< double > &residuals)
 
virtual void get_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
virtual void get_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void get_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void get_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void get_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void get_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void get_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void get_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void get_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
virtual unsigned self_test ()
 
virtual void compute_norm (Vector< double > &norm)
 
virtual void compute_norm (double &norm)
 
virtual unsigned ndof_types () const
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 
 GeomObject (const GeomObject &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const GeomObject &)=delete
 Broken assignment operator. More...
 
virtual ~GeomObject ()
 (Empty) destructor More...
 
unsigned nlagrangian () const
 Access function to # of Lagrangian coordinates. More...
 
unsigned ndim () const
 Access function to # of Eulerian coordinates. More...
 
void set_nlagrangian_and_ndim (const unsigned &n_lagrangian, const unsigned &n_dim)
 Set # of Lagrangian and Eulerian coordinates. More...
 
TimeStepper *& time_stepper_pt ()
 
TimeSteppertime_stepper_pt () const
 
virtual void position (const double &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void dposition (const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 
virtual void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 

Protected Member Functions

 ImmersedRigidBodyElement (TimeStepper *const &time_stepper_pt, Data *const &centre_displacement_data_pt=0)
 
void apply_rigid_body_motion (const unsigned &t, const Vector< double > &initial_x, Vector< double > &r) const
 
- Protected Member Functions inherited from oomph::GeneralisedElement
unsigned add_internal_data (Data *const &data_pt, const bool &fd=true)
 
bool internal_data_fd (const unsigned &i) const
 
void exclude_internal_data_fd (const unsigned &i)
 
void include_internal_data_fd (const unsigned &i)
 
void clear_global_eqn_numbers ()
 
void add_global_eqn_numbers (std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
 
virtual void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_additional_local_eqn_numbers ()
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
virtual void update_before_internal_fd ()
 
virtual void update_before_external_fd ()
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void fill_in_contribution_to_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void fill_in_contribution_to_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 

Protected Attributes

Vector< doubleInitial_centre_of_mass
 X-coordinate of initial centre of gravity. More...
 
double Initial_Phi
 Original rotation angle. More...
 
double Mass
 
double Moment_of_inertia
 Polar moment of inertia of body. More...
 
DataCentre_displacement_data_pt
 
- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 

Private Member Functions

int centre_displacement_local_eqn (const unsigned &i)
 
void initialise (TimeStepper *const &time_stepper_pt)
 Initialisation function. More...
 
void get_residuals_rigid_body_generic (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &flag)
 Get residuals and/or Jacobian. More...
 
void delete_external_hijacked_data ()
 Delete the storage for the external data formed from hijacked data. More...
 

Private Attributes

std::list< unsignedList_of_external_hijacked_data
 
GeomObjectGeom_object_pt
 Underlying geometric object. More...
 
ExternalForceFctPt External_force_fct_pt
 
ExternalTorqueFctPt External_torque_fct_pt
 
MeshDrag_mesh_pt
 
Vector< double > * G_pt
 The direction of gravity. More...
 
doubleRe_pt
 Reynolds number of external fluid. More...
 
doubleSt_pt
 Strouhal number of external fluid. More...
 
doubleReInvFr_pt
 Reynolds number divided by Froude number of external fluid. More...
 
doubleDensity_ratio_pt
 Density ratio of the solid to the external fluid. More...
 
unsigned Index_for_centre_displacement
 
bool Displacement_data_is_internal
 Boolean flag to indicate whether data is internal. More...
 
bool Include_geometric_rotation
 

Static Private Attributes

static double Default_Physical_Constant_Value = 0.0
 Static default value for physical constants. More...
 
static double Default_Physical_Ratio_Value = 1.0
 Static default value for physical ratios. More...
 
static Vector< doubleDefault_Gravity_vector
 Static default value for gravity. More...
 

Additional Inherited Members

- Static Public Attributes inherited from oomph::GeneralisedElement
static bool Suppress_warning_about_repeated_internal_data
 
static bool Suppress_warning_about_repeated_external_data = true
 
static double Default_fd_jacobian_step = 1.0e-8
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Detailed Description

Class that solves the equations of motion for a general two-dimensional rigid body subject to a particular imposed force and torque distribution and immersed within an external fluid. The body's position is entirely specified by the location of its centre of mass, \(\mbox{\boldmath$X$}\), and a single angle, \(\phi\), that represents a possible rotation. The equations of motion are then simply Newton's second law for the conservation of linear momentum in two directions and angular momentum about the single possible axis of rotation.

The non-dimensionalisation is based on the viscous scales of the surrounding fluid, in which case, the governing equations are

\[ Re St^{2} M \frac{\mbox{d}^{2} \mbox{\boldmath$X$}}{\mbox{d} t^{2}} = \mbox{\boldmath$F$} + \oint \mbox{\boldmath$t$} \mbox{d} s \quad\mbox{and}\quad Re St^{2} I \frac{\mbox{d}^{2}\Phi}{\mbox{d} t^{2}} = \mbox{\boldmath$T$} + \oint \mbox{\boldmath$q$} \mbox{d} s, \]

where \(\mbox{\boldmath$F$} = \mbox{\boldmath$F$}^{*}/\mu U\) is the external force per unit length; \(\mbox{\boldmath$t$}\) is the net force per unit length applied on the rigid body by the surrounding fluid; \(\mbox{\boldmath$T$} = \mbox{\boldmath$T$}^{*}/(\mu UL)\) is the external torque per unit length; and \(\mbox{\boldmath$q$}\) is the net torque per unit length applied on the body by the fluid. \(M\) is a scaled mass the density ratio multiplied by a shape parameter and \(I\) is a scaled moment of inertia. Finally, \(Re\) and \(St\) are the Reynolds and Strouhal numbers of the surrounding fluid. Note that these equations may be used without the external fluid, in which case the non-dimensionalisation doesn't make a lot of sense, but may be re-interpreted accordingly.

A Data object whose three values represent the x and y displacements of the body's centre of mass and its rotation about the centre of mass may be passed in as external data or, if not, it will be constructed internally.

For general usage, an underlying geometric object must passed to the constructor and the position will be determined by applying rigid body motions to the underlying object based on the initial_centre_of_mass and initial_phi (angle), which default to zero. If these defaults are not suitable, the values must be set externally. In addition a mass and moment of inertia should also be set externally.

If added to a mesh in the Problem (in its incarnation as a GeneralisedElement) the displacement/rotation of the body is computed in response to (i) user-specifiable applied forces and a torque and (ii) the net drag (and associated torque) from a mesh of elements that can exert a drag onto the body (typically Navier-Stokes FaceElements that apply a viscous drag to an immersed body, represented by the body.)

Member Typedef Documentation

◆ ExternalForceFctPt

typedef void(* oomph::ImmersedRigidBodyElement::ExternalForceFctPt) (const double &time, Vector< double > &external_force)

Function pointer to function that specifies external force

◆ ExternalTorqueFctPt

typedef void(* oomph::ImmersedRigidBodyElement::ExternalTorqueFctPt) (const double &time, double &external_torque)

Function pointer to function that specifies external torque

Constructor & Destructor Documentation

◆ ImmersedRigidBodyElement() [1/2]

oomph::ImmersedRigidBodyElement::ImmersedRigidBodyElement ( TimeStepper *const &  time_stepper_pt,
Data *const &  centre_displacement_data_pt = 0 
)
inlineprotected

Default constructor that intialises everything to zero. This is expected to be called only from derived clases such as the ImmersedRigidBodyTriangleMeshPolygon that can provided their own position() functions.

112  : Initial_Phi(0.0),
113  Mass(0.0),
114  Moment_of_inertia(0.0),
116  Geom_object_pt(0),
119  Drag_mesh_pt(0),
126  {
128  }
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
bool Include_geometric_rotation
Definition: immersed_rigid_body_elements.h:643
double * St_pt
Strouhal number of external fluid.
Definition: immersed_rigid_body_elements.h:617
static double Default_Physical_Constant_Value
Static default value for physical constants.
Definition: immersed_rigid_body_elements.h:626
void initialise(TimeStepper *const &time_stepper_pt)
Initialisation function.
Definition: immersed_rigid_body_elements.cc:266
ExternalTorqueFctPt External_torque_fct_pt
Definition: immersed_rigid_body_elements.h:604
double * ReInvFr_pt
Reynolds number divided by Froude number of external fluid.
Definition: immersed_rigid_body_elements.h:620
double Initial_Phi
Original rotation angle.
Definition: immersed_rigid_body_elements.h:582
Data * Centre_displacement_data_pt
Definition: immersed_rigid_body_elements.h:592
double * Re_pt
Reynolds number of external fluid.
Definition: immersed_rigid_body_elements.h:614
static Vector< double > Default_Gravity_vector
Static default value for gravity.
Definition: immersed_rigid_body_elements.h:632
GeomObject * Geom_object_pt
Underlying geometric object.
Definition: immersed_rigid_body_elements.h:596
ExternalForceFctPt External_force_fct_pt
Definition: immersed_rigid_body_elements.h:600
double Moment_of_inertia
Polar moment of inertia of body.
Definition: immersed_rigid_body_elements.h:588
Data *& centre_displacement_data_pt()
Definition: immersed_rigid_body_elements.h:235
double Mass
Definition: immersed_rigid_body_elements.h:585
Vector< double > * G_pt
The direction of gravity.
Definition: immersed_rigid_body_elements.h:611
Mesh * Drag_mesh_pt
Definition: immersed_rigid_body_elements.h:608
static double Default_Physical_Ratio_Value
Static default value for physical ratios.
Definition: immersed_rigid_body_elements.h:629
double * Density_ratio_pt
Density ratio of the solid to the external fluid.
Definition: immersed_rigid_body_elements.h:623

References initialise().

◆ ImmersedRigidBodyElement() [2/2]

oomph::ImmersedRigidBodyElement::ImmersedRigidBodyElement ( GeomObject *const &  geom_object_pt,
TimeStepper *const &  time_stepper_pt,
Data *const &  centre_displacement_data_pt = 0 
)
inline

Constructor that takes an underlying geometric object: and timestepper.

References initialise().

◆ ~ImmersedRigidBodyElement()

oomph::ImmersedRigidBodyElement::~ImmersedRigidBodyElement ( )
inline

Destuctor: Cleanup if required.

211  {
213  {
215  // Null out the pointer stored as internal data
216  this->internal_data_pt(0) = 0;
217  }
218  }
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
bool Displacement_data_is_internal
Boolean flag to indicate whether data is internal.
Definition: immersed_rigid_body_elements.h:639

References Centre_displacement_data_pt, Displacement_data_is_internal, and oomph::GeneralisedElement::internal_data_pt().

Member Function Documentation

◆ apply_rigid_body_motion()

void oomph::ImmersedRigidBodyElement::apply_rigid_body_motion ( const unsigned t,
const Vector< double > &  initial_x,
Vector< double > &  r 
) const
inlineprotected

Helper function to adjust the position in response to changes in position and angle of the solid about the centre of mass

501  {
502  // Scale relative to the centre of mass
503  double X = initial_x[0] - Initial_centre_of_mass[0];
504  double Y = initial_x[1] - Initial_centre_of_mass[1];
505 
506  // Find the original angle and radius
507  double phi_orig = atan2(Y, X);
508  double r_orig = sqrt(X * X + Y * Y);
509 
510  // Updated position vector
511  r[0] = Initial_centre_of_mass[0] +
512  this->Centre_displacement_data_pt->value(t, 0);
513 
514  r[1] = Initial_centre_of_mass[1] +
515  this->Centre_displacement_data_pt->value(t, 1);
516 
517  // Add in the rotation terms if there are to be included
519  {
520  r[0] += r_orig *
521  cos(phi_orig + this->Centre_displacement_data_pt->value(t, 2));
522  r[1] += r_orig *
523  sin(phi_orig + this->Centre_displacement_data_pt->value(t, 2));
524  }
525  else
526  {
527  r[0] += r_orig * cos(phi_orig);
528  r[1] += r_orig * sin(phi_orig);
529  }
530  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:139
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
double value(const unsigned &i) const
Definition: nodes.h:293
Vector< double > Initial_centre_of_mass
X-coordinate of initial centre of gravity.
Definition: immersed_rigid_body_elements.h:579
#define X
Definition: icosphere.cpp:20
r
Definition: UniformPSDSelfTest.py:20
const char Y
Definition: test/EulerAngles.cpp:32

References atan2(), Centre_displacement_data_pt, cos(), Include_geometric_rotation, Initial_centre_of_mass, UniformPSDSelfTest::r, sin(), sqrt(), oomph::Data::value(), X, and Y.

Referenced by position(), oomph::ImmersedRigidBodyTriangleMeshPolygon::position(), and oomph::ImmersedRigidBodyTriangleMeshPolygon::reset_reference_configuration().

◆ centre_displacement_data_pt()

Data*& oomph::ImmersedRigidBodyElement::centre_displacement_data_pt ( )
inline

Pointer to Data for centre of gravity displacement. Values: 0: x-displ; 1: y-displ; 2: rotation angle.

236  {
238  }

References Centre_displacement_data_pt.

◆ centre_displacement_local_eqn()

int oomph::ImmersedRigidBodyElement::centre_displacement_local_eqn ( const unsigned i)
inlineprivate

Return the equation number associated with the i-th centre of gravity displacment 0: x-displ; 1: y-displ; 2: rotation angle.

538  {
540  {
542  }
543  else
544  {
546  }
547  }
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Definition: elements.h:267
int external_local_eqn(const unsigned &i, const unsigned &j)
Definition: elements.h:311
unsigned Index_for_centre_displacement
Definition: immersed_rigid_body_elements.h:636

References Displacement_data_is_internal, oomph::GeneralisedElement::external_local_eqn(), Index_for_centre_displacement, and oomph::GeneralisedElement::internal_local_eqn().

Referenced by get_residuals_rigid_body_generic().

◆ centre_of_gravity()

Vector<double> oomph::ImmersedRigidBodyElement::centre_of_gravity ( )
inline

Get current centre of gravity.

260  {
261  Vector<double> cog(2);
262  for (unsigned i = 0; i < 2; i++)
263  {
264  cog[i] = Initial_centre_of_mass[i] +
266  }
267  return cog;
268  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References Centre_displacement_data_pt, i, Initial_centre_of_mass, and oomph::Data::value().

◆ centre_rotation_angle()

double& oomph::ImmersedRigidBodyElement::centre_rotation_angle ( )
inline

rotation of centre of mass

254  {
256  }
double * value_pt(const unsigned &i) const
Definition: nodes.h:324

References Centre_displacement_data_pt, and oomph::Data::value_pt().

◆ centre_x_displacement()

double& oomph::ImmersedRigidBodyElement::centre_x_displacement ( )
inline

x-displacement of centre of mass

242  {
244  }

References Centre_displacement_data_pt, and oomph::Data::value_pt().

◆ centre_y_displacement()

double& oomph::ImmersedRigidBodyElement::centre_y_displacement ( )
inline

y-displacement of centre of mass

248  {
250  }

References Centre_displacement_data_pt, and oomph::Data::value_pt().

◆ delete_external_hijacked_data()

void oomph::ImmersedRigidBodyElement::delete_external_hijacked_data ( )
inlineprivate

Delete the storage for the external data formed from hijacked data.

563  {
564  for (std::list<unsigned>::iterator it =
566  it != List_of_external_hijacked_data.end();
567  ++it)
568  {
569  // Delete the associated external data
570  delete this->external_data_pt(*it);
571  this->external_data_pt(*it) = 0;
572  }
573  // Now clear the list
575  }
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Definition: elements.h:659
std::list< unsigned > List_of_external_hijacked_data
Definition: immersed_rigid_body_elements.h:559

References oomph::GeneralisedElement::external_data_pt(), and List_of_external_hijacked_data.

Referenced by flush_drag_mesh(), and set_drag_mesh().

◆ density_ratio()

const double& oomph::ImmersedRigidBodyElement::density_ratio ( ) const
inline

Access function for the the density ratio.

490  {
491  return *Density_ratio_pt;
492  }

References Density_ratio_pt.

Referenced by get_residuals_rigid_body_generic().

◆ density_ratio_pt()

double*& oomph::ImmersedRigidBodyElement::density_ratio_pt ( )
inline

Access function for the pointer to the density ratio.

484  {
485  return Density_ratio_pt;
486  }

References Density_ratio_pt.

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem().

◆ dposition_dt()

void oomph::ImmersedRigidBodyElement::dposition_dt ( const Vector< double > &  zeta,
const unsigned j,
Vector< double > &  drdt 
)
virtual

Work out the position derivative, including rigid body motion.

Work out the position derivative taking into account the movement relative to the original centre of mass

Reimplemented from oomph::GeomObject.

48  {
49  // Switch on time level
50  switch (j)
51  {
52  // Current time, just return the position
53  case 0:
54  return position(zeta, drdt);
55  break;
56 
57  // Time derivative
58  case 1:
59  {
60  // Get the initial position of the underlying geometric object
61  Vector<double> initial_x(2);
62  Geom_object_pt->position(zeta, initial_x);
63  // Scale relative to the centre of mass
64  double X = initial_x[0] - Initial_centre_of_mass[0];
65  double Y = initial_x[1] - Initial_centre_of_mass[1];
66 
67  // Now calculate the original angle and radius
68  double phi_orig = atan2(Y, X);
69  double r_orig = sqrt(X * X + Y * Y);
70 
71  // Get first time derivatives of all displacement data
72  Vector<double> veloc(3);
73  // Get the velocity of the data
75  1, this->Centre_displacement_data_pt, veloc);
76 
77  // Now use the chain rule to specify the boundary velocities
78  drdt[0] = veloc[0];
79  drdt[1] = veloc[1];
80 
82  {
83  drdt[0] +=
84  -r_orig *
85  sin(phi_orig + this->Centre_displacement_data_pt->value(2)) *
86  veloc[2];
87  drdt[1] +=
88  r_orig *
89  cos(phi_orig + this->Centre_displacement_data_pt->value(2)) *
90  veloc[2];
91  }
92  }
93  // Done
94  return;
95  break;
96 
97  default:
98  std::ostringstream warning_stream;
99  warning_stream
100  << "Using default (static) assignment " << j
101  << "-th time derivative in GeomObject::dposition_dt(...) is zero\n"
102  << "Overload for your specific geometric object if this is not \n"
103  << "appropriate. \n";
104  OomphLibWarning(warning_stream.str(),
105  "GeomObject::dposition_dt()",
107 
108  unsigned n = drdt.size();
109  for (unsigned i = 0; i < n; i++)
110  {
111  drdt[i] = 0.0;
112  }
113  break;
114  }
115  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
void position(const Vector< double > &xi, Vector< double > &r) const
Overload the position to apply the rotation and translation.
Definition: immersed_rigid_body_elements.h:186
void time_derivative(const unsigned &i, Data *const &data_pt, Vector< double > &deriv)
Definition: timesteppers.h:502
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References atan2(), Centre_displacement_data_pt, cos(), Geom_object_pt, i, Include_geometric_rotation, Initial_centre_of_mass, j, n, OOMPH_EXCEPTION_LOCATION, position(), oomph::GeomObject::position(), sin(), sqrt(), oomph::TimeStepper::time_derivative(), oomph::Data::time_stepper_pt(), oomph::Data::value(), X, Y, and Eigen::zeta().

◆ drag_mesh_pt()

Mesh* const& oomph::ImmersedRigidBodyElement::drag_mesh_pt ( )
inline

Access fct to mesh containing face elements that allow the computation of the drag on the body

401  {
402  return Drag_mesh_pt;
403  }

References Drag_mesh_pt.

Referenced by set_drag_mesh().

◆ external_force_fct_pt()

ExternalForceFctPt& oomph::ImmersedRigidBodyElement::external_force_fct_pt ( )
inline

Access to function pointer to function that specifies external force

387  {
388  return External_force_fct_pt;
389  }

References External_force_fct_pt.

◆ external_torque_fct_pt()

ExternalTorqueFctPt& oomph::ImmersedRigidBodyElement::external_torque_fct_pt ( )
inline

Access to function pointer to function that specifies external torque

394  {
395  return External_torque_fct_pt;
396  }

References External_torque_fct_pt.

◆ fill_in_contribution_to_jacobian()

void oomph::ImmersedRigidBodyElement::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlinevirtual

Get residuals including contribution to jacobian.

Reimplemented from oomph::GeneralisedElement.

309  {
310  // Get generic function, but don't bother to get jacobian terms
311  bool flag = false;
312  get_residuals_rigid_body_generic(residuals, jacobian, flag);
313  // Get the internal effects by FD, because a change in internal
314  // data can change the fluid loading, so this is one of those
315  // subtle interactions
316  this->fill_in_jacobian_from_internal_by_fd(residuals, jacobian);
317  // Get the effect of the fluid loading on the rigid body
318  this->fill_in_jacobian_from_external_by_fd(residuals, jacobian);
319  }
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.cc:1199
void fill_in_jacobian_from_internal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.cc:1102
void get_residuals_rigid_body_generic(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &flag)
Get residuals and/or Jacobian.
Definition: immersed_rigid_body_elements.cc:304

References oomph::GeneralisedElement::fill_in_jacobian_from_external_by_fd(), oomph::GeneralisedElement::fill_in_jacobian_from_internal_by_fd(), and get_residuals_rigid_body_generic().

◆ fill_in_contribution_to_residuals()

void oomph::ImmersedRigidBodyElement::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inlinevirtual

Get the contribution to the residuals.

Reimplemented from oomph::GeneralisedElement.

299  {
300  // Get generic function without jacobian terms
302  residuals, GeneralisedElement::Dummy_matrix, false);
303  }
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227

References oomph::GeneralisedElement::Dummy_matrix, and get_residuals_rigid_body_generic().

◆ flush_drag_mesh()

void oomph::ImmersedRigidBodyElement::flush_drag_mesh ( )
inline

Function to clear the drag mesh and all associated external data.

411  {
412  // Delete the hijacked data created as the load
414  // Flush the external data
415  this->flush_external_data();
416  // Set the Drag_mesh pointer to null
417  Drag_mesh_pt = 0;
418  }
void flush_external_data()
Flush all external data.
Definition: elements.cc:387
void delete_external_hijacked_data()
Delete the storage for the external data formed from hijacked data.
Definition: immersed_rigid_body_elements.h:562

References delete_external_hijacked_data(), Drag_mesh_pt, and oomph::GeneralisedElement::flush_external_data().

◆ g()

const Vector<double>& oomph::ImmersedRigidBodyElement::g ( ) const
inline

Access function for gravity.

441  {
442  return *G_pt;
443  }

References G_pt.

Referenced by get_residuals_rigid_body_generic().

◆ g_pt()

Vector<double>*& oomph::ImmersedRigidBodyElement::g_pt ( )
inline

Access function to the direction of gravity.

435  {
436  return G_pt;
437  }

References G_pt.

◆ geom_data_pt()

Data* oomph::ImmersedRigidBodyElement::geom_data_pt ( const unsigned j)
inlinevirtual

Return pointer to the j-th (only) Data item that the object's shape depends on.

Reimplemented from oomph::GeomObject.

429  {
430  return this->Centre_displacement_data_pt;
431  }

References Centre_displacement_data_pt.

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::create_drag_elements().

◆ get_force_and_torque()

void oomph::ImmersedRigidBodyElement::get_force_and_torque ( const double time,
Vector< double > &  force,
double torque 
)

Get force and torque from specified fct pointers and drag mesh

Obtain the external force and torque on the body from specified function pointers and also from a drag mesh, if there is one

156  {
157  // Get external force
158  if (External_force_fct_pt == 0)
159  {
160  force[0] = 0.0;
161  force[1] = 0.0;
162  }
163  else
164  {
165  External_force_fct_pt(time, force);
166  }
167 
168  // Get external torque
169  if (External_torque_fct_pt == 0)
170  {
171  torque = 0.0;
172  }
173  else
174  {
175  External_torque_fct_pt(time, torque);
176  }
177 
178  // Add drag from any (fluid) mesh attached to surface of body
179  Vector<double> element_drag_force(2);
180  Vector<double> element_drag_torque(1);
181  if (Drag_mesh_pt == 0)
182  {
183  return;
184  }
185  else
186  {
187  unsigned nel = Drag_mesh_pt->nelement();
188 
189  for (unsigned e = 0; e < nel; e++)
190  {
191  dynamic_cast<ElementWithDragFunction*>(Drag_mesh_pt->element_pt(e))
192  ->get_drag_and_torque(element_drag_force, element_drag_torque);
193  force[0] += element_drag_force[0];
194  force[1] += element_drag_force[1];
195  torque += element_drag_torque[0];
196  }
197  }
198  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590

References Drag_mesh_pt, e(), oomph::Mesh::element_pt(), External_force_fct_pt, External_torque_fct_pt, and oomph::Mesh::nelement().

Referenced by get_residuals_rigid_body_generic().

◆ get_residuals_rigid_body_generic()

void oomph::ImmersedRigidBodyElement::get_residuals_rigid_body_generic ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
const bool flag 
)
private

Get residuals and/or Jacobian.

Calculate the contributions to the residuals and the jacobian.

306  {
307  // Get timestepper and time
308  TimeStepper* timestepper_pt =
310  double time = timestepper_pt->time();
311 
312  // Get second time derivatives of all displacement data
313  Vector<double> accel(3);
314  timestepper_pt->time_derivative(
315  2, this->Centre_displacement_data_pt, accel);
316 
317  // Get force and torque
318  Vector<double> external_force(2);
319  double external_torque;
320  get_force_and_torque(time, external_force, external_torque);
321 
322  // Get the timescale ratio product of Reynolds number
323  // and Strouhal number squared
324  const double Lambda_sq =
325  this->re() * this->st() * this->st() * this->density_ratio();
326 
327  // Get the effective ReInvFr which must be multiplied by the
328  // density ratio to compute the gravitational load on the rigid body
329  const double scaled_re_inv_fr = this->re_invfr() * this->density_ratio();
330  // Get the gravitational load
331  Vector<double> G = g();
332 
333  // Newton's law
334  int local_eqn = 0;
335  local_eqn = this->centre_displacement_local_eqn(0);
336  if (local_eqn >= 0)
337  {
338  residuals[local_eqn] = Lambda_sq * Mass * accel[0] - external_force[0] -
339  Mass * scaled_re_inv_fr * G[0];
340 
341  // Get Jacobian too?
342  if (flag)
343  {
344  jacobian(local_eqn, local_eqn) =
345  Lambda_sq * Mass * timestepper_pt->weight(2, 0);
346  }
347  }
348 
349  local_eqn = this->centre_displacement_local_eqn(1);
350  if (local_eqn >= 0)
351  {
352  residuals[local_eqn] = Lambda_sq * Mass * accel[1] - external_force[1] -
353  Mass * scaled_re_inv_fr * G[1];
354  // Get Jacobian too?
355  if (flag)
356  {
357  jacobian(local_eqn, local_eqn) =
358  Lambda_sq * Mass * timestepper_pt->weight(2, 0);
359  }
360  }
361 
362  local_eqn = this->centre_displacement_local_eqn(2);
363  if (local_eqn >= 0)
364  {
365  residuals[local_eqn] =
366  Lambda_sq * Moment_of_inertia * accel[2] - external_torque;
367  // Get Jacobian too?
368  if (flag)
369  {
370  jacobian(local_eqn, local_eqn) =
371  Lambda_sq * Moment_of_inertia * timestepper_pt->weight(2, 0);
372  }
373  }
374  }
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
const Vector< double > & g() const
Access function for gravity.
Definition: immersed_rigid_body_elements.h:440
const double & st() const
Access function for the fluid Strouhal number.
Definition: immersed_rigid_body_elements.h:464
int centre_displacement_local_eqn(const unsigned &i)
Definition: immersed_rigid_body_elements.h:537
const double & re() const
Access function for the fluid Reynolds number.
Definition: immersed_rigid_body_elements.h:452
const double & re_invfr()
Access to the fluid inverse Froude number.
Definition: immersed_rigid_body_elements.h:477
void get_force_and_torque(const double &time, Vector< double > &force, double &torque)
Definition: immersed_rigid_body_elements.cc:153
const double & density_ratio() const
Access function for the the density ratio.
Definition: immersed_rigid_body_elements.h:489
double & time()
Return current value of continous time.
Definition: timesteppers.h:332
double Lambda_sq
Pseudo-solid mass density.
Definition: pressure_driven_torus.cc:62

References Centre_displacement_data_pt, centre_displacement_local_eqn(), density_ratio(), G, g(), get_force_and_torque(), Global_Physical_Variables::Lambda_sq, Mass, Moment_of_inertia, re(), re_invfr(), st(), oomph::TimeStepper::time(), oomph::TimeStepper::time_derivative(), oomph::Data::time_stepper_pt(), and oomph::TimeStepper::weight().

Referenced by fill_in_contribution_to_jacobian(), and fill_in_contribution_to_residuals().

◆ initial_centre_of_mass() [1/2]

double& oomph::ImmersedRigidBodyElement::initial_centre_of_mass ( const unsigned i)
inline

◆ initial_centre_of_mass() [2/2]

const double& oomph::ImmersedRigidBodyElement::initial_centre_of_mass ( const unsigned i) const
inline

Access function for the initial centre of mass (const version)

181  {
182  return Initial_centre_of_mass[i];
183  }

References i, and Initial_centre_of_mass.

◆ initial_phi()

double& oomph::ImmersedRigidBodyElement::initial_phi ( )
inline

Access function for the initial angle.

169  {
170  return Initial_Phi;
171  }

References Initial_Phi.

◆ initialise()

void oomph::ImmersedRigidBodyElement::initialise ( TimeStepper *const &  time_stepper_pt)
private

Initialisation function.

Initialise the internal data.

267  {
268  // This could be calculated by an integral around the boundary
269  Initial_centre_of_mass.resize(2, 0.0);
270 
271  // Temporary hack
272  if (time_stepper_pt == 0)
273  {
274  return;
275  }
276 
277  // Provide Data for centre-of-mass displacement internally
279  {
281 
282  // I've created it so I have to tidy up too!
284 
285  // Centre displacement is internal Data for this element
288  }
289  // Data created externally, so somebody else will clean up
290  else
291  {
293 
294  // Centre displacement is external Data for this element
297  }
298  }
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62

References oomph::GeneralisedElement::add_external_data(), oomph::GeneralisedElement::add_internal_data(), Centre_displacement_data_pt, Displacement_data_is_internal, Index_for_centre_displacement, Initial_centre_of_mass, and oomph::GeomObject::time_stepper_pt().

Referenced by ImmersedRigidBodyElement().

◆ mass_shape()

double& oomph::ImmersedRigidBodyElement::mass_shape ( )
inline

Access to dimensionless "mass" shape parameter that must be set by hand for non polygonal shapes

223  {
224  return Mass;
225  }

References Mass.

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem().

◆ moment_of_inertia_shape()

double& oomph::ImmersedRigidBodyElement::moment_of_inertia_shape ( )
inline

Access to dimensionless polar "moment of inertia" shape parameter.

229  {
230  return Moment_of_inertia;
231  }

References Moment_of_inertia.

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem().

◆ ngeom_data()

unsigned oomph::ImmersedRigidBodyElement::ngeom_data ( ) const
inlinevirtual

The position of the object depends on one data item.

Reimplemented from oomph::GeomObject.

422  {
423  return 1;
424  }

◆ node_update_adjacent_fluid_elements()

void oomph::ImmersedRigidBodyElement::node_update_adjacent_fluid_elements ( )
inline

Update the positions of the nodes in fluid elements adjacent to the rigid body, defined as being elements in the drag mesh.

325  {
326  // If there is no drag mesh then do nothing
327  if (Drag_mesh_pt == 0)
328  {
329  return;
330  }
331  // Otherwise update the elements adjacent to the rigid body
332  //(all the elements adjacent to those in the drag mesh)
333  else
334  {
335  unsigned nel = Drag_mesh_pt->nelement();
336  for (unsigned e = 0; e < nel; e++)
337  {
338  dynamic_cast<FaceElement*>(Drag_mesh_pt->element_pt(e))
339  ->bulk_element_pt()
340  ->node_update();
341  }
342  }
343  }

References Drag_mesh_pt, e(), oomph::Mesh::element_pt(), oomph::Mesh::nelement(), and oomph::FiniteElement::node_update().

Referenced by reset_after_external_fd(), reset_after_internal_fd(), update_in_external_fd(), and update_in_internal_fd().

◆ output_centre_of_gravity()

void oomph::ImmersedRigidBodyElement::output_centre_of_gravity ( std::ostream &  outfile)

Output position velocity and acceleration of centre of gravity.

Output the position of the centre of gravity including velocities and accelerations

122  {
123  // Get timestepper
124  TimeStepper* time_stepper_pt =
126 
127  // Get first time derivatives of all displacement data
128  Vector<double> veloc(3);
130  1, this->Centre_displacement_data_pt, veloc);
131 
132  // Get second time derivatives of all displacement data
133  Vector<double> accel(3);
135  2, this->Centre_displacement_data_pt, accel);
136 
137  outfile << time_stepper_pt->time() << " "
138  << Initial_centre_of_mass[0] +
140  << " "
141  << Initial_centre_of_mass[1] +
143  << " " << Initial_Phi + this->Centre_displacement_data_pt->value(2)
144  << " " << veloc[0] << " " << veloc[1] << " " << veloc[2] << " "
145  << accel[0] << " " << accel[1] << " " << accel[2] << std::endl;
146  }

References Centre_displacement_data_pt, Initial_centre_of_mass, Initial_Phi, oomph::TimeStepper::time(), oomph::TimeStepper::time_derivative(), oomph::GeomObject::time_stepper_pt(), oomph::Data::time_stepper_pt(), and oomph::Data::value().

◆ pin_centre_of_mass_coordinate()

void oomph::ImmersedRigidBodyElement::pin_centre_of_mass_coordinate ( const unsigned i)
inline

Pin the i-th coordinate of the centre of mass.

272  {
274  }
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385

References Centre_displacement_data_pt, i, and oomph::Data::pin().

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::solve_for_consistent_nodal_positions(), and UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem().

◆ pin_rotation_angle()

void oomph::ImmersedRigidBodyElement::pin_rotation_angle ( )
inline

Pin the rotation angle.

284  {
286  }

References Centre_displacement_data_pt, and oomph::Data::pin().

◆ position() [1/2]

void oomph::ImmersedRigidBodyElement::position ( const unsigned t,
const Vector< double > &  xi,
Vector< double > &  r 
) const
inlinevirtual

Overload to include the time history of the motion of the object.

Reimplemented from oomph::GeomObject.

Reimplemented in oomph::ImmersedRigidBodyTriangleMeshPolygon.

197  {
198  Vector<double> initial_x(2);
199  Geom_object_pt->position(xi, initial_x);
200  this->apply_rigid_body_motion(t, initial_x, r);
201  }
void apply_rigid_body_motion(const unsigned &t, const Vector< double > &initial_x, Vector< double > &r) const
Definition: immersed_rigid_body_elements.h:498

References apply_rigid_body_motion(), Geom_object_pt, oomph::GeomObject::position(), and UniformPSDSelfTest::r.

◆ position() [2/2]

void oomph::ImmersedRigidBodyElement::position ( const Vector< double > &  xi,
Vector< double > &  r 
) const
inlinevirtual

Overload the position to apply the rotation and translation.

Implements oomph::GeomObject.

Reimplemented in oomph::ImmersedRigidBodyTriangleMeshPolygon.

187  {
188  Vector<double> initial_x(2);
189  Geom_object_pt->position(xi, initial_x);
190  this->apply_rigid_body_motion(0, initial_x, r);
191  }

References apply_rigid_body_motion(), Geom_object_pt, oomph::GeomObject::position(), and UniformPSDSelfTest::r.

Referenced by dposition_dt().

◆ re()

const double& oomph::ImmersedRigidBodyElement::re ( ) const
inline

Access function for the fluid Reynolds number.

453  {
454  return *Re_pt;
455  }

References Re_pt.

Referenced by get_residuals_rigid_body_generic().

◆ re_invfr()

const double& oomph::ImmersedRigidBodyElement::re_invfr ( )
inline

Access to the fluid inverse Froude number.

478  {
479  return *ReInvFr_pt;
480  }

References ReInvFr_pt.

Referenced by get_residuals_rigid_body_generic().

◆ re_invfr_pt()

double*& oomph::ImmersedRigidBodyElement::re_invfr_pt ( )
inline

Access function for pointer to the fluid inverse Froude number (dimensionless gravitational loading)

472  {
473  return ReInvFr_pt;
474  }

References ReInvFr_pt.

◆ re_pt()

double*& oomph::ImmersedRigidBodyElement::re_pt ( )
inline

Access function for the pointer to the fluid Reynolds number.

447  {
448  return Re_pt;
449  }

References Re_pt.

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem().

◆ reset_after_external_fd()

void oomph::ImmersedRigidBodyElement::reset_after_external_fd ( )
inlinevirtual

After all external data finite-differencing, update nodal positions

Reimplemented from oomph::GeneralisedElement.

358  {
360  }
void node_update_adjacent_fluid_elements()
Definition: immersed_rigid_body_elements.h:324

References node_update_adjacent_fluid_elements().

◆ reset_after_internal_fd()

void oomph::ImmersedRigidBodyElement::reset_after_internal_fd ( )
inlinevirtual

After all internal data finite-differencing, update nodal positions

Reimplemented from oomph::GeneralisedElement.

374  {
376  }

References node_update_adjacent_fluid_elements().

◆ reset_in_external_fd()

void oomph::ImmersedRigidBodyElement::reset_in_external_fd ( const unsigned i)
inlinevirtual

Do nothing to reset within finite-differencing of external data.

Reimplemented from oomph::GeneralisedElement.

353 {}

◆ reset_in_internal_fd()

void oomph::ImmersedRigidBodyElement::reset_in_internal_fd ( const unsigned i)
inlinevirtual

Do nothing to reset within finite-differencing of internal data.

Reimplemented from oomph::GeneralisedElement.

369 {}

◆ set_drag_mesh()

void oomph::ImmersedRigidBodyElement::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 Rigid Body

Set the external drag mesh, which should consist of NavierStokesSurfaceDragTorqueElements and then read out the appropriate load and geometric data from those elements and set as external data for this element.

207  {
208  // Delete the external hijacked data
210  // Flush any existing external data
211  this->flush_external_data();
212  // Set the pointer
214 
215  // Allocate storage for all geometric data in the mesh
216  std::set<Data*> bulk_geometric_data_pt;
217  // Allocate storage for all load data in the mesh
218  std::set<std::pair<Data*, unsigned>> bulk_load_data_pt;
219 
220  // Loop over all elements in the drag mesh
221  const unsigned n_element = drag_mesh_pt->nelement();
222  for (unsigned e = 0; e < n_element; ++e)
223  {
224  // Cast the bulk element associated with each FaceElement to
225  // an FSIFluidElement
226  FSIFluidElement* bulk_elem_pt = 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",
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();
246  ++it)
247  {
248  this->add_external_data(*it);
249  }
250 
251  // Now do the same but make custom data for the load data
252  for (std::set<std::pair<Data*, unsigned>>::iterator it =
253  bulk_load_data_pt.begin();
254  it != bulk_load_data_pt.end();
255  ++it)
256  {
257  Data* temp_data_pt = new HijackedData(it->second, it->first);
259  this->add_external_data(temp_data_pt));
260  }
261  }
Mesh *const & drag_mesh_pt()
Definition: immersed_rigid_body_elements.h:400
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
void set(Container &c, Position position, const Value &value)
Definition: stdlist_overload.cpp:36

References oomph::GeneralisedElement::add_external_data(), delete_external_hijacked_data(), drag_mesh_pt(), Drag_mesh_pt, e(), oomph::Mesh::element_pt(), oomph::GeneralisedElement::flush_external_data(), oomph::FiniteElement::identify_geometric_data(), oomph::FSIFluidElement::identify_load_data(), List_of_external_hijacked_data, oomph::Mesh::nelement(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and set().

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem().

◆ set_geometric_rotation()

void oomph::ImmersedRigidBodyElement::set_geometric_rotation ( )
inline

Set the rotation of the object to be included.

156  {
158  }

References Include_geometric_rotation.

◆ st()

const double& oomph::ImmersedRigidBodyElement::st ( ) const
inline

Access function for the fluid Strouhal number.

465  {
466  return *St_pt;
467  }

References St_pt.

Referenced by get_residuals_rigid_body_generic().

◆ st_pt()

double*& oomph::ImmersedRigidBodyElement::st_pt ( )
inline

Access function for the pointer to the fluid Strouhal number.

459  {
460  return St_pt;
461  }

References St_pt.

Referenced by UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem().

◆ unpin_centre_of_mass_coordinate()

void oomph::ImmersedRigidBodyElement::unpin_centre_of_mass_coordinate ( const unsigned i)
inline

Unpin the i-th coordinate of the centre of mass.

278  {
280  }
void unpin(const unsigned &i)
Unpin the i-th stored variable.
Definition: nodes.h:391

References Centre_displacement_data_pt, i, and oomph::Data::unpin().

◆ unpin_rotation_angle()

void oomph::ImmersedRigidBodyElement::unpin_rotation_angle ( )
inline

Unpin the rotation angle.

290  {
292  }

References Centre_displacement_data_pt, and oomph::Data::unpin().

◆ unset_geometric_rotation()

void oomph::ImmersedRigidBodyElement::unset_geometric_rotation ( )
inline

Set the rotation of the object to be ignored (only really useful if you have a circular shape)

163  {
165  }

References Include_geometric_rotation.

◆ update_in_external_fd()

void oomph::ImmersedRigidBodyElement::update_in_external_fd ( const unsigned i)
inlinevirtual

After an external data change, update the nodal positions.

Reimplemented from oomph::GeneralisedElement.

348  {
350  }

References node_update_adjacent_fluid_elements().

◆ update_in_internal_fd()

void oomph::ImmersedRigidBodyElement::update_in_internal_fd ( const unsigned i)
inlinevirtual

After an internal data change, update the nodal positions.

Reimplemented from oomph::GeneralisedElement.

364  {
366  }

References node_update_adjacent_fluid_elements().

Member Data Documentation

◆ Centre_displacement_data_pt

◆ Default_Gravity_vector

Vector< double > oomph::ImmersedRigidBodyElement::Default_Gravity_vector
staticprivate

Static default value for gravity.

Static default gravity direction vector.

◆ Default_Physical_Constant_Value

double oomph::ImmersedRigidBodyElement::Default_Physical_Constant_Value = 0.0
staticprivate

Static default value for physical constants.

Static default value for physical constants Zero gives instantaneous force and torque balances — no solid intertia

◆ Default_Physical_Ratio_Value

double oomph::ImmersedRigidBodyElement::Default_Physical_Ratio_Value = 1.0
staticprivate

Static default value for physical ratios.

Static default value for physical ratio.

◆ Density_ratio_pt

double* oomph::ImmersedRigidBodyElement::Density_ratio_pt
private

Density ratio of the solid to the external fluid.

Referenced by density_ratio(), and density_ratio_pt().

◆ Displacement_data_is_internal

bool oomph::ImmersedRigidBodyElement::Displacement_data_is_internal
private

Boolean flag to indicate whether data is internal.

Referenced by centre_displacement_local_eqn(), initialise(), and ~ImmersedRigidBodyElement().

◆ Drag_mesh_pt

Mesh* oomph::ImmersedRigidBodyElement::Drag_mesh_pt
private

Mesh containing face elements that allow the computation of the drag on the body

Referenced by drag_mesh_pt(), flush_drag_mesh(), get_force_and_torque(), node_update_adjacent_fluid_elements(), and set_drag_mesh().

◆ External_force_fct_pt

ExternalForceFctPt oomph::ImmersedRigidBodyElement::External_force_fct_pt
private

Function pointer to function that specifies external force

Referenced by external_force_fct_pt(), and get_force_and_torque().

◆ External_torque_fct_pt

ExternalTorqueFctPt oomph::ImmersedRigidBodyElement::External_torque_fct_pt
private

Function pointer to function that specifies external torque

Referenced by external_torque_fct_pt(), and get_force_and_torque().

◆ G_pt

Vector<double>* oomph::ImmersedRigidBodyElement::G_pt
private

The direction of gravity.

Referenced by g(), and g_pt().

◆ Geom_object_pt

GeomObject* oomph::ImmersedRigidBodyElement::Geom_object_pt
private

Underlying geometric object.

Referenced by dposition_dt(), and position().

◆ Include_geometric_rotation

bool oomph::ImmersedRigidBodyElement::Include_geometric_rotation
private

Boolean to indicate that the rotation variable does not affect the boundary shape

Referenced by apply_rigid_body_motion(), dposition_dt(), set_geometric_rotation(), and unset_geometric_rotation().

◆ Index_for_centre_displacement

unsigned oomph::ImmersedRigidBodyElement::Index_for_centre_displacement
private

Index for the data (internal or external) that contains the centre-of-gravity displacement

Referenced by centre_displacement_local_eqn(), and initialise().

◆ Initial_centre_of_mass

◆ Initial_Phi

◆ List_of_external_hijacked_data

std::list<unsigned> oomph::ImmersedRigidBodyElement::List_of_external_hijacked_data
private

Storage for the external data that is formed from hijacked data that must be deleted by this element

Referenced by delete_external_hijacked_data(), and set_drag_mesh().

◆ Mass

◆ Moment_of_inertia

double oomph::ImmersedRigidBodyElement::Moment_of_inertia
protected

◆ Re_pt

double* oomph::ImmersedRigidBodyElement::Re_pt
private

Reynolds number of external fluid.

Referenced by re(), and re_pt().

◆ ReInvFr_pt

double* oomph::ImmersedRigidBodyElement::ReInvFr_pt
private

Reynolds number divided by Froude number of external fluid.

Referenced by re_invfr(), and re_invfr_pt().

◆ St_pt

double* oomph::ImmersedRigidBodyElement::St_pt
private

Strouhal number of external fluid.

Referenced by st(), and st_pt().


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