oomph::RefineableElement Class Referenceabstract

#include <refineable_elements.h>

+ Inheritance diagram for oomph::RefineableElement:

Public Member Functions

 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 further_build ()
 Further build: e.g. deal with interpolation of internal values. 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)
 
virtual void set_macro_elem_pt (MacroElement *macro_elem_pt)
 
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_local_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void describe_nodal_local_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 
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
 
virtual Nodeconstruct_node (const unsigned &n)
 
virtual Nodeconstruct_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
virtual Nodeconstruct_boundary_node (const unsigned &n)
 
virtual Nodeconstruct_boundary_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
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)
 
unsigned ngeom_data () const
 
Datageom_data_pt (const unsigned &j)
 
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)
 
virtual double zeta_nodal (const unsigned &n, const unsigned &k, const unsigned &i) const
 
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_geometric_data (std::set< Data * > &geometric_data_pt)
 
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 void compute_norm (double &norm)
 
virtual unsigned ndof_types () const
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- Public Member Functions inherited from oomph::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
 

Static Public Member Functions

static doublemax_integrity_tolerance ()
 Max. allowed discrepancy in element integrity check. More...
 

Protected Member Functions

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)
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
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)
 

Static Protected Member Functions

static void check_value_id (const int &n_continuously_interpolated_values, const int &value_id)
 

Protected Attributes

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
 

Static Protected Attributes

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
 

Private Attributes

std::map< Node *, int > * Local_hang_eqn
 
std::map< Node *, unsignedShape_controlling_node_lookup
 

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

Detailed Description

RefineableElements are FiniteElements that may be subdivided into children to provide a better local approximation to the solution. After non-uniform refinement adjacent elements need not necessarily have nodes in common. A node that does not have a counterpart in its neighbouring element is known as a hanging node and its position and any data that it stores must be constrained to ensure inter-element continuity.

Generic data and function interfaces associated with refinement are defined in this class.

Additional data includes:

  • a pointer to a general Tree object that is used to track the refinement history,
  • a refinement level (not necessarily the same as the level in the tree!),
  • a flag indicating whether the element should be refined,
  • a flag indicating whether the element should be de-refined,
  • a global element number for plotting/validation purposes,
  • storage for local equation numbers associated with hanging nodes.

Additional functions perform the following generic tasks:

  • provide access to additional data,
  • setup local equation numbering for data associated with hanging nodes,
  • generic finite-difference calculation of contributions to the elemental jacobian from nodal data to include hanging nodes,
  • split of the element into its sons,
  • select and deselect the element for refinement,
  • select and deselect the sons of the element for de-refinement (merging),

In addition, there are a number of interfaces that specify element-specific tasks. These should be overloaded in RefineableElements of particular geometric types and perform the following tasks:

  • return a pointer to the root and father elements in the tree structure,
  • define the number of sons into which the element is divided,
  • build the element: construct nodes, assign their positions, values and any boundary conditions,
  • recreate the element from its sons if they are merged,
  • deactivate the element, perform any operations that are required when the element is still in the tree, but no longer active
  • set the number and provide access to the values interpolated by the nodes,
  • setup the hanging nodes

In mixed element different sets of nodes are used to interpolate different unknowns. Interfaces are provided for functions that can be used to find the position of the nodes that interpolate the different unknowns. These functions are used to setup hanging node information automatically in particular elements, e.g. Taylor Hood Navier–Stokes. The default implementation assumes that the elements are isoparameteric.

Constructor & Destructor Documentation

◆ RefineableElement() [1/2]

oomph::RefineableElement::RefineableElement ( )
inline

Constructor, calls the FiniteElement constructor and initialises the member data

189  : FiniteElement(),
190  Tree_pt(0),
191  Refine_level(0),
192  To_be_refined(false),
193  Refinement_is_enabled(true),
194  Sons_to_be_unrefined(false),
195  Number(-1),
196  Local_hang_eqn(0)
197  {
198  }
FiniteElement()
Constructor.
Definition: elements.h:1782
Tree * Tree_pt
A pointer to a general tree object.
Definition: refineable_elements.h:100
unsigned Refine_level
Refinement level.
Definition: refineable_elements.h:103
long Number
Global element number – for plotting/validation purposes.
Definition: refineable_elements.h:115
bool To_be_refined
Flag for refinement.
Definition: refineable_elements.h:106
std::map< Node *, int > * Local_hang_eqn
Definition: refineable_elements.h:167
bool Sons_to_be_unrefined
Flag for unrefinement.
Definition: refineable_elements.h:112
bool Refinement_is_enabled
Flag to indicate suppression of any refinement.
Definition: refineable_elements.h:109

◆ ~RefineableElement()

oomph::RefineableElement::~RefineableElement ( )
virtual

Destructor, delete the allocated storage for the hanging equations.

Destructor (needed here because of IBM xlC compiler under AIX) Delete the storage allocated for the local equations.

39  {
40  delete[] Local_hang_eqn;
41  }

References Local_hang_eqn.

◆ RefineableElement() [2/2]

oomph::RefineableElement::RefineableElement ( const RefineableElement )
delete

Broken copy constructor.

Member Function Documentation

◆ assemble_eulerian_base_vectors()

void oomph::RefineableElement::assemble_eulerian_base_vectors ( const DShape dpsids,
DenseMatrix< double > &  interpolated_G 
) const
protectedvirtual

Assemble the covariant Eulerian base vectors, assuming that the derivatives of the shape functions with respect to the local coordinates have already been constructed. Overload the standard version to account for hanging nodes.

Assemble the covariant Eulerian base vectors and return them in the matrix interpolated_G. The derivatives of the shape functions with respect to the local coordinate should already have been calculated before calling this function

Reimplemented from oomph::FiniteElement.

179  {
180  // Find the number of nodes and position types
181  const unsigned n_node = nnode();
182  const unsigned n_position_type = nnodal_position_type();
183  // Find the dimension of the node and element
184  const unsigned n_dim_node = nodal_dimension();
185  const unsigned n_dim_element = dim();
186 
187  // Loop over the dimensions and compute the entries of the
188  // base vector matrix
189  for (unsigned i = 0; i < n_dim_element; i++)
190  {
191  for (unsigned j = 0; j < n_dim_node; j++)
192  {
193  // Initialise the j-th component of the i-th base vector to zero
194  interpolated_G(i, j) = 0.0;
195  for (unsigned l = 0; l < n_node; l++)
196  {
197  for (unsigned k = 0; k < n_position_type; k++)
198  {
199  interpolated_G(i, j) +=
200  nodal_position_gen(l, k, j) * dpsids(l, k, i);
201  }
202  }
203  }
204  }
205  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
unsigned nnodal_position_type() const
Definition: elements.h:2463
unsigned dim() const
Definition: elements.h:2611
double nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2349
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
Definition: elements.h:2484
char char char int int * k
Definition: level2_impl.h:374
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::FiniteElement::dim(), i, j, k, oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_dimension(), and oomph::FiniteElement::nodal_position_gen().

◆ assemble_local_to_eulerian_jacobian()

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

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

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

Reimplemented from oomph::FiniteElement.

79  {
80  // Locally cache the elemental dimension
81  const unsigned el_dim = dim();
82  // The number of shape functions must be equal to the number
83  // of nodes (by definition)
84  const unsigned n_shape = nnode();
85  // The number of shape function types must be equal to the number
86  // of nodal position types (by definition)
87  const unsigned n_shape_type = nnodal_position_type();
88 
89 #ifdef PARANOID
90  // Check for dimensional compatibility
91  if (dim() != nodal_dimension())
92  {
93  std::ostringstream error_message;
94  error_message << "Dimension mismatch" << std::endl;
95  error_message << "The elemental dimension: " << dim()
96  << " must equal the nodal dimension: " << nodal_dimension()
97  << " for the jacobian of the mapping to be well-defined"
98  << std::endl;
99  throw OomphLibError(
100  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
101  }
102 #endif
103 
104  // Loop over the rows of the jacobian
105  for (unsigned i = 0; i < el_dim; i++)
106  {
107  // Loop over the columns of the jacobian
108  for (unsigned j = 0; j < el_dim; j++)
109  {
110  // Zero the entry
111  jacobian(i, j) = 0.0;
112  // Loop over the shape functions
113  for (unsigned l = 0; l < n_shape; l++)
114  {
115  for (unsigned k = 0; k < n_shape_type; k++)
116  {
117  // Jacobian is dx_j/ds_i, which is represented by the sum
118  // over the dpsi/ds_i of the nodal points X j
119  // Call the Hanging version of positions
120  jacobian(i, j) += nodal_position_gen(l, k, j) * dpsids(l, k, i);
121  }
122  }
123  }
124  }
125  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
unsigned el_dim
dimension
Definition: overloaded_cartesian_element_body.h:30

References oomph::FiniteElement::dim(), el_dim, i, j, k, oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_dimension(), oomph::FiniteElement::nodal_position_gen(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ assemble_local_to_eulerian_jacobian2()

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

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

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

Reimplemented from oomph::FiniteElement.

135  {
136  // Find the the dimension of the element
137  const unsigned el_dim = dim();
138  // Find the number of shape functions and shape functions types
139  // Must be equal to the number of nodes and their position types
140  // by the definition of the shape function.
141  const unsigned n_shape = nnode();
142  const unsigned n_shape_type = nnodal_position_type();
143  // Find the number of second derivatives
144  const unsigned n_row = N2deriv[el_dim];
145 
146  // Assemble the "jacobian" (d^2 x_j/ds_i^2) for second derivatives of
147  // shape functions
148  // Loop over the rows (number of second derivatives)
149  for (unsigned i = 0; i < n_row; i++)
150  {
151  // Loop over the columns (element dimension
152  for (unsigned j = 0; j < el_dim; j++)
153  {
154  // Zero the entry
155  jacobian2(i, j) = 0.0;
156  // Loop over the shape functions
157  for (unsigned l = 0; l < n_shape; l++)
158  {
159  // Loop over the shape function types
160  for (unsigned k = 0; k < n_shape_type; k++)
161  {
162  // Add the terms to the jacobian entry
163  // Call the Hanging version of positions
164  jacobian2(i, j) += nodal_position_gen(l, k, j) * d2psids(l, k, i);
165  }
166  }
167  }
168  }
169  }
static const unsigned N2deriv[]
Definition: elements.h:1483

References oomph::FiniteElement::dim(), el_dim, i, j, k, oomph::FiniteElement::N2deriv, oomph::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), and oomph::FiniteElement::nodal_position_gen().

◆ assign_hanging_local_eqn_numbers()

void oomph::RefineableElement::assign_hanging_local_eqn_numbers ( const bool store_local_dof_pt)
protected

Assign the local equation numbers for hanging node variables.

Assign the local hang eqn.

314  {
315  // Find the number of nodes
316  const unsigned n_node = nnode();
317 
318  // Check there are nodes!
319  if (n_node > 0)
320  {
321  // Find the number of continuously interpolated values
322  const unsigned n_cont_values = ncont_interpolated_values();
323 
324  // Delete the storage associated with the local hanging equation schemes
325  delete[] Local_hang_eqn;
326  // Allocate new storage
327  Local_hang_eqn = new std::map<Node*, int>[n_cont_values];
328 
329  // Boolean that is set to true if there are hanging equation numbers
330  bool hanging_eqn_numbers = false;
331 
332  // Maps that store whether the node's local equation number for a
333  // particular value has already been assigned
334  Vector<std::map<Node*, bool>> local_eqn_number_done(n_cont_values);
335 
336  // Get number of dofs assigned thus far
337  unsigned local_eqn_number = ndof();
338 
339  // A local queue to store the global equation numbers
340  std::deque<unsigned long> global_eqn_number_queue;
341 
342  // Now loop over all the nodes again to find the master nodes
343  // external to the element
344  for (unsigned n = 0; n < n_node; n++)
345  {
346  // Loop over the number of continuously-interpolated values at the node
347  for (unsigned j = 0; j < n_cont_values; j++)
348  {
349  // If the node is hanging node in value j
350  if (node_pt(n)->is_hanging(j))
351  {
352  // Get the pointer to the appropriate hanging info object
353  HangInfo* hang_info_pt = node_pt(n)->hanging_pt(j);
354  // Find the number of master nodes
355  unsigned n_master = hang_info_pt->nmaster();
356  // Loop over the master nodes
357  for (unsigned m = 0; m < n_master; m++)
358  {
359  // Get the m-th master node
360  Node* Master_node_pt = hang_info_pt->master_node_pt(m);
361 
362  // If the master node's value has not been considered already,
363  // give it a local equation number
364  if (local_eqn_number_done[j][Master_node_pt] == false)
365  {
366 #ifdef PARANOID
367  // Check that the value is stored at the master node
368  // If not the master node must have be set up incorrectly
369  if (Master_node_pt->nvalue() < j)
370  {
371  std::ostringstream error_stream;
372  error_stream << "Master node for " << j
373  << "-th value only has "
374  << Master_node_pt->nvalue() << " stored values!"
375  << std::endl;
376 
377  throw OomphLibError(error_stream.str(),
380  }
381 #endif
382 
383  // We now need to test whether the master node is actually
384  // a local node, in which case its local equation number
385  // will already have been assigned and will be stored
386  // in nodal_local_eqn
387 
388  // Storage for the index of the local node
389  // Initialised to n_node (beyond the possible indices of
390  //"real" nodes)
391  unsigned local_node_index = n_node;
392  // Loop over the local nodes (again)
393  for (unsigned n1 = 0; n1 < n_node; n1++)
394  {
395  // If the master node is a local node
396  // get its index and break out of the loop
397  if (Master_node_pt == node_pt(n1))
398  {
399  local_node_index = n1;
400  break;
401  }
402  }
403 
404  // Now we test whether the node was found
405  if (local_node_index < n_node)
406  {
407  // Copy the local equation number to the
408  // pointer-based look-up scheme
409  Local_hang_eqn[j][Master_node_pt] =
410  nodal_local_eqn(local_node_index, j);
411  }
412  // Otherwise it's a new master node
413  else
414  {
415  // Get the equation number
416  long eqn_number = Master_node_pt->eqn_number(j);
417  // If equation_number positive add to array
418  if (eqn_number >= 0)
419  {
420  // Add global equation number to the queue
421  global_eqn_number_queue.push_back(eqn_number);
422  // Add pointer to the dof to the queue if required
423  if (store_local_dof_pt)
424  {
426  Master_node_pt->value_pt(j));
427  }
428  // Add to pointer based scheme
429  Local_hang_eqn[j][Master_node_pt] = local_eqn_number;
430  // Increase number of local variables
432  }
433  // Otherwise the value is pinned
434  else
435  {
436  Local_hang_eqn[j][Master_node_pt] = Data::Is_pinned;
437  }
438  // There are now hanging equation numbers
439  }
440  // The value at this node has now been done
441  local_eqn_number_done[j][Master_node_pt] = true;
442  // There are hanging equation numbers
443  hanging_eqn_numbers = true;
444  }
445  }
446  }
447  }
448  } // End of second loop over nodes
449 
450  // Now add our global equations numbers to the internal element storage
451  add_global_eqn_numbers(global_eqn_number_queue,
453  // Clear the memory used in the deque
454  if (store_local_dof_pt)
455  {
456  std::deque<double*>().swap(GeneralisedElement::Dof_pt_deque);
457  }
458 
459 
460  // If there are no hanging_eqn_numbers delete the (empty) stored maps
461  if (!hanging_eqn_numbers)
462  {
463  delete[] Local_hang_eqn;
464  Local_hang_eqn = 0;
465  }
466 
467 
468  // Setup map that associates a unique number with any of the nodes
469  // that actively control the shape of the element (i.e. they are
470  // either non-hanging nodes of this element or master nodes
471  // of hanging nodes.
472  unsigned count = 0;
473  std::set<Node*> all_nodes;
475  for (unsigned j = 0; j < n_node; j++)
476  {
477  // Get node
478  Node* nod_pt = node_pt(j);
479 
480  // If the node is hanging, consider master nodes
481  if (nod_pt->is_hanging())
482  {
483  HangInfo* hang_info_pt = node_pt(j)->hanging_pt();
484  unsigned n_master = hang_info_pt->nmaster();
485 
486  // Loop over the master nodes
487  for (unsigned m = 0; m < n_master; m++)
488  {
489  Node* master_node_pt = hang_info_pt->master_node_pt(m);
490  // Do we have this one already?
491  unsigned old_size = all_nodes.size();
492  all_nodes.insert(master_node_pt);
493  if (all_nodes.size() > old_size)
494  {
495  Shape_controlling_node_lookup[master_node_pt] = count;
496  count++;
497  }
498  }
499  }
500  // Not hanging: Consider the node itself
501  else
502  {
503  // Do we have this one already?
504  unsigned old_size = all_nodes.size();
505  all_nodes.insert(nod_pt);
506  if (all_nodes.size() > old_size)
507  {
508  Shape_controlling_node_lookup[nod_pt] = count;
509  count++;
510  }
511  }
512  }
513 
514  } // End of if nodes
515  }
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
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
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
virtual unsigned ncont_interpolated_values() const =0
std::map< Node *, unsigned > Shape_controlling_node_lookup
Definition: refineable_elements.h:172
int * m
Definition: level2_cplx_impl.h:294

References oomph::GeneralisedElement::add_global_eqn_numbers(), oomph::GeneralisedElement::Dof_pt_deque, oomph::Data::eqn_number(), oomph::GeneralisedElement::eqn_number(), oomph::Node::hanging_pt(), oomph::Node::is_hanging(), oomph::Data::Is_pinned, j, oomph::GeneralisedElement::local_eqn_number(), Local_hang_eqn, m, oomph::HangInfo::master_node_pt(), n, ncont_interpolated_values(), oomph::GeneralisedElement::ndof(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_local_eqn(), oomph::FiniteElement::node_pt(), oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Shape_controlling_node_lookup, and oomph::Data::value_pt().

Referenced by assign_nodal_local_eqn_numbers().

◆ assign_nodal_local_eqn_numbers()

void oomph::RefineableElement::assign_nodal_local_eqn_numbers ( const bool store_local_dof_pt)
inlinevirtual

Overload the function that assigns local equation numbers for the Data stored at the nodes so that hanging data is taken into account

Reimplemented from oomph::FiniteElement.

512  {
514  assign_hanging_local_eqn_numbers(store_local_dof_pt);
515  }
virtual void assign_nodal_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.cc:3544
void assign_hanging_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for hanging node variables.
Definition: refineable_elements.cc:312

References assign_hanging_local_eqn_numbers(), and oomph::FiniteElement::assign_nodal_local_eqn_numbers().

◆ build()

virtual void oomph::RefineableElement::build ( Mesh *&  mesh_pt,
Vector< Node * > &  new_node_pt,
bool was_already_built,
std::ofstream &  new_nodes_file 
)
pure virtual

Interface to function that builds the element: i.e. construct the nodes, assign their positions, apply boundary conditions, etc. The required procedures depend on the geometrical type of the element and must be implemented in specific refineable elements. Any new nodes created during the build process are returned in the vector new_node_pt.

Implemented in oomph::RefineableSolidQElement< 2 >, oomph::RefineableQElement< 2 >, oomph::RefineableSolidQElement< 1 >, oomph::RefineableQElement< 1 >, oomph::NonRefineableElementWithHangingNodes, oomph::RefineableSolidQElement< 3 >, and oomph::RefineableQElement< 3 >.

◆ check_integrity()

virtual void oomph::RefineableElement::check_integrity ( double max_error)
pure virtual

Check the integrity of the element: Continuity of positions values, etc. Essentially, check that the approximation of the functions is consistent when viewed from both sides of the element boundaries Must be overloaded for each different geometric element

Implemented in oomph::RefineableQElement< 2 >, oomph::RefineableQElement< 1 >, oomph::NonRefineableElementWithHangingNodes, oomph::RefineableQElement< 3 >, oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >, oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >, and oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >.

◆ check_value_id()

void oomph::RefineableElement::check_value_id ( const int n_continuously_interpolated_values,
const int value_id 
)
staticprotected

Static helper function that is used to check that the value_id is in range

Helper function that is used to check that the value_id is in the range allowed by the element. The number of continuously interpolated values and the value_id must be passed as arguments.

55  {
56  // If the value_id is more than the number of continuously interpolated
57  // values or less than -1 (for the position), we have a problem
58  if ((value_id < -1) || (value_id >= n_continuously_interpolated_values))
59  {
60  std::ostringstream error_stream;
61  error_stream << "Value_id " << value_id << " is out of range."
62  << std::endl
63  << "It can only take the values -1 (position) "
64  << "or an integer in the range 0 to "
65  << n_continuously_interpolated_values << std::endl;
66 
67  throw OomphLibError(
69  }
70  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::RefineableQPVDElementWithContinuousPressure< DIM >::get_interpolating_node_at_local_coordinate(), oomph::RefineableQPVDElementWithContinuousPressure< DIM >::interpolating_basis(), oomph::RefineableQPVDElementWithContinuousPressure< DIM >::interpolating_node_pt(), oomph::RefineableQPVDElementWithContinuousPressure< DIM >::local_one_d_fraction_of_interpolating_node(), oomph::RefineableQPVDElementWithContinuousPressure< DIM >::ninterpolating_node(), and oomph::RefineableQPVDElementWithContinuousPressure< DIM >::ninterpolating_node_1d().

◆ deactivate_element()

void oomph::RefineableElement::deactivate_element ( )
virtual

Final operations that must be performed when the element is no longer active in the mesh, but still resident in the QuadTree.

Deactivate the element by marking setting all local pointers to obsolete nodes to zero

294  {
295  // Find the number of nodes
296  const unsigned n_node = nnode();
297  // Loop over the nodes
298  for (unsigned n = 0; n < n_node; n++)
299  {
300  // If the node pointer has not already been nulled, but is obsolete
301  // then null it
302  if ((this->node_pt(n) != 0) && (this->node_pt(n)->is_obsolete()))
303  {
304  this->node_pt(n) = 0;
305  }
306  }
307  }

References n, oomph::FiniteElement::nnode(), and oomph::FiniteElement::node_pt().

Referenced by oomph::Tree::deactivate_object().

◆ deselect_for_refinement()

void oomph::RefineableElement::deselect_for_refinement ( )
inline

Deselect the element for refinement.

327  {
328  To_be_refined = false;
329  }

References To_be_refined.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt().

◆ deselect_sons_for_unrefinement()

void oomph::RefineableElement::deselect_sons_for_unrefinement ( )
inline

No unrefinement will be performed by merging the four sons of this element

340  {
341  Sons_to_be_unrefined = false;
342  }

References Sons_to_be_unrefined.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt(), and oomph::Tree::merge_sons_if_required().

◆ disable_refinement()

void oomph::RefineableElement::disable_refinement ( )
inline

Suppress of any refinement for this element.

238  {
239  Refinement_is_enabled = false;
240  }

References Refinement_is_enabled.

◆ enable_refinement()

void oomph::RefineableElement::enable_refinement ( )
inline

Emnable refinement for this element.

244  {
245  Refinement_is_enabled = true;
246  }

References Refinement_is_enabled.

◆ father_element_pt()

virtual RefineableElement* oomph::RefineableElement::father_element_pt ( ) const
inlinevirtual

Return a pointer to the father element.

540  {
541  // If we have no tree, we have no father
542  if (Tree_pt == 0)
543  {
544  return 0;
545  }
546  else
547  {
548  // Otherwise get the father of the tree
549  Tree* father_pt = Tree_pt->father_pt();
550  // If the tree has no father then return null, no father
551  if (father_pt == 0)
552  {
553  return 0;
554  }
555  else
556  {
557  return father_pt->object_pt();
558  }
559  }
560  }
RefineableElement * object_pt() const
Definition: tree.h:88
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
Definition: tree.h:235

References oomph::Tree::father_pt(), oomph::Tree::object_pt(), and Tree_pt.

Referenced by oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::further_build(), oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement::further_build(), oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement::further_build(), oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >::further_build(), oomph::RefineablePolarStreamfunctionEquations::further_build(), oomph::RefineableAdvectionDiffusionEquations< DIM >::further_build(), oomph::RefineableGeneralisedAdvectionDiffusionEquations< DIM >::further_build(), oomph::RefineableAdvectionDiffusionReactionEquations< NREAGENT, DIM >::further_build(), oomph::RefineableAxisymAdvectionDiffusionEquations::further_build(), oomph::RefineableGeneralisedAxisymAdvectionDiffusionEquations::further_build(), oomph::RefineableAxisymmetricNavierStokesEquations::further_build(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::further_build(), oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >::further_build(), oomph::RefineableSolidElement::further_build(), oomph::RefineableHelmholtzEquations< DIM >::further_build(), oomph::RefineableLinearElasticityEquations< DIM >::further_build(), oomph::RefineableLinearWaveEquations< DIM >::further_build(), oomph::RefineableLinearisedNavierStokesEquations::further_build(), oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::further_build(), oomph::RefineableNavierStokesEquations< DIM >::further_build(), oomph::RefineablePMLHelmholtzEquations< DIM >::further_build(), oomph::RefineablePoissonEquations< DIM >::further_build(), oomph::RefineablePolarNavierStokesEquations::further_build(), oomph::RefineablePVDEquations< DIM >::further_build(), oomph::RefineablePVDEquationsWithPressure< DIM >::further_build(), oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::further_build(), oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< DIM >::further_build(), oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >::further_build(), oomph::RefineableSpaceTimeUnsteadyHeatMixedOrderEquations< SPATIAL_DIM >::further_build(), oomph::RefineableSphericalAdvectionDiffusionEquations::further_build(), oomph::RefineableSphericalNavierStokesEquations::further_build(), oomph::RefineableTimeHarmonicLinearElasticityEquations< DIM >::further_build(), oomph::RefineableUnsteadyHeatEquations< DIM >::further_build(), oomph::RefineableYoungLaplaceEquations::further_build(), oomph::RefineableQDPVDElement< DIM, NNODE_1D >::further_build(), and unbuild().

◆ fill_in_jacobian_from_nodal_by_fd()

void oomph::RefineableElement::fill_in_jacobian_from_nodal_by_fd ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
protectedvirtual

Calculate the contributions to the jacobian from the nodal degrees of freedom using finite differences. This version is overloaded to take hanging node information into account

This function calculates the entries of Jacobian matrix, used in the Newton method, associated with the nodal degrees of freedom. This is done by finite differences to handle the general case Overload the standard case to include hanging node case

Reimplemented from oomph::FiniteElement.

677  {
678  // Find the number of nodes
679  const unsigned n_node = nnode();
680 
681  // If there are no nodes, return straight away
682  if (n_node == 0)
683  {
684  return;
685  }
686 
687  // Call the update function to ensure that the element is in
688  // a consistent state before finite differencing starts
690 
691  // bool use_first_order_fd=false;
692 
693  // Find the number of dofs in the element
694  const unsigned n_dof = ndof();
695 
696  // Create newres vector
697  Vector<double> newres(n_dof); // , newres_minus(n_dof);
698 
699  // Used default value defined in GeneralisedElement
700  const double fd_step = Default_fd_jacobian_step;
701 
702  // Integer storage for local unknowns
703  int local_unknown = 0;
704 
705  // Loop over the nodes
706  for (unsigned n = 0; n < n_node; n++)
707  {
708  // Get the number of values stored at the node
709  const unsigned n_value = node_pt(n)->nvalue();
710 
711  // Get a pointer to the local node
712  Node* const local_node_pt = node_pt(n);
713 
714  // Loop over the number of values stored at the node
715  for (unsigned i = 0; i < n_value; i++)
716  {
717  // If the nodal value is not hanging
718  if (local_node_pt->is_hanging(i) == false)
719  {
720  // Get the equation number
721  local_unknown = nodal_local_eqn(n, i);
722  // If the variable is free
723  if (local_unknown >= 0)
724  {
725  // Get a pointer to the nodal value
726  double* const value_pt = local_node_pt->value_pt(i);
727 
728  // Save the old value of nodal value
729  const double old_var = *value_pt;
730 
731  // Increment the nodal value
732  *value_pt += fd_step;
733 
734  // Now update any dependent variables
736 
737  // Calculate the new residuals
738  get_residuals(newres);
739 
740  // if (use_first_order_fd)
741  {
742  // Do forward finite differences
743  for (unsigned m = 0; m < n_dof; m++)
744  {
745  // Stick the entry into the Jacobian matrix
746  jacobian(m, local_unknown) =
747  (newres[m] - residuals[m]) / fd_step;
748  }
749  }
750  // else
751  // {
752  // //Take backwards step
753  // *value_pt = old_var - fd_step;
754 
755  // //Calculate the new residuals at backward position
756  // get_residuals(newres_minus);
757 
758  // //Do central finite differences
759  // for(unsigned m=0;m<n_dof;m++)
760  // {
761  // //Stick the entry into the Jacobian matrix
762  // jacobian(m,local_unknown) =
763  // (newres[m] - newres_minus[m])/(2.0*fd_step);
764  // }
765  // }
766 
767  // Reset the nodal value
768  *value_pt = old_var;
769 
770  // Reset any dependent variables
772  }
773  }
774  // Otherwise the value is hanging node
775  else
776  {
777  // Get the local hanging infor
778  HangInfo* hang_info_pt = local_node_pt->hanging_pt(i);
779  // Loop over the master nodes
780  const unsigned n_master = hang_info_pt->nmaster();
781  for (unsigned m = 0; m < n_master; m++)
782  {
783  // Get the pointer to the master node
784  Node* const master_node_pt = hang_info_pt->master_node_pt(m);
785 
786  // Get the number of the unknown
787  local_unknown = local_hang_eqn(master_node_pt, i);
788  // If the variable is free
789  if (local_unknown >= 0)
790  {
791  // Get a pointer to the nodal value stored at the master node
792  double* const value_pt = master_node_pt->value_pt(i);
793 
794  // Save the old value of the nodal value stored at the master node
795  const double old_var = *value_pt;
796 
797  // Increment the nodal value stored at the master node
798  *value_pt += fd_step;
799 
800  // Now update any dependent variables
802 
803  // Calculate the new residuals
804  get_residuals(newres);
805 
806  // if (use_first_order_fd)
807  {
808  // Do forward finite differences
809  for (unsigned m = 0; m < n_dof; m++)
810  {
811  // Stick the entry into the Jacobian matrix
812  jacobian(m, local_unknown) =
813  (newres[m] - residuals[m]) / fd_step;
814  }
815  }
816  // else
817  // {
818  // //Take backwards step
819  // *value_pt = old_var - fd_step;
820 
821  // //Calculate the new residuals at backward
822  // position get_residuals(newres_minus);
823 
824  // //Do central finite differences
825  // for(unsigned m=0;m<n_dof;m++)
826  // {
827  // //Stick the entry into the Jacobian matrix
828  // jacobian(m,local_unknown) =
829  // (newres[m] - newres_minus[m])/(2.0*fd_step);
830  // }
831  // }
832 
833  // Reset the value at the master node
834  *value_pt = old_var;
835 
836  // Reset any dependent variables
838  }
839  } // End of loop over master nodes
840  } // End of hanging node case
841  } // End of loop over values
842  } // End of loop over nodes
843 
844  // End of finite difference loop
845  // Final reset of any dependent data
847  }
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
virtual void update_before_nodal_fd()
Definition: elements.h:1709
virtual void update_in_nodal_fd(const unsigned &i)
Definition: elements.h:1718
virtual void reset_in_nodal_fd(const unsigned &i)
Definition: elements.h:1723
virtual void reset_after_nodal_fd()
Definition: elements.h:1714
static double Default_fd_jacobian_step
Definition: elements.h:1198
virtual void get_residuals(Vector< double > &residuals)
Definition: elements.h:980
int local_hang_eqn(Node *const &node_pt, const unsigned &i)
Definition: refineable_elements.h:278

References oomph::GeneralisedElement::Default_fd_jacobian_step, oomph::GeneralisedElement::get_residuals(), oomph::Node::hanging_pt(), i, oomph::Node::is_hanging(), local_hang_eqn(), m, oomph::HangInfo::master_node_pt(), n, oomph::GeneralisedElement::ndof(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_local_eqn(), oomph::FiniteElement::node_pt(), oomph::Data::nvalue(), oomph::FiniteElement::reset_after_nodal_fd(), oomph::FiniteElement::reset_in_nodal_fd(), oomph::FiniteElement::update_before_nodal_fd(), oomph::FiniteElement::update_in_nodal_fd(), and oomph::Data::value_pt().

◆ further_build()

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

Further build: e.g. deal with interpolation of internal values.

Reimplemented in oomph::RefineableQDPVDElement< DIM, NNODE_1D >, oomph::RefineableYoungLaplaceEquations, oomph::RefineableUnsteadyHeatEquations< DIM >, oomph::RefineableTimeHarmonicLinearElasticityEquations< DIM >, oomph::RefineableQSphericalCrouzeixRaviartElement, oomph::RefineableSphericalNavierStokesEquations, oomph::RefineableSphericalAdvectionDiffusionEquations, oomph::RefineableSpaceTimeUnsteadyHeatMixedOrderEquations< SPATIAL_DIM >, oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >, oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >, oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< DIM >, oomph::RefineableSpaceTimeNavierStokesEquations< DIM >, oomph::RefineableSpaceTimeNavierStokesEquations< DIM >, oomph::RefineableSpaceTimeNavierStokesEquations< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineablePVDEquationsWithPressure< DIM >, oomph::RefineablePVDEquations< DIM >, oomph::RefineablePolarCrouzeixRaviartElement, oomph::RefineablePolarNavierStokesEquations, oomph::PRefineableQPoissonElement< DIM >, oomph::RefineablePoissonEquations< DIM >, oomph::RefineablePMLHelmholtzEquations< DIM >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableNavierStokesEquations< DIM >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedQCrouzeixRaviartElement, oomph::RefineableLinearisedNavierStokesEquations, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricNavierStokesEquations, oomph::RefineableLinearWaveEquations< DIM >, oomph::PRefineableQLinearElasticityElement< DIM >, oomph::RefineableLinearElasticityEquations< DIM >, oomph::RefineableHelmholtzEquations< DIM >, oomph::RefineableSolidElement, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianAxisymmetricQCrouzeixRaviartElement, oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations, oomph::RefineableAxisymmetricQCrouzeixRaviartElement, oomph::RefineableAxisymmetricNavierStokesEquations, oomph::RefineableGeneralisedAxisymAdvectionDiffusionEquations, oomph::RefineableAxisymAdvectionDiffusionEquations, oomph::RefineableAdvectionDiffusionReactionEquations< NREAGENT, DIM >, oomph::RefineableGeneralisedAdvectionDiffusionEquations< DIM >, oomph::RefineableAdvectionDiffusionEquations< DIM >, oomph::RefineablePolarStreamfunctionEquations, ModalPRefineableQPoissonElement< DIM >, RefineableModalPoissonEquations< DIM >, oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement, RefineableQCrouzeixRaviartElementWithTwoExternalElement< DIM >, RefineableQAxisymCrouzeixRaviartBoussinesqElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, RefineableQAxisymCrouzeixRaviartBoussinesqElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, RefineableQCrouzeixRaviartElementWithExternalElement< DIM >, RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations.

599 {}

Referenced by oomph::RefineableSolidElement::further_build().

◆ further_setup_hanging_nodes()

virtual void oomph::RefineableElement::further_setup_hanging_nodes ( )
inlinevirtual

Perform additional hanging node procedures for variables that are not interpolated by all nodes (e.g. lower order interpolations for the pressure in Taylor Hood).

Reimplemented in oomph::RefineableQElement< 2 >, oomph::RefineableQElement< 3 >, oomph::RefineableQYoungLaplaceElement< NNODE_1D >, oomph::RefineableQUnsteadyHeatElement< DIM, NNODE_1D >, oomph::RefineableQTimeHarmonicLinearElasticityElement< DIM, NNODE_1D >, oomph::RefineableQSphericalCrouzeixRaviartElement, oomph::RefineableQSphericalTaylorHoodElement, oomph::RefineableQSphericalAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQSphericalAdvectionDiffusionElement< 3 >, oomph::RefineableQUnsteadyHeatMixedOrderSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQUnsteadyHeatSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQUnsteadyHeatSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQPVDElementWithContinuousPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElement< DIM, NNODE_1D >, oomph::RefineablePolarCrouzeixRaviartElement, oomph::RefineablePolarTaylorHoodElement, oomph::RefineableQSpectralPoissonElement< DIM, NNODE_1D >, oomph::RefineableQPoissonElement< DIM, NNODE_1D >, oomph::RefineableQPMLHelmholtzElement< DIM, NNODE_1D >, oomph::RefineableQPMLHelmholtzElement< 2, NNODE_1D >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableQTaylorHoodElement< DIM >, oomph::RefineableQTaylorHoodElement< 2 >, oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedQTaylorHoodElement, oomph::RefineableLinearisedQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableQLinearWaveElement< DIM, NNODE_1D >, oomph::RefineableQLinearElasticityElement< DIM, NNODE_1D >, oomph::RefineableQHelmholtzElement< DIM, NNODE_1D >, oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >, oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >, oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::RefineableGeneralisedNewtonianAxisymmetricQCrouzeixRaviartElement, oomph::RefineableGeneralisedNewtonianAxisymmetricQTaylorHoodElement, oomph::RefineableAxisymmetricQCrouzeixRaviartElement, oomph::RefineableAxisymmetricQTaylorHoodElement, oomph::RefineableQGeneralisedAxisymAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQAxisymAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQAxisymAdvectionDiffusionElement< 3 >, oomph::RefineableQAdvectionDiffusionReactionElement< NREAGENT, DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionReactionElement< 2, DIM, 3 >, oomph::RefineableQSUPGAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQGeneralisedAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionElement< DIM, 3 >, oomph::RefineablePolarStreamfunctionElement, oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, and oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement.

609 {}

◆ get_dresidual_dnodal_coordinates()

void oomph::RefineableElement::get_dresidual_dnodal_coordinates ( RankThreeTensor< double > &  dresidual_dnodal_coordinates)
virtual

Compute derivatives of elemental residual vector with respect to nodal coordinates. Default implementation by FD can be overwritten for specific elements. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij} This version is overloaded from the version in FiniteElement and takes hanging nodes into account – j in the above loop loops over all the nodes that actively control the shape of the element (i.e. they are non-hanging or master nodes of hanging nodes in this element).

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< DIM >, oomph::RefineableSpaceTimeNavierStokesEquations< DIM >, oomph::RefineableSpaceTimeNavierStokesEquations< DIM >, oomph::RefineableSpaceTimeNavierStokesEquations< DIM >, oomph::RefineablePoissonEquations< DIM >, and oomph::RefineableNavierStokesEquations< DIM >.

599  {
600  // Number of nodes
601  unsigned n_nod = nnode();
602 
603  // If the element has no nodes (why??!!) return straightaway
604  if (n_nod == 0) return;
605 
606  // Get dimension from first node
607  unsigned dim_nod = node_pt(0)->ndim();
608 
609  // Number of dofs
610  unsigned n_dof = ndof();
611 
612  // Get reference residual
613  Vector<double> res(n_dof);
614  Vector<double> res_pls(n_dof);
616 
617  // FD step
619 
620  // Do FD loop over all active nodes
621  for (std::map<Node*, unsigned>::iterator it =
623  it != Shape_controlling_node_lookup.end();
624  it++)
625  {
626  // Get node
627  Node* nod_pt = it->first;
628 
629  // Get its number
630  unsigned node_number = it->second;
631 
632  // Loop over coordinate directions
633  for (unsigned i = 0; i < dim_nod; i++)
634  {
635  // Make backup
636  double backup = nod_pt->x(i);
637 
638  // Do FD step. No node update required as we're
639  // attacking the coordinate directly...
640  nod_pt->x(i) += eps_fd;
641 
642  // Perform auxiliary node update function
643  nod_pt->perform_auxiliary_node_update_fct();
644 
645  // Get advanced residual
646  get_residuals(res_pls);
647 
648  // Fill in FD entries [Loop order is "wrong" here as l is the
649  // slow index but this is in a function that's costly anyway
650  // and gives us the fastest loop outside where these tensor
651  // is actually used.]
652  for (unsigned l = 0; l < n_dof; l++)
653  {
654  dresidual_dnodal_coordinates(l, i, node_number) =
655  (res_pls[l] - res[l]) / eps_fd;
656  }
657 
658  // Reset coordinate. No node update required as we're
659  // attacking the coordinate directly...
660  nod_pt->x(i) = backup;
661 
662  // Perform auxiliary node update function
663  nod_pt->perform_auxiliary_node_update_fct();
664  }
665  }
666  }
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054

References oomph::GeneralisedElement::Default_fd_jacobian_step, oomph::GeneralisedElement::get_residuals(), i, oomph::Node::ndim(), oomph::GeneralisedElement::ndof(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::Node::perform_auxiliary_node_update_fct(), res, Shape_controlling_node_lookup, and oomph::Node::x().

◆ get_father_at_refinement_level()

void oomph::RefineableElement::get_father_at_refinement_level ( unsigned refinement_level,
RefineableElement *&  father_at_reflevel_pt 
)
inline

Return a pointer to the "father" element at the specified refinement level

566  {
567  // Get the father in the tree (it shouldn't try to get a null Tree...)
568  Tree* father_pt = Tree_pt->father_pt();
569  // Get the refineable element associated with this father
570  RefineableElement* father_el_pt =
571  dynamic_cast<RefineableElement*>(father_pt->object_pt());
572  // Get the refinement level
573  unsigned level = father_el_pt->refinement_level();
574  // If the level matches the required one then return, if not call again
575  if (level == refinement_level)
576  {
577  father_at_reflevel_pt = father_el_pt;
578  }
579  else
580  {
581  // Recursive call
582  father_el_pt->get_father_at_refinement_level(refinement_level,
583  father_at_reflevel_pt);
584  }
585  }
unsigned refinement_level() const
Return the Refinement level.
Definition: refineable_elements.h:314
RefineableElement()
Definition: refineable_elements.h:188

References oomph::Tree::father_pt(), get_father_at_refinement_level(), oomph::Tree::object_pt(), refinement_level(), and Tree_pt.

Referenced by get_father_at_refinement_level().

◆ get_interpolated_values() [1/2]

virtual void oomph::RefineableElement::get_interpolated_values ( const unsigned t,
const Vector< double > &  s,
Vector< double > &  values 
)
pure virtual

Get all continously interpolated function values at previous timestep in this element as a Vector. (t=0: present; t>0: prev. timestep) Note: Vector sets is own size to ensure that that this function can be used in black-box fashion.

Implemented in oomph::RefineableYoungLaplaceEquations, oomph::RefineableUnsteadyHeatEquations< DIM >, oomph::RefineableTimeHarmonicLinearElasticityEquations< DIM >, oomph::RefineableQSphericalCrouzeixRaviartElement, oomph::RefineableQSphericalTaylorHoodElement, oomph::RefineableSphericalAdvectionDiffusionEquations, oomph::RefineableSpaceTimeUnsteadyHeatMixedOrderEquations< SPATIAL_DIM >, oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >, oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >, oomph::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQPVDElementWithContinuousPressure< DIM >, oomph::RefineablePVDEquationsWithPressure< DIM >, oomph::RefineablePVDEquations< DIM >, oomph::RefineablePolarCrouzeixRaviartElement, oomph::RefineablePolarTaylorHoodElement, oomph::RefineablePoissonEquations< DIM >, oomph::RefineablePMLHelmholtzEquations< DIM >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableQTaylorHoodElement< DIM >, oomph::RefineableQTaylorHoodElement< 2 >, oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedQTaylorHoodElement, oomph::RefineableLinearisedQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableLinearWaveEquations< DIM >, oomph::RefineableLinearElasticityEquations< DIM >, oomph::RefineableHelmholtzEquations< DIM >, oomph::NonRefineableElementWithHangingNodes, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::RefineableGeneralisedNewtonianAxisymmetricQCrouzeixRaviartElement, oomph::RefineableGeneralisedNewtonianAxisymmetricQTaylorHoodElement, oomph::RefineableAxisymmetricQCrouzeixRaviartElement, oomph::RefineableAxisymmetricQTaylorHoodElement, oomph::RefineableGeneralisedAxisymAdvectionDiffusionEquations, oomph::RefineableAxisymAdvectionDiffusionEquations, oomph::RefineableAdvectionDiffusionReactionEquations< NREAGENT, DIM >, oomph::RefineableGeneralisedAdvectionDiffusionEquations< DIM >, oomph::RefineableAdvectionDiffusionEquations< DIM >, oomph::RefineablePolarStreamfunctionEquations, RefineableModalPoissonEquations< DIM >, oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, and oomph::SpectralPeriodicOrbitElement< NNODE_1D >.

◆ get_interpolated_values() [2/2]

virtual void oomph::RefineableElement::get_interpolated_values ( const Vector< double > &  s,
Vector< double > &  values 
)
inlinevirtual

Get all continously interpolated function values in this element as a Vector. Note: Vector sets is own size to ensure that that this function can be used in black-box fashion.

Reimplemented in oomph::RefineableYoungLaplaceEquations, oomph::RefineableUnsteadyHeatEquations< DIM >, oomph::RefineableTimeHarmonicLinearElasticityEquations< DIM >, oomph::RefineableQSphericalCrouzeixRaviartElement, oomph::RefineableQSphericalTaylorHoodElement, oomph::RefineableSphericalAdvectionDiffusionEquations, oomph::RefineableSpaceTimeUnsteadyHeatMixedOrderEquations< SPATIAL_DIM >, oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >, oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >, oomph::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQPVDElementWithContinuousPressure< DIM >, oomph::RefineablePVDEquationsWithPressure< DIM >, oomph::RefineablePVDEquations< DIM >, oomph::RefineablePolarCrouzeixRaviartElement, oomph::RefineablePolarTaylorHoodElement, oomph::RefineablePoissonEquations< DIM >, oomph::RefineablePMLHelmholtzEquations< DIM >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableQTaylorHoodElement< DIM >, oomph::RefineableQTaylorHoodElement< 2 >, oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedQTaylorHoodElement, oomph::RefineableLinearisedQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableLinearWaveEquations< DIM >, oomph::RefineableLinearElasticityEquations< DIM >, oomph::RefineableHelmholtzEquations< DIM >, oomph::NonRefineableElementWithHangingNodes, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::RefineableGeneralisedNewtonianAxisymmetricQCrouzeixRaviartElement, oomph::RefineableGeneralisedNewtonianAxisymmetricQTaylorHoodElement, oomph::RefineableAxisymmetricQCrouzeixRaviartElement, oomph::RefineableAxisymmetricQTaylorHoodElement, oomph::RefineableGeneralisedAxisymAdvectionDiffusionEquations, oomph::RefineableAxisymAdvectionDiffusionEquations, oomph::RefineableAdvectionDiffusionReactionEquations< NREAGENT, DIM >, oomph::RefineableGeneralisedAdvectionDiffusionEquations< DIM >, oomph::RefineableAdvectionDiffusionEquations< DIM >, oomph::RefineablePolarStreamfunctionEquations, RefineableModalPoissonEquations< DIM >, oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, and oomph::SpectralPeriodicOrbitElement< NNODE_1D >.

419  {
420  get_interpolated_values(0, s, values);
421  }
virtual void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_elements.h:417
RealScalar s
Definition: level1_cplx_impl.h:130

References s.

Referenced by oomph::RefineableQElement< 3 >::build(), oomph::RefineableQElement< 1 >::build(), oomph::RefineableQElement< 2 >::build(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::check_integrity(), oomph::RefineableQElement< 3 >::check_integrity(), oomph::RefineableQElement< 1 >::check_integrity(), oomph::RefineableQElement< 2 >::check_integrity(), oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >::p_refine(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::p_refine(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::p_refine(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::pre_build(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::pre_build(), oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >::rebuild_from_sons(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::rebuild_from_sons(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::rebuild_from_sons(), oomph::RefineableQSpectralElement< 3 >::rebuild_from_sons(), oomph::RefineableQSpectralElement< 1 >::rebuild_from_sons(), and oomph::RefineableQSpectralElement< 2 >::rebuild_from_sons().

◆ get_interpolating_node_at_local_coordinate()

virtual Node* oomph::RefineableElement::get_interpolating_node_at_local_coordinate ( const Vector< double > &  s,
const int value_id 
)
inlinevirtual

◆ identify_field_data_for_interactions()

void oomph::RefineableElement::identify_field_data_for_interactions ( std::set< std::pair< Data *, unsigned >> &  paired_field_data)
virtual

The purpose of this function is to identify all possible Data that can affect the fields interpolated by the FiniteElement. This must be overloaded to include data from any hanging nodes correctly

Reimplemented from oomph::FiniteElement.

525  {
526  // Loop over all internal data
527  const unsigned n_internal = this->ninternal_data();
528  for (unsigned n = 0; n < n_internal; n++)
529  {
530  // Cache the data pointer
531  Data* const dat_pt = this->internal_data_pt(n);
532  // Find the number of data values stored in the data object
533  const unsigned n_value = dat_pt->nvalue();
534  // Add the index of each data value and the pointer to the set
535  // of pairs
536  for (unsigned i = 0; i < n_value; i++)
537  {
538  paired_field_data.insert(std::make_pair(dat_pt, i));
539  }
540  }
541 
542  // Loop over all the nodes
543  const unsigned n_node = this->nnode();
544  for (unsigned n = 0; n < n_node; n++)
545  {
546  // Cache the node pointer
547  Node* const nod_pt = this->node_pt(n);
548  // Find the number of values stored at the node
549  const unsigned n_value = nod_pt->nvalue();
550 
551  // Loop over the number of values
552  for (unsigned i = 0; i < n_value; i++)
553  {
554  // If the node is hanging in the variable
555  if (nod_pt->is_hanging(i))
556  {
557  // Cache the pointer to the HangInfo object for this variable
558  HangInfo* const hang_pt = nod_pt->hanging_pt(i);
559  // Get number of master nodes
560  const unsigned nmaster = hang_pt->nmaster();
561 
562  // Loop over masters
563  for (unsigned m = 0; m < nmaster; m++)
564  {
565  // Cache the pointer to the master node
566  Node* const master_nod_pt = hang_pt->master_node_pt(m);
567 
568  // Under the assumption that the same data value is interpolated
569  // by the hanging nodes, which it really must be
570  // Add it to the paired field data
571  paired_field_data.insert(std::make_pair(master_nod_pt, i));
572  }
573  }
574  // Otherwise the node is not hanging in the variable, treat as normal
575  else
576  {
577  // Add the index of each data value and the pointer to the set
578  // of pairs
579  paired_field_data.insert(std::make_pair(nod_pt, i));
580  }
581  }
582  }
583  }
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:823

References oomph::Node::hanging_pt(), i, oomph::GeneralisedElement::internal_data_pt(), oomph::Node::is_hanging(), m, oomph::HangInfo::master_node_pt(), n, oomph::GeneralisedElement::ninternal_data(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), and oomph::Data::nvalue().

◆ initial_setup()

virtual void oomph::RefineableElement::initial_setup ( Tree *const &  adopted_father_pt = 0,
const unsigned initial_p_order = 0 
)
inlinevirtual

Initial setup of the element: e.g. set the appropriate internal p-order. If an adopted father is specified, information from this is used instead of using the father found from the tree.

Reimplemented in oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >, oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >, and oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >.

592  {
593  }

◆ interpolating_basis()

virtual void oomph::RefineableElement::interpolating_basis ( const Vector< double > &  s,
Shape psi,
const int value_id 
) const
inlinevirtual

◆ interpolating_node_pt()

virtual Node* oomph::RefineableElement::interpolating_node_pt ( const unsigned n,
const int value_id 
)
inlinevirtual

In mixed elements, different sets of nodes are used to interpolate different unknowns. This function returns the n-th node that interpolates the value_id-th unknown. Default implementation is that all variables use the positional nodes, i.e. isoparametric elements. Note that any overloaded versions of this function MUST provide a set of nodes for the position, which always has the value_id -1.

Reimplemented in oomph::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQPVDElementWithContinuousPressure< DIM >, oomph::RefineablePolarTaylorHoodElement, oomph::RefineableQTaylorHoodElement< DIM >, oomph::RefineableQTaylorHoodElement< 2 >, oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::RefineableQSphericalTaylorHoodElement, oomph::RefineableLinearisedQTaylorHoodElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, oomph::RefineableGeneralisedNewtonianAxisymmetricQTaylorHoodElement, oomph::RefineableAxisymmetricQTaylorHoodElement, and oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement.

439  {
440  return node_pt(n);
441  }

References n, and oomph::FiniteElement::node_pt().

Referenced by oomph::RefineableQElement< 3 >::oc_hang_helper(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::oc_hang_helper(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::quad_hang_helper(), and oomph::RefineableQElement< 2 >::quad_hang_helper().

◆ local_hang_eqn()

int oomph::RefineableElement::local_hang_eqn ( Node *const &  node_pt,
const unsigned i 
)
inline

Access function that returns the local equation number for the hanging node variables (values stored at master nodes). The local equation number corresponds to the i-th unknown stored at the node addressed by node_pt

279  {
280 #ifdef RANGE_CHECKING
282  {
283  std::ostringstream error_message;
284  error_message << "Range Error: Value " << i
285  << " is not in the range (0,"
286  << ncont_interpolated_values() - 1 << ")";
287  throw OomphLibError(error_message.str(),
290  }
291 #endif
292 
293  return Local_hang_eqn[i][node_pt];
294  }

References i, Local_hang_eqn, ncont_interpolated_values(), oomph::FiniteElement::node_pt(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::RefineableYoungLaplaceEquations::fill_in_contribution_to_residuals(), oomph::RefineablePolarNavierStokesEquations::fill_in_generic_residual_contribution(), oomph::RefineablePolarStreamfunctionEquations::fill_in_generic_residual_contribution(), oomph::RefineableAxisymAdvectionDiffusionEquations::fill_in_generic_residual_contribution_axi_adv_diff(), oomph::RefineableAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::RefineableGeneralisedAxisymAdvectionDiffusionEquations::fill_in_generic_residual_contribution_cons_axisym_adv_diff(), oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_nst(), oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst(), oomph::RefineableSphericalAdvectionDiffusionEquations::fill_in_generic_residual_contribution_spherical_adv_diff(), oomph::RefineableSphericalNavierStokesEquations::fill_in_generic_residual_contribution_spherical_nst(), fill_in_jacobian_from_nodal_by_fd(), oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement::fill_in_off_diagonal_jacobian_blocks_analytic(), oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement::fill_in_off_diagonal_jacobian_blocks_analytic(), oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::fill_in_off_diagonal_jacobian_blocks_analytic(), oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >::fill_in_off_diagonal_jacobian_blocks_by_fd(), oomph::RefineableAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::RefineableImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::refineable_fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(), oomph::RefineableFSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::refineable_fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(), and oomph::RefineableNavierStokesFluxControlElement< ELEMENT >::refineable_fill_in_generic_residual_contribution_fluid_traction().

◆ local_one_d_fraction_of_interpolating_node()

virtual double oomph::RefineableElement::local_one_d_fraction_of_interpolating_node ( const unsigned n1d,
const unsigned i,
const int value_id 
)
inlinevirtual

◆ local_to_eulerian_mapping_diagonal()

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

Calculate the mapping from local to Eulerian coordinates given the derivatives of the shape functions w.r.t the local 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. This funciton returns the determinant of the jacobian, the jacobian and the inverse jacobian. Overload the standard version to take hanging info into account.

Calculate the mapping from local to eulerian 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::FiniteElement.

219  {
220  // Find the dimension of the element
221  const unsigned el_dim = dim();
222  // Find the number of shape functions and shape functions types
223  // Equal to the number of nodes and their position types by definition
224  const unsigned n_shape = nnode();
225  const unsigned n_shape_type = nnodal_position_type();
226 
227 #ifdef PARANOID
228  // Check for dimension compatibility
229  if (dim() != nodal_dimension())
230  {
231  std::ostringstream error_message;
232  error_message << "Dimension mismatch" << std::endl;
233  error_message << "The elemental dimension: " << dim()
234  << " must equal the nodal dimension: " << nodal_dimension()
235  << " for the jacobian of the mapping to be well-defined"
236  << std::endl;
237  throw OomphLibError(
238  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
239  }
240 #endif
241 
242  // In this case we assume that there are no cross terms, that is
243  // global coordinate 0 is always in the direction of local coordinate 0
244 
245  // Loop over the coordinates
246  for (unsigned i = 0; i < el_dim; i++)
247  {
248  // Zero the jacobian and inverse jacobian entries
249  for (unsigned j = 0; j < el_dim; j++)
250  {
251  jacobian(i, j) = 0.0;
252  inverse_jacobian(i, j) = 0.0;
253  }
254 
255  // Loop over the shape functions
256  for (unsigned l = 0; l < n_shape; l++)
257  {
258  // Loop over the types of dof
259  for (unsigned k = 0; k < n_shape_type; k++)
260  {
261  // Derivatives are always dx_{i}/ds_{i}
262  jacobian(i, i) += nodal_position_gen(l, k, i) * dpsids(l, k, i);
263  }
264  }
265  }
266 
267  // Now calculate the determinant of the matrix
268  double det = 1.0;
269  for (unsigned i = 0; i < el_dim; i++)
270  {
271  det *= jacobian(i, i);
272  }
273 
274 // Report if Matrix is singular, or negative
275 #ifdef PARANOID
276  check_jacobian(det);
277 #endif
278 
279  // Calculate the inverse mapping (trivial in this case)
280  for (unsigned i = 0; i < el_dim; i++)
281  {
282  inverse_jacobian(i, i) = 1.0 / jacobian(i, i);
283  }
284 
285  // Return the value of the Jacobian
286  return (det);
287  }
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::FiniteElement::nnodal_position_type(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_dimension(), oomph::FiniteElement::nodal_position_gen(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ max_integrity_tolerance()

static double& oomph::RefineableElement::max_integrity_tolerance ( )
inlinestatic

Max. allowed discrepancy in element integrity check.

496  {
498  }
static double Max_integrity_tolerance
Max. allowed discrepancy in element integrity check.
Definition: refineable_elements.h:118

References Max_integrity_tolerance.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), and oomph::TreeBasedRefineableMeshBase::p_adapt_mesh().

◆ ncont_interpolated_values()

virtual unsigned oomph::RefineableElement::ncont_interpolated_values ( ) const
pure virtual

Number of continuously interpolated values. Note: We assume that they are located at the beginning of the value_pt Vector! (Used for interpolation to son elements, for integrity check and post-processing – we can only expect the continously interpolated values to be continous across element boundaries).

Implemented in oomph::RefineableQYoungLaplaceElement< NNODE_1D >, oomph::RefineableQUnsteadyHeatElement< DIM, NNODE_1D >, oomph::RefineableTimeHarmonicLinearElasticityEquations< DIM >, oomph::RefineableQSphericalCrouzeixRaviartElement, oomph::RefineableQSphericalTaylorHoodElement, oomph::RefineableQSphericalAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQSphericalAdvectionDiffusionElement< 3 >, oomph::RefineableQUnsteadyHeatMixedOrderSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQUnsteadyHeatSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQUnsteadyHeatSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >, oomph::RefineableNavierStokesMixedOrderSpaceTimeTractionElement< ELEMENT >, oomph::RefineableNavierStokesSpaceTimeTractionElement< ELEMENT >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableNavierStokesSpaceTimeTractionElement< ELEMENT >, oomph::RefineableNavierStokesSpaceTimeTractionElement< ELEMENT >, oomph::RefineableFSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >, oomph::RefineableImposeDisplacementByLagrangeMultiplierElement< ELEMENT >, oomph::RefineableSolidTractionElement< ELEMENT >, oomph::RefineableQPVDElementWithContinuousPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineablePVDEquationsWithPressure< DIM >, oomph::RefineablePVDEquations< DIM >, oomph::RefineablePolarCrouzeixRaviartElement, oomph::RefineablePolarTaylorHoodElement, oomph::RefineableQSpectralPoissonElement< DIM, NNODE_1D >, oomph::PRefineableQPoissonElement< DIM >, oomph::RefineableQPoissonElement< DIM, NNODE_1D >, oomph::RefineableQPMLHelmholtzElement< DIM, NNODE_1D >, oomph::RefineableQPMLHelmholtzElement< 2, NNODE_1D >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableQTaylorHoodElement< DIM >, oomph::RefineableQTaylorHoodElement< 2 >, oomph::RefineableNavierStokesFluxControlElement< ELEMENT >, oomph::RefineableNavierStokesTractionElement< ELEMENT >, oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedQTaylorHoodElement, oomph::RefineableLinearisedQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableQLinearWaveElement< DIM, NNODE_1D >, oomph::PRefineableQLinearElasticityElement< DIM >, oomph::RefineableLinearElasticityEquations< DIM >, oomph::RefineableQHelmholtzElement< DIM, NNODE_1D >, oomph::SpectralPeriodicOrbitElement< NNODE_1D >, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::RefineableGeneralisedNewtonianAxisymmetricQCrouzeixRaviartElement, oomph::RefineableGeneralisedNewtonianAxisymmetricQTaylorHoodElement, oomph::RefineableAxisymmetricQCrouzeixRaviartElement, oomph::RefineableAxisymmetricQTaylorHoodElement, oomph::RefineableQGeneralisedAxisymAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQAxisymAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQAxisymAdvectionDiffusionElement< 3 >, oomph::RefineableQAdvectionDiffusionReactionElement< NREAGENT, DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionReactionElement< 2, DIM, 3 >, oomph::RefineableQSUPGAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQGeneralisedAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionElement< DIM, 3 >, oomph::RefineablePolarStreamfunctionElement, ModalPRefineableQPoissonElement< DIM >, oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, and oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement.

Referenced by assign_hanging_local_eqn_numbers(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::check_integrity(), oomph::RefineableQElement< 3 >::check_integrity(), oomph::RefineableQElement< 1 >::check_integrity(), oomph::RefineableQElement< 2 >::check_integrity(), and local_hang_eqn().

◆ ninterpolating_node()

◆ ninterpolating_node_1d()

◆ nodes_built()

◆ nshape_controlling_nodes()

unsigned oomph::RefineableElement::nshape_controlling_nodes ( )
inline

◆ number()

long oomph::RefineableElement::number ( ) const
inline

Element number (for debugging/plotting)

396  {
397  return Number;
398  }

References Number.

Referenced by oomph::OcTree::doc_face_neighbours(), oomph::BinaryTree::doc_neighbours(), oomph::QuadTree::doc_neighbours(), and oomph::OcTree::doc_true_edge_neighbours().

◆ operator=()

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

Broken assignment operator.

◆ pre_build()

virtual void oomph::RefineableElement::pre_build ( Mesh *&  mesh_pt,
Vector< Node * > &  new_node_pt 
)
inlinevirtual

◆ rebuild_from_sons()

virtual void oomph::RefineableElement::rebuild_from_sons ( Mesh *&  mesh_pt)
pure virtual

Rebuild the element, e.g. set internal values in line with those of the sons that have now merged

Implemented in oomph::RefineableQYoungLaplaceElement< NNODE_1D >, oomph::RefineableQUnsteadyHeatElement< DIM, NNODE_1D >, oomph::RefineableQTimeHarmonicLinearElasticityElement< DIM, NNODE_1D >, oomph::RefineableQSphericalCrouzeixRaviartElement, oomph::RefineableQSphericalTaylorHoodElement, oomph::RefineableQSphericalAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQSphericalAdvectionDiffusionElement< 3 >, oomph::RefineableQUnsteadyHeatMixedOrderSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQUnsteadyHeatSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQUnsteadyHeatSpaceTimeElement< SPATIAL_DIM, NNODE_1D >, oomph::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQPVDElementWithContinuousPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElementWithPressure< DIM >, oomph::RefineableQPVDElement< DIM, NNODE_1D >, oomph::RefineablePolarCrouzeixRaviartElement, oomph::RefineablePolarTaylorHoodElement, oomph::RefineableQPoissonElement< DIM, NNODE_1D >, oomph::RefineableQPMLHelmholtzElement< DIM, NNODE_1D >, oomph::RefineableQPMLHelmholtzElement< 2, NNODE_1D >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::PRefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< DIM >, oomph::RefineableQCrouzeixRaviartElement< 2 >, oomph::RefineableQTaylorHoodElement< DIM >, oomph::RefineableQTaylorHoodElement< 2 >, oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedQTaylorHoodElement, oomph::RefineableLinearisedQCrouzeixRaviartElement, oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, oomph::RefineableQLinearWaveElement< DIM, NNODE_1D >, oomph::RefineableQLinearElasticityElement< DIM, NNODE_1D >, oomph::RefineableQHelmholtzElement< DIM, NNODE_1D >, oomph::RefineableQSpectralElement< 2 >, oomph::RefineableQSpectralElement< 1 >, oomph::NonRefineableElementWithHangingNodes, oomph::RefineableQSpectralElement< 3 >, oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >, oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >, oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::RefineableGeneralisedNewtonianAxisymmetricQCrouzeixRaviartElement, oomph::RefineableGeneralisedNewtonianAxisymmetricQTaylorHoodElement, oomph::RefineableAxisymmetricQCrouzeixRaviartElement, oomph::RefineableAxisymmetricQTaylorHoodElement, oomph::RefineableQGeneralisedAxisymAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQAxisymAdvectionDiffusionElement< NNODE_1D >, oomph::RefineableQAxisymAdvectionDiffusionElement< 3 >, oomph::RefineableQAdvectionDiffusionReactionElement< NREAGENT, DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionReactionElement< 2, DIM, 3 >, oomph::RefineableQSUPGAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQGeneralisedAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionElement< DIM, NNODE_1D >, oomph::RefineableQAdvectionDiffusionElement< DIM, 3 >, oomph::RefineablePolarStreamfunctionElement, oomph::RefineableDoubleBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableBuoyantQSphericalCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, oomph::RefineableBuoyantQAxisymCrouzeixRaviartElement, RefineableBuoyantQCrouzeixRaviartElement< DIM >, oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement, and oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement.

Referenced by oomph::Tree::merge_sons_if_required().

◆ refinement_is_enabled()

bool oomph::RefineableElement::refinement_is_enabled ( )
inline

Flag to indicate suppression of any refinement.

232  {
233  return Refinement_is_enabled;
234  }

References Refinement_is_enabled.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt().

◆ refinement_level()

unsigned oomph::RefineableElement::refinement_level ( ) const
inline

◆ required_nsons()

virtual unsigned oomph::RefineableElement::required_nsons ( ) const
inlinevirtual

Set the number of sons that can be constructed by the element The default is none

Reimplemented in oomph::RefineableQElement< 2 >, oomph::RefineableQElement< 1 >, and oomph::RefineableQElement< 3 >.

225  {
226  return 0;
227  }

Referenced by split().

◆ root_element_pt()

virtual RefineableElement* oomph::RefineableElement::root_element_pt ( )
inlinevirtual

Pointer to the root element in refinement hierarchy (must be implemented in specific elements that do refinement via tree-like refinement structure. Here we provide a default implementation that is appropriate for cases where tree-like refinement doesn't exist or if the element doesn't have root in that tree (i.e. if it's a root itself): We return "this".

525  {
526  // If there is no tree -- the element is its own root
527  if (Tree_pt == 0)
528  {
529  return this;
530  }
531  // Otherwise it's the tree's root object
532  else
533  {
534  return Tree_pt->root_pt()->object_pt();
535  }
536  }
TreeRoot *& root_pt()
Return pointer to root of the tree.
Definition: tree.h:141

References oomph::Tree::object_pt(), oomph::Tree::root_pt(), and Tree_pt.

◆ select_for_refinement()

void oomph::RefineableElement::select_for_refinement ( )
inline

Select the element for refinement.

321  {
322  To_be_refined = true;
323  }

References To_be_refined.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt().

◆ select_sons_for_unrefinement()

void oomph::RefineableElement::select_sons_for_unrefinement ( )
inline

Unrefinement will be performed by merging the four sons of this element.

333  {
334  Sons_to_be_unrefined = true;
335  }

References Sons_to_be_unrefined.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt().

◆ set_number()

void oomph::RefineableElement::set_number ( const long &  mynumber)
inline

Set element number (for debugging/plotting)

402  {
403  Number = mynumber;
404  }

References Number.

◆ set_refinement_level()

void oomph::RefineableElement::set_refinement_level ( const int refine_level)
inline

Set the refinement level.

309  {
310  Refine_level = refine_level;
311  }

References Refine_level.

◆ set_tree_pt()

void oomph::RefineableElement::set_tree_pt ( Tree my_tree_pt)
inline

Set pointer to quadtree representation of this element.

218  {
219  Tree_pt = my_tree_pt;
220  }

References Tree_pt.

Referenced by oomph::Tree::Tree().

◆ setup_hanging_nodes()

virtual void oomph::RefineableElement::setup_hanging_nodes ( Vector< std::ofstream * > &  output_stream)
inlinevirtual

Mark up any hanging nodes that arise as a result of non-uniform refinement. Any hanging nodes will be documented in files addressed by the streams in the vector output_stream, if the streams are open.

Reimplemented in oomph::RefineableQElement< 2 >, oomph::RefineableQElement< 1 >, and oomph::RefineableQElement< 3 >.

604 {}

◆ shape_controlling_node_lookup()

std::map<Node*, unsigned> oomph::RefineableElement::shape_controlling_node_lookup ( )
inline

Return lookup scheme for unique number associated with any of the nodes that actively control the shape of the element (i.e. they are either non-hanging nodes of this element or master nodes of hanging nodes.

637  {
639  }

References Shape_controlling_node_lookup.

Referenced by oomph::ElementWithMovingNodes::get_dnodal_coordinates_dgeom_dofs(), oomph::RefineableAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), and oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates().

◆ sons_to_be_unrefined()

bool oomph::RefineableElement::sons_to_be_unrefined ( )
inline

Has the element been selected for unrefinement?

352  {
353  return Sons_to_be_unrefined;
354  }

References Sons_to_be_unrefined.

Referenced by oomph::Tree::merge_sons_if_required().

◆ split()

template<class ELEMENT >
void oomph::RefineableElement::split ( Vector< ELEMENT * > &  son_pt) const
inline

Split the element into the number of sons to be constructed and return a vector of pointers to the sons. Elements are allocated, but they are not given any properties. The refinement level of the sons is one higher than that of the father elemern.

255  {
256  // Increase refinement level
257  int son_refine_level = Refine_level + 1;
258 
259  // How many sons are to be constructed
260  unsigned n_sons = required_nsons();
261  // Resize the son pointer
262  son_pt.resize(n_sons);
263 
264  // Loop over the sons and construct
265  for (unsigned i = 0; i < n_sons; i++)
266  {
267  son_pt[i] = new ELEMENT;
268  // Set the refinement level of the newly constructed son.
269  son_pt[i]->set_refinement_level(son_refine_level);
270  }
271  }
virtual unsigned required_nsons() const
Definition: refineable_elements.h:224

References i, Refine_level, and required_nsons().

Referenced by oomph::Tree::split_if_required().

◆ to_be_refined()

bool oomph::RefineableElement::to_be_refined ( )
inline

Has the element been selected for refinement?

346  {
347  return To_be_refined;
348  }

References To_be_refined.

Referenced by oomph::Tree::split_if_required().

◆ tree_pt()

Tree* oomph::RefineableElement::tree_pt ( )
inline

Access function: Pointer to quadtree representation of this element.

212  {
213  return Tree_pt;
214  }

References Tree_pt.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt(), oomph::RefineablePolarTaylorHoodElement::get_interpolated_values(), and oomph::RefineablePolarCrouzeixRaviartElement::get_interpolated_values().

◆ unbuild()

virtual void oomph::RefineableElement::unbuild ( )
inlinevirtual

Unbuild the element, i.e. mark the nodes that were created during its creation for possible deletion

363  {
364  // Get pointer to father element
365  RefineableElement* father_pt = father_element_pt();
366  // If there is no father, nothing to do
367  if (father_pt == 0)
368  {
369  return;
370  }
371 
372  // Loop over all the nodes
373  unsigned n_node = this->nnode();
374  for (unsigned n = 0; n < n_node; n++)
375  {
376  // If any node in this element is in the father, it can't be deleted
377  if (father_pt->get_node_number(this->node_pt(n)) >= 0)
378  {
380  }
381  }
382  }
void set_non_obsolete()
Mark node as non-obsolete.
Definition: nodes.h:1442
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539

References father_element_pt(), oomph::FiniteElement::get_node_number(), n, oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), and oomph::Node::set_non_obsolete().

Referenced by oomph::Tree::merge_sons_if_required().

Member Data Documentation

◆ Local_hang_eqn

std::map<Node*, int>* oomph::RefineableElement::Local_hang_eqn
private

Storage for local equation numbers of hanging node variables (values stored at master nodes). It is essential that these are indexed by a Node pointer because the Node may be internal or external to the element. local equation number = Local_hang_eqn(master_node_pt,ival)

Referenced by assign_hanging_local_eqn_numbers(), local_hang_eqn(), and ~RefineableElement().

◆ Max_integrity_tolerance

double oomph::RefineableElement::Max_integrity_tolerance = 1.0e-8
staticprotected

Max. allowed discrepancy in element integrity check.

Referenced by max_integrity_tolerance().

◆ Number

long oomph::RefineableElement::Number
protected

Global element number – for plotting/validation purposes.

Referenced by number(), and set_number().

◆ Refine_level

unsigned oomph::RefineableElement::Refine_level
protected

Refinement level.

Referenced by refinement_level(), set_refinement_level(), and split().

◆ Refinement_is_enabled

bool oomph::RefineableElement::Refinement_is_enabled
protected

Flag to indicate suppression of any refinement.

Referenced by disable_refinement(), enable_refinement(), and refinement_is_enabled().

◆ Shape_controlling_node_lookup

std::map<Node*, unsigned> oomph::RefineableElement::Shape_controlling_node_lookup
private

Lookup scheme for unique number associated with any of the nodes that actively control the shape of the element (i.e. they are either non-hanging nodes of this element or master nodes of hanging nodes.

Referenced by assign_hanging_local_eqn_numbers(), get_dresidual_dnodal_coordinates(), nshape_controlling_nodes(), and shape_controlling_node_lookup().

◆ Sons_to_be_unrefined

bool oomph::RefineableElement::Sons_to_be_unrefined
protected

◆ To_be_refined

bool oomph::RefineableElement::To_be_refined
protected

Flag for refinement.

Referenced by deselect_for_refinement(), select_for_refinement(), and to_be_refined().

◆ Tree_pt

Tree* oomph::RefineableElement::Tree_pt
protected

A pointer to a general tree object.

Referenced by father_element_pt(), get_father_at_refinement_level(), root_element_pt(), set_tree_pt(), and tree_pt().


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