68 double phi_orig = atan2(Y, X);
69 double r_orig = sqrt(X * X + Y * Y);
98 std::ostringstream 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";
105 "GeomObject::dposition_dt()",
106 OOMPH_EXCEPTION_LOCATION);
108 unsigned n = drdt.size();
109 for (
unsigned i = 0;
i < n;
i++)
144 <<
" " << veloc[0] <<
" " << veloc[1] <<
" " << veloc[2] <<
" "
145 << accel[0] <<
" " << accel[1] <<
" " << accel[2] << std::endl;
189 for (
unsigned e = 0;
e < nel;
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];
216 std::set<Data*> bulk_geometric_data_pt;
218 std::set<std::pair<Data*, unsigned>> bulk_load_data_pt;
222 for (
unsigned e = 0;
e < n_element; ++
e)
228 ->bulk_element_pt());
230 if (bulk_elem_pt == 0)
232 throw OomphLibError(
"Drag mesh must consist of FSIFluidElements\n",
233 OOMPH_CURRENT_FUNCTION,
234 OOMPH_EXCEPTION_LOCATION);
244 for (std::set<Data*>::iterator it = bulk_geometric_data_pt.begin();
245 it != bulk_geometric_data_pt.end();
252 for (std::set<std::pair<Data*, unsigned>>::iterator it =
253 bulk_load_data_pt.begin();
254 it != bulk_load_data_pt.end();
310 double time = timestepper_pt->
time();
319 double external_torque;
324 const double Lambda_sq =
338 residuals[local_eqn] = Lambda_sq *
Mass * accel[0] - external_force[0] -
339 Mass * scaled_re_inv_fr * G[0];
344 jacobian(local_eqn, local_eqn) =
345 Lambda_sq *
Mass * timestepper_pt->
weight(2, 0);
352 residuals[local_eqn] = Lambda_sq *
Mass * accel[1] - external_force[1] -
353 Mass * scaled_re_inv_fr * G[1];
357 jacobian(local_eqn, local_eqn) =
358 Lambda_sq *
Mass * timestepper_pt->
weight(2, 0);
365 residuals[local_eqn] =
370 jacobian(local_eqn, local_eqn) =
391 Data*
const& centre_displacement_data_pt)
410 double inertia_x = 0.0;
411 double inertia_y = 0.0;
414 unsigned nboundary = boundary_polyline_pt.size();
415 for (
unsigned i = 0;
i < nboundary;
i++)
418 unsigned nseg = boundary_polyline_pt[
i]->nsegment();
419 for (
unsigned j = 0; j < nseg; j++)
426 Mass += 0.5 * (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
430 (r_left[0] + r_right[0]) *
431 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
433 (r_left[1] + r_right[1]) *
434 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
443 Mass += 0.5 * (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
447 (r_left[0] + r_right[0]) *
448 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
450 (r_left[1] + r_right[1]) *
451 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
460 for (
unsigned i = 0;
i < nboundary;
i++)
463 unsigned nseg = boundary_polyline_pt[
i]->nsegment();
464 for (
unsigned j = 0; j < nseg; j++)
477 inertia_x += 1.0 / 12.0 *
478 (r_left[1] * r_left[1] + r_left[1] * r_right[1] +
479 r_right[1] * r_right[1]) *
480 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
482 inertia_y += 1.0 / 12.0 *
483 (r_left[0] * r_left[0] + r_left[0] * r_right[0] +
484 r_right[0] * r_right[0]) *
485 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
501 inertia_x += 1.0 / 12.0 *
502 (r_left[1] * r_left[1] + r_left[1] * r_right[1] +
503 r_right[1] * r_right[1]) *
504 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
506 inertia_y += 1.0 / 12.0 *
507 (r_left[0] * r_left[0] + r_left[0] * r_right[0] +
508 r_right[0] * r_right[0]) *
509 (r_left[0] * r_right[1] - r_right[0] * r_left[1]);
556 for (
unsigned i = 0;
i < npoly;
i++)
559 unsigned nvertex = poly_line_pt->
nvertex();
560 for (
unsigned j = 0; j < nvertex; j++)
585 for (
unsigned t = 0;
t < nprev;
t++)
A class that represents a collection of data; each Data object may contain many different individual ...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
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 ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
/////////////////////////////////////////////////////////////////////////
virtual void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)=0
Add to the set paired_load_data pairs containing.
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
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....
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 ...
void flush_external_data()
Flush all external data.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Custom Data class that is used when HijackingData. The class always contains a single value that is c...
Class that solves the equations of motion for a general two-dimensional rigid body subject to a parti...
const Vector< double > & g() const
Access function for gravity.
bool Include_geometric_rotation
Boolean to indicate that the rotation variable does not affect the boundary shape.
void position(const Vector< double > &xi, Vector< double > &r) const
Overload the position to apply the rotation and translation.
static double Default_Physical_Constant_Value
Static default value for physical constants.
void initialise(TimeStepper *const &time_stepper_pt)
Initialisation function.
void dposition_dt(const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
Work out the position derivative, including rigid body motion.
ExternalTorqueFctPt External_torque_fct_pt
Function pointer to function that specifies external torque.
void delete_external_hijacked_data()
Delete the storage for the external data formed from hijacked data.
double Initial_Phi
Original rotation angle.
bool Displacement_data_is_internal
Boolean flag to indicate whether data is internal.
void get_residuals_rigid_body_generic(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &flag)
Get residuals and/or Jacobian.
void output_centre_of_gravity(std::ostream &outfile)
Output position velocity and acceleration of centre of gravity.
const double & st() const
Access function for the fluid Strouhal number.
Data * Centre_displacement_data_pt
Data for centre of gravity displacement. Values: 0: x-displ; 1: y-displ; 2: rotation angle.
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.
GeomObject * Geom_object_pt
Underlying geometric object.
ExternalForceFctPt External_force_fct_pt
Function pointer to function that specifies external force.
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...
const double & re() const
Access function for the fluid Reynolds number.
double Moment_of_inertia
Polar moment of inertia of body.
Mesh *const & drag_mesh_pt()
Access fct to mesh containing face elements that allow the computation of the drag on the body.
const double & re_invfr()
Access to the fluid inverse Froude number.
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...
Mesh * Drag_mesh_pt
Mesh containing face elements that allow the computation of the drag on the body.
void get_force_and_torque(const double &time, Vector< double > &force, double &torque)
Get force and torque from specified fct pointers and drag mesh.
const double & density_ratio() const
Access function for the the density ratio.
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...
static double Default_Physical_Ratio_Value
Static default value for physical ratios.
Vector< double > Initial_centre_of_mass
X-coordinate of initial centre of gravity.
std::list< unsigned > List_of_external_hijacked_data
Storage for the external data that is formed from hijacked data that must be deleted by this element.
void assign_zeta()
Helper function to assign the values of the (scaled) arc-length to each node of each polyline....
ImmersedRigidBodyTriangleMeshPolygon(const Vector< double > &hole_center, const Vector< TriangleMeshCurveSection * > &boundary_polyline_pt, TimeStepper *const &time_stepper_pt, Data *const ¢re_displacement_data_pt=0)
Constructor: Specify coordinates of a point inside the hole and a vector of pointers to TriangleMeshP...
void reset_reference_configuration()
Update the reference configuration by re-setting the original position of the vertices to their curre...
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned long nelement() const
Return number of elements in the mesh.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
////////////////////////////////////////////////////////////////////// //////////////////////////////...
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
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[].
double & time()
Return current value of continous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Vector< double > internal_point() const
Coordinates of the internal point.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Class defining a polyline for use in Triangle Mesh generation.
unsigned nvertex() const
Number of vertices.
Vector< double > vertex_coordinate(const unsigned &i) const
Coordinate vector of i-th vertex (const version)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
TriangleMeshPolyLine * polyline_pt(const unsigned &i) const
Pointer to i-th constituent polyline.
unsigned ncurve_section() const
Number of constituent curves.
bool Can_update_configuration
Boolean flag to indicate whether the polygon can update its own reference configuration after it has ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...