oomph::DisplacementControlElement Class Reference

#include <displacement_control_element.h>

+ Inheritance diagram for oomph::DisplacementControlElement:

Public Member Functions

 DisplacementControlElement (SolidFiniteElement *controlled_element_pt, const Vector< double > &controlled_point, const unsigned &controlled_direction, double *control_position_value_pt, Data *displacement_control_load_pt)
 
 DisplacementControlElement (SolidFiniteElement *controlled_element_pt, const Vector< double > &controlled_point, const unsigned &controlled_direction, double *control_position_value_pt)
 
 DisplacementControlElement (const DisplacementControlElement &)=delete
 Broken copy constructor. More...
 
void operator= (const DisplacementControlElement &)=delete
 Broken assignment operator. More...
 
Datadisplacement_control_load_pt () const
 
void assign_additional_local_eqn_numbers ()
 Store local equation number of displacement control equation. More...
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 
unsigned ndof_types () const
 
void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- 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)
 

Protected Attributes

DataDisplacement_control_load_pt
 
doubleControl_position_value_pt
 
unsigned Controlled_direction
 
SolidFiniteElementControlled_element_pt
 Pointer to SolidFiniteElement at which control displacement is applied. More...
 
Vector< doubleControlled_point
 
bool Load_data_created_internally
 
unsigned Load_data_index
 
int Displ_ctrl_local_eqn
 Local equation number of the control-displacement equation. 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)
 
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

Displacement control element: In the "normal" formulation of solid mechanics problems, the external load is given and the displacement throughout the solid body is computed. For highly nonlinear problems it is sometimes helpful to re-formulate the problem by prescribing the position of a selected control point and treating the (scalar) load level required to achieve this deformation as an unknown. As an example consider the buckling of pressure-loaded, thin-walled elastic shells. The load-displacement characteristics of such structures tend to be highly nonlinear and bifurcations from the structure's pre-buckling state often occur via sub-critical bifurcations. If we have some a-priori knowledge of the expected deformation (for example, during the non-axisymmetric buckling of a circular cylindrical shell certain material points will be displaced radially inwards), it is advantageous to prescribe the radial displacement of a carefully selected control point and treat the external pressure as an unknown.

DisplacementControlElements facilitate the use of such methods. They require the specification of

  • the control point at which the displacement is prescribed. This is done by specifying:
    • a pointer, controlled_element_pt, to a SolidFiniteElement and
    • the vector controlled_point which contains the local coordinates of the control point in that SolidFiniteElement.
  • the coordinate direction. controlled_direction. in which the displacement is controlled.
  • a pointer to a double, control_position_value_pt, that specifies the desired value of the prescribed coordinate after the deformation (i.e. if controlled_direction=1 then *control_position_value_pt specifies the \( x_1 \) coordinate of the control point in the deformed configuration.)

The DisplacementControlElement has two constructors:

  • In the first version, we pass the pointer to the Data object whose one-and-only value contains the scalar load level that is "traded" for the displacement constraint. This is appropriate if the load Data has already been created (and is included in the overall equation numbering procedure) by some other element. In that case the DisplacementControlElement treats the (already existing) Data object external Data.
  • In the second version, a Data object (with a single value) is created by the constructor of the DisplacementControlElement and stored in its internal Data. Once the DisplacementControlElement has been included in one of the Problem's meshes, it is therefore automatically included in the equation numbering procedure. The (pointer to) the newly created Data is accessible via the access function displacement_control_load_pt(). It can be used to make make the unknown load level accessible to the load function that drives the deformation.

Note: The element inherits from the BlockPreconditionableElementBase and can be used in the block-preconditioning context. The element is "in charge" of the control load (if it's been created internally) and classifies it as its one-and-only "DOF type"

Constructor & Destructor Documentation

◆ DisplacementControlElement() [1/3]

oomph::DisplacementControlElement::DisplacementControlElement ( SolidFiniteElement controlled_element_pt,
const Vector< double > &  controlled_point,
const unsigned controlled_direction,
double control_position_value_pt,
Data displacement_control_load_pt 
)
inline

Constructor. Pass:

  • Pointer to SolidFiniteElement that contains the control point
  • Vector that contains the local coordinates of the control point in that element.
  • the coordinate direction in which the position of the control point is prescribed
  • pointer to double that specifies the prescribed coordinate of the control point
  • Pointer to Data item whose one-and-only value contains the load value that is being adjusted to allow displacement control.

The load Data is treated as external Data for this element.

128  Control_position_value_pt(control_position_value_pt),
129  Controlled_direction(controlled_direction),
130  Controlled_element_pt(controlled_element_pt),
131  Controlled_point(controlled_point)
132  {
133 #ifdef PARANOID
135  {
136  throw OomphLibError(
137  "Displacement control data must only contain a single value!\n",
140  }
141 #endif
142 
143  // The displacement control load is external Data for this element;
144  // add it to the container and and store its index in that container.
146 
147  // Store flag
149 
150  // The positional degrees of freedom of all the nodes in the
151  // controlled SolidFiniteElement are external Data
152  // for this element
153  unsigned nnode = Controlled_element_pt->nnode();
154  for (unsigned j = 0; j < nnode; j++)
155  {
157  static_cast<SolidNode*>(Controlled_element_pt->node_pt(j))
158  ->variable_position_pt());
159  }
160  }
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
Data * displacement_control_load_pt() const
Definition: displacement_control_element.h:219
SolidFiniteElement * Controlled_element_pt
Pointer to SolidFiniteElement at which control displacement is applied.
Definition: displacement_control_element.h:315
double * Control_position_value_pt
Definition: displacement_control_element.h:308
Vector< double > Controlled_point
Definition: displacement_control_element.h:319
unsigned Load_data_index
Definition: displacement_control_element.h:328
bool Load_data_created_internally
Definition: displacement_control_element.h:324
unsigned Controlled_direction
Definition: displacement_control_element.h:312
Data * Displacement_control_load_pt
Definition: displacement_control_element.h:304
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
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::GeneralisedElement::add_external_data(), Controlled_element_pt, displacement_control_load_pt(), Displacement_control_load_pt, j, Load_data_created_internally, Load_data_index, oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::SolidNode::variable_position_pt().

◆ DisplacementControlElement() [2/3]

oomph::DisplacementControlElement::DisplacementControlElement ( SolidFiniteElement controlled_element_pt,
const Vector< double > &  controlled_point,
const unsigned controlled_direction,
double control_position_value_pt 
)
inline

Constructor. Pass:

  • Pointer to SolidFiniteElement that contains the control point
  • Vector that contains the local coordinates of the control point in that element.
  • the coordinate direction in which the position of the control point is prescribed
  • pointer to double that specifies the prescribed coordinate of the control point

The pointer to a Data item whose one-and-only value contains the load value that is being adjusted to allow displacement control is created internally (and stored in the element's internal Data. It is accessible (for use the load function) via the access function displacement_control_load_pt()

181  : Control_position_value_pt(control_position_value_pt),
182  Controlled_direction(controlled_direction),
183  Controlled_element_pt(controlled_element_pt),
184  Controlled_point(controlled_point)
185  {
186  // Create displacement control load internally (below, we'll store it
187  // in the element's internal data so it'll be killed automatically --
188  // no need for a destructor)
189  Displacement_control_load_pt = new Data(1);
190 
191  // The displacement control load is internal Data for this element
193 
194  // Store flag
196 
197  // The positional degrees of freedom of all the nodes in the
198  // controlled SolidFiniteElement are external Data
199  // for this element
200  unsigned nnode = Controlled_element_pt->nnode();
201  for (unsigned j = 0; j < nnode; j++)
202  {
204  static_cast<SolidNode*>(Controlled_element_pt->node_pt(j))
205  ->variable_position_pt());
206  }
207  }
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62

References oomph::GeneralisedElement::add_external_data(), oomph::GeneralisedElement::add_internal_data(), Controlled_element_pt, Displacement_control_load_pt, j, Load_data_created_internally, Load_data_index, oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), and oomph::SolidNode::variable_position_pt().

◆ DisplacementControlElement() [3/3]

oomph::DisplacementControlElement::DisplacementControlElement ( const DisplacementControlElement )
delete

Broken copy constructor.

Member Function Documentation

◆ assign_additional_local_eqn_numbers()

void oomph::DisplacementControlElement::assign_additional_local_eqn_numbers ( )
inlinevirtual

Store local equation number of displacement control equation.

Reimplemented from oomph::GeneralisedElement.

227  {
229  {
230  // Local equation number is the local equation number of the
231  // one and only (i.e. the zero-th value stored in the
232  // load data (which is stored in the internal data)
234  }
235  else
236  {
237  // Local equation number is the local equation number of the
238  // one and only (i.e. the zero-th value stored in the
239  // load data (which is stored in the external data)
241  }
242  }
int Displ_ctrl_local_eqn
Local equation number of the control-displacement equation.
Definition: displacement_control_element.h:331
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 Displ_ctrl_local_eqn, oomph::GeneralisedElement::external_local_eqn(), oomph::GeneralisedElement::internal_local_eqn(), Load_data_created_internally, and Load_data_index.

◆ displacement_control_load_pt()

Data* oomph::DisplacementControlElement::displacement_control_load_pt ( ) const
inline

Pointer to Data object whose one-and-only value represents the load that is adjusted to allow displacement control

220  {
222  }

References Displacement_control_load_pt.

Referenced by DisplacementControlElement(), and FSICollapsibleChannelProblem< ELEMENT >::FSICollapsibleChannelProblem().

◆ fill_in_contribution_to_residuals()

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

Add the element's contribution to its residual vector: The displacement constraint. [Note: Jacobian is computed automatically by finite-differencing]

Reimplemented from oomph::GeneralisedElement.

249  {
250  if (Displ_ctrl_local_eqn >= 0)
251  {
252  residuals[Displ_ctrl_local_eqn] =
256  }
257  }
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962

References Control_position_value_pt, Controlled_direction, Controlled_element_pt, Controlled_point, Displ_ctrl_local_eqn, and oomph::FiniteElement::interpolated_x().

◆ get_dof_numbers_for_unknowns()

void oomph::DisplacementControlElement::get_dof_numbers_for_unknowns ( std::list< std::pair< unsigned long, unsigned >> &  dof_lookup_list) const
inlinevirtual

Create a list of pairs for all unknowns in this element, so that the first entry in each pair contains the global equation number of the unknown, while the second one contains the number of the "DOF type" that this unknown is associated with. (Function can obviously only be called if the equation numbering scheme has been set up.) The only dof this element is in charge of is the control load, provided it's been created as internal Data.

Reimplemented from oomph::GeneralisedElement.

276  {
278  {
279  // temporary pair (used to store dof lookup prior to being
280  // added to list)
281  std::pair<unsigned long, unsigned> dof_lookup;
282 
283  // determine local eqn number for displacement control eqn
285 
286  // Is it a dof or is it pinned?
287  if (local_eqn_number >= 0)
288  {
289  // store dof lookup in temporary pair: First entry in pair
290  // is global equation number; second entry is dof type
291  dof_lookup.first = this->eqn_number(local_eqn_number);
292  dof_lookup.second = 0;
293 
294  // Add to list
295  dof_lookup_list.push_front(dof_lookup);
296  }
297  }
298  }
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704
int local_eqn_number(const unsigned long &ieqn_global) const
Definition: elements.h:726

References Displ_ctrl_local_eqn, oomph::GeneralisedElement::eqn_number(), Load_data_created_internally, and oomph::GeneralisedElement::local_eqn_number().

◆ ndof_types()

unsigned oomph::DisplacementControlElement::ndof_types ( ) const
inlinevirtual

The number of "DOF" that degrees of freedom in this element are sub-divided into: Just the control pressure.

Reimplemented from oomph::GeneralisedElement.

262  {
263  return 1;
264  }

◆ operator=()

void oomph::DisplacementControlElement::operator= ( const DisplacementControlElement )
delete

Broken assignment operator.

Member Data Documentation

◆ Control_position_value_pt

double* oomph::DisplacementControlElement::Control_position_value_pt
protected

Pointer to the value that stores the prescribed coordinate of the control point

Referenced by fill_in_contribution_to_residuals().

◆ Controlled_direction

unsigned oomph::DisplacementControlElement::Controlled_direction
protected

Coordinate direction in which the displacement of the control point is controlled

Referenced by fill_in_contribution_to_residuals().

◆ Controlled_element_pt

SolidFiniteElement* oomph::DisplacementControlElement::Controlled_element_pt
protected

Pointer to SolidFiniteElement at which control displacement is applied.

Referenced by DisplacementControlElement(), and fill_in_contribution_to_residuals().

◆ Controlled_point

Vector<double> oomph::DisplacementControlElement::Controlled_point
protected

Vector of local coordinates of point at which control displacement is applied

Referenced by fill_in_contribution_to_residuals().

◆ Displ_ctrl_local_eqn

int oomph::DisplacementControlElement::Displ_ctrl_local_eqn
protected

Local equation number of the control-displacement equation.

Referenced by assign_additional_local_eqn_numbers(), fill_in_contribution_to_residuals(), and get_dof_numbers_for_unknowns().

◆ Displacement_control_load_pt

Data* oomph::DisplacementControlElement::Displacement_control_load_pt
protected

Pointer to Data item whose one-and-only value contains the load value that is being adjusted to allow displacement control.

Referenced by displacement_control_load_pt(), and DisplacementControlElement().

◆ Load_data_created_internally

bool oomph::DisplacementControlElement::Load_data_created_internally
protected

Flag to indicate if load data was created internally or externally (and is therefore stored in the element's internal or external Data)

Referenced by assign_additional_local_eqn_numbers(), DisplacementControlElement(), and get_dof_numbers_for_unknowns().

◆ Load_data_index

unsigned oomph::DisplacementControlElement::Load_data_index
protected

In which component (in the vector of the element's internal or external Data) is the load stored?

Referenced by assign_additional_local_eqn_numbers(), and DisplacementControlElement().


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