HeatedCircularPenetratorElement Class Reference
+ Inheritance diagram for HeatedCircularPenetratorElement:

Public Member Functions

 HeatedCircularPenetratorElement (SolidNode *control_node_pt, const unsigned &index_of_contact_pressure, const unsigned &index_of_horizontal_displacement, const unsigned &index_of_vertical_displacement, double *r_pt)
 
void surface_coordinate (const Vector< double > &x, Vector< double > &zeta) const
 
Vector< doublerigid_body_displacement () const
 Get rigid body displacement of reference point in penetrator. More...
 
void set_original_centre (const Vector< double > &orig_centre)
 
Vector< std::pair< Data *, unsigned > > equilibrium_data ()
 
double angle () const
 Angle of rotation around contact point. More...
 
void set_angle (const double &angle)
 Set angle of rotation around contact point. More...
 
Meshcontact_element_mesh_pt () const
 
void set_contact_element_mesh_pt (Mesh *contact_element_mesh_pt)
 
void set_equilibrium_target_forces ()
 Set target horizontal and vertical force to be in equilibrium. More...
 
double target_weight ()
 Target weight (returns zero if not imposed) More...
 
double target_horizontal_force ()
 Target horizontal force (returns zero if not imposed) More...
 
double target_yc ()
 Target vertical position of control point (returns zero if not imposed) More...
 
double target_rotation_angle ()
 Target rotation angle about contact point (returns zero if not imposed) More...
 
bool yc_is_imposed ()
 Is vertical positon of control node imposed? If false then weight imposed. More...
 
void impose_weight (double *target_weight_pt)
 
void impose_yc (double *target_yc_pt)
 
bool rotation_angle_is_imposed ()
 
void impose_horizontal_force (double *target_horizontal_force_pt)
 
void impose_rotation_angle (double *target_rotation_angle_pt)
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Fill in contribution to residuals. More...
 
Vector< doublecentre () const
 Get centre of penetrator. More...
 
double centre (const unsigned &i) const
 Get centre of penetrator. More...
 
void penetration (const Vector< double > &x, const Vector< double > &n, double &d, bool &intersection) const
 Get penetration for given point x. More...
 
double temperature (const Vector< double > &x) const
 
void output (std::ostream &outfile, const unsigned &nplot) const
 Output coordinates of penetrator at nplot plot points. More...
 
void position_from_zeta (const Vector< double > &zeta, Vector< double > &r) const
 Get position to surface, r, in terms of surface coordinate zeta. More...
 
Vector< doubleresulting_force () const
 Resulting force from all associated ContactElements. More...
 
double radius () const
 Radius of penetrator. 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::HeatedPenetrator
 HeatedPenetrator ()
 Constructor. More...
 
virtual ~HeatedPenetrator ()
 Destructor. More...
 
- Public Member Functions inherited from oomph::Penetrator
 Penetrator ()
 Constructor. More...
 
virtual ~Penetrator ()
 Destructor. More...
 

Private Attributes

doubleRadius_pt
 Pointer to radius of penetrator. More...
 
Vector< doubleOrig_centre
 
SolidNodeControl_node_pt
 Control node. More...
 
unsigned Index_of_contact_pressure
 
unsigned Index_of_vertical_displacement
 Where is the vertical displacement (linear_elasticity) stored? More...
 
unsigned Index_of_horizontal_displacement
 Where is the horizontal displacement (linear_elasticity) stored? More...
 
unsigned External_data_index_of_traded_contact_pressure
 
doubleTarget_weight_pt
 
doubleTarget_horizontal_force_pt
 
doubleTarget_yc_pt
 
doubleTarget_rotation_angle_pt
 
MeshContact_element_mesh_pt
 Mesh of contact elements that contribute to weight/horizontal force. 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
 
- 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 reset_after_internal_fd ()
 
virtual void update_in_internal_fd (const unsigned &i)
 
virtual void reset_in_internal_fd (const unsigned &i)
 
virtual void update_before_external_fd ()
 
virtual void reset_after_external_fd ()
 
virtual void update_in_external_fd (const unsigned &i)
 
virtual void reset_in_external_fd (const unsigned &i)
 
virtual void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
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)
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Detailed Description

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
Penetrator that keeps circle in contact with a control node on target surface (made of solid contact face elements) – centre of the circular penetrator is located at

{\bf r}_c = {\bf R}_p + R {\bf e}_alpha

where {\bf R}_p is the position of the control point, R the radius of the circular penetrator, and {\bf e}_alpha is a unit vector inclined at an angle \alpha against the vertical. Penetration can be driven in two ways. (1) We impose the vertical position of the control point (by pseudo-hijacking the Lagrange-multiplier (representing the contact pressure) stored at the controlled node. This means that rather than determining the contact pressure from the no-penetration constraint, (which we know to be satisfied by construction) we determine it from the condition that {\bf R}_p \cdot {\bf e}_y = Y_c which is prescribed. We also impose the angle \alpha (stored as an internal Data value in the element) by solving it via the equation \alpha-\alpha_{prescribed} = 0. (2) We impose the weight (i.e. the vertical reaction force from the contact elements) by using the equation

\int p_c {\bf n} \cdot {\bf e}_y ds - W = 0

as the equation for the pseudo-hijacked contact pressure and similarly, use the horizontal force balance

\int p_c {\bf n} \cdot {\bf e}_x ds - H = 0

to determine the rotation angle. Here, W and H are prescribed and the integral is computed from the contact elements that potentially impact on the penetrator.

Constructor & Destructor Documentation

◆ HeatedCircularPenetratorElement()

HeatedCircularPenetratorElement::HeatedCircularPenetratorElement ( SolidNode control_node_pt,
const unsigned index_of_contact_pressure,
const unsigned index_of_horizontal_displacement,
const unsigned index_of_vertical_displacement,
double r_pt 
)
inline

Constructor: Pass pointer to control node whose index_of_contact_pressure-th value represents the Lagrange multiplier (the discrete contact pressure) that has been traded for the vertical displacement/weight constraint. Also need the indices of the nodal values that store the horizontal/vertical displacement (linear elasticity).

2183  {
2184  // Create internal data, representing the angle of rotation about
2185  // contact point. Determined either directly via insisting
2186  // that the difference between this value and the target is zero
2187  // or by insisting that the horizontal force is zero.
2188  add_internal_data(new Data(1));
2189  internal_data_pt(0)->set_value(0,0.0);
2190 
2191  oomph_info << "In here..\n";
2192  exit(0);
2193 
2194  // Store pointer to radius
2195  Radius_pt=r_pt;
2196 
2197  // Store original centre
2198  Orig_centre=centre();
2199 
2200  // Control node
2201  Control_node_pt=control_node_pt;
2202 
2203  // Where is the tradedd contact pressure stored?
2204  Index_of_contact_pressure=index_of_contact_pressure;
2205 
2206  // Where is the horizontal displacement (linear_elasticity) stored?
2207  Index_of_horizontal_displacement=index_of_horizontal_displacement;
2208 
2209  // Where is the vertical displacement (linear_elasticity) stored?
2210  Index_of_vertical_displacement=index_of_vertical_displacement;
2211 
2212  //Pointer to target weight (null if vertical displacement of control
2213  //node is imposed)
2214  Target_weight_pt=0;
2215 
2216  // Pointer to target horizontal force (null if rotation angle angle
2217  // about control node is imposed)
2219 
2220  // Pointer to target vertical displacement of control node (null if
2221  // weight is imposed)
2222  Target_yc_pt=0;
2223 
2224  // Pointer to target rotation angle about control node (null
2225  // if horizontal force is imposed)
2227 
2228  // Pointer to mesh of contact elements that contribute to force
2230  }
double * Radius_pt
Pointer to radius of penetrator.
Definition: heated_linear_solid_contact_with_gravity.cc:2720
double * Target_horizontal_force_pt
Definition: heated_linear_solid_contact_with_gravity.cc:2749
Mesh * Contact_element_mesh_pt
Mesh of contact elements that contribute to weight/horizontal force.
Definition: heated_linear_solid_contact_with_gravity.cc:2760
Vector< double > centre() const
Get centre of penetrator.
Definition: heated_linear_solid_contact_with_gravity.cc:2592
unsigned Index_of_vertical_displacement
Where is the vertical displacement (linear_elasticity) stored?
Definition: heated_linear_solid_contact_with_gravity.cc:2734
double * Target_rotation_angle_pt
Definition: heated_linear_solid_contact_with_gravity.cc:2757
SolidNode * Control_node_pt
Control node.
Definition: heated_linear_solid_contact_with_gravity.cc:2727
double * Target_yc_pt
Definition: heated_linear_solid_contact_with_gravity.cc:2753
unsigned Index_of_contact_pressure
Definition: heated_linear_solid_contact_with_gravity.cc:2731
double * Target_weight_pt
Definition: heated_linear_solid_contact_with_gravity.cc:2745
unsigned Index_of_horizontal_displacement
Where is the horizontal displacement (linear_elasticity) stored?
Definition: heated_linear_solid_contact_with_gravity.cc:2737
Vector< double > Orig_centre
Definition: heated_linear_solid_contact_with_gravity.cc:2724
Definition: nodes.h:86
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References oomph::GeneralisedElement::add_internal_data(), centre(), Contact_element_mesh_pt, Control_node_pt, Index_of_contact_pressure, Index_of_horizontal_displacement, Index_of_vertical_displacement, oomph::GeneralisedElement::internal_data_pt(), oomph::oomph_info, Orig_centre, Radius_pt, oomph::Data::set_value(), Target_horizontal_force_pt, Target_rotation_angle_pt, Target_weight_pt, and Target_yc_pt.

Member Function Documentation

◆ angle()

double HeatedCircularPenetratorElement::angle ( ) const
inline

Angle of rotation around contact point.

2302  {
2303  return internal_data_pt(0)->value(0);
2304  }
double value(const unsigned &i) const
Definition: nodes.h:293

References oomph::GeneralisedElement::internal_data_pt(), and oomph::Data::value().

Referenced by centre(), ContactProblem< ELEMENT >::complete_problem_setup(), and set_angle().

◆ centre() [1/2]

Vector<double> HeatedCircularPenetratorElement::centre ( ) const
inline

Get centre of penetrator.

2593  {
2594  Vector<double> rc(2);
2595  rc[0]=centre(0);
2596  rc[1]=centre(1);
2597  return rc;
2598  }
list rc
Definition: plotDoE.py:16

References plotDoE::rc.

Referenced by ContactProblem< ELEMENT >::doc_solution(), HeatedCircularPenetratorElement(), output(), penetration(), position_from_zeta(), rigid_body_displacement(), surface_coordinate(), and temperature().

◆ centre() [2/2]

double HeatedCircularPenetratorElement::centre ( const unsigned i) const
inline

Get centre of penetrator.

2602  {
2603  switch (i)
2604  {
2605  case 0:
2606  return Control_node_pt->x(0)+
2608  (*Radius_pt)*sin(angle());
2609  break;
2610 
2611  case 1:
2612  return Control_node_pt->x(1)+
2614  (*Radius_pt)*cos(angle());
2615  break;
2616 
2617  default:
2618  std::stringstream junk;
2619  junk << "Wrong index: " << i
2620  << "\nCan only handle 0 or 1 (it's 2D!)\n";
2621  throw OomphLibError(
2622  junk.str(),
2625  }
2626  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
int i
Definition: BiCGSTAB_step_by_step.cpp:9
double angle() const
Angle of rotation around contact point.
Definition: heated_linear_solid_contact_with_gravity.cc:2301
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
double value(const unsigned &i) const
Definition: nodes.cc:2408
Definition: oomph_definitions.h:222
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References angle(), Control_node_pt, cos(), i, Index_of_horizontal_displacement, Index_of_vertical_displacement, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, sin(), oomph::Node::value(), and oomph::Node::x().

◆ contact_element_mesh_pt()

Mesh* HeatedCircularPenetratorElement::contact_element_mesh_pt ( ) const
inline

Access to pointer to mesh of contact elements that contribute to force on penetrator

2317  {
2318  return Contact_element_mesh_pt;
2319  }

References Contact_element_mesh_pt.

Referenced by set_contact_element_mesh_pt().

◆ equilibrium_data()

Vector<std::pair<Data*,unsigned> > HeatedCircularPenetratorElement::equilibrium_data ( )
inlinevirtual

Vector of pairs identifying values (via a pair of pointer to Data object and index within it) that correspond to the Data values that are determined by the horizontal/vertical/... equilibrium equations.

Reimplemented from oomph::Penetrator.

2267  {
2268  // We're in 2D
2270 
2271 
2272  // Horizontal equilibrium determines the rotation angle
2273  // which is stored as the zero-th internal data
2275  {
2276  thingy[0]=std::make_pair(static_cast<Data*>(0),0);
2277  }
2278  else
2279  {
2280  thingy[0]=std::make_pair(internal_data_pt(0),0);
2281  }
2282 
2283 
2284  // Vertical equilibrium determines the discrete contact pressure
2285  // (Lagrange multiplier) at control node
2286  if (Target_weight_pt==0)
2287  {
2288  thingy[1]=std::make_pair(static_cast<Data*>(0),0);
2289  }
2290  else
2291  {
2292  thingy[1]=std::make_pair(
2295  }
2296 
2297  return thingy;
2298  }
unsigned External_data_index_of_traded_contact_pressure
Definition: heated_linear_solid_contact_with_gravity.cc:2741
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Definition: elements.h:659

References External_data_index_of_traded_contact_pressure, oomph::GeneralisedElement::external_data_pt(), Index_of_contact_pressure, oomph::GeneralisedElement::internal_data_pt(), Target_horizontal_force_pt, and Target_weight_pt.

◆ fill_in_contribution_to_residuals()

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

Fill in contribution to residuals.

Reimplemented from oomph::GeneralisedElement.

2511  {
2512  // Get resulting force from all associated PseudoContactElements
2513  // onto the elastic body
2515 
2516  // Equation for Lagrange multiplier (contact pressure) at controlled
2517  // node
2518  int local_eqn=external_local_eqn(
2520  if (local_eqn>=0)
2521  {
2522  // Resulting force from all associated PseudoContactElements
2523  // onto the elastic body is equal and opposite to force on penetrator
2524  if (Target_weight_pt!=0)
2525  {
2526  residuals[local_eqn]+=(*Target_weight_pt);
2527  }
2528  // Impose vertical position of control node
2529  else
2530  {
2531 #ifdef PARANOID
2532  if (Target_yc_pt!=0)
2533  {
2534 #endif
2535  residuals[local_eqn]+=Control_node_pt->x(1)+
2537 #ifdef PARANOID
2538  }
2539  else
2540  {
2541  std::stringstream junk;
2542  junk << "Target_yc_pt=0\n"
2543  << "Set with impose_yc(...)\n";
2544  throw OomphLibError(
2545  junk.str(),
2548  }
2549 #endif
2550  }
2551  }
2552 
2553 
2554 
2555  // Equation for rotation angle
2556  local_eqn=internal_local_eqn(0,0);
2557  if (local_eqn>=0)
2558  {
2559  // Resulting force from all associated PseudoContactElements
2560  // onto the elastic body is equal and opposite to force on penetrator
2562  {
2563  residuals[local_eqn]+=(*Target_horizontal_force_pt);
2564  }
2565  // Set rotation angle
2566  else
2567  {
2568 #ifdef PARANOID
2569  if (Target_rotation_angle_pt!=0)
2570  {
2571 #endif
2572  residuals[local_eqn]+=internal_data_pt(0)->value(0)-
2573  (*Target_rotation_angle_pt);
2574 #ifdef PARANOID
2575  }
2576  else
2577  {
2578  std::stringstream junk;
2579  junk << "Target_rotation_angle_pt=0\n"
2580  << "Set with impose_rotation_angle(...)\n";
2581  throw OomphLibError(
2582  junk.str(),
2585  }
2586 #endif
2587  }
2588  }
2589  }
Vector< double > resulting_force() const
Resulting force from all associated ContactElements.
Definition: heated_linear_solid_contact_with_gravity.cc:2696
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

References Control_node_pt, External_data_index_of_traded_contact_pressure, oomph::GeneralisedElement::external_local_eqn(), Index_of_contact_pressure, Index_of_vertical_displacement, oomph::GeneralisedElement::internal_data_pt(), oomph::GeneralisedElement::internal_local_eqn(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, resulting_force(), Target_horizontal_force_pt, Target_rotation_angle_pt, Target_weight_pt, Target_yc_pt, oomph::Data::value(), oomph::Node::value(), and oomph::Node::x().

◆ impose_horizontal_force()

void HeatedCircularPenetratorElement::impose_horizontal_force ( double target_horizontal_force_pt)
inline

Impose horizontal force (rather than rotation about contact node). Target force specified via pointer.

2496  {
2497  Target_horizontal_force_pt=target_horizontal_force_pt;
2499  }

References Target_horizontal_force_pt, and Target_rotation_angle_pt.

◆ impose_rotation_angle()

void HeatedCircularPenetratorElement::impose_rotation_angle ( double target_rotation_angle_pt)
inline

Impose rotation about contact node (rather than horizontal force) Target angle specified via pointer.

2504  {
2506  Target_rotation_angle_pt=target_rotation_angle_pt;
2507  }

References Target_horizontal_force_pt, and Target_rotation_angle_pt.

◆ impose_weight()

void HeatedCircularPenetratorElement::impose_weight ( double target_weight_pt)
inline

Impose weight (rather than imposed displacement). Target weight specified via pointer.

2471  {
2472  Target_weight_pt=target_weight_pt;
2473  Target_yc_pt=0;
2474  }

References Target_weight_pt, and Target_yc_pt.

◆ impose_yc()

void HeatedCircularPenetratorElement::impose_yc ( double target_yc_pt)
inline

Impose vertical position of control node (rather than weight). Target vertical position of control node specified via pointer.

2479  {
2480  Target_weight_pt=0;
2481  Target_yc_pt=target_yc_pt;
2482  }

References Target_weight_pt, and Target_yc_pt.

◆ output()

void HeatedCircularPenetratorElement::output ( std::ostream &  outfile,
const unsigned nplot 
) const
inlinevirtual

Output coordinates of penetrator at nplot plot points.

Implements oomph::Penetrator.

2676  {
2677  for (unsigned j=0;j<nplot;j++)
2678  {
2679  double phi=2.0*MathematicalConstants::Pi*double(j)/double(nplot-1);
2680  outfile << centre(0)+(*Radius_pt)*cos(phi) << " "
2681  << centre(1)+(*Radius_pt)*sin(phi)
2682  << std::endl;
2683  }
2684  }
double Pi
Definition: two_d_biharmonic.cc:235
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References centre(), cos(), j, BiharmonicTestFunctions2::Pi, and sin().

◆ penetration()

void HeatedCircularPenetratorElement::penetration ( const Vector< double > &  x,
const Vector< double > &  n,
double d,
bool intersection 
) const
inlinevirtual

Get penetration for given point x.

Implements oomph::Penetrator.

2631  {
2632  // Vector from potential contact point to centre of penetrator
2633  Vector<double> l(2);
2634  l[0]=centre(0)-x[0];
2635  l[1]=centre(1)-x[1];
2636 
2637  // Distance from potential contact point to centre of penetrator
2638  double ll=sqrt(l[0]*l[0]+l[1]*l[1]);
2639 
2640  // Projection of vector from potential contact point to centre of penetrator
2641  // onto outer unit normal on potential contact point
2642  double project=n[0]*l[0]+n[1]*l[1];
2643  double project_squared=project*project;
2644 
2645  // Final term in square root
2646  double b_squared=ll*ll-(*Radius_pt)*(*Radius_pt);
2647 
2648  // Is square root negative? In this case we have no intersection
2649  // and we return penetration as -DBL_MAX
2650  if (project_squared<b_squared)
2651  {
2652  d= -DBL_MAX;
2653  intersection = false;
2654  }
2655  else
2656  {
2657  double sqr=sqrt(project_squared-b_squared);
2658  d= -std::min(project-sqr,project+sqr);
2659  intersection = true;
2660  }
2661  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define min(a, b)
Definition: datatypes.h:22
list x
Definition: plotDoE.py:28

References centre(), min, n, sqrt(), and plotDoE::x.

◆ position_from_zeta()

void HeatedCircularPenetratorElement::position_from_zeta ( const Vector< double > &  zeta,
Vector< double > &  r 
) const
inline

Get position to surface, r, in terms of surface coordinate zeta.

2689  {
2690  double phi=zeta[0];
2691  r[0]=centre(0)+(*Radius_pt)*cos(phi);
2692  r[1]=centre(1)+(*Radius_pt)*sin(phi);
2693  }
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
r
Definition: UniformPSDSelfTest.py:20

References centre(), cos(), UniformPSDSelfTest::r, sin(), and Eigen::zeta().

◆ radius()

double HeatedCircularPenetratorElement::radius ( ) const
inline

Radius of penetrator.

2715 {return *Radius_pt;}

References Radius_pt.

◆ resulting_force()

Vector<double> HeatedCircularPenetratorElement::resulting_force ( ) const
inline

Resulting force from all associated ContactElements.

2697  {
2698  Vector<double> contact_force(2,0.0);
2699  Vector<double> el_contact_force(2);
2700  unsigned nel=Contact_element_mesh_pt->nelement();
2701  for (unsigned e=0;e<nel;e++)
2702  {
2703  dynamic_cast<TemplateFreeContactElementBase*>(
2705  resulting_contact_force(el_contact_force);
2706  for (unsigned i=0;i<2;i++)
2707  {
2708  contact_force[i]+=el_contact_force[i];
2709  }
2710  }
2711  return contact_force;
2712  }
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
Template-free base class for contact elements.
Definition: contact_elements.h:518

References Contact_element_mesh_pt, e(), oomph::Mesh::element_pt(), i, and oomph::Mesh::nelement().

Referenced by fill_in_contribution_to_residuals(), and set_equilibrium_target_forces().

◆ rigid_body_displacement()

Vector<double> HeatedCircularPenetratorElement::rigid_body_displacement ( ) const
inlinevirtual

Get rigid body displacement of reference point in penetrator.

Reimplemented from oomph::Penetrator.

2244  {
2245  unsigned n=Orig_centre.size();
2246  Vector<double> displ(n);
2247  for (unsigned i=0;i<n;i++)
2248  {
2249  displ[i]=centre(i)-Orig_centre[i];
2250  }
2251  return displ;
2252  }

References centre(), i, n, and Orig_centre.

◆ rotation_angle_is_imposed()

bool HeatedCircularPenetratorElement::rotation_angle_is_imposed ( )
inline

Is angle of rotation about control node imposed? If false then horizontal force is imposed.

2488  {
2489  return (Target_rotation_angle_pt!=0);
2490  }

References Target_rotation_angle_pt.

Referenced by ContactProblem< ELEMENT >::complete_problem_setup().

◆ set_angle()

void HeatedCircularPenetratorElement::set_angle ( const double angle)
inline

Set angle of rotation around contact point.

2309  {
2311  }

References angle(), oomph::GeneralisedElement::internal_data_pt(), and oomph::Data::set_value().

◆ set_contact_element_mesh_pt()

void HeatedCircularPenetratorElement::set_contact_element_mesh_pt ( Mesh contact_element_mesh_pt)
inline

Set pointer to mesh of contact elements and setup external Data, i.e. Data that affects the residuals in this element. Also set the node pointed to by Control_node_pt as external Data for the elements in the contact mesh (unless they contain this node already).

2327  {
2330 
2331  // Store Data associated with control node: It contains the traded
2332  // Lagrange multiplier (contact pressure)
2335 
2336  // Store its position data
2338 
2339  // Store it as Data (which includes the displacement)
2341 
2342  // Loop over all the elements in the contact mesh
2343  // If they don't contain the contact node already, its position
2344  // is external data because it affects the penetration.
2345  unsigned nel=Contact_element_mesh_pt->nelement();
2346  for (unsigned e=0;e<nel;e++)
2347  {
2348  bool el_contains_control_node=false;
2350  unsigned nnod=el_pt->nnode();
2351  for (unsigned j=0;j<nnod;j++)
2352  {
2353  SolidNode* nod_pt=dynamic_cast<SolidNode*>(el_pt->node_pt(j));
2354  if (nod_pt==Control_node_pt)
2355  {
2356  el_contains_control_node=true;
2357  }
2358  }
2359 
2360  // Position of control node affects position of penetrator and
2361  // therefore is external data for all contact elements (apart from
2362  // any that contain the control node as one of their own)
2363  if (!el_contains_control_node)
2364  {
2365  // position
2367  // displacement relative to position
2369  }
2370 
2371  // Rotation angle angle affects position of penetrator and therefore
2372  // affects penetration at all contact elements
2374  }
2375  }
Mesh * contact_element_mesh_pt() const
Definition: heated_linear_solid_contact_with_gravity.cc:2316
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
void flush_external_data()
Flush all external data.
Definition: elements.cc:387
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
Definition: nodes.h:1686
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
Definition: nodes.h:1765

References oomph::GeneralisedElement::add_external_data(), contact_element_mesh_pt(), Contact_element_mesh_pt, Control_node_pt, e(), External_data_index_of_traded_contact_pressure, oomph::Mesh::finite_element_pt(), oomph::GeneralisedElement::flush_external_data(), oomph::GeneralisedElement::internal_data_pt(), j, oomph::Mesh::nelement(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), and oomph::SolidNode::variable_position_pt().

Referenced by ContactProblem< ELEMENT >::complete_problem_setup().

◆ set_equilibrium_target_forces()

void HeatedCircularPenetratorElement::set_equilibrium_target_forces ( )
inline

Set target horizontal and vertical force to be in equilibrium.

2382  {
2383 #ifdef PARANOID
2385  {
2386  std::stringstream junk;
2387  junk << "Target_horizontal_force_pt==0\n"
2388  << "Please set it by call to impose_weight(...)\n";
2389  throw OomphLibError(
2390  junk.str(),
2393  }
2394  if (Target_weight_pt==0)
2395  {
2396  std::stringstream junk;
2397  junk << "Target_weight_pt==0.\n"
2398  << "Please set it by call to impose_horizontal_force(...)\n";
2399  throw OomphLibError(
2400  junk.str(),
2403  }
2404 #endif
2406  (*Target_horizontal_force_pt)=-force[0];
2407  (*Target_weight_pt)=-force[1];
2408  }

References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, resulting_force(), Target_horizontal_force_pt, and Target_weight_pt.

◆ set_original_centre()

void HeatedCircularPenetratorElement::set_original_centre ( const Vector< double > &  orig_centre)
inline

Set original centre of penetrator (for computation of rigid body displacement

2258  {
2259  Orig_centre=orig_centre;
2260  }

References Orig_centre.

◆ surface_coordinate()

void HeatedCircularPenetratorElement::surface_coordinate ( const Vector< double > &  x,
Vector< double > &  zeta 
) const
inlinevirtual

Get surface coordinate along penetrator for given point x. We assume that point on the surface and given point share the same polar angle and return that polar angle

Reimplemented from oomph::Penetrator.

2237  {
2238  zeta[0]=atan2(x[1]-centre(1),x[0]-centre(0));
2239  }
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:139

References atan2(), centre(), plotDoE::x, and Eigen::zeta().

◆ target_horizontal_force()

double HeatedCircularPenetratorElement::target_horizontal_force ( )
inline

Target horizontal force (returns zero if not imposed)

2425  {
2427  {
2428  return 0.0;
2429  }
2430  else
2431  {
2433  }
2434  }

References Target_horizontal_force_pt.

◆ target_rotation_angle()

double HeatedCircularPenetratorElement::target_rotation_angle ( )
inline

Target rotation angle about contact point (returns zero if not imposed)

2451  {
2452  if (Target_rotation_angle_pt==0)
2453  {
2454  return 0.0;
2455  }
2456  else
2457  {
2458  return *Target_rotation_angle_pt;
2459  }
2460  }

References Target_rotation_angle_pt.

◆ target_weight()

double HeatedCircularPenetratorElement::target_weight ( )
inline

Target weight (returns zero if not imposed)

2412  {
2413  if (Target_weight_pt==0)
2414  {
2415  return 0.0;
2416  }
2417  else
2418  {
2419  return *Target_weight_pt;
2420  }
2421  }

References Target_weight_pt.

Referenced by ContactProblem< ELEMENT >::doc_solution().

◆ target_yc()

double HeatedCircularPenetratorElement::target_yc ( )
inline

Target vertical position of control point (returns zero if not imposed)

2438  {
2439  if (Target_yc_pt==0)
2440  {
2441  return 0.0;
2442  }
2443  else
2444  {
2445  return *Target_yc_pt;
2446  }
2447  }

References Target_yc_pt.

◆ temperature()

double HeatedCircularPenetratorElement::temperature ( const Vector< double > &  x) const
inlinevirtual

Get temperature on penetrator at point "associated" with point x using the same logic as for the position function). Here we assume that both points shrare the same polar angle relative to the centre of (circular!) penetrator

Implements oomph::HeatedPenetrator.

2669  {
2670  double phi=atan2(x[1]-centre(1),x[0]-centre(0));
2671  return cos(phi-0.5*MathematicalConstants::Pi);
2672  }

References atan2(), centre(), cos(), BiharmonicTestFunctions2::Pi, and plotDoE::x.

◆ yc_is_imposed()

bool HeatedCircularPenetratorElement::yc_is_imposed ( )
inline

Is vertical positon of control node imposed? If false then weight imposed.

2464  {
2465  return (Target_yc_pt!=0);
2466  }

References Target_yc_pt.

Referenced by ContactProblem< ELEMENT >::complete_problem_setup().

Member Data Documentation

◆ Contact_element_mesh_pt

Mesh* HeatedCircularPenetratorElement::Contact_element_mesh_pt
private

Mesh of contact elements that contribute to weight/horizontal force.

Referenced by contact_element_mesh_pt(), HeatedCircularPenetratorElement(), resulting_force(), and set_contact_element_mesh_pt().

◆ Control_node_pt

SolidNode* HeatedCircularPenetratorElement::Control_node_pt
private

◆ External_data_index_of_traded_contact_pressure

unsigned HeatedCircularPenetratorElement::External_data_index_of_traded_contact_pressure
private

Index of external data that contains the the contact pressure in its Index_of_contact_pressure-th value

Referenced by equilibrium_data(), fill_in_contribution_to_residuals(), and set_contact_element_mesh_pt().

◆ Index_of_contact_pressure

unsigned HeatedCircularPenetratorElement::Index_of_contact_pressure
private

Index at which contact pressure (Lagr mult) is stored in nodal data associated with control node

Referenced by equilibrium_data(), fill_in_contribution_to_residuals(), and HeatedCircularPenetratorElement().

◆ Index_of_horizontal_displacement

unsigned HeatedCircularPenetratorElement::Index_of_horizontal_displacement
private

Where is the horizontal displacement (linear_elasticity) stored?

Referenced by centre(), and HeatedCircularPenetratorElement().

◆ Index_of_vertical_displacement

unsigned HeatedCircularPenetratorElement::Index_of_vertical_displacement
private

Where is the vertical displacement (linear_elasticity) stored?

Referenced by centre(), fill_in_contribution_to_residuals(), and HeatedCircularPenetratorElement().

◆ Orig_centre

Vector<double> HeatedCircularPenetratorElement::Orig_centre
private

Original centre of penetrator (origin for cylindrical polar coordinate system)

Referenced by HeatedCircularPenetratorElement(), rigid_body_displacement(), and set_original_centre().

◆ Radius_pt

double* HeatedCircularPenetratorElement::Radius_pt
private

Pointer to radius of penetrator.

Referenced by HeatedCircularPenetratorElement(), and radius().

◆ Target_horizontal_force_pt

double* HeatedCircularPenetratorElement::Target_horizontal_force_pt
private

Pointer to target horizontal force (null if rotation angle angle about control node is imposed)

Referenced by equilibrium_data(), fill_in_contribution_to_residuals(), HeatedCircularPenetratorElement(), impose_horizontal_force(), impose_rotation_angle(), set_equilibrium_target_forces(), and target_horizontal_force().

◆ Target_rotation_angle_pt

double* HeatedCircularPenetratorElement::Target_rotation_angle_pt
private

Pointer to target rotation angle about control node (null if horizontal force is imposed)

Referenced by fill_in_contribution_to_residuals(), HeatedCircularPenetratorElement(), impose_horizontal_force(), impose_rotation_angle(), rotation_angle_is_imposed(), and target_rotation_angle().

◆ Target_weight_pt

double* HeatedCircularPenetratorElement::Target_weight_pt
private

Pointer to target weight (null if vertical displacement of control node is imposed)

Referenced by equilibrium_data(), fill_in_contribution_to_residuals(), HeatedCircularPenetratorElement(), impose_weight(), impose_yc(), set_equilibrium_target_forces(), and target_weight().

◆ Target_yc_pt

double* HeatedCircularPenetratorElement::Target_yc_pt
private

Pointer to target vertical displacement of control node (null if weight is imposed)

Referenced by fill_in_contribution_to_residuals(), HeatedCircularPenetratorElement(), impose_weight(), impose_yc(), target_yc(), and yc_is_imposed().


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