oomph::RefineableQElement< 1 > Class Reference

#include <refineable_line_element.h>

+ Inheritance diagram for oomph::RefineableQElement< 1 >:

Public Types

typedef void(RefineableQElement< 1 >::* VoidMemberFctPt) ()
 
- Public Types inherited from oomph::FiniteElement
typedef void(* SteadyExactSolutionFctPt) (const Vector< double > &, Vector< double > &)
 
typedef void(* UnsteadyExactSolutionFctPt) (const double &, const Vector< double > &, Vector< double > &)
 

Public Member Functions

 RefineableQElement ()
 Constructor: Pass refinement level (default 0 = root) More...
 
 RefineableQElement (const RefineableQElement< 1 > &dummy)=delete
 Broken copy constructor. More...
 
virtual ~RefineableQElement ()
 Broken assignment operator. More...
 
unsigned required_nsons () const
 A refineable line element has two sons. More...
 
Nodenode_created_by_neighbour (const Vector< double > &s_fraction, bool &is_periodic)
 
Nodenode_created_by_son_of_neighbour (const Vector< double > &s_fraction, bool &is_periodic)
 
virtual void build (Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built, std::ofstream &new_nodes_file)
 
void check_integrity (double &max_error)
 
void output_corners (std::ostream &outfile, const std::string &colour) const
 Print corner nodes, using colour. More...
 
BinaryTreebinary_tree_pt ()
 Pointer to binary tree representation of this element. More...
 
BinaryTreebinary_tree_pt () const
 Pointer to binary tree representation of this element (const version) More...
 
void setup_hanging_nodes (Vector< std::ofstream * > &output_stream)
 Line elements have no hanging nodes so this is deliberately left empty. More...
 
- Public Member Functions inherited from oomph::RefineableElement
 RefineableElement ()
 
virtual ~RefineableElement ()
 Destructor, delete the allocated storage for the hanging equations. More...
 
 RefineableElement (const RefineableElement &)=delete
 Broken copy constructor. More...
 
void operator= (const RefineableElement &)=delete
 Broken assignment operator. More...
 
Treetree_pt ()
 Access function: Pointer to quadtree representation of this element. More...
 
void set_tree_pt (Tree *my_tree_pt)
 Set pointer to quadtree representation of this element. More...
 
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)
 
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
 
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 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...
 
void get_centre_of_gravity_and_max_radius_in_terms_of_zeta (Vector< double > &cog, double &max_radius) const
 
virtual void local_coordinate_of_node (const unsigned &j, Vector< double > &s) const
 
virtual void local_fraction_of_node (const unsigned &j, Vector< double > &s_fraction)
 
virtual double local_one_d_fraction_of_node (const unsigned &n1d, const unsigned &i)
 
MacroElementmacro_elem_pt ()
 Access function to pointer to macro element. More...
 
void get_x (const Vector< double > &s, Vector< double > &x) const
 
void get_x (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
virtual void 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 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 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...
 
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
 
- Public Member Functions inherited from oomph::LineElementBase
 LineElementBase ()
 Constructor. Empty. More...
 
virtual unsigned nvertex_node () const =0
 Number of vertex nodes in the element. More...
 
virtual Nodevertex_node_pt (const unsigned &j) const =0
 Pointer to the j-th vertex node in the element. More...
 
- Public Member Functions inherited from oomph::QElementBase
 QElementBase ()
 Constructor: Initialise pointers to macro element reference coords. More...
 
 QElementBase (const QElementBase &)=delete
 Broken copy constructor. More...
 
virtual ~QElementBase ()
 Broken assignment operator. More...
 
bool local_coord_is_valid (const Vector< double > &s)
 Check whether the local coordinate are valid or not. More...
 
void move_local_coord_back_into_element (Vector< double > &s) const
 
virtual void set_macro_elem_pt (MacroElement *macro_elem_pt)
 
doubles_macro_ll (const unsigned &i)
 
doubles_macro_ur (const unsigned &i)
 
double s_macro_ll (const unsigned &i) const
 
double s_macro_ur (const unsigned &i) const
 
void get_x_from_macro_element (const Vector< double > &s, Vector< double > &x) const
 
void get_x_from_macro_element (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
unsigned nnode_on_face () const
 
ElementGeometry::ElementGeometry element_geometry () const
 It's a Q element! More...
 
- Public Member Functions inherited from oomph::QElementGeometricBase
 QElementGeometricBase ()
 Empty default constructor. More...
 
 QElementGeometricBase (const QElementGeometricBase &)=delete
 Broken copy constructor. More...
 

Protected Member Functions

void setup_father_bounds ()
 
void setup_hang_for_value (const int &value_id)
 Line elements have no hanging nodes so this is deliberately left empty. More...
 
void binary_hang_helper (const int &value_id, const int &my_edge, std::ofstream &output_hangfile)
 Line elements have no hanging nodes so this is deliberately left empty. More...
 
- Protected Member Functions inherited from oomph::RefineableElement
void assemble_local_to_eulerian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
void assemble_local_to_eulerian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
void assemble_eulerian_base_vectors (const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
 
double local_to_eulerian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
void assign_hanging_local_eqn_numbers (const bool &store_local_dof_pt)
 Assign the local equation numbers for hanging node variables. More...
 
virtual void fill_in_jacobian_from_nodal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
- Protected Member Functions inherited from oomph::FiniteElement
template<unsigned DIM>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double invert_jacobian_mapping (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
 
virtual void dJ_eulerian_dnodal_coordinates (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<unsigned DIM>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
virtual void d_dshape_eulerian_dnodal_coordinates (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<unsigned DIM>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
virtual void transform_derivatives (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
void transform_derivatives_diagonal (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
virtual void transform_second_derivatives (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
void fill_in_jacobian_from_nodal_by_fd (DenseMatrix< double > &jacobian)
 
virtual void update_before_nodal_fd ()
 
virtual void reset_after_nodal_fd ()
 
virtual void update_in_nodal_fd (const unsigned &i)
 
virtual void reset_in_nodal_fd (const unsigned &i)
 
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 Attributes

static std::map< unsigned, DenseMatrix< int > > Father_bound
 
- Static Protected Attributes inherited from oomph::RefineableElement
static double Max_integrity_tolerance = 1.0e-8
 Max. allowed discrepancy in element integrity check. More...
 
- Static Protected Attributes inherited from oomph::FiniteElement
static const unsigned Default_Initial_Nvalue = 0
 Default value for the number of values at a node. More...
 
static const double Node_location_tolerance = 1.0e-14
 
static const unsigned N2deriv [] = {0, 1, 3, 6}
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Additional Inherited Members

- Static Public Member Functions inherited from oomph::RefineableElement
static doublemax_integrity_tolerance ()
 Max. allowed discrepancy in element integrity check. More...
 
- Static Public Attributes inherited from oomph::FiniteElement
static double Tolerance_for_singular_jacobian = 1.0e-16
 Tolerance below which the jacobian is considered singular. More...
 
static bool Accept_negative_jacobian = false
 
static bool Suppress_output_while_checking_for_inverted_elements
 
- Static Public Attributes inherited from oomph::GeneralisedElement
static bool Suppress_warning_about_repeated_internal_data
 
static bool Suppress_warning_about_repeated_external_data = true
 
static double Default_fd_jacobian_step = 1.0e-8
 
- Static Protected Member Functions inherited from oomph::RefineableElement
static void check_value_id (const int &n_continuously_interpolated_values, const int &value_id)
 
- Protected Attributes inherited from oomph::RefineableElement
TreeTree_pt
 A pointer to a general tree object. More...
 
unsigned Refine_level
 Refinement level. More...
 
bool To_be_refined
 Flag for refinement. More...
 
bool Refinement_is_enabled
 Flag to indicate suppression of any refinement. More...
 
bool Sons_to_be_unrefined
 Flag for unrefinement. More...
 
long Number
 Global element number – for plotting/validation purposes. More...
 
- Protected Attributes inherited from oomph::FiniteElement
MacroElementMacro_elem_pt
 Pointer to the element's macro element (NULL by default) More...
 
- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 

Detailed Description

Refineable version of QElement<1,NNODE_1D>.

Refinement is performed by binary tree procedures. When the element is subdivided, the geometry of its sons is established by calls to their father's get_x(...) function which refers to:

  • the father element's geometric FE mapping (this is the default) or
  • a MacroElement's MacroElement::macro_map (if the pointer to the macro element is non-NULL)

The class provides a generic RefineableQElement<1>::build() function which deals with generic isoparametric QElements in which all values are associated with nodes. The RefineableQElement<1>::further_build() function provides an interface for any element-specific non-generic build operations.

Member Typedef Documentation

◆ VoidMemberFctPt

typedef void(RefineableQElement<1>::* oomph::RefineableQElement< 1 >::VoidMemberFctPt) ()

Shorthand for pointer to an argument-free void member function of the refineable element

Constructor & Destructor Documentation

◆ RefineableQElement() [1/2]

Constructor: Pass refinement level (default 0 = root)

74  {
75 #ifdef LEAK_CHECK
76  LeakCheckNames::RefineableQElement<1> _build += 1;
77 #endif
78  }
RefineableElement()
Definition: refineable_elements.h:188

◆ RefineableQElement() [2/2]

oomph::RefineableQElement< 1 >::RefineableQElement ( const RefineableQElement< 1 > &  dummy)
delete

Broken copy constructor.

◆ ~RefineableQElement()

virtual oomph::RefineableQElement< 1 >::~RefineableQElement ( )
inlinevirtual

Broken assignment operator.

Destructor

93  {
94 #ifdef LEAK_CHECK
95  LeakCheckNames::RefineableQElement<1> _build -= 1;
96 #endif
97  }

Member Function Documentation

◆ binary_hang_helper()

void oomph::RefineableQElement< 1 >::binary_hang_helper ( const int value_id,
const int my_edge,
std::ofstream &  output_hangfile 
)
inlineprotected

Line elements have no hanging nodes so this is deliberately left empty.

174  {
175  }

◆ binary_tree_pt() [1/2]

BinaryTree* oomph::RefineableQElement< 1 >::binary_tree_pt ( )
inline

Pointer to binary tree representation of this element.

145  {
146  return dynamic_cast<BinaryTree*>(Tree_pt);
147  }
Tree * Tree_pt
A pointer to a general tree object.
Definition: refineable_elements.h:100

◆ binary_tree_pt() [2/2]

BinaryTree* oomph::RefineableQElement< 1 >::binary_tree_pt ( ) const
inline

Pointer to binary tree representation of this element (const version)

151  {
152  return dynamic_cast<BinaryTree*>(Tree_pt);
153  }

◆ build()

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

Build the element, i.e. give it nodal positions, apply BCs, etc. Pointers to any new nodes will be returned in new_node_pt. If it is open, the positions of the new nodes will be written to the file stream new_nodes_file.

Build the element by doing the following:

  • Give it nodal positions (by establishing the pointers to its nodes). In the process create new nodes where required (i.e. if they don't already exist in the father element and have not already been created whilst building new neighbouring elements). Node building involves the following steps:
    • Get the nodal position from the father element.
    • Establish the time-history of the newly created nodal point (its coordinates and previous values) consistent with the father's history.
    • Add the new node to the mesh itself.
    • Doc newly created nodes in "new_nodes.dat" stored in the directory of the DocInfo object (only if it's open!).
    • NOTE: Unlike in higher-dimensional elements, in 1D it is impossible for newly-created nodes to be on a mesh boundary, since any boundary nodes must exist in the initial (coarse) mesh. Therefore it is not necessary to add any nodes to the mesh's boundary node storage schemes, and we always create normal "bulk" nodes.
  • Once the element has a full complement of nodes, excute the element- specific further_build() (empty by default – must be overloaded for specific elements). This deals with any build operations that are not included in the generic process outlined above. For instance, in Crouzeix Raviart elements we need to initialise the internal pressure pressure values in a manner consistent with the pressure distribution in the father element.

Implements oomph::RefineableElement.

Reimplemented in oomph::RefineableSolidQElement< 1 >.

216  {
217  using namespace BinaryTreeNames;
218 
219  // Find the number of nodes along a 1D edge (which is the number of nodes
220  // in the element for a 1D element!)
221  const unsigned n_node = nnode_1d();
222 
223  // Check whether static father_bound needs to be created
224  if (Father_bound[n_node].nrow() == 0)
225  {
227  }
228 
229  // Pointer to the current element's father (in binary tree impersonation)
230  BinaryTree* father_pt =
231  dynamic_cast<BinaryTree*>(binary_tree_pt()->father_pt());
232 
233  // What type of son is the current element?
234  // Ask its binary tree representation...
235  const int son_type = Tree_pt->son_type();
236 
237  // Has somebody built the current element already?
238  // Check this by determining whether or not the first node has been built
239 
240  // If this element has not already been built...
241  if (!nodes_built())
242  {
243 #ifdef PARANOID
244  if (father_pt == 0)
245  {
246  std::string error_message =
247  "Something fishy here: I have no father and yet \n";
248  error_message += "I have no nodes. Who has created me then?!\n";
249 
250  throw OomphLibError(
252  }
253 #endif
254 
255  // Indicate status
256  was_already_built = false;
257 
258  // Return pointer to father element
259  RefineableQElement<1>* father_el_pt =
260  dynamic_cast<RefineableQElement<1>*>(father_pt->object_pt());
261 
262  // Timestepper should be the same for all nodes in father element.
263  // Use it create timesteppers for new nodes.
264  TimeStepper* time_stepper_pt =
265  father_el_pt->node_pt(0)->time_stepper_pt();
266 
267  // Determine number of history values (including present)
268  const unsigned ntstorage = time_stepper_pt->ntstorage();
269 
270  // Currently we can't handle the case of generalised coordinates
271  // since we haven't established how they should be interpolated.
272  // Buffer this case:
273  if (father_el_pt->node_pt(0)->nposition_type() != 1)
274  {
275  throw OomphLibError("Can't handle generalised nodal positions (yet).",
278  }
279 
280  // Set up vertex coordinates in the father element:
281  // ------------------------------------------------
282 
283  // Allocate storage for the vertex coordinates s_left and s_right of
284  // the current element as viewed by this element's father (i.e. s_left[0]
285  // stores the local coordinate within the father element at which the
286  // node on the current element's left-hand edge is located. Likewise,
287  // s_right[0] stores the local coordinate within the father element at
288  // which the node on the current element's right-hand edge is located).
289  Vector<double> s_left(1);
290  Vector<double> s_right(1);
291 
292  // In order to set up the vertex coordinates we need to know which
293  // type of son the current element is
294  switch (son_type)
295  {
296  case L:
297  s_left[0] = -1.0;
298  s_right[0] = 0.0;
299  break;
300 
301  case R:
302  s_left[0] = 0.0;
303  s_right[0] = 1.0;
304  break;
305  }
306 
307  // Pass macro element pointer on to sons and set coordinates in
308  // macro element
309  // hierher why can I see this?
310  if (father_el_pt->Macro_elem_pt != 0)
311  {
312  set_macro_elem_pt(father_el_pt->Macro_elem_pt);
313 
314  s_macro_ll(0) =
315  father_el_pt->s_macro_ll(0) +
316  0.5 * (s_left[0] + 1.0) *
317  (father_el_pt->s_macro_ur(0) - father_el_pt->s_macro_ll(0));
318  s_macro_ur(0) =
319  father_el_pt->s_macro_ll(0) +
320  0.5 * (s_right[0] + 1.0) *
321  (father_el_pt->s_macro_ur(0) - father_el_pt->s_macro_ll(0));
322  }
323 
324  // If the father element hasn't been generated yet, we're stuck...
325  if (father_el_pt->node_pt(0) == 0)
326  {
327  throw OomphLibError(
328  "Trouble: father_el_pt->node_pt(0)==0\n Can't build son element!\n",
331  }
332  // Otherwise, carry on
333  else
334  {
335  // Allocate storage for the location of a node in terms of the local
336  // coordinate of the father element
337  Vector<double> s_in_father(1);
338 
339  // Allocate storage for the fractional position (in the current
340  // element) of the node in the direction of s[0]
341  Vector<double> s_fraction(1);
342 
343  // Loop over all nodes in the element
344  for (unsigned n = 0; n < n_node; n++)
345  {
346  // Get the fractional position (in the current element) of the node
347  // in the direction of s[0]
348  s_fraction[0] = local_one_d_fraction_of_node(n, 0);
349 
350  // Evaluate the local coordinate of the node in the father element
351  s_in_father[0] = s_left[0] + (s_right[0] - s_left[0]) * s_fraction[0];
352 
353  // Initialise flag: So far, this node hasn't been built or copied yet
354  bool node_done = false;
355 
356  // Get the pointer to the node in the father (returns NULL if there
357  // is no node at this position)
358  Node* created_node_pt =
359  father_el_pt->get_node_at_local_coordinate(s_in_father);
360 
361  // Does this node already exist in father element?
362  // -----------------------------------------------
363 
364  // If it does...
365  if (created_node_pt != 0)
366  {
367  // ...copy node across
368  node_pt(n) = created_node_pt;
369 
370  // Make sure that we update the values at the node so that they
371  // are consistent with the present representation. This is only
372  // needed for mixed interpolation where the value at the father
373  // could now become active.
374 
375  // Loop over all history values
376  for (unsigned t = 0; t < ntstorage; t++)
377  {
378  // Get values from father element
379  // Note: get_interpolated_values() sets Vector size itself
380  Vector<double> prev_values;
381  father_el_pt->get_interpolated_values(
382  t, s_in_father, prev_values);
383 
384  // Find the minimum number of values (either those stored at the
385  // node, or those returned by the function)
386  unsigned n_val_at_node = created_node_pt->nvalue();
387  unsigned n_val_from_function = prev_values.size();
388 
389  // Use the ternary conditional operator here
390  unsigned n_var = n_val_at_node < n_val_from_function ?
391  n_val_at_node :
392  n_val_from_function;
393 
394  // Assign the values that we can
395  for (unsigned k = 0; k < n_var; k++)
396  {
397  created_node_pt->set_value(t, k, prev_values[k]);
398  }
399  }
400 
401  // Indicate that node has been created by copy
402  node_done = true;
403  }
404 
405  // Node does not exist in father element but might already
406  // -------------------------------------------------------
407  // have been created by neighbouring elements
408  // ------------------------------------------
409 
410  else
411  {
412  // Was the node created by one of its neighbours? Whether or not
413  // the node lies on an edge can be calculated from the fractional
414  // position.
415  bool is_periodic = false;
416  created_node_pt =
417  node_created_by_neighbour(s_fraction, is_periodic);
418 
419  // If the node was so created...
420  if (created_node_pt != 0)
421  {
422  // ...assign the pointer
423  node_pt(n) = created_node_pt;
424 
425  // Indicate that node has been created by copy
426  node_done = true;
427 
428  // In a 1D mesh there is no way that a periodic node (which must
429  // be on a boundary) can exist without being part of the initial
430  // (coarse) mesh. Therefore issue an error message if
431  // node_created_by_neighbour(...) returns `is_periodic==true'.
432 #ifdef PARANOID
433  if (is_periodic)
434  {
435  std::string error_message =
436  "node_created_by_neighbour returns a node which claims\n";
437  error_message += "to be periodic. In a 1D mesh any periodic "
438  "nodes must exist\n";
439  error_message += "in the initial (coarse) mesh.";
440 
441  throw OomphLibError(error_message,
444  }
445 #endif
446  }
447  }
448 
449  // Node does not exist in father element or neighbouring element
450  // -------------------------------------------------------------
451 
452  // If the node has not been built anywhere ---> build it here
453  if (!node_done)
454  {
455  // In a 1D mesh any node which lies on the boundary must exist in
456  // the initial (coarse) mesh, so any newly-built nodes cannot be
457  // boundary nodes. Therefore we always create a normal "bulk" node.
458 
459  // Create node and set the pointer to it from the element
460  created_node_pt = construct_node(n, time_stepper_pt);
461 
462  // Add to vector of new nodes
463  new_node_pt.push_back(created_node_pt);
464 
465  // Now we set the position and values at the newly created node.
466  // In the first instance use macro element or FE representation
467  // to create past and present nodal positions.
468  // (THIS STEP SHOULD NOT BE SKIPPED FOR ALGEBRAIC ELEMENTS AS NOT
469  // ALL OF THEM NECESSARILY IMPLEMENT NONTRIVIAL NODE UPDATE
470  // FUNCTIONS. CALLING THE NODE UPDATE FOR SUCH ELEMENTS/NODES WILL
471  // LEAVE THEIR NODAL POSITIONS WHERE THEY WERE (THIS IS APPROPRIATE
472  // ONCE THEY HAVE BEEN GIVEN POSITIONS) BUT WILL NOT ASSIGN SENSIBLE
473  // INITIAL POSITIONS!)
474 
475  // Loop over history values
476  for (unsigned t = 0; t < ntstorage; t++)
477  {
478  // Allocate storage for the previous position of the node
479  Vector<double> x_prev(1);
480 
481  // Get position from father element -- this uses the macro
482  // element representation if appropriate.
483  father_el_pt->get_x(t, s_in_father, x_prev);
484 
485  // Set the previous position of the new node
486  created_node_pt->x(t, 0) = x_prev[0];
487 
488  // Allocate storage for the previous values at the node
489  // NOTE: the size of this vector is equal to the number of values
490  // (e.g. 3 velocity components and 1 pressure, say)
491  // associated with each node and NOT the number of history values
492  // which the node stores!
493  Vector<double> prev_values;
494 
495  // Get values from father element
496  // Note: get_interpolated_values() sets Vector size itself.
497  father_el_pt->get_interpolated_values(
498  t, s_in_father, prev_values);
499 
500  // Determine the number of values at the new node
501  const unsigned n_value = created_node_pt->nvalue();
502 
503  // Loop over all values and set the previous values
504  for (unsigned v = 0; v < n_value; v++)
505  {
506  created_node_pt->set_value(t, v, prev_values[v]);
507  }
508  } // End of loop over history values
509 
510  // Add new node to mesh
511  mesh_pt->add_node_pt(created_node_pt);
512 
513  } // End of case where we build the node ourselves
514 
515  // Check if the element is an algebraic element
516  AlgebraicElementBase* alg_el_pt =
517  dynamic_cast<AlgebraicElementBase*>(this);
518 
519  // If it is, set up node position (past and present) from algebraic
520  // node position (past and present) from algebraic node update
521  // node update function. This over-writes previous assingments that
522  // were made based on the macro-element/FE representation.
523  // NOTE: YES, THIS NEEDS TO BE CALLED REPEATEDLY IF THE NODE IS A
524  // MEMBER OF MULTIPLE ELEMENTS: THEY ALL ASSIGN THE SAME NODAL
525  // POSITIONS BUT WE NEED TO ADD THE REMESH INFO FOR *ALL* ROOT
526  // ELEMENTS!
527  if (alg_el_pt != 0)
528  {
529  // Build algebraic node update info for new node. This sets up
530  // the node update data for all node update functions that are
531  // shared by all nodes in the father element.
532  alg_el_pt->setup_algebraic_node_update(
533  node_pt(n), s_in_father, father_el_pt);
534  }
535 
536  // If we have built the node and we are documenting our progress,
537  // write the (hopefully consistent position) to the outputfile
538  if ((!node_done) && (new_nodes_file.is_open()))
539  {
540  new_nodes_file << node_pt(n)->x(0) << std::endl;
541  }
542  } // End of loop over all nodes in element
543 
544 
545  // If the element is a MacroElementNodeUpdateElement, set the update
546  // parameters for the current element's nodes -- all this needs is
547  // the vector of (pointers to the) geometric objects that affect the
548  // MacroElement-based node update. This is the same as that in the
549  // father element
550  MacroElementNodeUpdateElementBase* father_m_el_pt =
551  dynamic_cast<MacroElementNodeUpdateElementBase*>(father_el_pt);
552  if (father_m_el_pt != 0)
553  {
554  // Get Vector of geometric objects from father (construct Vector
555  // via copy operation)
556  Vector<GeomObject*> geom_object_pt(father_m_el_pt->geom_object_pt());
557 
558  // Cast current element to MacroElementNodeUpdateElement:
559  MacroElementNodeUpdateElementBase* m_el_pt =
560  dynamic_cast<MacroElementNodeUpdateElementBase*>(this);
561 
562 #ifdef PARANOID
563  if (m_el_pt == 0)
564  {
565  std::string error_message =
566  "Failed to cast to MacroElementNodeUpdateElementBase*\n";
567  error_message +=
568  "Strange -- if the father is a MacroElementNodeUpdateElement\n";
569  error_message += "the son should be too....\n";
570 
571  throw OomphLibError(
573  }
574 #endif
575  // Build update info by passing Vector of geometric objects:
576  // This sets the current element to be the update element for all
577  // of the element's nodes. This is reversed if the element is
578  // ever un-refined in the father element's rebuild_from_sons()
579  // function which overwrites this assignment to avoid nasty
580  // segmentation faults that occur when a node tries to update
581  // itself via an element that no longer exists...
582  m_el_pt->set_node_update_info(geom_object_pt);
583  }
584 
585 #ifdef OOMPH_HAS_MPI
586  // Pass on non-halo proc ID
587  Non_halo_proc_ID =
588  tree_pt()->father_pt()->object_pt()->non_halo_proc_ID();
589 #endif
590 
591  // Is the new element an ElementWithMovingNodes?
592  ElementWithMovingNodes* aux_el_pt =
593  dynamic_cast<ElementWithMovingNodes*>(this);
594 
595  // Pass down the information re the method for the evaluation
596  // of the shape derivatives
597  if (aux_el_pt != 0)
598  {
599  ElementWithMovingNodes* aux_father_el_pt =
600  dynamic_cast<ElementWithMovingNodes*>(father_el_pt);
601 
602 #ifdef PARANOID
603  if (aux_father_el_pt == 0)
604  {
605  std::string error_message =
606  "Failed to cast to ElementWithMovingNodes*\n";
607  error_message +=
608  "Strange -- if the son is a ElementWithMovingNodes\n";
609  error_message += "the father should be too....\n";
610 
611  throw OomphLibError(
613  }
614 #endif
615 
616  // If evaluating the residuals by finite differences in the father
617  // continue to do so in the child
618  if (aux_father_el_pt
619  ->are_dresidual_dnodal_coordinates_always_evaluated_by_fd())
620  {
621  aux_el_pt
622  ->enable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
623  }
624 
625  aux_el_pt->method_for_shape_derivs() =
626  aux_father_el_pt->method_for_shape_derivs();
627 
628  // If bypassing the evaluation of fill_in_jacobian_from_geometric_data
629  // continue to do so
630  if (aux_father_el_pt
631  ->is_fill_in_jacobian_from_geometric_data_bypassed())
632  {
633  aux_el_pt->enable_bypass_fill_in_jacobian_from_geometric_data();
634  }
635  }
636 
637 
638  // Now do further build (if any)
639  further_build();
640 
641  } // Sanity check: Father element has been generated
642 
643  } // End of if element has not already been built
644 
645  // If element has already been built, say so
646  else
647  {
648  was_already_built = true;
649  }
650  }
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
MatrixXd L
Definition: LLT_example.cpp:6
@ R
Definition: StatisticsVector.h:21
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Definition: elements.h:1872
virtual Node * construct_node(const unsigned &n)
Definition: elements.h:2509
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual unsigned nnode_1d() const
Definition: elements.h:2218
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Definition: elements.h:1858
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
double & s_macro_ll(const unsigned &i)
Definition: Qelements.h:186
double & s_macro_ur(const unsigned &i)
Definition: Qelements.h:202
Tree * tree_pt()
Access function: Pointer to quadtree representation of this element.
Definition: refineable_elements.h:211
virtual void further_build()
Further build: e.g. deal with interpolation of internal values.
Definition: refineable_elements.h:599
virtual bool nodes_built()
Return true if all the nodes have been built, false if not.
Definition: refineable_elements.h:389
static std::map< unsigned, DenseMatrix< int > > Father_bound
Definition: refineable_line_element.h:161
BinaryTree * binary_tree_pt()
Pointer to binary tree representation of this element.
Definition: refineable_line_element.h:144
Node * node_created_by_neighbour(const Vector< double > &s_fraction, bool &is_periodic)
Definition: refineable_line_element.cc:91
void setup_father_bounds()
Definition: refineable_line_element.cc:48
unsigned ntstorage() const
Definition: timesteppers.h:601
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
int son_type() const
Return son type.
Definition: tree.h:214
char char char int int * k
Definition: level2_impl.h:374
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::Mesh::add_node_pt(), oomph::ElementWithMovingNodes::enable_always_evaluate_dresidual_dnodal_coordinates_by_fd(), oomph::ElementWithMovingNodes::enable_bypass_fill_in_jacobian_from_geometric_data(), oomph::MacroElementNodeUpdateElementBase::geom_object_pt(), oomph::RefineableElement::get_interpolated_values(), oomph::FiniteElement::get_node_at_local_coordinate(), oomph::FiniteElement::get_x(), k, L, oomph::FiniteElement::Macro_elem_pt, oomph::ElementWithMovingNodes::method_for_shape_derivs(), n, oomph::FiniteElement::node_pt(), oomph::Node::nposition_type(), oomph::Data::nvalue(), oomph::Tree::object_pt(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, oomph::QElementBase::s_macro_ll(), oomph::QElementBase::s_macro_ur(), oomph::MacroElementNodeUpdateElementBase::set_node_update_info(), oomph::Data::set_value(), oomph::AlgebraicElementBase::setup_algebraic_node_update(), oomph::Tree::son_type(), oomph::Global_string_for_annotation::string(), plotPSD::t, oomph::Data::time_stepper_pt(), v, and oomph::Node::x().

◆ check_integrity()

void oomph::RefineableQElement< 1 >::check_integrity ( double max_error)
virtual

Check the integrity of the element: ensure that the position and values are continuous across the element edges.

Check inter-element continuity of

  • nodal positions
  • (nodally) interpolated function values

Implements oomph::RefineableElement.

687  {
688  using namespace BinaryTreeNames;
689 
690  // Calculate number of nodes
691  const unsigned n_node = nnode_1d();
692 
693  // Number of timesteps (including present) for which continuity is
694  // to be checked
695  const unsigned n_time = 1;
696 
697  // Initialise errors
698  max_error = 0.0;
699  Vector<double> max_error_x(1, 0.0);
700  double max_error_val = 0.0;
701 
702  // Initialise vector of element edges in the current element
703  Vector<int> edge_in_current(2);
704  edge_in_current[0] = L;
705  edge_in_current[1] = R;
706 
707  // Loop over both edges
708  for (unsigned edge_counter = 0; edge_counter < 2; edge_counter++)
709  {
710  // Allocate storage for the fractional position (in the current
711  // element) of the node in the direction of s[0]
712  Vector<double> s_fraction(1);
713 
714  // Allocate storage for the location of a node in terms of the local
715  // coordinate of the current element
716  Vector<double> s_in_current(1);
717 
718  // Allocate storage for the location of a node in terms of the local
719  // coordinate of the neighbouring element
720  Vector<double> s_in_neighbour(1);
721 
722  // Allocate storage for edge in neighbouring element
723  int edge_in_neighbour;
724 
725  // Allocate storage for difference in size between current and
726  // neighbouring element
727  int diff_level;
728 
729  // Allocate storage for flag indicating if the node is not in the same
730  // binary tree
731  bool in_neighbouring_tree;
732 
733  // Calculate the local coordinate and the local coordinate as viewed
734  // from the neighbour
735 
736  // Allocate storage for the pointer to the neighbouring element
737  // (using its binary tree representation)
738  BinaryTree* neighbour_pt;
739 
740  // Find pointer to neighbouring element along the edge in question and
741  // calculate the local coordinate of the node within that element,
742  // s_in_neighbour
743  neighbour_pt =
744  binary_tree_pt()->gteq_edge_neighbour(edge_in_current[edge_counter],
745  s_in_neighbour,
746  edge_in_neighbour,
747  diff_level,
748  in_neighbouring_tree);
749 
750  // If neighbour exists and has existing nodes
751  if ((neighbour_pt != 0) && (neighbour_pt->object_pt()->nodes_built()))
752  {
753  // Need to exclude periodic nodes from this check.
754  // There are only periodic nodes if we are in a neighbouring tree...
755  bool is_periodic = false;
756  if (in_neighbouring_tree)
757  {
758  // Is it periodic?
759  is_periodic = tree_pt()->root_pt()->is_neighbour_periodic(
760  edge_in_current[edge_counter]);
761  }
762 
763  // Allocate storage for pointer to the local node
764  Node* local_node_pt = 0;
765 
766  switch (edge_counter)
767  {
768  case 0:
769  // Local fraction of node
770  s_fraction[0] = 0.0;
771  // Get pointer to local node
772  local_node_pt = node_pt(0);
773  break;
774 
775  case 1:
776  // Local fraction of node
777  s_fraction[0] = 1.0;
778  // Get pointer to local node
779  local_node_pt = node_pt(n_node - 1);
780  break;
781  }
782 
783  // Evaluate the local coordinate of the node in the current element
784  s_in_current[0] = -1.0 + 2.0 * s_fraction[0];
785 
786  // NOTE: We have already calculated the local coordinate of the node
787  // in the neighbouring element above when calling gteq_edge_neighbour()
788 
789  // Loop over timesteps
790  for (unsigned t = 0; t < n_time; t++)
791  {
792  // Allocate storage for the nodal position in the neighbouring element
793  Vector<double> x_in_neighbour(1);
794 
795  // Get the nodal position from the neighbouring element
796  neighbour_pt->object_pt()->interpolated_x(
797  t, s_in_neighbour, x_in_neighbour);
798 
799  // Check error only if the node is NOT periodic
800  if (is_periodic == false)
801  {
802  // Find the spatial error
803  double err = std::fabs(local_node_pt->x(t, 0) - x_in_neighbour[0]);
804 
805  // If it's bigger than our tolerance, say so
806  if (err > 1e-9)
807  {
808  oomph_info << "errx " << err << " " << t << " "
809  << local_node_pt->x(t, 0) << " " << x_in_neighbour[0]
810  << std::endl;
811 
812  oomph_info << "at " << local_node_pt->x(0) << std::endl;
813  }
814 
815  // If it's bigger than the previous max error, it is the
816  // new max error!
817  if (err > max_error_x[0])
818  {
819  max_error_x[0] = err;
820  }
821  }
822  // Allocate storage for the nodal values in the neighbouring element
823  Vector<double> values_in_neighbour;
824 
825  // Get the values from neighbouring element. NOTE: Number of values
826  // gets set by routine (because in general we don't know how many
827  // interpolated values a certain element has.
828  neighbour_pt->object_pt()->get_interpolated_values(
829  t, s_in_neighbour, values_in_neighbour);
830 
831  // Allocate storage for the nodal values in the current element
832  Vector<double> values_in_current;
833 
834  // Get the values in current element
835  get_interpolated_values(t, s_in_current, values_in_current);
836 
837  // Now figure out how many continuously interpolated values there are
838  const unsigned num_val =
839  neighbour_pt->object_pt()->ncont_interpolated_values();
840 
841  // Check error
842  for (unsigned ival = 0; ival < num_val; ival++)
843  {
844  // Find the spatial error
845  double err =
846  std::fabs(values_in_current[ival] - values_in_neighbour[ival]);
847 
848  // If it's bigger than our tolerance, say so
849  if (err > 1.0e-10)
850  {
851  oomph_info << local_node_pt->x(0) << "\n# "
852  << "erru " << err << " " << ival << " "
853  << get_node_number(local_node_pt) << " "
854  << values_in_current[ival] << " "
855  << values_in_neighbour[ival] << std::endl;
856  }
857 
858  // If it's bigger than the previous max error, it is the
859  // new max error!
860  if (err > max_error_val)
861  {
862  max_error_val = err;
863  }
864  }
865  } // End of loop over timesteps
866  } // End of if neighbour exists and has existing nodes
867  } // End of loop over edges
868 
869  // Update max_error if necessary
870  max_error = max_error_x[0];
871  if (max_error_val > max_error)
872  {
873  max_error = max_error_val;
874  }
875 
876  // Output max_error information
877  if (max_error > 1e-9)
878  {
879  oomph_info << "\n#------------------------------------ \n#Max error ";
880  oomph_info << max_error_x[0] << " " << max_error_val << std::endl;
881  oomph_info << "#------------------------------------ \n " << std::endl;
882  }
883  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
BinaryTree * gteq_edge_neighbour(const int &direction, Vector< double > &s_in_neighbour, int &edge, int &diff_level, bool &in_neighbouring_tree) const
Definition: binary_tree.cc:172
int get_node_number(Node *const &node_pt) const
Definition: elements.cc:3814
virtual void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_elements.h:417
bool is_neighbour_periodic(const int &direction)
Definition: tree.h:364
TreeRoot *& root_pt()
Return pointer to root of the tree.
Definition: tree.h:141
double max_error
Definition: MortaringCantileverCompareToNonMortaring.cpp:188
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References e(), boost::multiprecision::fabs(), oomph::RefineableElement::get_interpolated_values(), oomph::BinaryTree::gteq_edge_neighbour(), oomph::FiniteElement::interpolated_x(), L, MeshRefinement::max_error, oomph::RefineableElement::ncont_interpolated_values(), oomph::RefineableElement::nodes_built(), oomph::Tree::object_pt(), oomph::oomph_info, R, plotPSD::t, and oomph::Node::x().

◆ node_created_by_neighbour()

Node * oomph::RefineableQElement< 1 >::node_created_by_neighbour ( const Vector< double > &  s_fraction,
bool is_periodic 
)

If a neighbouring element has already created a node at a position corresponding to the local fractional position within the present element, s_fraction, return a pointer to that node. If not, return NULL (0). If the node is on a periodic boundary the flag is_periodic is true, otherwise it will be false.

If a neighbouring element has already created a node at a position corresponding to the local fractional position within the present element, s_fraction, return a pointer to that node. If not, return NULL (0). If the node is periodic the flag is_periodic will be true.

93  {
94  using namespace BinaryTreeNames;
95 
96  // Initialise edge of current element on which node lies
97  int edge_in_current = OMEGA;
98 
99  // Determine the edge of the current element on which the node lies
100  if (s_fraction[0] == 0.0)
101  {
102  edge_in_current = L;
103  }
104  if (s_fraction[0] == 1.0)
105  {
106  edge_in_current = R;
107  }
108 
109  // If the node does not lie on an edge then there is no neighbour:
110  // return NULL
111  if (edge_in_current == OMEGA)
112  {
113  return 0;
114  }
115 
116  // Allocate storage for edge in neighbouring element
117  int edge_in_neighbour;
118 
119  // Allocate storage for difference in size between current and
120  // neighbouring element
121  int diff_level;
122 
123  // Allocate storage for local coordinate of node in neighbouring tree
124  Vector<double> s_in_neighbour(1);
125 
126  // Allocate storage for flag indicating if the node is not in the same
127  // binary tree
128  bool in_neighbouring_tree;
129 
130  // Allocate storage for the pointer to the neighbouring element
131  // (using its binary tree representation)
132  BinaryTree* neighbour_pt;
133 
134  // Find pointer to neighbouring element along the edge in question and
135  // calculate the local coordinate of the node within that element
136  // s_in_neighbour
137  neighbour_pt = binary_tree_pt()->gteq_edge_neighbour(edge_in_current,
138  s_in_neighbour,
139  edge_in_neighbour,
140  diff_level,
141  in_neighbouring_tree);
142 
143  // If a neighbour exists...
144  if (neighbour_pt != 0)
145  {
146  // ...check whether its nodes have been created yet
147  if (neighbour_pt->object_pt()->nodes_built())
148  {
149  // If they have, find the node in question in the neighbour
150  Node* neighbour_node_pt =
151  neighbour_pt->object_pt()->get_node_at_local_coordinate(
152  s_in_neighbour);
153 
154  // If there is no node at this position, there is a problem, since in
155  // a 1D element (whose nodes have already been built) there should
156  // ALWAYS be a node at each edge of the element.
157  if (neighbour_node_pt == 0)
158  {
159  std::string error_message =
160  "Problem: an element claims to have had its nodes built, yet\n";
161  error_message += "it is missing (a least) a node at its edge.\n";
162  throw OomphLibError(
164  }
165  // Otherwise, carry on
166  else
167  {
168  // Now work out whether it's a periodic boundary (this is only
169  // (possible if we have moved into a neighbouring tree)
170  if (in_neighbouring_tree)
171  {
172  // Return whether the neighbour is periodic
173  is_periodic = binary_tree_pt()->root_pt()->is_neighbour_periodic(
174  edge_in_current);
175  }
176  // Return the pointer to the neighbouring node
177  return neighbour_node_pt;
178  }
179  }
180  }
181  // Node not found, return null
182  return 0;
183  }
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
Definition: elements.cc:3882
@ OMEGA
Definition: binary_tree.h:52

References oomph::FiniteElement::get_node_at_local_coordinate(), oomph::BinaryTree::gteq_edge_neighbour(), L, oomph::RefineableElement::nodes_built(), oomph::Tree::object_pt(), oomph::BinaryTreeNames::OMEGA, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, and oomph::Global_string_for_annotation::string().

◆ node_created_by_son_of_neighbour()

Node* oomph::RefineableQElement< 1 >::node_created_by_son_of_neighbour ( const Vector< double > &  s_fraction,
bool is_periodic 
)
inline

If a neighbouring element has already created a node at a position corresponding to the local fractional position within the present element, s_fraction, return a pointer to that node. If not, return NULL (0). If the node is on a periodic boundary the flag is_periodic is true, otherwise it will be false.

120  {
121  // It is impossible for this situation to arise in meshes
122  // containing elements of uniform p-order. This is here so
123  // that it can be overloaded for p-refineable elements.
124  return 0;
125  }

◆ output_corners()

void oomph::RefineableQElement< 1 >::output_corners ( std::ostream &  outfile,
const std::string &  colour 
) const

Print corner nodes, using colour.

Print corner nodes, use colour (default "BLACK")

657  {
658  // Allocate storage for local coordinate s
659  Vector<double> s(1);
660 
661  // Allocate storage for global coordinate of element vertex
662  Vector<double> vertex(1);
663 
664  outfile << "ZONE I=2,J=2, C=" << colour << std::endl;
665 
666  // Left-hand vertex
667  s[0] = -1.0;
668  get_x(s, vertex);
669  outfile << vertex[0] << " " << Number << std::endl;
670 
671  // Right-hand vertex
672  s[0] = 1.0;
673  get_x(s, vertex);
674  outfile << vertex[0] << " " << Number << std::endl;
675 
676  outfile << "TEXT CS = GRID, X = " << vertex[0]
677  << ", HU = GRID, H = 0.01, AN = MIDCENTER, T =\"" << Number << "\""
678  << std::endl;
679  }
void get_x(const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:1885
long Number
Global element number – for plotting/validation purposes.
Definition: refineable_elements.h:115
RealScalar s
Definition: level1_cplx_impl.h:130
Vector< std::string > colour
Tecplot colours.
Definition: oomph_utilities.cc:1159

References oomph::TecplotNames::colour, oomph::Global_unsigned::Number, and s.

◆ required_nsons()

unsigned oomph::RefineableQElement< 1 >::required_nsons ( ) const
inlinevirtual

A refineable line element has two sons.

Reimplemented from oomph::RefineableElement.

101  {
102  return 2;
103  }

◆ setup_father_bounds()

void oomph::RefineableQElement< 1 >::setup_father_bounds ( )
protected

Setup static matrix for coincidence between son nodal points and father boundaries

Setup static matrix for coincidence between son nodal points and father boundaries:

Father_bound[nnode_1d](nnode_son,son_type) = {L/R/OMEGA}

so that node nnode_son in element of type son_type lies on boundary/ vertex Father_bound[nnode_1d](nnode_son,son_type) in its father element. If the node doesn't lie on a boundary the value is OMEGA.

49  {
50  using namespace BinaryTreeNames;
51 
52  // Find the number of nodes along a 1D edge (which is the number of nodes
53  // in the element for a 1D element!)
54  const unsigned n_node = nnode_1d();
55 
56  // Allocate space for the boundary information
57  Father_bound[n_node].resize(n_node, 2);
58 
59  // Initialise: By default points are not on the boundary
60  for (unsigned n = 0; n < n_node; n++)
61  {
62  for (unsigned ison = 0; ison < 2; ison++)
63  {
64  Father_bound[n_node](n, ison) = Tree::OMEGA;
65  }
66  }
67 
68  // Left-hand son:
69  // --------------
70 
71  // L node (0) is the L node of the parent
72  Father_bound[n_node](0, L) = L;
73 
74  // Other boundary is in the interior
75 
76  // Right-hand son:
77  // ---------------
78 
79  // R node (n_node-1) is the R node of the parent
80  Father_bound[n_node](n_node - 1, R) = R;
81 
82  // Other boundary is in the interior
83  }
static const int OMEGA
Default value for an unassigned neighbour.
Definition: tree.h:262

References L, n, oomph::Tree::OMEGA, and R.

◆ setup_hang_for_value()

void oomph::RefineableQElement< 1 >::setup_hang_for_value ( const int value_id)
inlineprotected

Line elements have no hanging nodes so this is deliberately left empty.

168 {}

◆ setup_hanging_nodes()

void oomph::RefineableQElement< 1 >::setup_hanging_nodes ( Vector< std::ofstream * > &  output_stream)
inlinevirtual

Line elements have no hanging nodes so this is deliberately left empty.

Reimplemented from oomph::RefineableElement.

156 {}

Member Data Documentation

◆ Father_bound

std::map< unsigned, DenseMatrix< int > > oomph::RefineableQElement< 1 >::Father_bound
staticprotected

Coincidence between son nodal points and father boundaries: Father_bound[node_1d](jnod_son,son_type) = {L/R/OMEGA}

Static matrix for coincidence between son nodal points and father boundaries


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