oomph::RefineableSolidElement Class Reference

#include <refineable_elements.h>

+ Inheritance diagram for oomph::RefineableSolidElement:

Public Member Functions

 RefineableSolidElement ()
 Constructor. More...
 
virtual ~RefineableSolidElement ()
 Virtual Destructor, delete any allocated storage. More...
 
void assign_solid_local_eqn_numbers (const bool &store_local_dof_pt)
 
unsigned ngeom_data () const
 
Datageom_data_pt (const unsigned &j)
 
void identify_geometric_data (std::set< Data * > &geometric_data_pt)
 
void fill_in_jacobian_from_solid_position_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
bool is_undeformed_macro_element_used_for_new_lagrangian_coords () const
 
void enable_use_of_undeformed_macro_element_for_new_lagrangian_coords ()
 
void disable_use_of_undeformed_macro_element_for_new_lagrangian_coords ()
 
DenseMatrix< int > & local_position_hang_eqn (Node *const &node_pt)
 
virtual void further_build ()
 
- Public Member Functions inherited from oomph::RefineableElement
 RefineableElement ()
 
virtual ~RefineableElement ()
 Destructor, delete the allocated storage for the hanging equations. More...
 
 RefineableElement (const RefineableElement &)=delete
 Broken copy constructor. More...
 
void operator= (const RefineableElement &)=delete
 Broken assignment operator. More...
 
Treetree_pt ()
 Access function: Pointer to quadtree representation of this element. More...
 
void set_tree_pt (Tree *my_tree_pt)
 Set pointer to quadtree representation of this element. More...
 
virtual unsigned required_nsons () const
 
bool refinement_is_enabled ()
 Flag to indicate suppression of any refinement. More...
 
void disable_refinement ()
 Suppress of any refinement for this element. More...
 
void enable_refinement ()
 Emnable refinement for this element. More...
 
template<class ELEMENT >
void split (Vector< ELEMENT * > &son_pt) const
 
int local_hang_eqn (Node *const &node_pt, const unsigned &i)
 
virtual void build (Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built, std::ofstream &new_nodes_file)=0
 
void set_refinement_level (const int &refine_level)
 Set the refinement level. More...
 
unsigned refinement_level () const
 Return the Refinement level. More...
 
void select_for_refinement ()
 Select the element for refinement. More...
 
void deselect_for_refinement ()
 Deselect the element for refinement. More...
 
void select_sons_for_unrefinement ()
 Unrefinement will be performed by merging the four sons of this element. More...
 
void deselect_sons_for_unrefinement ()
 
bool to_be_refined ()
 Has the element been selected for refinement? More...
 
bool sons_to_be_unrefined ()
 Has the element been selected for unrefinement? More...
 
virtual void rebuild_from_sons (Mesh *&mesh_pt)=0
 
virtual void unbuild ()
 
virtual void deactivate_element ()
 
virtual bool nodes_built ()
 Return true if all the nodes have been built, false if not. More...
 
long number () const
 Element number (for debugging/plotting) More...
 
void set_number (const long &mynumber)
 Set element number (for debugging/plotting) More...
 
virtual unsigned ncont_interpolated_values () const =0
 
virtual void get_interpolated_values (const Vector< double > &s, Vector< double > &values)
 
virtual void get_interpolated_values (const unsigned &t, const Vector< double > &s, Vector< double > &values)=0
 
virtual Nodeinterpolating_node_pt (const unsigned &n, const int &value_id)
 
virtual double local_one_d_fraction_of_interpolating_node (const unsigned &n1d, const unsigned &i, const int &value_id)
 
virtual Nodeget_interpolating_node_at_local_coordinate (const Vector< double > &s, const int &value_id)
 
virtual unsigned ninterpolating_node (const int &value_id)
 
virtual unsigned ninterpolating_node_1d (const int &value_id)
 
virtual void interpolating_basis (const Vector< double > &s, Shape &psi, const int &value_id) const
 
virtual void check_integrity (double &max_error)=0
 
void identify_field_data_for_interactions (std::set< std::pair< Data *, unsigned >> &paired_field_data)
 
void assign_nodal_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual RefineableElementroot_element_pt ()
 
virtual RefineableElementfather_element_pt () const
 Return a pointer to the father element. More...
 
void get_father_at_refinement_level (unsigned &refinement_level, RefineableElement *&father_at_reflevel_pt)
 
virtual void initial_setup (Tree *const &adopted_father_pt=0, const unsigned &initial_p_order=0)
 
virtual void pre_build (Mesh *&mesh_pt, Vector< Node * > &new_node_pt)
 Pre-build the element. More...
 
virtual void setup_hanging_nodes (Vector< std::ofstream * > &output_stream)
 
virtual void further_setup_hanging_nodes ()
 
void get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
unsigned nshape_controlling_nodes ()
 
std::map< Node *, unsignedshape_controlling_node_lookup ()
 
- 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
 
virtual double J_eulerian (const Vector< double > &s) const
 
virtual double J_eulerian_at_knot (const unsigned &ipt) 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 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 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...
 
virtual double interpolated_x (const Vector< double > &s, const unsigned &i) const
 Return FE interpolated coordinate x[i] at local coordinate s. More...
 
virtual double interpolated_x (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
virtual void interpolated_x (const Vector< double > &s, Vector< double > &x) const
 Return FE interpolated position x[] at local coordinate s as Vector. More...
 
virtual void interpolated_x (const unsigned &t, const Vector< double > &s, Vector< double > &x) const
 
virtual double interpolated_dxdt (const Vector< double > &s, const unsigned &i, const unsigned &t)
 
virtual void interpolated_dxdt (const Vector< double > &s, const unsigned &t, Vector< double > &dxdt)
 
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 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 (std::ostream &outfile)
 
virtual void output (std::ostream &outfile, const unsigned &n_plot)
 
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)
 
virtual unsigned ndof_types () const
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- Public Member Functions inherited from oomph::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...
 
double zeta_nodal (const unsigned &n, const unsigned &k, const unsigned &i) const
 
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 double interpolated_xi (const Vector< double > &s, const unsigned &i) const
 
virtual void interpolated_xi (const Vector< double > &s, Vector< double > &xi) 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 assemble_local_to_lagrangian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
void assemble_local_to_lagrangian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
double local_to_lagrangian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
- Protected Member Functions inherited from oomph::RefineableElement
void assemble_local_to_eulerian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
void assemble_local_to_eulerian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
void assemble_eulerian_base_vectors (const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
 
double local_to_eulerian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
void assign_hanging_local_eqn_numbers (const bool &store_local_dof_pt)
 Assign the local equation numbers for hanging node variables. More...
 
virtual void fill_in_jacobian_from_nodal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
- Protected Member Functions inherited from oomph::FiniteElement
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 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
 
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)
 
virtual void fill_in_contribution_to_residuals (Vector< double > &residuals)
 
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_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)
 
- 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
 
void describe_solid_local_dofs (std::ostream &out, const std::string &current_string) const
 Classifies dofs locally for solid specific aspects. More...
 
void fill_in_contribution_to_jacobian (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

bool Use_undeformed_macro_element_for_new_lagrangian_coords
 
- Protected Attributes inherited from oomph::RefineableElement
TreeTree_pt
 A pointer to a general tree object. More...
 
unsigned Refine_level
 Refinement level. More...
 
bool To_be_refined
 Flag for refinement. More...
 
bool Refinement_is_enabled
 Flag to indicate suppression of any refinement. More...
 
bool Sons_to_be_unrefined
 Flag for unrefinement. More...
 
long Number
 Global element number – for plotting/validation purposes. More...
 
- 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
 

Private Member Functions

void assign_solid_hanging_local_eqn_numbers (const bool &store_local_dof_pt)
 

Private Attributes

std::map< Node *, DenseMatrix< int > > Local_position_hang_eqn
 

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 Member Functions inherited from oomph::RefineableElement
static doublemax_integrity_tolerance ()
 Max. allowed discrepancy in element integrity check. More...
 
- 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 Member Functions inherited from oomph::RefineableElement
static void check_value_id (const int &n_continuously_interpolated_values, const int &value_id)
 
- Static Protected Attributes inherited from oomph::RefineableElement
static double Max_integrity_tolerance = 1.0e-8
 Max. allowed discrepancy in element integrity check. More...
 
- 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

/////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// RefineableSolidElements are SolidFiniteElements that may be subdivided into children to provide a better local approximation to the solution. The distinction is required to keep a clean separation between problems that alter nodal positions and others. A number of procedures are generic and are included in this class.

Constructor & Destructor Documentation

◆ RefineableSolidElement()

oomph::RefineableSolidElement::RefineableSolidElement ( )
inline

Constructor.

929  : RefineableElement(),
932  {
933  }
RefineableElement()
Definition: refineable_elements.h:188
bool Use_undeformed_macro_element_for_new_lagrangian_coords
Definition: refineable_elements.h:899
SolidFiniteElement()
Constructor: Set defaults.
Definition: elements.h:3585

◆ ~RefineableSolidElement()

virtual oomph::RefineableSolidElement::~RefineableSolidElement ( )
inlinevirtual

Virtual Destructor, delete any allocated storage.

936 {}

Member Function Documentation

◆ assemble_local_to_lagrangian_jacobian()

void oomph::RefineableSolidElement::assemble_local_to_lagrangian_jacobian ( const DShape dpsids,
DenseMatrix< double > &  jacobian 
) const
protectedvirtual

Assemble the jacobian matrix for the mapping from local to lagrangian coordinates, given the derivatives of the shape function Overload the standard version to use the hanging information for the lagrangian coordinates.

Internal function that is used to assemble the jacobian of the mapping from local coordinates (s) to the lagrangian coordinates (xi), given the derivatives of the shape functions.

Reimplemented from oomph::SolidFiniteElement.

857  {
858  // Find the the dimension of the element
859  const unsigned el_dim = dim();
860  // Find the number of shape functions and shape functions types
861  const unsigned n_shape = nnode();
862  const unsigned n_shape_type = nnodal_lagrangian_type();
863 
864  // Loop over the rows of the jacobian
865  for (unsigned i = 0; i < el_dim; i++)
866  {
867  // Loop over the columns of the jacobian
868  for (unsigned j = 0; j < el_dim; j++)
869  {
870  // Zero the entry
871  jacobian(i, j) = 0.0;
872  // Loop over the shape functions
873  for (unsigned l = 0; l < n_shape; l++)
874  {
875  for (unsigned k = 0; k < n_shape_type; k++)
876  {
877  // Jacobian is dx_j/ds_i, which is represented by the sum
878  // over the dpsi/ds_i of the nodal points X j
879  // Use the hanging version here
880  jacobian(i, j) +=
881  lagrangian_position_gen(l, k, j) * dpsids(l, k, i);
882  }
883  }
884  }
885  }
886  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
unsigned dim() const
Definition: elements.h:2611
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
double lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:3912
unsigned nnodal_lagrangian_type() const
Definition: elements.h:3785
char char char int int * k
Definition: level2_impl.h:374
unsigned el_dim
dimension
Definition: overloaded_cartesian_element_body.h:30
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::FiniteElement::dim(), el_dim, i, j, k, oomph::SolidFiniteElement::lagrangian_position_gen(), oomph::SolidFiniteElement::nnodal_lagrangian_type(), and oomph::FiniteElement::nnode().

◆ assemble_local_to_lagrangian_jacobian2()

void oomph::RefineableSolidElement::assemble_local_to_lagrangian_jacobian2 ( const DShape d2psids,
DenseMatrix< double > &  jacobian2 
) const
protectedvirtual

Assemble the the "jacobian" matrix of second derivatives, given the second derivatives of the shape functions w.r.t. local coordinates Overload the standard version to use the hanging information for the lagrangian coordinates.

Internal function that is used to assemble the jacobian of second derivatives of the the mapping from local coordinates (s) to the lagrangian coordinates (xi), given the second derivatives of the shape functions.

Reimplemented from oomph::SolidFiniteElement.

896  {
897  // Find the the dimension of the element
898  const unsigned el_dim = dim();
899  // Find the number of shape functions and shape functions types
900  const unsigned n_shape = nnode();
901  const unsigned n_shape_type = nnodal_lagrangian_type();
902  // Find the number of second derivatives
903  const unsigned n_row = N2deriv[el_dim];
904 
905  // Assemble the "jacobian" (d^2 x_j/ds_i^2) for second derivatives of
906  // shape functions
907  // Loop over the rows (number of second derivatives)
908  for (unsigned i = 0; i < n_row; i++)
909  {
910  // Loop over the columns (element dimension
911  for (unsigned j = 0; j < el_dim; j++)
912  {
913  // Zero the entry
914  jacobian2(i, j) = 0.0;
915  // Loop over the shape functions
916  for (unsigned l = 0; l < n_shape; l++)
917  {
918  // Loop over the shape function types
919  for (unsigned k = 0; k < n_shape_type; k++)
920  {
921  // Add the terms to the jacobian entry
922  // Use the hanging version here
923  jacobian2(i, j) +=
924  lagrangian_position_gen(l, k, j) * d2psids(l, k, i);
925  }
926  }
927  }
928  }
929  }
static const unsigned N2deriv[]
Definition: elements.h:1483

References oomph::FiniteElement::dim(), el_dim, i, j, k, oomph::SolidFiniteElement::lagrangian_position_gen(), oomph::FiniteElement::N2deriv, oomph::SolidFiniteElement::nnodal_lagrangian_type(), and oomph::FiniteElement::nnode().

◆ assign_solid_hanging_local_eqn_numbers()

void oomph::RefineableSolidElement::assign_solid_hanging_local_eqn_numbers ( const bool store_local_dof_pt)
private

Assign local equation numbers to the hanging values associated with positions or additional solid values.

The standard equation numbering scheme for solid positions, so that hanging Node information is included.

1180  {
1181  // Find the number of nodes
1182  const unsigned n_node = nnode();
1183 
1184  // Check there are nodes!
1185  if (n_node > 0)
1186  {
1187  // Wipe the local matrix maps, they will be assigned below
1188  Local_position_hang_eqn.clear();
1189 
1190  // Find the local numbers
1191  const unsigned n_position_type = nnodal_position_type();
1192  const unsigned nodal_dim = nodal_dimension();
1193 
1194  // Matrix structure to store all positional equations at a node
1195  DenseMatrix<int> Position_local_eqn_at_node(n_position_type, nodal_dim);
1196 
1197  // Map that store whether the node's equation numbers have already been
1198  // added to the local arrays
1199  std::map<Node*, bool> local_eqn_number_done;
1200 
1201  // Get number of dofs so far
1202  unsigned local_eqn_number = ndof();
1203 
1204  // A local queue to store the global equation numbers
1205  std::deque<unsigned long> global_eqn_number_queue;
1206 
1207  // Now loop over all the nodes again to find the master nodes
1208  // of any hanging nodes that have not yet been assigned
1209  for (unsigned n = 0; n < n_node; n++)
1210  {
1211  // POSITIONAL EQUATAIONS
1212  // If the node is a hanging node
1213  if (node_pt(n)->is_hanging())
1214  {
1215  // Find the local hang info object
1216  HangInfo* hang_info_pt = node_pt(n)->hanging_pt();
1217  // Find the number of master nodes
1218  unsigned n_master = hang_info_pt->nmaster();
1219  // Loop over the master nodes
1220  for (unsigned m = 0; m < n_master; m++)
1221  {
1222  // Get the m-th master node
1223  Node* Master_node_pt = hang_info_pt->master_node_pt(m);
1224 
1225  // If the local equation numbers associated with this master node
1226  // have not already been assigned, assign them
1227  if (local_eqn_number_done[Master_node_pt] == false)
1228  {
1229  // Now we need to test whether the master node is actually
1230  // a local node, in which case its local equation numbers
1231  // will already have been assigned and stored in
1232  // position_local_eqn(n,j,k)
1233 
1234  // Storage for the index of the local node
1235  // Initialised to n_node (beyond the possible indices of
1236  //"real" nodes)
1237  unsigned local_node_index = n_node;
1238  // Loop over the local nodes (again)
1239  for (unsigned n1 = 0; n1 < n_node; n1++)
1240  {
1241  // If the master node is a local node
1242  // get its index and break out of the loop
1243  if (Master_node_pt == node_pt(n1))
1244  {
1245  local_node_index = n1;
1246  break;
1247  }
1248  }
1249 
1250  // Now we test whether the node was found
1251  if (local_node_index < n_node)
1252  {
1253  // Loop over the number of position dofs
1254  for (unsigned j = 0; j < n_position_type; j++)
1255  {
1256  // Loop over the dimension of each node
1257  for (unsigned k = 0; k < nodal_dim; k++)
1258  {
1259  // Set the values in the node-based positional look-up
1260  // scheme
1261  Position_local_eqn_at_node(j, k) =
1262  position_local_eqn(local_node_index, j, k);
1263  }
1264  }
1265  }
1266  // Otherwise it's a new master node
1267  else
1268  {
1269  // Loop over the number of position dofs
1270  for (unsigned j = 0; j < n_position_type; j++)
1271  {
1272  // Loop over the dimension of each node
1273  for (unsigned k = 0; k < nodal_dim; k++)
1274  {
1275  // Get equation number (position_eqn_number)
1276  // Note eqn_number is long !
1277  long eqn_number = static_cast<SolidNode*>(Master_node_pt)
1278  ->position_eqn_number(j, k);
1279  // If equation_number positive add to array
1280  if (eqn_number >= 0)
1281  {
1282  // Add global equation number to the local queue
1283  global_eqn_number_queue.push_back(eqn_number);
1284  // Add pointer to the dof to the queue if required
1285  if (store_local_dof_pt)
1286  {
1288  &(Master_node_pt->x_gen(j, k)));
1289  }
1290  // Add to pointer-based scheme
1291  Position_local_eqn_at_node(j, k) = local_eqn_number;
1292  // Increase the number of local variables
1293  local_eqn_number++;
1294  }
1295  // Otherwise the value is pinned
1296  else
1297  {
1298  Position_local_eqn_at_node(j, k) = Data::Is_pinned;
1299  }
1300  }
1301  }
1302  } // End of case when it's a new master node
1303 
1304  // Dofs included with this node have now been done
1305  local_eqn_number_done[Master_node_pt] = true;
1306  // Add to the pointer-based reference scheme
1307  Local_position_hang_eqn[Master_node_pt] =
1308  Position_local_eqn_at_node;
1309  }
1310  }
1311  }
1312 
1313  } // End of loop over nodes
1314 
1315  // Now add our global equations numbers to the internal element storage
1316  add_global_eqn_numbers(global_eqn_number_queue,
1318  // Clear the memory used in the deque
1319  if (store_local_dof_pt)
1320  {
1321  std::deque<double*>().swap(GeneralisedElement::Dof_pt_deque);
1322  }
1323 
1324 
1325  } // End of if nodes
1326  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
static long Is_pinned
Static "Magic number" to indicate pinned values.
Definition: nodes.h:183
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
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
Definition: elements.h:2484
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704
static std::deque< double * > Dof_pt_deque
Definition: elements.h:231
int local_eqn_number(const unsigned long &ieqn_global) const
Definition: elements.h:726
void add_global_eqn_numbers(std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
Definition: elements.cc:156
unsigned nmaster() const
Return the number of master nodes.
Definition: nodes.h:785
HangInfo *const & hanging_pt() const
Definition: nodes.h:1228
std::map< Node *, DenseMatrix< int > > Local_position_hang_eqn
Definition: refineable_elements.h:880
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Definition: elements.h:4137
int * m
Definition: level2_cplx_impl.h:294

References oomph::GeneralisedElement::add_global_eqn_numbers(), oomph::GeneralisedElement::Dof_pt_deque, oomph::GeneralisedElement::eqn_number(), oomph::Node::hanging_pt(), oomph::Data::Is_pinned, j, k, oomph::GeneralisedElement::local_eqn_number(), Local_position_hang_eqn, m, oomph::HangInfo::master_node_pt(), n, oomph::GeneralisedElement::ndof(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_dimension(), oomph::FiniteElement::node_pt(), oomph::SolidFiniteElement::position_local_eqn(), and oomph::Node::x_gen().

Referenced by assign_solid_local_eqn_numbers().

◆ assign_solid_local_eqn_numbers()

void oomph::RefineableSolidElement::assign_solid_local_eqn_numbers ( const bool store_local_dof_pt)
inlinevirtual

Overload the local equation numbers for Data stored as part of solid nodes to include hanging node data

Reimplemented from oomph::SolidFiniteElement.

941  {
943  assign_solid_hanging_local_eqn_numbers(store_local_dof_pt);
944  }
void assign_solid_hanging_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: refineable_elements.cc:1178
virtual void assign_solid_local_eqn_numbers(const bool &store_local_dof)
Assign local equation numbers for the solid equations in the element.
Definition: elements.cc:6898

References assign_solid_hanging_local_eqn_numbers(), and oomph::SolidFiniteElement::assign_solid_local_eqn_numbers().

◆ disable_use_of_undeformed_macro_element_for_new_lagrangian_coords()

void oomph::RefineableSolidElement::disable_use_of_undeformed_macro_element_for_new_lagrangian_coords ( )
inline

Unset the flag deciding if the Lagrangian coordinates of newly-created interior SolidNodes are to be determined by the father element's undeformed MacroElement representation (if it has one).

References Use_undeformed_macro_element_for_new_lagrangian_coords.

◆ enable_use_of_undeformed_macro_element_for_new_lagrangian_coords()

void oomph::RefineableSolidElement::enable_use_of_undeformed_macro_element_for_new_lagrangian_coords ( )
inline

Set the flag deciding if the Lagrangian coordinates of newly-created interior SolidNodes are to be determined by the father element's undeformed MacroElement representation (if it has one).

References Use_undeformed_macro_element_for_new_lagrangian_coords.

◆ fill_in_jacobian_from_solid_position_by_fd()

void oomph::RefineableSolidElement::fill_in_jacobian_from_solid_position_by_fd ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
virtual

Compute element residual Vector and element Jacobian matrix corresponding to the solid positions. Overloaded version to take the hanging nodes into account

This function calculates the entries of Jacobian matrix, used in the Newton method, associated with the elastic problem in which the nodal position is a variable. It does this using finite differences, rather than an analytical formulation, so can be done in total generality. Overload the standard case to include hanging node case

Reimplemented from oomph::SolidFiniteElement.

1337  {
1338  // Find the number of nodes
1339  const unsigned n_node = nnode();
1340 
1341  // If there are no nodes, return straight away
1342  if (n_node == 0)
1343  {
1344  return;
1345  }
1346 
1347  // Call the update function to ensure that the element is in
1348  // a consistent state before finite differencing starts
1350 
1351  // bool use_first_order_fd=false;
1352 
1353  // Find the number of positional dofs and nodal dimension
1354  const unsigned n_position_type = nnodal_position_type();
1355  const unsigned nodal_dim = nodal_dimension();
1356 
1357  // Find the number of dofs in the element
1358  const unsigned n_dof = ndof();
1359 
1360  // Create newres vector
1361  Vector<double> newres(n_dof); //, newres_minus(n_dof);
1362 
1363  // Used default value defined in GeneralisedElement
1364  const double fd_step = Default_fd_jacobian_step;
1365 
1366  // Integer storage for local unknowns
1367  int local_unknown = 0;
1368 
1369  // Loop over the nodes
1370  for (unsigned l = 0; l < n_node; l++)
1371  {
1372  // Get the pointer to the node
1373  Node* const local_node_pt = node_pt(l);
1374 
1375  // If the node is not a hanging node
1376  if (local_node_pt->is_hanging() == false)
1377  {
1378  // Loop over position dofs
1379  for (unsigned k = 0; k < n_position_type; k++)
1380  {
1381  // Loop over dimension
1382  for (unsigned i = 0; i < nodal_dim; i++)
1383  {
1384  local_unknown = position_local_eqn(l, k, i);
1385  // If the variable is free
1386  if (local_unknown >= 0)
1387  {
1388  // Store a pointer to the (generalised) Eulerian nodal position
1389  double* const value_pt = &(local_node_pt->x_gen(k, i));
1390 
1391  // Save the old value of the (generalised) Eulerian nodal position
1392  const double old_var = *value_pt;
1393 
1394  // Increment the (generalised) Eulerian nodal position
1395  *value_pt += fd_step;
1396 
1397  // Perform any auxialiary node updates
1398  local_node_pt->perform_auxiliary_node_update_fct();
1399 
1400  // Update any other dependent variables
1402 
1403 
1404  // Calculate the new residuals
1405  get_residuals(newres);
1406 
1407  // if (use_first_order_fd)
1408  {
1409  // Do forward finite differences
1410  for (unsigned m = 0; m < n_dof; m++)
1411  {
1412  // Stick the entry into the Jacobian matrix
1413  jacobian(m, local_unknown) =
1414  (newres[m] - residuals[m]) / fd_step;
1415  }
1416  }
1417  // else
1418  // {
1419  // //Take backwards step for the (generalised)
1420  // Eulerian nodal
1421  // // position
1422  // node_pt(l)->x_gen(k,i) = old_var-fd_step;
1423 
1424  // //Calculate the new residuals at backward
1425  // position get_residuals(newres_minus);
1426 
1427  // //Do central finite differences
1428  // for(unsigned m=0;m<n_dof;m++)
1429  // {
1430  // //Stick the entry into the Jacobian matrix
1431  // jacobian(m,local_unknown) =
1432  // (newres[m] - newres_minus[m])/(2.0*fd_step);
1433  // }
1434  // }
1435 
1436  // Reset the (generalised) Eulerian nodal position
1437  *value_pt = old_var;
1438 
1439  // Perform any auxialiary node updates
1440  local_node_pt->perform_auxiliary_node_update_fct();
1441 
1442  // Reset any other dependent variables
1444  }
1445  }
1446  }
1447  }
1448  // Otherwise it's a hanging node
1449  else
1450  {
1451  // Find the local hanging object
1452  HangInfo* hang_info_pt = local_node_pt->hanging_pt();
1453  // Loop over the master nodes
1454  const unsigned n_master = hang_info_pt->nmaster();
1455  for (unsigned m = 0; m < n_master; m++)
1456  {
1457  // Get the pointer to the master node
1458  Node* const master_node_pt = hang_info_pt->master_node_pt(m);
1459 
1460  // Get the local equation numbers for the master node
1461  DenseMatrix<int> Position_local_eqn_at_node =
1462  Local_position_hang_eqn[master_node_pt];
1463 
1464  // Loop over position dofs
1465  for (unsigned k = 0; k < n_position_type; k++)
1466  {
1467  // Loop over dimension
1468  for (unsigned i = 0; i < nodal_dim; i++)
1469  {
1470  local_unknown = Position_local_eqn_at_node(k, i);
1471  // If the variable is free
1472  if (local_unknown >= 0)
1473  {
1474  // Store a pointer to the (generalised) Eulerian nodal position
1475  double* const value_pt = &(master_node_pt->x_gen(k, i));
1476 
1477  // Save the old value of the (generalised) Eulerian nodal
1478  // position
1479  const double old_var = *value_pt;
1480 
1481  // Increment the (generalised) Eulerian nodal position
1482  *value_pt += fd_step;
1483 
1484  // Perform any auxialiary node updates
1485  master_node_pt->perform_auxiliary_node_update_fct();
1486 
1487  // Update any dependent variables
1489 
1490  // Calculate the new residuals
1491  get_residuals(newres);
1492 
1493  // if (use_first_order_fd)
1494  {
1495  // Do forward finite differences
1496  for (unsigned m = 0; m < n_dof; m++)
1497  {
1498  // Stick the entry into the Jacobian matrix
1499  jacobian(m, local_unknown) =
1500  (newres[m] - residuals[m]) / fd_step;
1501  }
1502  }
1503  // else
1504  // {
1505  // //Take backwards step for the (generalised)
1506  // Eulerian nodal
1507  // // position
1508  // master_node_pt->x_gen(k,i) = old_var-fd_step;
1509 
1510  // //Calculate the new residuals at backward
1511  // position get_residuals(newres_minus);
1512 
1513  // //Do central finite differences
1514  // for(unsigned m=0;m<n_dof;m++)
1515  // {
1516  // //Stick the entry into the Jacobian matrix
1517  // jacobian(m,local_unknown) =
1518  // (newres[m] -
1519  // newres_minus[m])/(2.0*fd_step);
1520  // }
1521  // }
1522 
1523  // Reset the (generalised) Eulerian nodal position
1524  *value_pt = old_var;
1525 
1526  // Perform any auxialiary node updates
1527  master_node_pt->perform_auxiliary_node_update_fct();
1528 
1529  // Reset any other dependent variables
1531  }
1532  }
1533  }
1534  }
1535  } // End of hanging node case
1536 
1537  } // End of loop over nodes
1538 
1539  // End of finite difference loop
1540  // Final reset of any dependent data
1542  }
static double Default_fd_jacobian_step
Definition: elements.h:1198
virtual void get_residuals(Vector< double > &residuals)
Definition: elements.h:980
virtual void update_before_solid_position_fd()
Definition: elements.h:4240
virtual void update_in_solid_position_fd(const unsigned &i)
Definition: elements.h:4250
virtual void reset_in_solid_position_fd(const unsigned &i)
Definition: elements.h:4255
virtual void reset_after_solid_position_fd()
Definition: elements.h:4245

References oomph::GeneralisedElement::Default_fd_jacobian_step, oomph::GeneralisedElement::get_residuals(), oomph::Node::hanging_pt(), i, oomph::Node::is_hanging(), k, Local_position_hang_eqn, m, oomph::HangInfo::master_node_pt(), oomph::GeneralisedElement::ndof(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_dimension(), oomph::FiniteElement::node_pt(), oomph::Node::perform_auxiliary_node_update_fct(), oomph::SolidFiniteElement::position_local_eqn(), oomph::SolidFiniteElement::reset_after_solid_position_fd(), oomph::SolidFiniteElement::reset_in_solid_position_fd(), oomph::SolidFiniteElement::update_before_solid_position_fd(), oomph::SolidFiniteElement::update_in_solid_position_fd(), and oomph::Node::x_gen().

◆ further_build()

virtual void oomph::RefineableSolidElement::further_build ( )
inlinevirtual

Further build: Pass the father's Use_undeformed_macro_element_for_new_lagrangian_coords flag down, then call the underlying RefineableElement's version.

Reimplemented from oomph::RefineableElement.

Reimplemented in oomph::RefineableQDPVDElement< DIM, NNODE_1D >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineablePVDEquationsWithPressure< DIM >, and oomph::RefineablePVDEquations< DIM >.

1015  {
1017  dynamic_cast<RefineableSolidElement*>(father_element_pt())
1019 
1021  }
virtual void further_build()
Further build: e.g. deal with interpolation of internal values.
Definition: refineable_elements.h:599
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
bool is_undeformed_macro_element_used_for_new_lagrangian_coords() const
Definition: refineable_elements.h:980
RefineableSolidElement()
Constructor.
Definition: refineable_elements.h:928

References oomph::RefineableElement::father_element_pt(), oomph::RefineableElement::further_build(), is_undeformed_macro_element_used_for_new_lagrangian_coords(), and Use_undeformed_macro_element_for_new_lagrangian_coords.

Referenced by oomph::RefineablePVDEquations< DIM >::further_build(), and oomph::RefineablePVDEquationsWithPressure< DIM >::further_build().

◆ geom_data_pt()

Data * oomph::RefineableSolidElement::geom_data_pt ( const unsigned j)
virtual

Return pointer to the j-th Data item that the object's shape depends on: Positional data of non-hanging nodes and positional data of master nodes. Recomputed on the fly.

Reimplemented from oomph::SolidFiniteElement.

1056  {
1057  // Find the number of nodes
1058  const unsigned n_node = nnode();
1059 
1060  // Temporary storage for unique position data. Set and vector are
1061  // required to ensure uniqueness in enumeration on different processors.
1062  // Set checks uniqueness; Vector stores entries in predictable order.
1063  std::set<Data*> all_position_data_pt;
1064  Vector<Data*> all_position_data_vector_pt;
1065 
1066  // Number of entries in set before possibly adding new entry
1067  unsigned n_old = 0;
1068 
1069  // Now loop over all the nodes again to find the master nodes
1070  // of any hanging nodes that have not yet been assigned
1071  for (unsigned n = 0; n < n_node; n++)
1072  {
1073  // If the node is a hanging node
1074  if (node_pt(n)->is_hanging())
1075  {
1076  // Find the local hang info object
1077  HangInfo* hang_info_pt = node_pt(n)->hanging_pt();
1078 
1079  // Find the number of master nodes
1080  unsigned n_master = hang_info_pt->nmaster();
1081 
1082  // Loop over the master nodes
1083  for (unsigned m = 0; m < n_master; m++)
1084  {
1085  // Get the m-th master node
1086  Node* Master_node_pt = hang_info_pt->master_node_pt(m);
1087 
1088  // Positional data
1089  Data* pos_data_pt =
1090  dynamic_cast<SolidNode*>(Master_node_pt)->variable_position_pt();
1091 
1092  // Add to set
1093  n_old = all_position_data_pt.size();
1094  all_position_data_pt.insert(pos_data_pt);
1095 
1096  // New entry?
1097  if (all_position_data_pt.size() > n_old)
1098  {
1099  all_position_data_vector_pt.push_back(pos_data_pt);
1100  }
1101  }
1102  }
1103  // Not hanging
1104  else
1105  {
1106  // Add node itself to set
1107 
1108  // Positional data
1109  Data* pos_data_pt =
1110  dynamic_cast<SolidNode*>(node_pt(n))->variable_position_pt();
1111 
1112  // Add to set
1113  n_old = all_position_data_pt.size();
1114  all_position_data_pt.insert(pos_data_pt);
1115 
1116  // New entry?
1117  if (all_position_data_pt.size() > n_old)
1118  {
1119  all_position_data_vector_pt.push_back(pos_data_pt);
1120  }
1121  }
1122 
1123  } // End of loop over nodes
1124 
1125 
1126  // Return j-th entry
1127  return all_position_data_vector_pt[j];
1128  }

References oomph::Node::hanging_pt(), j, m, oomph::HangInfo::master_node_pt(), n, oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), and oomph::FiniteElement::node_pt().

◆ identify_geometric_data()

void oomph::RefineableSolidElement::identify_geometric_data ( std::set< Data * > &  geometric_data_pt)
virtual

Specify Data that affects the geometry of the element by adding the position Data to the set that's passed in. (This functionality is required in FSI problems; set is used to avoid double counting). Refineable version includes hanging nodes

Reimplemented from oomph::SolidFiniteElement.

1139  {
1140  // Loop over the node update data and add to the set
1141  const unsigned n_node = this->nnode();
1142  for (unsigned j = 0; j < n_node; j++)
1143  {
1144  // If the node is a hanging node
1145  if (node_pt(j)->is_hanging())
1146  {
1147  // Find the local hang info object
1148  HangInfo* hang_info_pt = node_pt(j)->hanging_pt();
1149 
1150  // Find the number of master nodes
1151  unsigned n_master = hang_info_pt->nmaster();
1152 
1153  // Loop over the master nodes
1154  for (unsigned m = 0; m < n_master; m++)
1155  {
1156  // Get the m-th master node
1157  Node* Master_node_pt = hang_info_pt->master_node_pt(m);
1158 
1159  // Add to set
1160  geometric_data_pt.insert(
1161  dynamic_cast<SolidNode*>(Master_node_pt)->variable_position_pt());
1162  }
1163  }
1164  // Not hanging
1165  else
1166  {
1167  // Add node itself to set
1168  geometric_data_pt.insert(
1169  dynamic_cast<SolidNode*>(node_pt(j))->variable_position_pt());
1170  }
1171  }
1172  }

References oomph::Node::hanging_pt(), j, m, oomph::HangInfo::master_node_pt(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), and oomph::FiniteElement::node_pt().

◆ is_undeformed_macro_element_used_for_new_lagrangian_coords()

bool oomph::RefineableSolidElement::is_undeformed_macro_element_used_for_new_lagrangian_coords ( ) const
inline

Return the flag deciding if the Lagrangian coordinates of newly-created interior SolidNodes are to be determined by the father element's undeformed MacroElement representation (if it has one). Default: False as it means that, following a refinement an element is no longer in equilbrium (as the Lagrangian coordinate is determined differently from the Eulerian one). However, basing the Lagrangian coordinates on the undeformed MacroElement can be more stable numerically and for steady problems it's not a big deal either way as the difference between the two formulations only matters at finite resolution so we have no right to say that one is "more correct" than the other...

References Use_undeformed_macro_element_for_new_lagrangian_coords.

Referenced by further_build().

◆ local_position_hang_eqn()

DenseMatrix<int>& oomph::RefineableSolidElement::local_position_hang_eqn ( Node *const &  node_pt)
inline

◆ local_to_lagrangian_mapping_diagonal()

double oomph::RefineableSolidElement::local_to_lagrangian_mapping_diagonal ( const DShape dpsids,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  inverse_jacobian 
) const
protectedvirtual

Calculate the mapping from local to Lagrangian coordinates given the derivatives of the shape functions w.r.t the local coorindates. assuming that the coordinates are aligned in the direction of the local coordinates, i.e. there are no cross terms and the jacobian is diagonal. This function returns the determinant of the jacobian, the jacobian and the inverse jacobian.

Calculate the mapping from local to lagrangian coordinates assuming that the coordinates are aligned in the direction of the local coordinates, i.e. there are no cross terms and the jacobian is diagonal. The local derivatives are passed as dpsids and the jacobian and inverse jacobian are returned.

Reimplemented from oomph::SolidFiniteElement.

942  {
943  // Find the dimension of the element
944  const unsigned el_dim = dim();
945  // Find the number of shape functions and shape functions types
946  const unsigned n_shape = nnode();
947  const unsigned n_shape_type = nnodal_lagrangian_type();
948 
949  // In this case we assume that there are no cross terms, that is
950  // global coordinate 0 is always in the direction of local coordinate 0
951 
952  // Loop over the coordinates
953  for (unsigned i = 0; i < el_dim; i++)
954  {
955  // Zero the jacobian and inverse jacobian entries
956  for (unsigned j = 0; j < el_dim; j++)
957  {
958  jacobian(i, j) = 0.0;
959  inverse_jacobian(i, j) = 0.0;
960  }
961 
962  // Loop over the shape functions
963  for (unsigned l = 0; l < n_shape; l++)
964  {
965  // Loop over the types of dof
966  for (unsigned k = 0; k < n_shape_type; k++)
967  {
968  // Derivatives are always dx_{i}/ds_{i}
969  jacobian(i, i) += lagrangian_position_gen(l, k, i) * dpsids(l, k, i);
970  }
971  }
972  }
973 
974  // Now calculate the determinant of the matrix
975  double det = 1.0;
976  for (unsigned i = 0; i < el_dim; i++)
977  {
978  det *= jacobian(i, i);
979  }
980 
981 // Report if Matrix is singular, or negative
982 #ifdef PARANOID
983  check_jacobian(det);
984 #endif
985 
986  // Calculate the inverse mapping (trivial in this case)
987  for (unsigned i = 0; i < el_dim; i++)
988  {
989  inverse_jacobian(i, i) = 1.0 / jacobian(i, i);
990  }
991 
992  // Return the value of the Jacobian
993  return (det);
994  }
void check_jacobian(const double &jacobian) const
Definition: elements.cc:1750

References oomph::FiniteElement::check_jacobian(), oomph::FiniteElement::dim(), el_dim, i, j, k, oomph::SolidFiniteElement::lagrangian_position_gen(), oomph::SolidFiniteElement::nnodal_lagrangian_type(), and oomph::FiniteElement::nnode().

◆ ngeom_data()

unsigned oomph::RefineableSolidElement::ngeom_data ( ) const
virtual

The number of geometric data affecting a RefineableSolidFiniteElement is the positional Data of all non-hanging nodes plus the geometric Data of all distinct master nodes. Recomputed on the fly.

Reimplemented from oomph::SolidFiniteElement.

1004  {
1005  // Find the number of nodes
1006  const unsigned n_node = nnode();
1007 
1008  // Temporary storage for unique position data
1009  std::set<Data*> all_position_data_pt;
1010 
1011  // Now loop over all the nodes again to find the master nodes
1012  // of any hanging nodes that have not yet been assigned
1013  for (unsigned n = 0; n < n_node; n++)
1014  {
1015  // If the node is a hanging node
1016  if (node_pt(n)->is_hanging())
1017  {
1018  // Find the local hang info object
1019  HangInfo* hang_info_pt = node_pt(n)->hanging_pt();
1020 
1021  // Find the number of master nodes
1022  unsigned n_master = hang_info_pt->nmaster();
1023 
1024  // Loop over the master nodes
1025  for (unsigned m = 0; m < n_master; m++)
1026  {
1027  // Get the m-th master node
1028  Node* Master_node_pt = hang_info_pt->master_node_pt(m);
1029 
1030  // Add to set
1031  all_position_data_pt.insert(
1032  dynamic_cast<SolidNode*>(Master_node_pt)->variable_position_pt());
1033  }
1034  }
1035  // Not hanging
1036  else
1037  {
1038  // Add node itself to set
1039  all_position_data_pt.insert(
1040  dynamic_cast<SolidNode*>(node_pt(n))->variable_position_pt());
1041  }
1042 
1043  } // End of loop over nodes
1044 
1045  // How many are there?
1046  return all_position_data_pt.size();
1047  }

References oomph::Node::hanging_pt(), m, oomph::HangInfo::master_node_pt(), n, oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), and oomph::FiniteElement::node_pt().

Member Data Documentation

◆ Local_position_hang_eqn

std::map<Node*, DenseMatrix<int> > oomph::RefineableSolidElement::Local_position_hang_eqn
private

Storage for local equation numbers of hanging node variables associated with nodal positions. local position equation number = Local_position_hang_eqn(master_node_pt,ival)

Referenced by assign_solid_hanging_local_eqn_numbers(), fill_in_jacobian_from_solid_position_by_fd(), and local_position_hang_eqn().

◆ Use_undeformed_macro_element_for_new_lagrangian_coords

bool oomph::RefineableSolidElement::Use_undeformed_macro_element_for_new_lagrangian_coords
protected

Flag deciding if the Lagrangian coordinates of newly-created interior SolidNodes are to be determined by the father element's undeformed MacroElement representation (if it has one). Default: False as it means that, following a refinement an element is no longer in equilbrium (as the Lagrangian coordinate is determined differently from the Eulerian one). However, basing the Lagrangian coordinates on the undeformed MacroElement can be more stable numerically and for steady problems it's not a big deal either way as the difference between the two formulations only matters at finite resolution so we have no right to say that one is "more correct" than the other...

Referenced by disable_use_of_undeformed_macro_element_for_new_lagrangian_coords(), enable_use_of_undeformed_macro_element_for_new_lagrangian_coords(), further_build(), and is_undeformed_macro_element_used_for_new_lagrangian_coords().


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