Public Member Functions | Private Member Functions | Private Attributes | List of all members
oomph::ImmersedRigidBodyTriangleMeshPolygon Class Reference

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.) More...

#include <immersed_rigid_body_elements.h>

+ Inheritance diagram for oomph::ImmersedRigidBodyTriangleMeshPolygon:

Public Member Functions

 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. More...
 
 ~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 ()
 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. More...
 
- Public Member Functions inherited from oomph::TriangleMeshPolygon
 TriangleMeshPolygon (const Vector< TriangleMeshCurveSection * > &boundary_polyline_pt, const Vector< double > &internal_point_pt=Vector< double >(0), const bool &is_internal_point_fixed=false)
 Constructor: Specify vector of pointers to TriangleMeshCurveSection that define the boundary of the segments of the polygon. Each TriangleMeshCurveSection has its own boundary ID and can contain multiple (straight-line) segments. For consistency across the various uses of this class, we insist that the closed boundary is represented by at least two separate TriangleMeshCurveSection whose joint vertices must be specified in both. (This is to allow the setup of unique boundary coordinate(s) around the polygon.) This may seem slightly annoying in cases where a polygon really only represents a single boundary, but... Note: The specified vector of pointers must consist of only TriangleMeshPolyLine elements. There is a checking on the PARANOID mode for this constraint. More...
 
virtual ~TriangleMeshPolygon ()
 Empty virtual destructor. More...
 
unsigned ncurve_section () const
 Number of constituent curves. More...
 
unsigned npolyline () const
 Number of constituent polylines. More...
 
TriangleMeshPolyLinepolyline_pt (const unsigned &i) const
 Pointer to i-th constituent polyline. More...
 
TriangleMeshPolyLinepolyline_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 ()
 Is re-distribution of polyline segments in the curve between different boundaries during adaptation enabled? More...
 
void enable_redistribution_of_segments_between_polylines ()
 Enable re-distribution of polyline segments in the curve between different boundaries during adaptation. More...
 
void disable_redistribution_of_segments_between_polylines ()
 Disable re-distribution of polyline segments in the curve between different boundaries during adaptation. More...
 
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...
 
- Public Member Functions inherited from oomph::TriangleMeshClosedCurve
 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 ()
 Fix the internal point (i.e. do not allow our automatic machinery to update it) More...
 
void unfix_internal_point ()
 Unfix the internal point (i.e. allow our automatic machinery to update it) More...
 
bool is_internal_point_fixed () const
 Test whether the internal point is fixed. More...
 
- Public Member Functions inherited from oomph::TriangleMeshCurve
 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)
 Enable refinement of polylines to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the optional argument which specifies the refinement tolerance. It defaults to 0.08 and the smaller the number the finer the surface representation. More...
 
void set_polyline_refinement_tolerance (const double &tolerance)
 Set tolerance for refinement of polylines to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the refinement tolerance. (The smaller the number the finer the surface representation). If set to a negative value, we're switching off refinement – equivalent to calling disable_polyline_refinement() More...
 
double polyline_refinement_tolerance ()
 Get tolerance for refinement of polylines to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation. If it's negative refinement is disabled. More...
 
void disable_polyline_refinement ()
 Disable refinement of polylines. More...
 
void enable_polyline_unrefinement (const double &tolerance=0.04)
 Enable unrefinement of polylines to avoid unnecessarily large numbers of elements on of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the optional argument which specifies the unrefinement tolerance. It defaults to 0.04 and the larger the number the more agressive we are when removing unnecessary vertices on gently curved polylines. More...
 
void set_polyline_unrefinement_tolerance (const double &tolerance)
 Set tolerance for unrefinement of polylines to avoid unnecessarily large numbers of elements on of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the optional argument which specifies the unrefinement tolerance. It defaults to 0.04 and the larger the number the more agressive we are when removing unnecessary vertices on gently curved polylines. If set to a negative value, we're switching off unrefinement – equivalent to calling disable_polyline_unrefinement() More...
 
double polyline_unrefinement_tolerance ()
 Get tolerance for unrefinement of polylines to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation. If it's negative unrefinement is disabled. More...
 
void disable_polyline_unrefinement ()
 Disable unrefinement of polylines. More...
 
virtual TriangleMeshCurveSectioncurve_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...
 
- Public Member Functions inherited from oomph::ImmersedRigidBodyElement
 ImmersedRigidBodyElement (GeomObject *const &geom_object_pt, TimeStepper *const &time_stepper_pt, Data *const &centre_displacement_data_pt=0)
 Constructor that takes an underlying geometric object: and timestepper. More...
 
void set_geometric_rotation ()
 Set the rotation of the object to be included. More...
 
void unset_geometric_rotation ()
 Set the rotation of the object to be ignored (only really useful if you have a circular shape) More...
 
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 ()
 Access to dimensionless "mass" shape parameter that must be set by hand for non polygonal shapes. More...
 
double & moment_of_inertia_shape ()
 Access to dimensionless polar "moment of inertia" shape parameter. More...
 
Data *& centre_displacement_data_pt ()
 Pointer to Data for centre of gravity displacement. Values: 0: x-displ; 1: y-displ; 2: rotation angle. More...
 
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 ()
 Update the positions of the nodes in fluid elements adjacent to the rigid body, defined as being elements in the drag mesh. More...
 
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 ()
 After all external data finite-differencing, update nodal positions. More...
 
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 ()
 After all internal data finite-differencing, update nodal positions. More...
 
void get_force_and_torque (const double &time, Vector< double > &force, double &torque)
 Get force and torque from specified fct pointers and drag mesh. More...
 
ExternalForceFctPtexternal_force_fct_pt ()
 Access to function pointer to function that specifies external force. More...
 
ExternalTorqueFctPtexternal_torque_fct_pt ()
 Access to function pointer to function that specifies external torque. More...
 
Mesh *const & drag_mesh_pt ()
 Access fct to mesh containing face elements that allow the computation of the drag on the body. More...
 
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 Rigid Body. More...
 
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)
 Return pointer to the j-th (only) Data item that the object's shape depends on. More...
 
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 ()
 Access function for pointer to the fluid inverse Froude number (dimensionless gravitational loading) More...
 
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...
 
- Public Member Functions inherited from oomph::GeneralisedElement
GeneralisedElement() GeneralisedElement (const GeneralisedElement &)=delete
 Constructor: Initialise all pointers and all values to zero. 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
 Return the global equation number corresponding to the ieqn_local-th local equation number. More...
 
int local_eqn_number (const unsigned long &ieqn_global) const
 Return the local equation number corresponding to the ieqn_global-th global equation number. Returns minus one (-1) if there is no local degree of freedom corresponding to the chosen global equation number. More...
 
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.e. the index required to obtain it from the access function external_data_pt(...). The optional boolean flag indicates whether the data should be included in the general finite-difference loop when calculating the jacobian. The default value is true, i.e. the data will be included in the finite-differencing. More...
 
bool external_data_fd (const unsigned &i) const
 Return the status of the boolean flag indicating whether the external data is included in the finite difference loop. More...
 
void exclude_external_data_fd (const unsigned &i)
 Set the boolean flag to exclude the external datum from the the finite difference loop when computing the jacobian matrix. More...
 
void include_external_data_fd (const unsigned &i)
 Set the boolean flag to include the external datum in the the finite difference loop when computing the jacobian matrix. More...
 
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)
 Set the timestepper associated with the i-th internal data object. More...
 
void assign_internal_eqn_numbers (unsigned long &global_number, Vector< double * > &Dof_pt)
 Assign the global equation numbers to the internal Data. The arguments are the current highest global equation number (which will be incremented) and a Vector of pointers to the global variables (to which any unpinned values in the internal Data are added). More...
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 Function to describe the dofs of the element. The ostream specifies the output stream to which the description is written; the string stores the currently assembled output that is ultimately written to the output stream by Data::describe_dofs(...); it is typically built up incrementally as we descend through the call hierarchy of this function when called from Problem::describe_dofs(...) More...
 
virtual void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 Function to describe the local dofs of the element. The ostream specifies the output stream to which the description is written; the string stores the currently assembled output that is ultimately written to the output stream by Data::describe_dofs(...); it is typically built up incrementally as we descend through the call hierarchy of this function when called from Problem::describe_dofs(...) More...
 
void add_internal_value_pt_to_map (std::map< unsigned, double * > &map_of_value_pt)
 Add pointers to the internal data values to map indexed by the global equation number. More...
 
void add_internal_data_values_to_vector (Vector< double > &vector_of_values)
 Add all internal data and time history values to the vector in the internal storage order. More...
 
void read_internal_data_values_from_vector (const Vector< double > &vector_of_values, unsigned &index)
 Read all internal data and time history values from the vector starting from index. On return the index will be set to the value at the end of the data that has been read in. More...
 
void add_internal_eqn_numbers_to_vector (Vector< long > &vector_of_eqn_numbers)
 Add all equation numbers associated with internal data to the vector in the internal storage order. More...
 
void read_internal_eqn_numbers_from_vector (const Vector< long > &vector_of_eqn_numbers, unsigned &index)
 Read all equation numbers associated with internal data from the vector starting from index. On return the index will be set to the value at the end of the data that has been read in. More...
 
virtual void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 Setup the arrays of local equation numbers for the element. If the optional boolean argument is true, then pointers to the associated degrees of freedom are stored locally in the array Dof_pt. More...
 
virtual void complete_setup_of_dependencies ()
 Complete the setup of any additional dependencies that the element may have. Empty virtual function that may be overloaded for specific derived elements. Used, e.g., for elements with algebraic node update functions to determine the "geometric Data", i.e. the Data that affects the element's shape. This function is called (for all elements) at the very beginning of the equation numbering procedure to ensure that all dependencies are accounted for. More...
 
virtual void get_residuals (Vector< double > &residuals)
 Calculate the vector of residuals of the equations in the element. By default initialise the vector to zero and then call the fill_in_contribution_to_residuals() function. Note that this entire function can be overloaded if desired. More...
 
virtual void get_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Calculate the elemental Jacobian matrix "d equation / d variable". More...
 
virtual void get_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 Calculate the residuals and the elemental "mass" matrix, the matrix that multiplies the time derivative terms in a problem. More...
 
virtual void get_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 Calculate the residuals and jacobian and elemental "mass" matrix, the matrix that multiplies the time derivative terms. More...
 
virtual void get_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 Calculate the derivatives of the residuals with respect to a parameter. More...
 
virtual void get_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 Calculate the derivatives of the elemental Jacobian matrix and residuals with respect to a parameter. More...
 
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)
 Calculate the derivatives of the elemental Jacobian matrix mass matrix and residuals with respect to a parameter. More...
 
virtual void get_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 Calculate the product of the Hessian (derivative of Jacobian with respect to all variables) an eigenvector, Y, and other specified vectors, C (d(J_{ij})/d u_{k}) Y_{j} C_{k}. More...
 
virtual void get_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 Return the vector of inner product of the given pairs of history values. More...
 
virtual void get_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 Compute the vectors that when taken as a dot product with other history values give the inner product over the element. More...
 
virtual unsigned self_test ()
 Self-test: Have all internal values been classified as pinned/unpinned? Return 0 if OK. More...
 
virtual void compute_norm (Vector< double > &norm)
 Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever norm is desired for the specific element. More...
 
virtual void compute_norm (double &norm)
 Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever norm is desired for the specific element. More...
 
void set_halo (const unsigned &non_halo_proc_ID)
 Label the element as halo and specify processor that holds non-halo counterpart. More...
 
void set_nonhalo ()
 Label the element as not being a halo. More...
 
bool is_halo () const
 Is this element a halo? More...
 
int non_halo_proc_ID ()
 ID of processor ID that holds non-halo counterpart of halo element; negative if not a halo. More...
 
void set_must_be_kept_as_halo ()
 Insist that this element be kept as a halo element during a distribute? More...
 
void unset_must_be_kept_as_halo ()
 Do not insist that this element be kept as a halo element during distribution. More...
 
bool must_be_kept_as_halo () const
 Test whether the element must be kept as a halo element. More...
 
virtual unsigned ndof_types () const
 The number of types of degrees of freedom in this element are sub-divided into. More...
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 Create a list of pairs for the unknowns that this element is "in charge of" – ignore any unknowns associated with external Data. The first entry in each pair must contain the global equation number of the unknown, while the second one contains the number of the DOF type that this unknown is associated with. (The function can obviously only be called if the equation numbering scheme has been set up.) More...
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 Constructor: Pass dimension of geometric object (# of Eulerian coords = # of Lagrangian coords; no time history available/needed) More...
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 Constructor: pass # of Eulerian and Lagrangian coordinates. No time history available/needed. More...
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 Constructor: pass # of Eulerian and Lagrangian coordinates and pointer to time-stepper which is used to handle the position at previous timesteps and allows the evaluation of veloc/acceleration etc. in cases where the GeomData varies with time. More...
 
 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 ()
 Access function for pointer to time stepper: Null if object is not time-dependent. More...
 
TimeSteppertime_stepper_pt () const
 Access function for pointer to time stepper: Null if object is not time-dependent. Const version. More...
 
virtual void position (const double &t, const Vector< double > &zeta, Vector< double > &r) const
 Parametrised position on object: r(zeta). Evaluated at the continuous time value, t. More...
 
virtual void dposition (const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
 Derivative of position Vector w.r.t. to coordinates: $ \frac{dR_i}{d \zeta_\alpha}$ = drdzeta(alpha,i). Evaluated at current time. More...
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 2nd derivative of position Vector w.r.t. to coordinates: $ \frac{d^2R_i}{d \zeta_\alpha d \zeta_\beta}$ = ddrdzeta(alpha,beta,i). Evaluated at current time. More...
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 Posn Vector and its 1st & 2nd derivatives w.r.t. to coordinates: $ \frac{dR_i}{d \zeta_\alpha}$ = drdzeta(alpha,i). $ \frac{d^2R_i}{d \zeta_\alpha d \zeta_\beta}$ = ddrdzeta(alpha,beta,i). Evaluated at current time. More...
 
virtual void locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 A geometric object may be composed of may sub-objects (e.g. a finite-element representation of a boundary). In order to implement sparse update functions, it is necessary to know the sub-object and local coordinate within that sub-object at a given intrinsic coordinate, zeta. Note that only one sub-object can "cover" any given intrinsic position. If the position is at an "interface" between sub-objects, either one can be returned. The default implementation merely returns, the pointer to the "entire" GeomObject and the coordinate, zeta The optional boolean flag only applies if a Newton method is used to find the value of zeta, and if true the value of the coordinate s is used as the initial guess for the method. If the flag is false (the default) a value of s=0 is used as the initial guess. More...
 
virtual void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 A geometric object may be composed of many sub-objects each with their own local coordinate. This function returns the "global" intrinsic coordinate zeta (within the compound object), at a given local coordinate s (i.e. the intrinsic coordinate of the sub-GeomObject. In simple (non-compound) GeomObjects, the local intrinsic coordinate is the global intrinsic coordinate and so the function merely returns s. To make it less likely that the default implementation is called in error (because it is not overloaded in a derived GeomObject where the default is not appropriate, we do at least check that s and zeta have the same size if called in PARANOID mode. More...
 

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 ()
 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. More...
 

Private Attributes

Vector< Vector< double > > Zeta_vertex
 Vector of intrisic coordinate values at the nodes. More...
 

Additional Inherited Members

- Public Types inherited from oomph::ImmersedRigidBodyElement
typedef void(* ExternalForceFctPt) (const double &time, Vector< double > &external_force)
 Function pointer to function that specifies external force. More...
 
typedef void(* ExternalTorqueFctPt) (const double &time, double &external_torque)
 Function pointer to function that specifies external torque. More...
 
- Static Public Attributes inherited from oomph::GeneralisedElement
static bool Suppress_warning_about_repeated_internal_data
 Static boolean to suppress warnings about repeated internal data. Defaults to false. More...
 
static bool Suppress_warning_about_repeated_external_data = true
 Static boolean to suppress warnings about repeated external data. Defaults to true. More...
 
static double Default_fd_jacobian_step = 1.0e-8
 Double used for the default finite difference step in elemental jacobian calculations. More...
 
- Protected Member Functions inherited from oomph::ImmersedRigidBodyElement
 ImmersedRigidBodyElement (TimeStepper *const &time_stepper_pt, Data *const &centre_displacement_data_pt=0)
 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. More...
 
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 about the centre of mass. More...
 
- Protected Member Functions inherited from oomph::GeneralisedElement
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 from the access function internal_data_pt(). The boolean indicates whether the datum should be included in the general finite-difference loop when calculating the jacobian. The default value is true, i.e. the data will be included in the finite differencing. More...
 
bool internal_data_fd (const unsigned &i) const
 Return the status of the boolean flag indicating whether the internal data is included in the finite difference loop. More...
 
void exclude_internal_data_fd (const unsigned &i)
 Set the boolean flag to exclude the internal datum from the finite difference loop when computing the jacobian matrix. More...
 
void include_internal_data_fd (const unsigned &i)
 Set the boolean flag to include the internal datum in the finite difference loop when computing the jacobian matrix. More...
 
void clear_global_eqn_numbers ()
 Clear the storage for the global equation numbers and pointers to dofs (if stored) More...
 
void add_global_eqn_numbers (std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
 Add the contents of the queue global_eqn_numbers to the local storage for the local-to-global translation scheme. It is essential that the entries in the queue are added IN ORDER i.e. from the front. More...
 
virtual void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 Assign the local equation numbers for the internal and external Data This must be called after the global equation numbers have all been assigned. It is virtual so that it can be overloaded by ElementWithExternalElements so that any external data from the external elements in included in the numbering scheme. If the boolean argument is true then pointers to the dofs will be stored in Dof_pt. More...
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 Assign all the local equation numbering schemes that can be applied generically for the element. In most cases, this is the function that will be overloaded by inherited classes. It is required to ensure that assign_additional_local_eqn_numbers() can always be called after ALL other local equation numbering has been performed. The default for the GeneralisedElement is simply to call internal and external local equation numbering. If the boolean argument is true then pointers to the dofs will be stored in Dof_pt. More...
 
virtual void assign_additional_local_eqn_numbers ()
 Setup any additional look-up schemes for local equation numbers. Examples of use include using local storage to refer to explicit degrees of freedom. The additional memory cost of such storage may or may not be offset by fast local access. More...
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 Return the local equation number corresponding to the j-th value stored at the i-th internal data. More...
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 Return the local equation number corresponding to the j-th value stored at the i-th external data. More...
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 Calculate the contributions to the jacobian from the internal degrees of freedom using finite differences. This version of the function assumes that the residuals vector has already been calculated. If the boolean argument is true, the finite differencing will be performed for all internal data, irrespective of the information in Data_fd. The default value (false) uses the information in Data_fd to selectively difference only certain data. More...
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 Calculate the contributions to the jacobian from the internal degrees of freedom using finite differences. This version computes the residuals vector before calculating the jacobian terms. If the boolean argument is true, the finite differencing will be performed for all internal data, irrespective of the information in Data_fd. The default value (false) uses the information in Data_fd to selectively difference only certain data. More...
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 Calculate the contributions to the jacobian from the external degrees of freedom using finite differences. This version of the function assumes that the residuals vector has already been calculated. If the boolean argument is true, the finite differencing will be performed for all external data, irrespective of the information in Data_fd. The default value (false) uses the information in Data_fd to selectively difference only certain data. More...
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 Calculate the contributions to the jacobian from the external degrees of freedom using finite differences. This version computes the residuals vector before calculating the jacobian terms. If the boolean argument is true, the finite differencing will be performed for all internal data, irrespective of the information in Data_fd. The default value (false) uses the information in Data_fd to selectively difference only certain data. More...
 
virtual void update_before_internal_fd ()
 Function that is called before the finite differencing of any internal data. This may be overloaded to update any dependent data before finite differencing takes place. More...
 
virtual void update_before_external_fd ()
 Function that is called before the finite differencing of any external data. This may be overloaded to update any dependent data before finite differencing takes place. More...
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 Add the elemental contribution to the mass matrix matrix. and the residuals vector. Note that this function should NOT initialise the residuals vector or the mass matrix. It must be called after the residuals vector and jacobian matrix have been initialised to zero. The default is deliberately broken. More...
 
virtual void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 Add the elemental contribution to the jacobian matrix, mass matrix and the residuals vector. Note that this function should NOT initialise any entries. It must be called after the residuals vector and matrices have been initialised to zero. More...
 
virtual void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 Add the elemental contribution to the derivatives of the residuals with respect to a parameter. This function should NOT initialise any entries and must be called after the entries have been initialised to zero The default implementation is to use finite differences to calculate the derivatives. More...
 
virtual void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 Add the elemental contribution to the derivatives of the elemental Jacobian matrix and residuals with respect to a parameter. This function should NOT initialise any entries and must be called after the entries have been initialised to zero The default implementation is to use finite differences to calculate the derivatives. More...
 
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)
 Add the elemental contribution to the derivative of the jacobian matrix, mass matrix and the residuals vector with respect to the passed parameter. Note that this function should NOT initialise any entries. It must be called after the residuals vector and matrices have been initialised to zero. More...
 
virtual void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 Fill in contribution to the product of the Hessian (derivative of Jacobian with respect to all variables) an eigenvector, Y, and other specified vectors, C (d(J_{ij})/d u_{k}) Y_{j} C_{k}. More...
 
virtual void fill_in_contribution_to_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 Fill in the contribution to the inner products between given pairs of history values. More...
 
virtual void fill_in_contribution_to_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 Fill in the contributions to the vectors that when taken as dot product with other history values give the inner product over the element. More...
 
- Protected Attributes inherited from oomph::TriangleMeshPolygon
bool Enable_redistribution_of_segments_between_polylines
 Is re-distribution of polyline segments between different boundaries during adaptation enabled? (Default: false) More...
 
bool Can_update_configuration
 Boolean flag to indicate whether the polygon can update its own reference configuration after it has moved i.e. if it is upgraded to a rigid body rather than being a free surface (default false) More...
 
- Protected Attributes inherited from oomph::TriangleMeshClosedCurve
Vector< double > Internal_point_pt
 Vector of vertex coordinates. More...
 
bool Is_internal_point_fixed
 Indicate whether the internal point should be updated automatically. More...
 
- Protected Attributes inherited from oomph::TriangleMeshCurve
Vector< TriangleMeshCurveSection * > Curve_section_pt
 Vector of curve sections. More...
 
- Protected Attributes inherited from oomph::ImmersedRigidBodyElement
Vector< double > Initial_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
 Data for centre of gravity displacement. Values: 0: x-displ; 1: y-displ; 2: rotation angle. More...
 
- Protected Attributes inherited from oomph::GeneralisedElement
int Non_halo_proc_ID
 Non-halo processor ID for Data; -1 if it's not a halo. More...
 
bool Must_be_kept_as_halo
 Does this element need to be kept as a halo element during a distribute? More...
 
- 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
 Timestepper (used to handle access to geometry at previous timesteps) More...
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< double > Dummy_matrix
 Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case when only the residuals are being assembled. More...
 
static std::deque< double * > Dof_pt_deque
 Static storage for deque used to add_global_equation_numbers when pointers to the dofs in each element are not required. More...
 

Detailed Description

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.)

Definition at line 662 of file immersed_rigid_body_elements.h.

Constructor & Destructor Documentation

◆ ImmersedRigidBodyTriangleMeshPolygon()

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.

Definition at line 387 of file immersed_rigid_body_elements.cc.

References assign_zeta(), oomph::TriangleMeshPolygon::Can_update_configuration, i, oomph::ImmersedRigidBodyElement::Initial_centre_of_mass, oomph::ImmersedRigidBodyElement::Initial_Phi, oomph::ImmersedRigidBodyElement::Mass, oomph::ImmersedRigidBodyElement::Moment_of_inertia, oomph::TriangleMeshPolygon::polyline_pt(), and oomph::TriangleMeshPolyLine::vertex_coordinate().

◆ ~ImmersedRigidBodyTriangleMeshPolygon()

oomph::ImmersedRigidBodyTriangleMeshPolygon::~ImmersedRigidBodyTriangleMeshPolygon ( )
inline

Empty Destuctor.

Definition at line 681 of file immersed_rigid_body_elements.h.

Member Function Documentation

◆ assign_zeta()

void oomph::ImmersedRigidBodyTriangleMeshPolygon::assign_zeta ( )
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.

Definition at line 806 of file immersed_rigid_body_elements.h.

References oomph::TriangleMeshPolygon::npolyline(), oomph::TriangleMeshPolyLine::nvertex(), oomph::TriangleMeshPolygon::polyline_pt(), oomph::TriangleMeshPolyLine::vertex_coordinate(), and Zeta_vertex.

Referenced by ImmersedRigidBodyTriangleMeshPolygon().

◆ get_initial_position()

void oomph::ImmersedRigidBodyTriangleMeshPolygon::get_initial_position ( const Vector< double > &  xi,
Vector< double > &  r 
) const
inlineprivate

◆ position() [1/2]

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

Overload (again) the position to apply the rotation and translation.

Reimplemented from oomph::ImmersedRigidBodyElement.

Definition at line 693 of file immersed_rigid_body_elements.h.

References oomph::ImmersedRigidBodyElement::apply_rigid_body_motion(), and get_initial_position().

◆ position() [2/2]

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

Overload (again) the position to apply the rotation and translation.

Reimplemented from oomph::ImmersedRigidBodyElement.

Definition at line 684 of file immersed_rigid_body_elements.h.

References oomph::ImmersedRigidBodyElement::apply_rigid_body_motion(), and get_initial_position().

◆ reset_reference_configuration()

void oomph::ImmersedRigidBodyTriangleMeshPolygon::reset_reference_configuration ( )
virtual

Member Data Documentation

◆ Zeta_vertex

Vector<Vector<double> > oomph::ImmersedRigidBodyTriangleMeshPolygon::Zeta_vertex
private

Vector of intrisic coordinate values at the nodes.

Definition at line 859 of file immersed_rigid_body_elements.h.

Referenced by assign_zeta(), and get_initial_position().


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