oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT > Class Template Reference

#include <solid_traction_elements.h>

+ Inheritance diagram for oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >:

Public Member Functions

 ImposeDisplacementByLagrangeMultiplierElement (FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0, const bool &called_from_refineable_constructor=false)
 
GeomObjectboundary_shape_geom_object_pt () const
 
void set_boundary_shape_geom_object_pt (GeomObject *boundary_shape_geom_object_pt, const unsigned &boundary_number_in_bulk_mesh)
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Fill in the residuals. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Fill in contribution from Jacobian. More...
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
void output (std::ostream &outfile, const unsigned &n_plot)
 Output function. More...
 
void output (std::ostream &outfile)
 Output function. More...
 
double square_of_l2_norm_of_error ()
 
- Public Member Functions inherited from oomph::SolidFaceElement
double zeta_nodal (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double interpolated_xi (const Vector< double > &s, const unsigned &i) const
 
void interpolated_xi (const Vector< double > &s, Vector< double > &xi) const
 
- Public Member Functions inherited from oomph::FaceElement
 FaceElement ()
 Constructor: Initialise all appropriate member data. More...
 
virtual ~FaceElement ()
 Empty virtual destructor. More...
 
 FaceElement (const FaceElement &)=delete
 Broken copy constructor. More...
 
const unsignedboundary_number_in_bulk_mesh () const
 Broken assignment operator. More...
 
void set_boundary_number_in_bulk_mesh (const unsigned &b)
 Set function for the boundary number in bulk mesh. More...
 
double J_eulerian (const Vector< double > &s) const
 
double J_eulerian_at_knot (const unsigned &ipt) const
 
void check_J_eulerian_at_knots (bool &passed) const
 
double interpolated_x (const Vector< double > &s, const unsigned &i) const
 
double interpolated_x (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
void interpolated_x (const Vector< double > &s, Vector< double > &x) const
 
void interpolated_x (const unsigned &t, const Vector< double > &s, Vector< double > &x) const
 
double interpolated_dxdt (const Vector< double > &s, const unsigned &i, const unsigned &t)
 
void interpolated_dxdt (const Vector< double > &s, const unsigned &t, Vector< double > &dxdt)
 
intnormal_sign ()
 
int normal_sign () const
 
intface_index ()
 
int face_index () const
 
const Vector< double > * tangent_direction_pt () const
 Public access function for the tangent direction pointer. More...
 
void set_tangent_direction (Vector< double > *tangent_direction_pt)
 Set the tangent direction vector. More...
 
void turn_on_warning_for_discontinuous_tangent ()
 
void turn_off_warning_for_discontinuous_tangent ()
 
void continuous_tangent_and_outer_unit_normal (const Vector< double > &s, Vector< Vector< double >> &tang_vec, Vector< double > &unit_normal) const
 
void continuous_tangent_and_outer_unit_normal (const unsigned &ipt, Vector< Vector< double >> &tang_vec, Vector< double > &unit_normal) const
 
void outer_unit_normal (const Vector< double > &s, Vector< double > &unit_normal) const
 Compute outer unit normal at the specified local coordinate. More...
 
void outer_unit_normal (const unsigned &ipt, Vector< double > &unit_normal) const
 Compute outer unit normal at ipt-th integration point. More...
 
FiniteElement *& bulk_element_pt ()
 Pointer to higher-dimensional "bulk" element. More...
 
FiniteElementbulk_element_pt () const
 Pointer to higher-dimensional "bulk" element (const version) More...
 
CoordinateMappingFctPtface_to_bulk_coordinate_fct_pt ()
 
CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt () const
 
BulkCoordinateDerivativesFctPtbulk_coordinate_derivatives_fct_pt ()
 
BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt () const
 
Vector< doublelocal_coordinate_in_bulk (const Vector< double > &s) const
 
void get_local_coordinate_in_bulk (const Vector< double > &s, Vector< double > &s_bulk) const
 
void get_ds_bulk_ds_face (const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction) const
 
unsignedbulk_position_type (const unsigned &i)
 
const unsignedbulk_position_type (const unsigned &i) const
 
void bulk_node_number_resize (const unsigned &i)
 Resize the storage for the bulk node numbers. More...
 
unsignedbulk_node_number (const unsigned &n)
 
const unsignedbulk_node_number (const unsigned &n) const
 
void bulk_position_type_resize (const unsigned &i)
 Resize the storage for bulk_position_type to i entries. More...
 
unsignednbulk_value (const unsigned &n)
 
unsigned nbulk_value (const unsigned &n) const
 
void nbulk_value_resize (const unsigned &i)
 
void resize_nodes (Vector< unsigned > &nadditional_data_values)
 
void output_zeta (std::ostream &outfile, const unsigned &nplot)
 Output boundary coordinate zeta. More...
 
- Public Member Functions inherited from oomph::FiniteElement
void set_dimension (const unsigned &dim)
 
void set_nodal_dimension (const unsigned &nodal_dim)
 
void set_nnodal_position_type (const unsigned &nposition_type)
 Set the number of types required to interpolate the coordinate. More...
 
void set_n_node (const unsigned &n)
 
int nodal_local_eqn (const unsigned &n, const unsigned &i) const
 
double dJ_eulerian_at_knot (const unsigned &ipt, Shape &psi, DenseMatrix< double > &djacobian_dX) const
 
 FiniteElement ()
 Constructor. More...
 
virtual ~FiniteElement ()
 
 FiniteElement (const FiniteElement &)=delete
 Broken copy constructor. More...
 
virtual bool local_coord_is_valid (const Vector< double > &s)
 Broken assignment operator. More...
 
virtual void move_local_coord_back_into_element (Vector< double > &s) const
 
void get_centre_of_gravity_and_max_radius_in_terms_of_zeta (Vector< double > &cog, double &max_radius) const
 
virtual void local_coordinate_of_node (const unsigned &j, Vector< double > &s) const
 
virtual void local_fraction_of_node (const unsigned &j, Vector< double > &s_fraction)
 
virtual double local_one_d_fraction_of_node (const unsigned &n1d, const unsigned &i)
 
MacroElementmacro_elem_pt ()
 Access function to pointer to macro element. More...
 
void get_x (const Vector< double > &s, Vector< double > &x) const
 
void get_x (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
virtual void get_x_from_macro_element (const Vector< double > &s, Vector< double > &x) const
 
virtual void get_x_from_macro_element (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
virtual void set_integration_scheme (Integral *const &integral_pt)
 Set the spatial integration scheme. More...
 
Integral *const & integral_pt () const
 Return the pointer to the integration scheme (const version) More...
 
virtual void shape (const Vector< double > &s, Shape &psi) const =0
 
virtual void shape_at_knot (const unsigned &ipt, Shape &psi) const
 
virtual void dshape_local (const Vector< double > &s, Shape &psi, DShape &dpsids) const
 
virtual void dshape_local_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsids) const
 
virtual void d2shape_local (const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
 
virtual void d2shape_local_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
 
void check_J_eulerian_at_knots (bool &passed) const
 
void check_jacobian (const double &jacobian) const
 
double dshape_eulerian (const Vector< double > &s, Shape &psi, DShape &dpsidx) const
 
virtual double dshape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidx) const
 
virtual double dshape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsi, DenseMatrix< double > &djacobian_dX, RankFourTensor< double > &d_dpsidx_dX) const
 
double d2shape_eulerian (const Vector< double > &s, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
 
virtual double d2shape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
 
virtual void assign_nodal_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void describe_nodal_local_dofs (std::ostream &out, const std::string &current_string) const
 
Node *& node_pt (const unsigned &n)
 Return a pointer to the local node n. More...
 
Node *const & node_pt (const unsigned &n) const
 Return a pointer to the local node n (const version) More...
 
unsigned nnode () const
 Return the number of nodes. More...
 
virtual unsigned nnode_1d () const
 
double raw_nodal_position (const unsigned &n, const unsigned &i) const
 
double raw_nodal_position (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double raw_dnodal_position_dt (const unsigned &n, const unsigned &i) const
 
double raw_dnodal_position_dt (const unsigned &n, const unsigned &j, const unsigned &i) const
 
double raw_nodal_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_nodal_position_gen (const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_dnodal_position_gen_dt (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_dnodal_position_gen_dt (const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double nodal_position (const unsigned &n, const unsigned &i) const
 
double nodal_position (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double dnodal_position_dt (const unsigned &n, const unsigned &i) const
 Return the i-th component of nodal velocity: dx/dt at local node n. More...
 
double dnodal_position_dt (const unsigned &n, const unsigned &j, const unsigned &i) const
 
double nodal_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double nodal_position_gen (const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double dnodal_position_gen_dt (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double dnodal_position_gen_dt (const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
 
virtual void get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
virtual void disable_ALE ()
 
virtual void enable_ALE ()
 
virtual unsigned required_nvalue (const unsigned &n) const
 
unsigned nnodal_position_type () const
 
bool has_hanging_nodes () const
 
unsigned nodal_dimension () const
 Return the required Eulerian dimension of the nodes in this element. More...
 
virtual unsigned nvertex_node () const
 
virtual Nodevertex_node_pt (const unsigned &j) const
 
int get_node_number (Node *const &node_pt) const
 
virtual Nodeget_node_at_local_coordinate (const Vector< double > &s) const
 
double raw_nodal_value (const unsigned &n, const unsigned &i) const
 
double raw_nodal_value (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double nodal_value (const unsigned &n, const unsigned &i) const
 
double nodal_value (const unsigned &t, const unsigned &n, const unsigned &i) const
 
unsigned dim () const
 
virtual ElementGeometry::ElementGeometry element_geometry () const
 Return the geometry type of the element (either Q or T usually). More...
 
void position (const Vector< double > &zeta, Vector< double > &r) const
 
void position (const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
 
void dposition_dt (const Vector< double > &zeta, const unsigned &t, Vector< double > &drdt)
 
void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 
void locate_zeta (const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 
virtual void node_update ()
 
virtual void identify_field_data_for_interactions (std::set< std::pair< Data *, unsigned >> &paired_field_data)
 
virtual double s_min () const
 Min value of local coordinate. More...
 
virtual double s_max () const
 Max. value of local coordinate. More...
 
double size () const
 
virtual double compute_physical_size () const
 
virtual void point_output_data (const Vector< double > &s, Vector< double > &data)
 
void point_output (std::ostream &outfile, const Vector< double > &s)
 
virtual unsigned nplot_points_paraview (const unsigned &nplot) const
 
virtual unsigned nsub_elements_paraview (const unsigned &nplot) const
 
void output_paraview (std::ofstream &file_out, const unsigned &nplot) const
 
virtual void write_paraview_output_offset_information (std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
 
virtual void write_paraview_type (std::ofstream &file_out, const unsigned &nplot) const
 
virtual void write_paraview_offsets (std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
 
virtual unsigned nscalar_paraview () const
 
virtual void scalar_value_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
 
virtual void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
 
virtual void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
 
virtual std::string scalar_name_paraview (const unsigned &i) const
 
virtual void output (const unsigned &t, std::ostream &outfile, const unsigned &n_plot) const
 
virtual void output (FILE *file_pt)
 
virtual void output (FILE *file_pt, const unsigned &n_plot)
 
virtual void output_fct (std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 Output an exact solution over the element. More...
 
virtual void output_fct (std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
 Output a time-dependent exact solution over the element. More...
 
virtual void output_fct (std::ostream &outfile, const unsigned &n_plot, const double &time, const SolutionFunctorBase &exact_soln) const
 Output a time-dependent exact solution over the element. More...
 
virtual void get_s_plot (const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
 
virtual std::string tecplot_zone_string (const unsigned &nplot) const
 
virtual void write_tecplot_zone_footer (std::ostream &outfile, const unsigned &nplot) const
 
virtual void write_tecplot_zone_footer (FILE *file_pt, const unsigned &nplot) const
 
virtual unsigned nplot_points (const unsigned &nplot) const
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 Calculate the norm of the error and that of the exact solution. More...
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 Calculate the norm of the error and that of the exact solution. More...
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_abs_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error)
 
void integrate_fct (FiniteElement::SteadyExactSolutionFctPt integrand_fct_pt, Vector< double > &integral)
 Integrate Vector-valued function over element. More...
 
void integrate_fct (FiniteElement::UnsteadyExactSolutionFctPt integrand_fct_pt, const double &time, Vector< double > &integral)
 Integrate Vector-valued time-dep function over element. More...
 
virtual void build_face_element (const int &face_index, FaceElement *face_element_pt)
 
virtual unsigned self_test ()
 
virtual unsigned get_bulk_node_number (const int &face_index, const unsigned &i) const
 
virtual int face_outer_unit_normal_sign (const int &face_index) const
 Get the sign of the outer unit normal on the face given by face_index. More...
 
virtual unsigned nnode_on_face () const
 
void face_node_number_error_check (const unsigned &i) const
 Range check for face node numbers. More...
 
virtual CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt (const int &face_index) const
 
virtual BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt (const int &face_index) 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
 
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 void compute_norm (Vector< double > &norm)
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 
 GeomObject (const GeomObject &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const GeomObject &)=delete
 Broken assignment operator. More...
 
virtual ~GeomObject ()
 (Empty) destructor More...
 
unsigned nlagrangian () const
 Access function to # of Lagrangian coordinates. More...
 
unsigned ndim () const
 Access function to # of Eulerian coordinates. More...
 
void set_nlagrangian_and_ndim (const unsigned &n_lagrangian, const unsigned &n_dim)
 Set # of Lagrangian and Eulerian coordinates. More...
 
TimeStepper *& time_stepper_pt ()
 
TimeSteppertime_stepper_pt () const
 
virtual void position (const double &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void dposition (const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 
- Public Member Functions inherited from oomph::SolidFiniteElement
void set_lagrangian_dimension (const unsigned &lagrangian_dimension)
 
virtual bool has_internal_solid_data ()
 
 SolidFiniteElement ()
 Constructor: Set defaults. More...
 
virtual ~SolidFiniteElement ()
 Destructor to clean up any allocated memory. More...
 
 SolidFiniteElement (const SolidFiniteElement &)=delete
 Broken copy constructor. More...
 
unsigned ngeom_data () const
 Broken assignment operator. More...
 
Datageom_data_pt (const unsigned &j)
 
void identify_geometric_data (std::set< Data * > &geometric_data_pt)
 
virtual void get_x_and_xi (const Vector< double > &s, Vector< double > &x_fe, Vector< double > &x, Vector< double > &xi_fe, Vector< double > &xi) const
 
virtual void set_macro_elem_pt (MacroElement *macro_elem_pt)
 
virtual void set_macro_elem_pt (MacroElement *macro_elem_pt, MacroElement *undeformed_macro_elem_pt)
 
void set_undeformed_macro_elem_pt (MacroElement *undeformed_macro_elem_pt)
 
MacroElementundeformed_macro_elem_pt ()
 Access function to pointer to "undeformed" macro element. More...
 
double dshape_lagrangian (const Vector< double > &s, Shape &psi, DShape &dpsidxi) const
 
virtual double dshape_lagrangian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
 
double d2shape_lagrangian (const Vector< double > &s, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
 
virtual double d2shape_lagrangian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
 
unsigned lagrangian_dimension () const
 
unsigned nnodal_lagrangian_type () const
 
Nodeconstruct_node (const unsigned &n)
 Construct the local node n and return a pointer to it. More...
 
Nodeconstruct_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
Nodeconstruct_boundary_node (const unsigned &n)
 
Nodeconstruct_boundary_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 
void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
double raw_lagrangian_position (const unsigned &n, const unsigned &i) const
 
double raw_lagrangian_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double lagrangian_position (const unsigned &n, const unsigned &i) const
 Return i-th Lagrangian coordinate at local node n. More...
 
double lagrangian_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
virtual void interpolated_dxids (const Vector< double > &s, DenseMatrix< double > &dxids) const
 
virtual void J_lagrangian (const Vector< double > &s) const
 
virtual double J_lagrangian_at_knot (const unsigned &ipt) const
 
SolidInitialCondition *& solid_ic_pt ()
 Pointer to object that describes the initial condition. More...
 
void enable_solve_for_consistent_newmark_accel ()
 
void disable_solve_for_consistent_newmark_accel ()
 Set to reset the problem being solved to be the standard problem. More...
 
MultiplierFctPtmultiplier_fct_pt ()
 
MultiplierFctPt multiplier_fct_pt () const
 
virtual void get_residuals_for_solid_ic (Vector< double > &residuals)
 
void fill_in_residuals_for_solid_ic (Vector< double > &residuals)
 
void fill_in_jacobian_for_solid_ic (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_for_newmark_accel (DenseMatrix< double > &jacobian)
 
void compute_norm (double &el_norm)
 
int position_local_eqn (const unsigned &n, const unsigned &k, const unsigned &j) const
 

Protected Member Functions

void fill_in_generic_contribution_to_residuals_displ_lagr_multiplier (Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
 
unsigned ndof_types () const
 
void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- Protected Member Functions inherited from oomph::FaceElement
void add_additional_values (const Vector< unsigned > &nadditional_values, const unsigned &id)
 
- Protected Member Functions inherited from oomph::FiniteElement
virtual void assemble_local_to_eulerian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
virtual void assemble_local_to_eulerian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
virtual void assemble_eulerian_base_vectors (const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
 
template<unsigned DIM>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double invert_jacobian_mapping (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual void dJ_eulerian_dnodal_coordinates (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<unsigned DIM>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
virtual void d_dshape_eulerian_dnodal_coordinates (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<unsigned DIM>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
virtual void transform_derivatives (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
void transform_derivatives_diagonal (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
virtual void transform_second_derivatives (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
virtual void fill_in_jacobian_from_nodal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_nodal_by_fd (DenseMatrix< double > &jacobian)
 
virtual void update_before_nodal_fd ()
 
virtual void reset_after_nodal_fd ()
 
virtual void update_in_nodal_fd (const unsigned &i)
 
virtual void reset_in_nodal_fd (const unsigned &i)
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Zero-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 One-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Two-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
- 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_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_mass_matrix (Vector< double > &residuals, 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)
 
- Protected Member Functions inherited from oomph::SolidFiniteElement
void fill_in_generic_jacobian_for_solid_ic (Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
 
void set_nnodal_lagrangian_type (const unsigned &nlagrangian_type)
 
virtual double local_to_lagrangian_mapping (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
double local_to_lagrangian_mapping (const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_lagrangian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual void assign_solid_local_eqn_numbers (const bool &store_local_dof)
 Assign local equation numbers for the solid equations in the element. More...
 
void describe_solid_local_dofs (std::ostream &out, const std::string &current_string) const
 Classifies dofs locally for solid specific aspects. More...
 
virtual void fill_in_jacobian_from_solid_position_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_solid_position_by_fd (DenseMatrix< double > &jacobian)
 
virtual void update_before_solid_position_fd ()
 
virtual void reset_after_solid_position_fd ()
 
virtual void update_in_solid_position_fd (const unsigned &i)
 
virtual void reset_in_solid_position_fd (const unsigned &i)
 

Protected Attributes

unsigned Id
 Lagrange Id. More...
 
GeomObjectBoundary_shape_geom_object_pt
 
Vector< GeomObject * > Sub_geom_object_pt
 Storage for sub-GeomObject at the integration points. More...
 
Vector< Vector< double > > Zeta_sub_geom_object
 
bool Sparsify
 
- Protected Attributes inherited from oomph::FaceElement
unsigned Boundary_number_in_bulk_mesh
 The boundary number in the bulk mesh to which this element is attached. More...
 
FiniteElementBulk_element_pt
 Pointer to the associated higher-dimensional "bulk" element. More...
 
Vector< unsignedBulk_node_number
 
Vector< unsignedNbulk_value
 
Vector< double > * Tangent_direction_pt
 
- Protected Attributes inherited from oomph::FiniteElement
MacroElementMacro_elem_pt
 Pointer to the element's macro element (NULL by default) 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
 
- Protected Attributes inherited from oomph::SolidFiniteElement
MacroElementUndeformed_macro_elem_pt
 Pointer to the element's "undeformed" macro element (NULL by default) More...
 
SolidInitialConditionSolid_ic_pt
 Pointer to object that specifies the initial condition. More...
 
bool Solve_for_consistent_newmark_accel_flag
 

Additional Inherited Members

- Public Types inherited from oomph::FiniteElement
typedef void(* SteadyExactSolutionFctPt) (const Vector< double > &, Vector< double > &)
 
typedef void(* UnsteadyExactSolutionFctPt) (const double &, const Vector< double > &, Vector< double > &)
 
- Public Types inherited from oomph::SolidFiniteElement
typedef double(* MultiplierFctPt) (const Vector< double > &xi)
 
- Static Public Attributes inherited from oomph::FiniteElement
static double Tolerance_for_singular_jacobian = 1.0e-16
 Tolerance below which the jacobian is considered singular. More...
 
static bool Accept_negative_jacobian = false
 
static bool Suppress_output_while_checking_for_inverted_elements
 
- 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
 
- Static Protected Attributes inherited from oomph::FiniteElement
static const unsigned Default_Initial_Nvalue = 0
 Default value for the number of values at a node. More...
 
static const double Node_location_tolerance = 1.0e-14
 
static const unsigned N2deriv [] = {0, 1, 3, 6}
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Detailed Description

template<class ELEMENT>
class oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >

///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// A class for elements that allow the imposition of a displacement constraint for "bulk" solid elements via a Lagrange multiplier. The geometrical information can be read from the FaceGeometry<ELEMENT> class and and thus, we can be generic enough without the need to have a separate equations class. NOTE: Currently (and for the foreseeable future) this element only works with bulk elements that do not have generalised degrees of freedom (so it won't work with Hermite-type elements, say). The additional functionality to deal with such elements could easily be added (once a a suitable test case is written). For now we simply throw errors if an attempt is made to use the element with an unsuitable bulk element.

Constructor & Destructor Documentation

◆ ImposeDisplacementByLagrangeMultiplierElement()

template<class ELEMENT >
oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::ImposeDisplacementByLagrangeMultiplierElement ( FiniteElement *const &  element_pt,
const int face_index,
const unsigned id = 0,
const bool called_from_refineable_constructor = false 
)
inline

Constructor takes a "bulk" element and the index that identifies which face the FaceElement is supposed to be attached to. The optional identifier can be used to distinguish the additional nodal values created by this element from thos created by other FaceElements.

1119  : FaceGeometry<ELEMENT>(), FaceElement(), Boundary_shape_geom_object_pt(0)
1120  {
1121  // Store the ID of the FaceElement -- this is used to distinguish
1122  // it from any others
1123  Id = id;
1124 
1125  // By default sparsify, i.e. check if the GeomObject that
1126  // defines the boundary contains sub-GeomObjects. If so,
1127  // only use their GeomData as the external Data that affects
1128  // this element's residuals.
1129  Sparsify = true;
1130 
1131  // Build the face element
1132  element_pt->build_face_element(face_index, this);
1133 
1134 #ifdef PARANOID
1135  {
1136  // Initialise number of assigned geom Data.
1137  N_assigned_geom_data = 0;
1138 
1139  // Check that the bulk element is not a refineable 3d element
1140  if (!called_from_refineable_constructor)
1141  {
1142  if (element_pt->dim() == 3)
1143  {
1144  // Is it refineable
1145  RefineableElement* ref_el_pt =
1146  dynamic_cast<RefineableElement*>(element_pt);
1147  if (ref_el_pt != 0)
1148  {
1149  if (this->has_hanging_nodes())
1150  {
1151  throw OomphLibError(
1152  "This face element will not work correctly if nodes are "
1153  "hanging\nUse the refineable version instead. ",
1156  }
1157  }
1158  }
1159  }
1160  }
1161 
1162  {
1163  // Check that the bulk element does not require generalised positional
1164  // degrees of freedom
1165  if (element_pt->nnodal_position_type() != 1)
1166  {
1167  throw OomphLibError(
1168  "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) "
1169  "be used with elements that have generalised positional dofs",
1172  }
1173  }
1174 #endif
1175 
1176  // Dimension of the bulk element
1177  unsigned dim = element_pt->dim();
1178 
1179  // We need dim additional values for each FaceElement node
1180  // to store the dim Lagrange multipliers.
1181  Vector<unsigned> n_additional_values(nnode(), dim);
1182 
1183  // Now add storage for Lagrange multipliers and set the map containing
1184  // the position of the first entry of this face element's
1185  // additional values.
1186  add_additional_values(n_additional_values, id);
1187  }
int & face_index()
Definition: elements.h:4626
FaceElement()
Constructor: Initialise all appropriate member data.
Definition: elements.h:4446
void add_additional_values(const Vector< unsigned > &nadditional_values, const unsigned &id)
Definition: elements.h:4428
unsigned dim() const
Definition: elements.h:2611
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
bool has_hanging_nodes() const
Definition: elements.h:2470
unsigned Id
Lagrange Id.
Definition: solid_traction_elements.h:1952
GeomObject * Boundary_shape_geom_object_pt
Definition: solid_traction_elements.h:1970
bool Sparsify
Definition: solid_traction_elements.h:1982
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::FaceElement::add_additional_values(), oomph::FiniteElement::build_face_element(), oomph::FiniteElement::dim(), oomph::FaceElement::face_index(), oomph::FiniteElement::has_hanging_nodes(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Id, oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Sparsify.

Member Function Documentation

◆ boundary_shape_geom_object_pt()

template<class ELEMENT >
GeomObject* oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::boundary_shape_geom_object_pt ( ) const
inline

Access to GeomObject that specifies the prescribed boundary displacement; GeomObject is assumed to be parametrised by the same coordinate that is used as the boundary coordinate in the bulk solid mesh to which this element is attached.

1196  {
1198  }

References oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Boundary_shape_geom_object_pt.

Referenced by oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::set_boundary_shape_geom_object_pt().

◆ fill_in_contribution_to_jacobian()

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlinevirtual

Fill in contribution from Jacobian.

Reimplemented from oomph::SolidFiniteElement.

Reimplemented in oomph::RefineableImposeDisplacementByLagrangeMultiplierElement< ELEMENT >.

1366  {
1367  // Call the generic routine with the flag set to 1
1369  residuals, jacobian, 1);
1370 
1371  // Fill in the derivatives w.r.t. external data by FD, re-using
1372  // the pre-computed residual vector
1373  fill_in_jacobian_from_external_by_fd(residuals, jacobian);
1374  }
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.cc:1199
void fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Definition: solid_traction_elements.h:1676

References oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(), and oomph::GeneralisedElement::fill_in_jacobian_from_external_by_fd().

Referenced by oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_jacobian_and_mass_matrix().

◆ fill_in_contribution_to_jacobian_and_mass_matrix()

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_jacobian_and_mass_matrix ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix 
)
inlinevirtual

Fill in contribution to Mass matrix and Jacobian. There is no contributiont to mass matrix so simply call the fill_in_contribution_to_jacobian term Note that the Jacobian is multiplied by minus one to ensure that the mass matrix is positive semi-definite.

Reimplemented from oomph::GeneralisedElement.

1386  {
1387  // Just call the jacobian calculation
1388  fill_in_contribution_to_jacobian(residuals, jacobian);
1389 
1390  // Multiply the residuals and jacobian by minus one
1391  const unsigned n_dof = this->ndof();
1392  for (unsigned i = 0; i < n_dof; i++)
1393  {
1394  residuals[i] *= -1.0;
1395  for (unsigned j = 0; j < n_dof; j++)
1396  {
1397  jacobian(i, j) *= -1.0;
1398  }
1399  }
1400  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
Definition: solid_traction_elements.h:1364
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_jacobian(), i, j, and oomph::GeneralisedElement::ndof().

◆ fill_in_contribution_to_residuals()

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inlinevirtual

◆ fill_in_generic_contribution_to_residuals_displ_lagr_multiplier()

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_generic_contribution_to_residuals_displ_lagr_multiplier ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
const unsigned flag 
)
inlineprotected

Helper function to compute the residuals and, if flag==1, the Jacobian

1680  {
1681  // Find out how many positional dofs there are
1682  unsigned n_position_type = this->nnodal_position_type();
1683 
1684 #ifdef PARANOID
1685  if (n_position_type != 1)
1686  {
1687  throw OomphLibError(
1688  "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) be "
1689  "used with elements that have generalised positional dofs",
1692  }
1693 #endif
1694 
1695  // Find out how many nodes there are
1696  unsigned n_node = nnode();
1697 
1698  // Dimension of element
1699  unsigned dim_el = dim();
1700 
1701  // Set up memory for the shape functions
1702  Shape psi(n_node);
1703  DShape dpsids(n_node, dim_el);
1704 
1705  // Set the value of n_intpt
1706  unsigned n_intpt = integral_pt()->nweight();
1707 
1708  // Loop over the integration points
1709  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1710  {
1711  // Get the integral weight
1712  double w = integral_pt()->weight(ipt);
1713 
1714  // Only need to call the local derivatives
1715  dshape_local_at_knot(ipt, psi, dpsids);
1716 
1717  // Calculate the Eulerian coordinates and Lagrange multiplier
1718  Vector<double> x(dim_el + 1, 0.0);
1719  Vector<double> lambda(dim_el + 1, 0.0);
1720  Vector<double> zeta(dim_el, 0.0);
1721  DenseMatrix<double> interpolated_a(dim_el, dim_el + 1, 0.0);
1722 
1723  // Loop over nodes
1724  for (unsigned j = 0; j < n_node; j++)
1725  {
1726  Node* nod_pt = node_pt(j);
1727 
1728  // Cast to a boundary node
1729  BoundaryNodeBase* bnod_pt =
1730  dynamic_cast<BoundaryNodeBase*>(node_pt(j));
1731 
1732  // Get the index of the first nodal value associated with
1733  // this FaceElement
1734  unsigned first_index =
1735  bnod_pt->index_of_first_value_assigned_by_face_element(Id);
1736 
1737  // Assemble higher-dimensional quantities
1738  for (unsigned i = 0; i < dim_el + 1; i++)
1739  {
1740  x[i] += nodal_position(j, i) * psi(j);
1741  lambda[i] += nod_pt->value(first_index + i) * psi(j);
1742  for (unsigned ii = 0; ii < dim_el; ii++)
1743  {
1744  interpolated_a(ii, i) +=
1745  lagrangian_position(j, i) * dpsids(j, ii);
1746  }
1747  }
1748  if (!Sparsify)
1749  {
1750  for (unsigned k = 0; k < n_position_type; k++)
1751  {
1752  // Assemble in-element quantities: boundary coordinate
1753  for (unsigned i = 0; i < dim_el; i++)
1754  {
1755  zeta[i] += zeta_nodal(j, k, i) * psi(j, k);
1756  }
1757  }
1758  }
1759  }
1760 
1761  if (Sparsify) zeta = Zeta_sub_geom_object[ipt];
1762 
1763 
1764  // Now find the local undeformed metric tensor from the tangent Vectors
1765  DenseMatrix<double> a(dim_el);
1766  for (unsigned i = 0; i < dim_el; i++)
1767  {
1768  for (unsigned j = 0; j < dim_el; j++)
1769  {
1770  // Initialise surface metric tensor to zero
1771  a(i, j) = 0.0;
1772  // Take the dot product
1773  for (unsigned k = 0; k < dim_el + 1; k++)
1774  {
1775  a(i, j) += interpolated_a(i, k) * interpolated_a(j, k);
1776  }
1777  }
1778  }
1779 
1780 
1781  // Find the determinant of the metric tensor
1782  double adet = 0.0;
1783  switch (dim_el + 1)
1784  {
1785  case 2:
1786  adet = a(0, 0);
1787  break;
1788 
1789  case 3:
1790  adet = a(0, 0) * a(1, 1) - a(0, 1) * a(1, 0);
1791  break;
1792 
1793  default:
1794  throw OomphLibError(
1795  "Wrong dimension "
1796  "fill_in_generic_contribution_to_residuals_displ_lagr_multiplier",
1797  "ImposeDisplacementByLagrangeMultiplierElement::fill_in_generic_"
1798  "contribution_to_residuals_displ_lagr_multiplier()",
1800  }
1801 
1802  // Get prescribed wall shape
1803  Vector<double> r_prescribed(dim_el + 1);
1804  if (!Sparsify)
1805  {
1807  }
1808  else
1809  {
1810  Sub_geom_object_pt[ipt]->position(zeta, r_prescribed);
1811  }
1812 
1813  // Premultiply the weights and the square-root of the determinant of
1814  // the metric tensor
1815  double W = w * sqrt(adet);
1816 
1817  // Assemble residuals and jacobian
1818 
1819  // Loop over directions
1820  for (unsigned i = 0; i < dim_el + 1; i++)
1821  {
1822  // Loop over the nodes
1823  for (unsigned j = 0; j < n_node; j++)
1824  {
1825  // Assemble residual for Lagrange multiplier:
1826 
1827  // Cast to a boundary node
1828  BoundaryNodeBase* bnod_pt =
1829  dynamic_cast<BoundaryNodeBase*>(node_pt(j));
1830 
1831  // Local eqn number:
1832  int local_eqn = nodal_local_eqn(
1833  j,
1834  bnod_pt->index_of_first_value_assigned_by_face_element(Id) + i);
1835 
1836 
1837  if (local_eqn >= 0)
1838  {
1839  residuals[local_eqn] += (x[i] - r_prescribed[i]) * psi(j) * W;
1840 
1841  // Do Jacobian too?
1842  if (flag == 1)
1843  {
1844  // Loop over the nodes again for unknowns (only diagonal
1845  // contribution to direction!).
1846  for (unsigned jj = 0; jj < n_node; jj++)
1847  {
1848  int local_unknown = position_local_eqn(jj, 0, i);
1849  if (local_unknown >= 0)
1850  {
1851  jacobian(local_eqn, local_unknown) += psi(jj) * psi(j) * W;
1852  }
1853  }
1854  }
1855  }
1856 
1857 
1858  // Add Lagrange multiplier contribution to bulk equations
1859 
1860  // Local eqn number: Node, type, direction
1861  local_eqn = position_local_eqn(j, 0, i);
1862  if (local_eqn >= 0)
1863  {
1864  // Add to residual
1865  residuals[local_eqn] += lambda[i] * psi(j) * W;
1866 
1867  // Do Jacobian too?
1868  if (flag == 1)
1869  {
1870  // Loop over the nodes again for unknowns (only diagonal
1871  // contribution to direction!).
1872  for (unsigned jj = 0; jj < n_node; jj++)
1873  {
1874  // Cast to a boundary node
1875  BoundaryNodeBase* bnode_pt =
1876  dynamic_cast<BoundaryNodeBase*>(node_pt(jj));
1877 
1878  int local_unknown = nodal_local_eqn(
1879  jj,
1880  bnode_pt->index_of_first_value_assigned_by_face_element(
1881  Id) +
1882  i);
1883  if (local_unknown >= 0)
1884  {
1885  jacobian(local_eqn, local_unknown) += psi(jj) * psi(j) * W;
1886  }
1887  }
1888  }
1889  }
1890  }
1891  }
1892 
1893 
1894  } // End of loop over the integration points
1895  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
cout<< "The eigenvalues of A are:"<< endl<< ces.eigenvalues()<< endl;cout<< "The matrix of eigenvectors, V, is:"<< endl<< ces.eigenvectors()<< endl<< endl;complex< float > lambda
Definition: ComplexEigenSolver_compute.cpp:9
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnodal_position_type() const
Definition: elements.h:2463
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Definition: elements.cc:3239
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
double nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
Vector< Vector< double > > Zeta_sub_geom_object
Definition: solid_traction_elements.h:1977
Vector< GeomObject * > Sub_geom_object_pt
Storage for sub-GeomObject at the integration points.
Definition: solid_traction_elements.h:1973
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4921
double lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n.
Definition: elements.h:3905
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Definition: elements.h:4137
const Scalar * a
Definition: level2_cplx_impl.h:32
char char char int int * k
Definition: level2_impl.h:374
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
@ W
Definition: quadtree.h:63
list x
Definition: plotDoE.py:28

References a, oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Boundary_shape_geom_object_pt, oomph::FiniteElement::dim(), oomph::FiniteElement::dshape_local_at_knot(), i, oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Id, oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element(), oomph::FiniteElement::integral_pt(), j, k, oomph::SolidFiniteElement::lagrangian_position(), lambda, oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_local_eqn(), oomph::FiniteElement::nodal_position(), oomph::FiniteElement::node_pt(), oomph::Integral::nweight(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), oomph::SolidFiniteElement::position_local_eqn(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Sparsify, sqrt(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Sub_geom_object_pt, oomph::Node::value(), w, oomph::QuadTreeNames::W, oomph::Integral::weight(), plotDoE::x, Eigen::zeta(), oomph::SolidFaceElement::zeta_nodal(), and oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Zeta_sub_geom_object.

Referenced by oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_jacobian(), and oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_residuals().

◆ get_dof_numbers_for_unknowns()

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::get_dof_numbers_for_unknowns ( std::list< std::pair< unsigned long, unsigned >> &  dof_lookup_list) const
inlineprotectedvirtual

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 that this unknown is associated with. (Function can obviously only be called if the equation numbering scheme has been set up.)

Reimplemented from oomph::GeneralisedElement.

1915  {
1916  // temporary pair (used to store dof lookup prior to being added to list)
1917  std::pair<unsigned, unsigned> dof_lookup;
1918 
1919  // number of nodes
1920  const unsigned n_node = this->nnode();
1921 
1922  // Loop over directions
1923  unsigned dim_el = this->dim();
1924  for (unsigned i = 0; i < dim_el + 1; i++)
1925  {
1926  // Loop over the nodes
1927  for (unsigned j = 0; j < n_node; j++)
1928  {
1929  // Cast to a boundary node
1930  BoundaryNodeBase* bnod_pt =
1931  dynamic_cast<BoundaryNodeBase*>(node_pt(j));
1932 
1933  // Local eqn number:
1934  int local_eqn = nodal_local_eqn(
1935  j, bnod_pt->index_of_first_value_assigned_by_face_element(Id) + i);
1936  if (local_eqn >= 0)
1937  {
1938  // store dof lookup in temporary pair: First entry in pair
1939  // is global equation number; second entry is dof type
1940  dof_lookup.first = this->eqn_number(local_eqn);
1941  dof_lookup.second = i;
1942 
1943  // add to list
1944  dof_lookup_list.push_front(dof_lookup);
1945  }
1946  }
1947  }
1948  }
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704

References oomph::FiniteElement::dim(), oomph::GeneralisedElement::eqn_number(), i, oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Id, oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element(), j, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_local_eqn(), and oomph::FiniteElement::node_pt().

◆ ndof_types()

template<class ELEMENT >
unsigned oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::ndof_types ( ) const
inlineprotectedvirtual

The number of "DOF types" that degrees of freedom in this element are sub-divided into: We only label the Lagrange multiplier degrees of freedom (one for each spatial dimension)

Reimplemented from oomph::GeneralisedElement.

1902  {
1903  return this->dim() + 1;
1904  }

References oomph::FiniteElement::dim().

◆ output() [1/2]

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::output ( std::ostream &  outfile)
inlinevirtual

Output function.

Reimplemented from oomph::FiniteElement.

1509  {
1510  unsigned n_plot = 5;
1511  output(outfile, n_plot);
1512  }
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
Definition: solid_traction_elements.h:1404

References oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::output().

◆ output() [2/2]

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::output ( std::ostream &  outfile,
const unsigned n_plot 
)
inlinevirtual

Output function.

Reimplemented from oomph::FiniteElement.

1405  {
1406  // Elemental dimension
1407  unsigned dim_el = dim();
1408 
1409  // Find the number of positional types
1410  unsigned n_position_type = this->nnodal_position_type();
1411 
1412 #ifdef PARANOID
1413  if (n_position_type != 1)
1414  {
1415  throw OomphLibError(
1416  "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) be "
1417  "used with elements that have generalised positional dofs",
1420  }
1421 #endif
1422 
1423 
1424  // Local coord
1425  Vector<double> s(dim_el);
1426 
1427  // # of nodes,
1428  unsigned n_node = nnode();
1429  Shape psi(n_node, n_position_type);
1430 
1431  // Tecplot header info
1432  outfile << this->tecplot_zone_string(n_plot);
1433 
1434  // Loop over plot points
1435  unsigned num_plot_points = this->nplot_points(n_plot);
1436  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
1437  {
1438  // Get local coordinates of plot point
1439  this->get_s_plot(iplot, n_plot, s);
1440 
1441  // Get shape function
1442  shape(s, psi);
1443 
1444  // Calculate the Eulerian coordinates and Lagrange multiplier
1445  Vector<double> x(dim_el + 1, 0.0);
1446  Vector<double> lambda(dim_el + 1, 0.0);
1447  Vector<double> zeta(dim_el, 0.0);
1448  for (unsigned j = 0; j < n_node; j++)
1449  {
1450  // Cast to a boundary node
1451  BoundaryNodeBase* bnod_pt =
1452  dynamic_cast<BoundaryNodeBase*>(node_pt(j));
1453 
1454  // get the node pt
1455  Node* nod_pt = node_pt(j);
1456 
1457  // Get the index of the first nodal value associated with
1458  // this FaceElement
1459  unsigned first_index =
1460  bnod_pt->index_of_first_value_assigned_by_face_element(Id);
1461 
1462  // higher dimensional quantities
1463  for (unsigned i = 0; i < dim_el + 1; i++)
1464  {
1465  x[i] += nodal_position(j, i) * psi(j, 0); // need to sort
1466  // this out properly
1467  // for generalised dofs
1468  lambda[i] += nod_pt->value(first_index + i) * psi(j, 0);
1469  }
1470  // In-element quantities
1471  for (unsigned i = 0; i < dim_el; i++)
1472  {
1473  // Loop over positional types
1474  for (unsigned k = 0; k < n_position_type; k++)
1475  {
1476  zeta[i] += zeta_nodal(j, k, i) * psi(j, k);
1477  }
1478  }
1479  }
1480 
1481  // Get prescribed wall shape
1482  Vector<double> r_prescribed(dim_el + 1);
1484 
1485  // Output stuff
1486  for (unsigned i = 0; i < dim_el + 1; i++)
1487  {
1488  outfile << x[i] << " ";
1489  }
1490  for (unsigned i = 0; i < dim_el + 1; i++)
1491  {
1492  outfile << -lambda[i] << " ";
1493  }
1494  for (unsigned i = 0; i < dim_el + 1; i++)
1495  {
1496  outfile << r_prescribed[i] << " ";
1497  }
1498  /* for(unsigned i=0;i<dim_el;i++) */
1499  /* { */
1500  /* outfile << zeta[i] << " "; */
1501  /* } */
1502  outfile << std::endl;
1503  }
1504  }
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Definition: elements.h:3161
virtual void shape(const Vector< double > &s, Shape &psi) const =0
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Definition: elements.h:3148
virtual unsigned nplot_points(const unsigned &nplot) const
Definition: elements.h:3186
RealScalar s
Definition: level1_cplx_impl.h:130

References oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Boundary_shape_geom_object_pt, oomph::FiniteElement::dim(), oomph::FiniteElement::get_s_plot(), i, oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Id, oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element(), j, k, lambda, oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_position(), oomph::FiniteElement::node_pt(), oomph::FiniteElement::nplot_points(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), s, oomph::FiniteElement::shape(), oomph::FiniteElement::tecplot_zone_string(), oomph::Node::value(), plotDoE::x, Eigen::zeta(), and oomph::SolidFaceElement::zeta_nodal().

Referenced by oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::output().

◆ set_boundary_shape_geom_object_pt()

template<class ELEMENT >
void oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::set_boundary_shape_geom_object_pt ( GeomObject boundary_shape_geom_object_pt,
const unsigned boundary_number_in_bulk_mesh 
)
inline

Set GeomObject that specifies the prescribed boundary displacement; GeomObject is assumed to be parametrised by the same coordinate that is used as the boundary coordinate in the bulk solid mesh to which this element is attached. GeomData of GeomObject is added to this element's external Data. Also specify the boundary number in the bulk mesh to which this element is attached.

1212  {
1213  // Record boundary number
1214 #ifdef PARANOID
1215  Boundary_number_in_bulk_mesh_has_been_set = true;
1216 #endif
1218 
1219 
1220  // Store (possibly compound) GeomObject that specifies the
1221  // the desired boundary shape.
1223 
1224 
1225  // Don't sparsify: Use all the geometric Data associated with
1226  // the (possibly compound) GeomObject that specifies the
1227  // boundary shape as external data for this element.
1228  if (!Sparsify)
1229  {
1230  unsigned n_geom_data = boundary_shape_geom_object_pt->ngeom_data();
1231 
1232 #ifdef PARANOID
1233  if ((this->nexternal_data() > 0) &&
1234  (N_assigned_geom_data != this->nexternal_data()))
1235  {
1236  std::ostringstream error_message;
1237  error_message << "About to wipe external data for "
1238  << "ImposeDisplacementByLagrangeMultiplierElement.\n"
1239  << "I noted that N_assigned_geom_data = "
1240  << N_assigned_geom_data
1241  << " != nexternal_data() = " << this->nexternal_data()
1242  << " \n"
1243  << "so we're going to wipe some external data that\n"
1244  << "is not geometric Data of the GeomObject that\n"
1245  << "specifies the desired boundary shape.\n"
1246  << std::endl;
1247  throw OomphLibError(error_message.str(),
1250  }
1251 #endif
1252  this->flush_external_data();
1253  for (unsigned i = 0; i < n_geom_data; i++)
1254  {
1256  }
1257 #ifdef PARANOID
1258  N_assigned_geom_data = n_geom_data;
1259 #endif
1260  }
1261  // Sparsify: Use locate_zeta to determine the sub-GeomObjects that
1262  // make up the (possibly compound) GeomObject that specifies the
1263  // boundary shape. Use their geometric Data as external data for
1264  // this element.
1265  else
1266  {
1267  // Find out how many nodes there are
1268  unsigned n_node = nnode();
1269 
1270  // Get the number of position dofs and dimensions at the node
1271  const unsigned n_position_type = nnodal_position_type();
1272 
1273  // Dimension of element
1274  unsigned dim_el = dim();
1275 
1276  // Set up memory for the shape functions
1277  Shape psi(n_node);
1278 
1279 
1280 #ifdef PARANOID
1281  if ((this->nexternal_data() > 0) &&
1282  (N_assigned_geom_data != this->nexternal_data()))
1283  {
1284  std::ostringstream error_message;
1285  error_message << "About to wipe external data for "
1286  << "ImposeDisplacementByLagrangeMultiplierElement.\n"
1287  << "I noted that N_assigned_geom_data = "
1288  << N_assigned_geom_data
1289  << " != nexternal_data() = " << this->nexternal_data()
1290  << " \n"
1291  << "so we're going to wipe some external data that\n"
1292  << "is not geometric Data of the GeomObject that\n"
1293  << "specifies the desired boundary shape.\n"
1294  << std::endl;
1295  throw OomphLibError(error_message.str(),
1298  }
1299 #endif
1300 
1301  // Flush the data
1302  this->flush_external_data();
1303 
1304 #ifdef PARANOID
1305  N_assigned_geom_data = 0;
1306 #endif
1307 
1308  // Prepare local storage
1309  unsigned n_intpt = integral_pt()->nweight();
1310  Sub_geom_object_pt.resize(n_intpt);
1311  Zeta_sub_geom_object.resize(n_intpt);
1312 
1313  // Loop over the integration points
1314  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1315  {
1316  // Get shape function
1317  shape_at_knot(ipt, psi);
1318 
1319  // Calculate the intrinsic coordinates
1320  Vector<double> zeta(dim_el, 0.0);
1321  Vector<double> s(dim_el);
1322 
1323  // Loop over nodes
1324  for (unsigned j = 0; j < n_node; j++)
1325  {
1326  for (unsigned k = 0; k < n_position_type; k++)
1327  {
1328  // Assemble the intrinsic coordinate
1329  for (unsigned i = 0; i < dim_el; i++)
1330  {
1331  zeta[i] += zeta_nodal(j, k, i) * psi(j, k);
1332  }
1333  }
1334  }
1335 
1336  // Find sub-GeomObject and local coordinate within it
1337  // at integration point
1338  Zeta_sub_geom_object[ipt].resize(dim_el);
1341 
1342  unsigned n_geom_data = Sub_geom_object_pt[ipt]->ngeom_data();
1343  for (unsigned i = 0; i < n_geom_data; i++)
1344  {
1346  }
1347 #ifdef PARANOID
1348  N_assigned_geom_data += n_geom_data;
1349 #endif
1350  }
1351  }
1352  }
unsigned Boundary_number_in_bulk_mesh
The boundary number in the bulk mesh to which this element is attached.
Definition: elements.h:4388
const unsigned & boundary_number_in_bulk_mesh() const
Broken assignment operator.
Definition: elements.h:4475
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Definition: elements.cc:3220
unsigned nexternal_data() const
Return the number of external data objects.
Definition: elements.h:829
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
virtual unsigned ngeom_data() const
Definition: geom_objects.h:209
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
Definition: geom_objects.h:381
virtual Data * geom_data_pt(const unsigned &j)
Definition: geom_objects.h:233
GeomObject * boundary_shape_geom_object_pt() const
Definition: solid_traction_elements.h:1195
Data * geom_data_pt(const unsigned &j)
Definition: elements.h:3615

References oomph::GeneralisedElement::add_external_data(), oomph::FaceElement::Boundary_number_in_bulk_mesh, oomph::FaceElement::boundary_number_in_bulk_mesh(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::boundary_shape_geom_object_pt(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Boundary_shape_geom_object_pt, oomph::FiniteElement::dim(), oomph::GeneralisedElement::flush_external_data(), oomph::SolidFiniteElement::geom_data_pt(), oomph::GeomObject::geom_data_pt(), i, oomph::FiniteElement::integral_pt(), j, k, oomph::GeomObject::locate_zeta(), oomph::GeneralisedElement::nexternal_data(), oomph::GeomObject::ngeom_data(), oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::Integral::nweight(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, oomph::FiniteElement::shape_at_knot(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Sparsify, oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Sub_geom_object_pt, Eigen::zeta(), oomph::SolidFaceElement::zeta_nodal(), and oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Zeta_sub_geom_object.

Referenced by ContactProblem< ELEMENT >::create_displ_imposition_elements(), UnstructuredTorusProblem< ELEMENT >::create_lagrange_multiplier_elements(), FSICollapsibleChannelProblem< ELEMENT >::create_lagrange_multiplier_elements(), PseudoElasticCollapsibleChannelProblem< FLUID_ELEMENT, SOLID_ELEMENT >::create_lagrange_multiplier_elements(), FSIChannelWithLeafletProblem< ELEMENT >::create_lagrange_multiplier_elements(), UnstructuredFSIProblem< FLUID_ELEMENT, SOLID_ELEMENT >::create_lagrange_multiplier_elements(), PrescribedBoundaryDisplacementProblem< ELEMENT >::create_lagrange_multiplier_elements(), UnstructuredImmersedEllipseProblem< ELEMENT >::create_lagrange_multiplier_elements(), UnstructuredFluidProblem< ELEMENT >::create_lagrange_multiplier_elements(), CollapsibleChannelProblem< ELEMENT >::create_lagrange_multiplier_elements(), and oomph::NonLinearElasticitySmoothMesh< ELEMENT >::operator()().

◆ square_of_l2_norm_of_error()

template<class ELEMENT >
double oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::square_of_l2_norm_of_error ( )
inline

Compute square of L2 norm of error between prescribed and actual displacement

1518  {
1519  // Find out how many positional dofs there are
1520  unsigned n_position_type = this->nnodal_position_type();
1521 
1522 #ifdef PARANOID
1523  if (n_position_type != 1)
1524  {
1525  throw OomphLibError(
1526  "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) be "
1527  "used with elements that have generalised positional dofs",
1530  }
1531 #endif
1532 
1533  // Find out how many nodes there are
1534  unsigned n_node = nnode();
1535 
1536  // Dimension of element
1537  unsigned dim_el = dim();
1538 
1539  // Set up memory for the shape functions
1540  Shape psi(n_node);
1541  DShape dpsids(n_node, dim_el);
1542 
1543  // Set the value of n_intpt
1544  unsigned n_intpt = integral_pt()->nweight();
1545 
1546 
1547  // Initialise error
1548  double squared_error = 0.0;
1549 
1550  // Loop over the integration points
1551  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1552  {
1553  // Get the integral weight
1554  double w = integral_pt()->weight(ipt);
1555 
1556  // Only need to call the local derivatives
1557  dshape_local_at_knot(ipt, psi, dpsids);
1558 
1559  // Calculate the Eulerian coordinates and Lagrange multiplier
1560  Vector<double> x(dim_el + 1, 0.0);
1561  Vector<double> lambda(dim_el + 1, 0.0);
1562  Vector<double> zeta(dim_el, 0.0);
1563  DenseMatrix<double> interpolated_a(dim_el, dim_el + 1, 0.0);
1564 
1565  // Loop over nodes
1566  for (unsigned j = 0; j < n_node; j++)
1567  {
1568  Node* nod_pt = node_pt(j);
1569 
1570  // Cast to a boundary node
1571  BoundaryNodeBase* bnod_pt =
1572  dynamic_cast<BoundaryNodeBase*>(node_pt(j));
1573 
1574  // Get the index of the first nodal value associated with
1575  // this FaceElement
1576  unsigned first_index =
1577  bnod_pt->index_of_first_value_assigned_by_face_element(Id);
1578 
1579  // Assemble higher-dimensional quantities
1580  for (unsigned i = 0; i < dim_el + 1; i++)
1581  {
1582  x[i] += nodal_position(j, i) * psi(j);
1583  lambda[i] += nod_pt->value(first_index + i) * psi(j);
1584  for (unsigned ii = 0; ii < dim_el; ii++)
1585  {
1586  interpolated_a(ii, i) +=
1587  lagrangian_position(j, i) * dpsids(j, ii);
1588  }
1589  }
1590  if (!Sparsify)
1591  {
1592  for (unsigned k = 0; k < n_position_type; k++)
1593  {
1594  // Assemble in-element quantities: boundary coordinate
1595  for (unsigned i = 0; i < dim_el; i++)
1596  {
1597  zeta[i] += zeta_nodal(j, k, i) * psi(j, k);
1598  }
1599  }
1600  }
1601  }
1602 
1603  if (Sparsify) zeta = Zeta_sub_geom_object[ipt];
1604 
1605 
1606  // Now find the local undeformed metric tensor from the tangent Vectors
1607  DenseMatrix<double> a(dim_el);
1608  for (unsigned i = 0; i < dim_el; i++)
1609  {
1610  for (unsigned j = 0; j < dim_el; j++)
1611  {
1612  // Initialise surface metric tensor to zero
1613  a(i, j) = 0.0;
1614  // Take the dot product
1615  for (unsigned k = 0; k < dim_el + 1; k++)
1616  {
1617  a(i, j) += interpolated_a(i, k) * interpolated_a(j, k);
1618  }
1619  }
1620  }
1621 
1622 
1623  // Find the determinant of the metric tensor
1624  double adet = 0.0;
1625  switch (dim_el + 1)
1626  {
1627  case 2:
1628  adet = a(0, 0);
1629  break;
1630 
1631  case 3:
1632  adet = a(0, 0) * a(1, 1) - a(0, 1) * a(1, 0);
1633  break;
1634 
1635  default:
1636  throw OomphLibError(
1637  "Wrong dimension "
1638  "fill_in_generic_contribution_to_residuals_displ_lagr_multiplier",
1639  "ImposeDisplacementByLagrangeMultiplierElement::fill_in_generic_"
1640  "contribution_to_residuals_displ_lagr_multiplier()",
1642  }
1643 
1644  // Get prescribed wall shape
1645  Vector<double> r_prescribed(dim_el + 1);
1646  if (!Sparsify)
1647  {
1649  }
1650  else
1651  {
1652  Sub_geom_object_pt[ipt]->position(zeta, r_prescribed);
1653  }
1654 
1655  // Premultiply the weights and the square-root of the determinant of
1656  // the metric tensor
1657  double W = w * sqrt(adet);
1658 
1659  // Assemble error
1660 
1661  // Loop over directions
1662  for (unsigned i = 0; i < dim_el + 1; i++)
1663  {
1664  squared_error +=
1665  (x[i] - r_prescribed[i]) * (x[i] - r_prescribed[i]) * W;
1666  }
1667  } // End of loop over the integration points
1668 
1669  return squared_error;
1670  }

References a, oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Boundary_shape_geom_object_pt, oomph::FiniteElement::dim(), oomph::FiniteElement::dshape_local_at_knot(), i, oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Id, oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element(), oomph::FiniteElement::integral_pt(), j, k, oomph::SolidFiniteElement::lagrangian_position(), lambda, oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_position(), oomph::FiniteElement::node_pt(), oomph::Integral::nweight(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Sparsify, sqrt(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Sub_geom_object_pt, oomph::Node::value(), w, oomph::QuadTreeNames::W, oomph::Integral::weight(), plotDoE::x, Eigen::zeta(), oomph::SolidFaceElement::zeta_nodal(), and oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::Zeta_sub_geom_object.

Member Data Documentation

◆ Boundary_shape_geom_object_pt

◆ Id

◆ Sparsify

◆ Sub_geom_object_pt

◆ Zeta_sub_geom_object


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