![]() |
|
#include <immersed_rigid_body_elements.h>
Public Member Functions | |
ImmersedRigidBodyTriangleMeshPolygon (const Vector< double > &hole_center, const Vector< TriangleMeshCurveSection * > &boundary_polyline_pt, TimeStepper *const &time_stepper_pt, Data *const ¢re_displacement_data_pt=0) | |
~ImmersedRigidBodyTriangleMeshPolygon () | |
Empty Destuctor. More... | |
void | position (const Vector< double > &xi, Vector< double > &r) const |
Overload (again) the position to apply the rotation and translation. More... | |
void | position (const unsigned &t, const Vector< double > &xi, Vector< double > &r) const |
Overload (again) the position to apply the rotation and translation. More... | |
void | reset_reference_configuration () |
![]() | |
TriangleMeshPolygon (const Vector< TriangleMeshCurveSection * > &boundary_polyline_pt, const Vector< double > &internal_point_pt=Vector< double >(0), const bool &is_internal_point_fixed=false) | |
virtual | ~TriangleMeshPolygon () |
Empty virtual destructor. More... | |
unsigned | ncurve_section () const |
Number of constituent curves. More... | |
unsigned | npolyline () const |
Number of constituent polylines. More... | |
TriangleMeshPolyLine * | polyline_pt (const unsigned &i) const |
Pointer to i-th constituent polyline. More... | |
TriangleMeshPolyLine * | polyline_pt (const unsigned &i) |
Pointer to i-th constituent polyline. More... | |
Vector< unsigned > | polygon_boundary_id () |
Return vector of boundary ids of associated polylines. More... | |
bool | is_redistribution_of_segments_between_polylines_enabled () |
void | enable_redistribution_of_segments_between_polylines () |
void | disable_redistribution_of_segments_between_polylines () |
bool | can_update_reference_configuration () const |
Test whether curve can update reference. More... | |
bool | is_fixed () const |
Test whether the polygon is fixed or not. More... | |
void | set_fixed () |
Set the polygon to be fixed. More... | |
void | set_unfixed () |
Set the polygon to be allowed to move (default) More... | |
![]() | |
TriangleMeshClosedCurve (const Vector< TriangleMeshCurveSection * > &curve_section_pt, const Vector< double > &internal_point_pt=Vector< double >(0), const bool &is_internal_point_fixed=false) | |
Constructor prototype. More... | |
virtual | ~TriangleMeshClosedCurve () |
Empty destructor. More... | |
unsigned | nvertices () const |
Number of vertices. More... | |
unsigned | nsegments () const |
Total number of segments. More... | |
void | output (std::ostream &outfile, const unsigned &n_sample=50) |
Output each sub-boundary at n_sample (default: 50) points. More... | |
Vector< double > | internal_point () const |
Coordinates of the internal point. More... | |
Vector< double > & | internal_point () |
Coordinates of the internal point. More... | |
void | fix_internal_point () |
void | unfix_internal_point () |
bool | is_internal_point_fixed () const |
Test whether the internal point is fixed. More... | |
![]() | |
TriangleMeshCurve (const Vector< TriangleMeshCurveSection * > &curve_section_pt) | |
Empty constructor. More... | |
virtual | ~TriangleMeshCurve () |
Empty destructor. More... | |
unsigned | max_boundary_id () |
Return max boundary id of associated curves. More... | |
void | enable_polyline_refinement (const double &tolerance=0.08) |
void | set_polyline_refinement_tolerance (const double &tolerance) |
double | polyline_refinement_tolerance () |
void | disable_polyline_refinement () |
Disable refinement of polylines. More... | |
void | enable_polyline_unrefinement (const double &tolerance=0.04) |
void | set_polyline_unrefinement_tolerance (const double &tolerance) |
double | polyline_unrefinement_tolerance () |
void | disable_polyline_unrefinement () |
Disable unrefinement of polylines. More... | |
virtual TriangleMeshCurveSection * | curve_section_pt (const unsigned &i) const |
Pointer to i-th constituent curve section. More... | |
virtual TriangleMeshCurveSection *& | curve_section_pt (const unsigned &i) |
Pointer to i-th constituent curve section. More... | |
![]() | |
ImmersedRigidBodyElement (GeomObject *const &geom_object_pt, TimeStepper *const &time_stepper_pt, Data *const ¢re_displacement_data_pt=0) | |
void | set_geometric_rotation () |
Set the rotation of the object to be included. More... | |
void | unset_geometric_rotation () |
double & | initial_phi () |
Access function for the initial angle. More... | |
double & | initial_centre_of_mass (const unsigned &i) |
Access function for the initial centre of mass. More... | |
const double & | initial_centre_of_mass (const unsigned &i) const |
Access function for the initial centre of mass (const version) 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... | |
double & | mass_shape () |
double & | moment_of_inertia_shape () |
Access to dimensionless polar "moment of inertia" shape parameter. More... | |
Data *& | centre_displacement_data_pt () |
double & | centre_x_displacement () |
x-displacement of centre of mass More... | |
double & | centre_y_displacement () |
y-displacement of centre of mass More... | |
double & | centre_rotation_angle () |
rotation of centre of mass More... | |
Vector< double > | centre_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) |
ExternalForceFctPt & | external_force_fct_pt () |
ExternalTorqueFctPt & | external_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... | |
Data * | geom_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 double & | re () const |
Access function for the fluid Reynolds number. More... | |
double *& | st_pt () |
Access function for the pointer to the fluid Strouhal number. More... | |
const double & | st () const |
Access function for the fluid Strouhal number. More... | |
double *& | re_invfr_pt () |
const double & | re_invfr () |
Access to the fluid inverse Froude number. More... | |
double *& | density_ratio_pt () |
Access function for the pointer to the density ratio. More... | |
const double & | density_ratio () const |
Access function for the the density ratio. More... | |
![]() | |
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 ¤t_string) const |
virtual void | describe_local_dofs (std::ostream &out, const std::string ¤t_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 ¶meter_pt, Vector< double > &dres_dparam) |
virtual void | get_djacobian_dparameter (double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam) |
virtual void | get_djacobian_and_dmass_matrix_dparameter (double *const ¶meter_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 |
![]() | |
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 () |
TimeStepper * | time_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 |
Private Member Functions | |
void | get_initial_position (const Vector< double > &xi, Vector< double > &r) const |
Get the initial position of the polygon. More... | |
void | assign_zeta () |
Private Attributes | |
Vector< Vector< double > > | Zeta_vertex |
Vector of intrisic coordinate values at the nodes. More... | |
Class upgrading a TriangleMeshPolygon to a "hole" for use during triangle mesh generation. For mesh generation purposes, the main (and only) addition to the base class is the provision of the coordinates of a hole inside the polygon. To faciliate the movement of the "hole" through the domain we also provide a Data object whose three values represent the x and y displacements of its centre of gravity and the polygon's rotation about its centre of gravity. If added to a mesh in the Problem (in its incarnation as a GeneralisedElement) the displacement/rotation of the polygon 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 polygon (typically Navier-Stokes FaceElements that apply a viscous drag to an immersed body, represented by the polygon.)
oomph::ImmersedRigidBodyTriangleMeshPolygon::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 TriangleMeshPolyLines that define the boundary segments of the polygon. Each TriangleMeshPolyLine has its own boundary ID and can contain multiple (straight-line) segments. The optional final argument is a pointer to a Data object whose three values represent the two displacements of and the rotation angle about the polygon's centre of mass.
References assign_zeta(), oomph::TriangleMeshPolygon::Can_update_configuration, i, oomph::ImmersedRigidBodyElement::Initial_centre_of_mass, oomph::ImmersedRigidBodyElement::Initial_Phi, j, oomph::ImmersedRigidBodyElement::Mass, oomph::ImmersedRigidBodyElement::Moment_of_inertia, oomph::TriangleMeshPolygon::polyline_pt(), and oomph::TriangleMeshPolyLine::vertex_coordinate().
|
inline |
|
inlineprivate |
Helper function to assign the values of the (scaled) arc-length to each node of each polyline. The direction will be the natural order of the vertices within the polyline.
References oomph::TriangleMeshPolygon::npolyline(), oomph::TriangleMeshPolyLine::nvertex(), p, oomph::TriangleMeshPolygon::polyline_pt(), Eigen::bfloat16_impl::pow(), sqrt(), v, oomph::TriangleMeshPolyLine::vertex_coordinate(), and Zeta_vertex.
Referenced by ImmersedRigidBodyTriangleMeshPolygon().
|
inlineprivate |
Get the initial position of the polygon.
References Eigen::bfloat16_impl::floor(), i, Eigen::placeholders::last, oomph::TriangleMeshPolygon::npolyline(), oomph::TriangleMeshPolyLine::nvertex(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, p, oomph::TriangleMeshPolygon::polyline_pt(), UniformPSDSelfTest::r, v, oomph::TriangleMeshPolyLine::vertex_coordinate(), and Zeta_vertex.
Referenced by position().
|
inlinevirtual |
Overload (again) the position to apply the rotation and translation.
Reimplemented from oomph::ImmersedRigidBodyElement.
References oomph::ImmersedRigidBodyElement::apply_rigid_body_motion(), get_initial_position(), and UniformPSDSelfTest::r.
|
inlinevirtual |
Overload (again) the position to apply the rotation and translation.
Reimplemented from oomph::ImmersedRigidBodyElement.
References oomph::ImmersedRigidBodyElement::apply_rigid_body_motion(), get_initial_position(), and UniformPSDSelfTest::r.
|
virtual |
Update the reference configuration by re-setting the original position of the vertices to their current ones, re-set the original position of the centre of mass, and the displacements and rotations relative to it
Reimplemented from oomph::TriangleMeshPolygon.
References oomph::ImmersedRigidBodyElement::apply_rigid_body_motion(), oomph::ImmersedRigidBodyElement::Centre_displacement_data_pt, i, oomph::ImmersedRigidBodyElement::Initial_centre_of_mass, oomph::ImmersedRigidBodyElement::Initial_Phi, oomph::TriangleMeshClosedCurve::internal_point(), j, oomph::TriangleMeshPolygon::ncurve_section(), oomph::TimeStepper::nprev_values(), oomph::TriangleMeshPolyLine::nvertex(), oomph::TriangleMeshPolygon::polyline_pt(), UniformPSDSelfTest::r, oomph::Data::set_value(), plotPSD::t, oomph::Data::time_stepper_pt(), oomph::Data::value(), and oomph::TriangleMeshPolyLine::vertex_coordinate().
Vector of intrisic coordinate values at the nodes.
Referenced by assign_zeta(), and get_initial_position().