oomph::ElementWithExternalElement Class Reference

#include <element_with_external_element.h>

+ Inheritance diagram for oomph::ElementWithExternalElement:

Public Member Functions

 ElementWithExternalElement ()
 
virtual ~ElementWithExternalElement ()
 The destructor, clean up any allocated memory. More...
 
 ElementWithExternalElement (const ElementWithExternalElement &)=delete
 Broken copy constructor. More...
 
void operator= (const ElementWithExternalElement &)=delete
 Broken assignment operator. More...
 
bool storage_has_been_allocated () const
 Helper function to check if storage has actually been allocated. More...
 
FiniteElement *& external_element_pt (const unsigned &interaction_index, const unsigned &ipt)
 
FiniteElement *const & external_element_pt (const unsigned &interaction_index, const unsigned &ipt) const
 Access function to source element, const version. More...
 
Vector< double > & external_element_local_coord (const unsigned &interaction_index, const unsigned &ipt)
 
Vector< double > const & external_element_local_coord (const unsigned &interaction_index, const unsigned &ipt) const
 Access function to get source element's coords, const version. More...
 
void output_external_elements (std::ostream &outfile, const unsigned &interaction_index)
 
void initialise_external_element_storage ()
 
void flush_all_external_element_storage ()
 Flush the storage for external elements. More...
 
void set_ninteraction (const unsigned &n_interaction)
 
unsigned ninteraction () const
 Return the number of interactions in the element. More...
 
virtual void identify_all_field_data_for_external_interaction (Vector< std::set< FiniteElement * >> const &external_elements_pt, std::set< std::pair< Data *, unsigned >> &paired_interaction_data)
 
virtual void identify_all_geometric_data_for_external_interaction (Vector< std::set< FiniteElement * >> const &external_elements_pt, std::set< Data * > &external_geometric_data_pt)
 
unsigned nexternal_interaction_field_data () const
 
Vector< Data * > external_interaction_field_data_pt () const
 
unsigned nexternal_interaction_geometric_data () const
 
bool add_external_geometric_data ()
 Are we including external geometric data in the element's Jacobian. More...
 
bool add_external_interaction_data ()
 Are we including external data in the element's Jacobian. More...
 
Vector< Data * > external_interaction_geometric_data_pt () const
 
void ignore_external_geometric_data ()
 
void ignore_external_interaction_data ()
 
void include_external_geometric_data ()
 
void include_external_interaction_data ()
 
bool external_geometric_data_is_included () const
 
void describe_local_dofs (std::ostream &out, const std::string &curr_string) const
 
- 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 assign_nodal_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void describe_nodal_local_dofs (std::ostream &out, const std::string &current_string) const
 
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 get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
virtual void disable_ALE ()
 
virtual void enable_ALE ()
 
virtual unsigned required_nvalue (const unsigned &n) const
 
unsigned nnodal_position_type () const
 
bool has_hanging_nodes () const
 
unsigned nodal_dimension () const
 Return the required Eulerian dimension of the nodes in this element. More...
 
virtual unsigned nvertex_node () const
 
virtual Nodevertex_node_pt (const unsigned &j) const
 
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_field_data_for_interactions (std::set< std::pair< Data *, unsigned >> &paired_field_data)
 
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
 

Protected Member Functions

void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 
void assign_external_interaction_data_local_eqn_numbers (const bool &store_local_dof_pt)
 
void fill_in_jacobian_from_external_interaction_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_external_interaction_by_fd (DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_external_interaction_field_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_external_interaction_field_by_fd (DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_external_interaction_geometric_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_external_interaction_geometric_by_fd (DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
virtual void update_before_external_interaction_field_fd ()
 
virtual void reset_after_external_interaction_field_fd ()
 
virtual void update_in_external_interaction_field_fd (const unsigned &i)
 
virtual void reset_in_external_interaction_field_fd (const unsigned &i)
 
virtual void update_before_external_interaction_geometric_fd ()
 
virtual void reset_after_external_interaction_geometric_fd ()
 
virtual void update_in_external_interaction_geometric_fd (const unsigned &i)
 
virtual void reset_in_external_interaction_geometric_fd (const unsigned &i)
 
- Protected Member Functions inherited from oomph::FiniteElement
virtual void assemble_local_to_eulerian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
virtual void assemble_local_to_eulerian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
virtual void assemble_eulerian_base_vectors (const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
 
template<unsigned DIM>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double invert_jacobian_mapping (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual void dJ_eulerian_dnodal_coordinates (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<unsigned DIM>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
virtual void d_dshape_eulerian_dnodal_coordinates (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<unsigned DIM>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
virtual void transform_derivatives (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
void transform_derivatives_diagonal (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
virtual void transform_second_derivatives (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
virtual void fill_in_jacobian_from_nodal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_nodal_by_fd (DenseMatrix< double > &jacobian)
 
virtual void update_before_nodal_fd ()
 
virtual void reset_after_nodal_fd ()
 
virtual void update_in_nodal_fd (const unsigned &i)
 
virtual void reset_in_nodal_fd (const unsigned &i)
 
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_additional_local_eqn_numbers ()
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 
virtual void fill_in_contribution_to_residuals (Vector< double > &residuals)
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
virtual void update_before_internal_fd ()
 
virtual void reset_after_internal_fd ()
 
virtual void update_in_internal_fd (const unsigned &i)
 
virtual void reset_in_internal_fd (const unsigned &i)
 
virtual void update_before_external_fd ()
 
virtual void reset_after_external_fd ()
 
virtual void update_in_external_fd (const unsigned &i)
 
virtual void reset_in_external_fd (const unsigned &i)
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void fill_in_contribution_to_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void fill_in_contribution_to_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 

Protected Attributes

bool Add_external_interaction_data
 Boolean flag to indicate whether to include the external data. More...
 
bool Add_external_geometric_data
 Boolean flag to indicate whether to include the external geometric data. More...
 
Data ** External_interaction_field_data_pt
 
Data ** External_interaction_geometric_data_pt
 
- Protected Attributes inherited from oomph::FiniteElement
MacroElementMacro_elem_pt
 Pointer to the element's macro element (NULL by default) More...
 
- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 

Private Member Functions

void check_storage_allocated () const
 Helper function to check that storage has actually been allocated. More...
 
void range_check (const unsigned &interaction_index, const unsigned &ipt) const
 Helper function for range checking in the access functions. More...
 

Private Attributes

unsigned Ninteraction
 Number of interactions. More...
 
unsigned Nintpt
 Number of intergation point in the element. More...
 
unsigned Nexternal_element_storage
 
unsigned Nexternal_interaction_field_data
 Number of external interaction field data. More...
 
unsigned Nexternal_interaction_geometric_data
 Number of external interaction geometric data. More...
 
FiniteElement ** External_element_pt
 
Vector< double > * External_element_local_coord
 
unsignedExternal_interaction_field_data_index
 
intExternal_interaction_field_data_local_eqn
 
unsignedExternal_interaction_geometric_data_index
 
intExternal_interaction_geometric_data_local_eqn
 

Additional Inherited Members

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

Detailed Description

This is a base class for all elements that require external sources (e.g. FSI, multi-domain problems such as Helmholtz, multi-mesh Boussinesq convection, etc.). It provides storage for the source element and corresponding local coordinate at each integration point, and allows use of locate_zeta to obtain such source elements. In addition separate storage is allocated for all field data in the external elements and all geometric data that can affect the field data in the external elements. Generic finite difference routines are provided to calculate entries in the Jacobian from the data of the external elements.

Constructor & Destructor Documentation

◆ ElementWithExternalElement() [1/2]

oomph::ElementWithExternalElement::ElementWithExternalElement ( )
inline

Constructor. Initialise member data and pointers to data associated with the external elements to zero.

61  : FiniteElement(),
66  Ninteraction(0),
67  Nintpt(0),
77  {
78  }
unsigned Nexternal_interaction_field_data
Number of external interaction field data.
Definition: element_with_external_element.h:591
unsigned Nexternal_element_storage
Definition: element_with_external_element.h:588
unsigned Nexternal_interaction_geometric_data
Number of external interaction geometric data.
Definition: element_with_external_element.h:594
unsigned * External_interaction_field_data_index
Definition: element_with_external_element.h:609
FiniteElement ** External_element_pt
Definition: element_with_external_element.h:600
Data ** External_interaction_field_data_pt
Definition: element_with_external_element.h:515
Vector< double > * External_element_local_coord
Definition: element_with_external_element.h:605
int * External_interaction_field_data_local_eqn
Definition: element_with_external_element.h:613
bool Add_external_geometric_data
Boolean flag to indicate whether to include the external geometric data.
Definition: element_with_external_element.h:511
Data ** External_interaction_geometric_data_pt
Definition: element_with_external_element.h:519
unsigned * External_interaction_geometric_data_index
Definition: element_with_external_element.h:618
bool Add_external_interaction_data
Boolean flag to indicate whether to include the external data.
Definition: element_with_external_element.h:508
unsigned Nintpt
Number of intergation point in the element.
Definition: element_with_external_element.h:584
unsigned Ninteraction
Number of interactions.
Definition: element_with_external_element.h:581
int * External_interaction_geometric_data_local_eqn
Definition: element_with_external_element.h:622
FiniteElement()
Constructor.
Definition: elements.h:1782

◆ ~ElementWithExternalElement()

oomph::ElementWithExternalElement::~ElementWithExternalElement ( )
virtual

The destructor, clean up any allocated memory.

Destructor, clean up any memory allocated for the equation numbering schemes and storage for the external elements

37  {
38  // If storage has been allocated for external geometric data,
39  // delete it
41  {
43  }
45  {
47  }
49  {
51  }
52 
53  // If storage has been allocated for external field data,
54  // delete it
56  {
58  }
60  {
62  }
64  {
66  }
67 
68  // Flush the storage associated with the external elements
70  }
void flush_all_external_element_storage()
Flush the storage for external elements.
Definition: element_with_external_element.cc:125

References External_interaction_field_data_index, External_interaction_field_data_local_eqn, External_interaction_field_data_pt, External_interaction_geometric_data_index, External_interaction_geometric_data_local_eqn, External_interaction_geometric_data_pt, and flush_all_external_element_storage().

◆ ElementWithExternalElement() [2/2]

oomph::ElementWithExternalElement::ElementWithExternalElement ( const ElementWithExternalElement )
delete

Broken copy constructor.

Member Function Documentation

◆ add_external_geometric_data()

bool oomph::ElementWithExternalElement::add_external_geometric_data ( )
inline

Are we including external geometric data in the element's Jacobian.

239  {
241  }

References Add_external_geometric_data.

Referenced by oomph::ProjectableElement< ELEMENT >::enable_projection().

◆ add_external_interaction_data()

bool oomph::ElementWithExternalElement::add_external_interaction_data ( )
inline

Are we including external data in the element's Jacobian.

245  {
247  }

References Add_external_interaction_data.

Referenced by oomph::ProjectableElement< ELEMENT >::enable_projection().

◆ assign_external_interaction_data_local_eqn_numbers()

void oomph::ElementWithExternalElement::assign_external_interaction_data_local_eqn_numbers ( const bool store_local_dof_pt)
protected

Assign the local equation numbers for those Data values involved in the external interactions that affect the residuals of the element

This function determines the all Data in external elemetns that affects the residuals of the element and adds their global equation numbers to the local-to-global look-up scheme. Note that we only include Data items into the element's External_interaction_data if they are not already included in the element's nodal positional Data, its internal or external Data.

248  {
249  // Reset number of stored field data to zero
251  // Clear all the internal field data storage, if it's been allocated
253  {
256  }
258  {
261  }
263  {
266  }
267 
268  // Reset number of stored geometric data to zero
270  // Clear all internal external data storage, if it's been allocated
272  {
275  }
277  {
280  }
282  {
285  }
286 
287  // Only bother with non-halo elements
288 #ifdef OOMPH_HAS_MPI
289  if (!this->is_halo())
290 #endif
291  {
292  // If desired, determine the Data that affects the interactions but is not
293  // already included in elements other generic Data.
294  // The conditional test is done here, so that the vectors are cleared
295  // and not re-filled if Add_external_interaction_data is false
297  {
298  // Number of interactions
299  const unsigned n_interaction = this->ninteraction();
300  // Number of integration points
301  const unsigned n_intpt = integral_pt()->nweight();
302 
303  // Sets of all (external) FiniteElements that affect the interactions
304  // One set per interaction
305  Vector<std::set<FiniteElement*>> external_interaction_elements_pt(
306  n_interaction);
307 
308  // Loop over the interactions
309  for (unsigned i = 0; i < n_interaction; i++)
310  {
311  // Loop over the integration points and the adjacent element at
312  // each integration point to the set
313  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
314  {
315  // Add the element adjacent to the element into the set
316  external_interaction_elements_pt[i].insert(
317  external_element_pt(i, ipt));
318  }
319  // For safety erase any null pointers
320  external_interaction_elements_pt[i].erase(0);
321  }
322 
323  // Storage for a pairs of interaction data (pointer to Data and the
324  // index of the value within this Data object) affecting the element.
325  std::set<std::pair<Data*, unsigned>> paired_field_data;
326 
327  // Determine the field data that affects the external interactions
328  // for all sets of external elements
330  external_interaction_elements_pt, paired_field_data);
331 
332  // It's just possible that some of the field data could be internal
333  // or nodal data, so we should remove it if that's the case
334  // Loop over all internal data
335  const unsigned n_internal = this->ninternal_data();
336  for (unsigned n = 0; n < n_internal; n++)
337  {
338  // Cache the data pointer
339  Data* const dat_pt = this->internal_data_pt(n);
340  // Find the number of data values stored in the data object
341  const unsigned n_value = dat_pt->nvalue();
342  // Add the index of each data value and the pointer to the set
343  // of pairs
344  for (unsigned i = 0; i < n_value; i++)
345  {
346  paired_field_data.erase(std::make_pair(dat_pt, i));
347  }
348  }
349 
350  // Loop over all the nodes
351  const unsigned n_node = this->nnode();
352  for (unsigned n = 0; n < n_node; n++)
353  {
354  // Find the node point
355  Node* const nod_pt = this->node_pt(n);
356  // Find the number of values stored at the node
357  const unsigned n_value = nod_pt->nvalue();
358  // Loop over values and erase all pairs from the set
359  for (unsigned i = 0; i < n_value; i++)
360  {
361  paired_field_data.erase(std::make_pair(nod_pt, i));
362  }
363  SolidNode* solid_nod_pt = dynamic_cast<SolidNode*>(nod_pt);
364  if (solid_nod_pt != 0)
365  {
366  Data* pos_data_pt = solid_nod_pt->variable_position_pt();
367  // Find the number of positional values stored at the node
368  const unsigned n_value = pos_data_pt->nvalue();
369  // Loop over values and erase all pairs from the set
370  for (unsigned i = 0; i < n_value; i++)
371  {
372  paired_field_data.erase(std::make_pair(pos_data_pt, i));
373  }
374  }
375  }
376 
377  // Now allocate storage for the external field data
378  // associated indices and local equation numbers
379  const unsigned n_external_interaction_field_data =
380  paired_field_data.size();
381  Nexternal_interaction_field_data = n_external_interaction_field_data;
383  new Data*[n_external_interaction_field_data];
385  new unsigned[n_external_interaction_field_data];
386 
387  // Add the pairs of data to the field data vectors
388  {
389  unsigned count = 0;
390  for (std::set<std::pair<Data*, unsigned>>::iterator it =
391  paired_field_data.begin();
392  it != paired_field_data.end();
393  it++)
394  {
395  External_interaction_field_data_pt[count] = it->first;
396  External_interaction_field_data_index[count] = it->second;
397  ++count;
398  }
399  }
400 
401 
402  // Only bother to add geometric data if we're told to
404  {
405  // Storage for a set of external geometric Data affecting the element
406  std::set<Data*> external_geometric_data_pt;
407 
408  // Determine the geometric data that affects the external interactions
409  // for all sets of external elements
411  external_interaction_elements_pt, external_geometric_data_pt);
412 
413  // Now loop over any geometric data of the Element itself
414  // and erase them from the external_geometric_data_pt
415  // because these data are actually intrinsic
416  // data of this element and are counted and numbered elsewhere
417  unsigned n_geom_data = ngeom_data();
418  for (unsigned j = 0; j < n_geom_data; j++)
419  {
420  external_geometric_data_pt.erase(geom_data_pt(j));
421  }
422 
423  // It is possible that the geometric data may have already been added
424  // as external data. We should erase any common entries from the
425  // External_interaction_data
426  // but not touch the external data that has been set up by a
427  //"knowledgeable" user
428  unsigned n_external = nexternal_data();
429  for (unsigned j = 0; j < n_external; j++)
430  {
431  external_geometric_data_pt.erase(external_data_pt(j));
432  }
433 
434  // Loop over all the nodes of present element to avoid double counting
435  const unsigned n_node = this->nnode();
436  for (unsigned n = 0; n < n_node; n++)
437  {
438  Node* const nod_pt = this->node_pt(n);
439  external_geometric_data_pt.erase(nod_pt);
440 
441  SolidNode* solid_nod_pt = dynamic_cast<SolidNode*>(nod_pt);
442  if (solid_nod_pt != 0)
443  {
444  Data* pos_data_pt = solid_nod_pt->variable_position_pt();
445  // std::ostringstream junk;
446  // junk << "Erasing ";
447  // unsigned nval=pos_data_pt->nvalue();
448  // for (unsigned i=0;i<nval;i++)
449  // {
450  // junk << pos_data_pt->eqn_number(i) << " ";
451  // }
452  // oomph_info << junk.str() << std::endl;
453  external_geometric_data_pt.erase(pos_data_pt);
454  }
455  }
456 
457 
458  // Next allocate storage for the geometric field data
459  // Find out how many individual data we have
460  unsigned n_external_interaction_geometric_data = 0;
461  for (std::set<Data*>::iterator it =
462  external_geometric_data_pt.begin();
463  it != external_geometric_data_pt.end();
464  it++)
465  {
466  // Add the number of values stored in each geometric datum
467  n_external_interaction_geometric_data += (*it)->nvalue();
468  }
469 
470  // Now allocate storage
472  n_external_interaction_geometric_data;
474  new Data*[n_external_interaction_geometric_data];
476  new unsigned[n_external_interaction_geometric_data];
477 
478  // Now we can add all the geometric data to the geometric data vectors
479  {
480  unsigned count = 0;
481  for (std::set<Data*>::iterator it =
482  external_geometric_data_pt.begin();
483  it != external_geometric_data_pt.end();
484  it++)
485  {
486  // Find the number of values stored in the geometric data
487  unsigned n_value = (*it)->nvalue();
488  // Loop over the values
489  for (unsigned j = 0; j < n_value; j++)
490  {
491  // Add data to the external geometric data
494  ++count;
495  }
496  }
497  }
498  }
499  }
500 
501  // All external interaction data has now been specified
502 
503  // Find the number of external field data
504  const unsigned n_external_field_data = nexternal_interaction_field_data();
505 
506  // If there are interaction data fill in the internal storage
507  if (n_external_field_data > 0)
508  {
509  // Allocate storage for the local equation numbers associated with
510  // external field data
512  new int[n_external_field_data];
513 
514  // Find the number of local equations assigned so far
515  unsigned local_eqn_number = ndof();
516 
517  // A local queue to store the global equation numbers
518  std::deque<unsigned long> global_eqn_number_queue;
519 
520  // Now loop over the field data again to assign local equation numbers
521  for (unsigned i = 0; i < n_external_field_data; i++)
522  {
523  // Get the GLOBAL equation number
526 
527  // If the GLOBAL equation number is positive (i.e. not pinned)
528  if (eqn_number >= 0)
529  {
530  // std::ostringstream junk;
531  // junk << "Adding global eqn " << eqn_number << " (";
532  // if (!(External_interaction_field_data_pt[i]->is_halo()))
533  // {
534  // junk << "not";
535  // }
536  // oomph_info << junk.str() << " halo" << std::endl;
537 
538  // Add the GLOBAL equation number to the local queue
539  global_eqn_number_queue.push_back(eqn_number);
540  // Add pointer to the dof to the queue if required
541  if (store_local_dof_pt)
542  {
546  }
547 
548  // Add the local equation number to the local scheme
550  // Increase the local number
552  }
553  else
554  {
555  // Set the local scheme to be pinned
557  }
558  }
559  // Now add our global equations numbers to the internal element storage
560  add_global_eqn_numbers(global_eqn_number_queue,
562  // Clear the memory used in the deque
563  if (store_local_dof_pt)
564  {
565  std::deque<double*>().swap(GeneralisedElement::Dof_pt_deque);
566  }
567  }
568 
569  // Find the number of external geometric data
570  unsigned n_external_geom_data = nexternal_interaction_geometric_data();
571 
572  // If there are external geometric data fill in the internal storage
573  if (n_external_geom_data > 0)
574  {
575  // Allocate storage for the local equation numbers associated with
576  // external geometric data
578  new int[n_external_geom_data];
579 
580  // Find the number of local equations assigned so far
581  unsigned local_eqn_number = ndof();
582 
583  // A local queue to store the global equation numbers
584  std::deque<unsigned long> global_eqn_number_queue;
585 
586  // Now loop over the field data again assign local equation numbers
587  for (unsigned i = 0; i < n_external_geom_data; i++)
588  {
589  // Get the GLOBAL equation number
590  long eqn_number =
593 
594  // If the GLOBAL equation number is positive (a free variable)
595  if (eqn_number >= 0)
596  {
597  // Add the GLOBAL equation number to the local queue
598  global_eqn_number_queue.push_back(eqn_number);
599  // Add pointer to the dof to the queue if required
600  if (store_local_dof_pt)
601  {
605  }
606 
607  // Add the local equation number to the local scheme
609  // Increase the local number
611  }
612  else
613  {
614  // Set the local scheme to be pinned
616  }
617  }
618  // Now add our global equations numbers to the internal element storage
619  add_global_eqn_numbers(global_eqn_number_queue,
621  // Clear the memory used in the deque
622  if (store_local_dof_pt)
623  {
624  std::deque<double*>().swap(GeneralisedElement::Dof_pt_deque);
625  }
626  }
627  }
628  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
Definition: nodes.h:367
static long Is_pinned
Static "Magic number" to indicate pinned values.
Definition: nodes.h:183
FiniteElement *& external_element_pt(const unsigned &interaction_index, const unsigned &ipt)
Definition: element_with_external_element.h:107
virtual void identify_all_geometric_data_for_external_interaction(Vector< std::set< FiniteElement * >> const &external_elements_pt, std::set< Data * > &external_geometric_data_pt)
Definition: element_with_external_element.cc:178
unsigned nexternal_interaction_geometric_data() const
Definition: element_with_external_element.h:232
unsigned nexternal_interaction_field_data() const
Definition: element_with_external_element.h:205
virtual void identify_all_field_data_for_external_interaction(Vector< std::set< FiniteElement * >> const &external_elements_pt, std::set< std::pair< Data *, unsigned >> &paired_interaction_data)
Definition: element_with_external_element.cc:152
unsigned ninteraction() const
Return the number of interactions in the element.
Definition: element_with_external_element.h:184
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
Data * geom_data_pt(const unsigned &j)
Definition: elements.h:2667
unsigned ngeom_data() const
Definition: elements.h:2660
unsigned nexternal_data() const
Return the number of external data objects.
Definition: elements.h:829
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
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Definition: elements.h:659
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
void add_global_eqn_numbers(std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
Definition: elements.cc:156
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
void set(Container &c, Position position, const Value &value)
Definition: stdlist_overload.cpp:36
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References Add_external_geometric_data, Add_external_interaction_data, oomph::GeneralisedElement::add_global_eqn_numbers(), oomph::GeneralisedElement::Dof_pt_deque, oomph::Data::eqn_number(), oomph::GeneralisedElement::eqn_number(), oomph::GeneralisedElement::external_data_pt(), external_element_pt(), External_interaction_field_data_index, External_interaction_field_data_local_eqn, External_interaction_field_data_pt, External_interaction_geometric_data_index, External_interaction_geometric_data_local_eqn, External_interaction_geometric_data_pt, oomph::FiniteElement::geom_data_pt(), i, identify_all_field_data_for_external_interaction(), identify_all_geometric_data_for_external_interaction(), oomph::FiniteElement::integral_pt(), oomph::GeneralisedElement::internal_data_pt(), oomph::Data::Is_pinned, j, oomph::GeneralisedElement::local_eqn_number(), n, oomph::GeneralisedElement::ndof(), oomph::GeneralisedElement::nexternal_data(), nexternal_interaction_field_data(), Nexternal_interaction_field_data, nexternal_interaction_geometric_data(), Nexternal_interaction_geometric_data, oomph::FiniteElement::ngeom_data(), ninteraction(), oomph::GeneralisedElement::ninternal_data(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::Data::nvalue(), oomph::Integral::nweight(), set(), and oomph::SolidNode::variable_position_pt().

Referenced by assign_internal_and_external_local_eqn_numbers().

◆ assign_internal_and_external_local_eqn_numbers()

void oomph::ElementWithExternalElement::assign_internal_and_external_local_eqn_numbers ( const bool store_local_dof_pt)
inlineprotectedvirtual

Overload the assign internal and external local equation number scheme so that the interaction data is taken into account

Reimplemented from oomph::GeneralisedElement.

322  {
323  // Call the external stuff first so that it is near the front of the
324  // list for fast searches when using indexing by global dof for
325  // analytic calculation of interaction blocks.
327  store_local_dof_pt);
328  // Now call the underlying equation numbering
330  store_local_dof_pt);
331  }
void assign_external_interaction_data_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: element_with_external_element.cc:246
virtual void assign_internal_and_external_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.cc:938

References assign_external_interaction_data_local_eqn_numbers(), and oomph::GeneralisedElement::assign_internal_and_external_local_eqn_numbers().

◆ check_storage_allocated()

void oomph::ElementWithExternalElement::check_storage_allocated ( ) const
inlineprivate

Helper function to check that storage has actually been allocated.

524  {
525  // If either of the storage arrays is zero, then storage has not
526  // yet been allocated. Both arrays are allocated at once, so
527  // if one is zero both will (should) be
529  {
530  std::ostringstream error_stream;
531  error_stream
532  << "Storage for the external elements has not been allocated.\n"
533  << "initialise_external_element_storage() must be called.\n"
534  << "This tends to be done automatically during the multi-domain\n"
535  << "setup procedures -- you're most likely to get this error\n"
536  << "because you have not specified the number of interactions\n"
537  << "that your ElementWithExternalElement is involved in.\n"
538  << "You ought to specify this with a call to\n\n"
539  << " ElementWithExternalElement::set_ninteraction(...)\n\n";
540  throw OomphLibError(
541  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
542  }
543  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References External_element_local_coord, External_element_pt, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by external_element_local_coord(), and external_element_pt().

◆ describe_local_dofs()

void oomph::ElementWithExternalElement::describe_local_dofs ( std::ostream &  out,
const std::string &  current_string 
) const
virtual

Function to describe the local dofs of the element. The ostream specifies the output stream to which the description is written; the string stores the currently assembled output that is ultimately written to the output stream by Data::describe_dofs(...); it is typically built up incrementally as we descend through the call hierarchy of this function when called from Problem::describe_dofs(...)

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >, oomph::ProjectableElement< ELEMENT >, oomph::ProjectableElement< FVK_ELEMENT >, oomph::ProjectableElement< AXISYM_LINEAR_ELAST_ELEMENT >, oomph::ProjectableElement< UNSTEADY_HEAT_ELEMENT >, oomph::ProjectableElement< LINEAR_ELAST_ELEMENT >, oomph::ProjectableElement< CROUZEIX_RAVIART_ELEMENT >, oomph::ProjectableElement< HELMHOLTZ_ELEMENT >, oomph::ProjectableElement< AXISYMMETRIC_POROELASTICITY_ELEMENT >, oomph::ProjectableElement< TAYLOR_HOOD_ELEMENT >, oomph::ProjectableElement< PVD_ELEMENT >, oomph::ProjectableElement< ADR_ELEMENT >, oomph::ProjectableElement< DARCY_ELEMENT >, oomph::ProjectableElement< POISSON_ELEMENT >, oomph::ProjectableElement< FOURIER_DECOMPOSED_HELMHOLTZ_ELEMENT >, oomph::ProjectableElement< TIME_HARMONIC_LINEAR_ELAST_ELEMENT >, oomph::ProjectableElement< LINEAR_HEAT_AND_ELAST_ELEMENT >, oomph::FSIWallElement, and oomph::FaceElementAsGeomObject< ELEMENT >.

207  {
208  // Find the number of external field data
209  const unsigned n_external_field_data = nexternal_interaction_field_data();
210  // Now loop over the field data again to assign local equation numbers
211  for (unsigned i = 0; i < n_external_field_data; i++)
212  {
213  std::stringstream conversion;
214  conversion << " of External Interaction Field Data " << i
215  << current_string;
216  std::string in(conversion.str());
218  }
219 
220  // Find the number of external geometric data
221  unsigned n_external_geom_data = nexternal_interaction_geometric_data();
222 
223  // Now loop over the field data again assign local equation numbers
224  for (unsigned i = 0; i < n_external_geom_data; i++)
225  {
226  std::stringstream conversion;
227  conversion << " of External Interaction Geometric Data " << i
228  << current_string;
229  std::string in(conversion.str());
231  }
233  }
virtual void describe_dofs(std::ostream &out, const std::string &current_string) const
Definition: nodes.cc:939
virtual void describe_local_dofs(std::ostream &out, const std::string &current_string) const
Definition: elements.cc:573
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
std::ofstream out("Result.txt")

References oomph::Data::describe_dofs(), oomph::GeneralisedElement::describe_local_dofs(), External_interaction_field_data_pt, External_interaction_geometric_data_pt, i, nexternal_interaction_field_data(), nexternal_interaction_geometric_data(), out(), and oomph::Global_string_for_annotation::string().

Referenced by oomph::FaceElementAsGeomObject< ELEMENT >::describe_local_dofs(), oomph::ProjectableElement< ELEMENT >::describe_local_dofs(), and oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::describe_local_dofs().

◆ external_element_local_coord() [1/2]

Vector<double>& oomph::ElementWithExternalElement::external_element_local_coord ( const unsigned interaction_index,
const unsigned ipt 
)
inline

Access function to get source element's local coords for specified interaction index at specified integration point

138  {
139 #ifdef PARANOID
141 #endif
142 #ifdef RANGE_CHECKING
143  range_check(interaction_index, ipt);
144 #endif
145  return External_element_local_coord[Nintpt * interaction_index + ipt];
146  }
void check_storage_allocated() const
Helper function to check that storage has actually been allocated.
Definition: element_with_external_element.h:523
void range_check(const unsigned &interaction_index, const unsigned &ipt) const
Helper function for range checking in the access functions.
Definition: element_with_external_element.h:546

References check_storage_allocated(), External_element_local_coord, Nintpt, and range_check().

Referenced by oomph::LinearisedAxisymPoroelasticBJS_FSIElement< FLUID_BULK_ELEMENT, POROELASTICITY_BULK_ELEMENT >::contribution_to_total_porous_flux(), oomph::FSI_functions::doc_fsi(), oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(), oomph::FSIWallElement::fluid_load_vector(), oomph::RefineableNavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::get_body_force_nst(), oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::get_dwind_adv_diff_dexternal_element_data(), oomph::FSILinearisedAxisymPoroelasticTractionElement< POROELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::get_pressure(), oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >::get_pressure_fvk(), oomph::FSILinearisedAxisymPoroelasticTractionElement< POROELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::get_traction(), oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::get_wind_adv_diff(), oomph::Multi_domain_functions::locate_zeta_for_local_coordinates(), oomph::FSIAxisymmetricLinearElasticityTractionElement< ELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::output(), oomph::LinearisedFSIAxisymmetricNStNoSlipBCElementElement< FLUID_BULK_ELEMENT, SOLID_BULK_ELEMENT >::output(), oomph::LinearisedAxisymPoroelasticBJS_FSIElement< FLUID_BULK_ELEMENT, POROELASTICITY_BULK_ELEMENT >::output(), oomph::FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::HelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::PMLHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), output_external_elements(), oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >::output_integration_points(), oomph::RefineableFSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::refineable_fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(), oomph::ProjectableAxisymmetricPoroelasticityElement< AXISYMMETRIC_POROELASTICITY_ELEMENT >::residual_for_projection(), oomph::ProjectableDarcyElement< DARCY_ELEMENT >::residual_for_projection(), and oomph::ProjectableElement< ELEMENT >::residual_for_projection().

◆ external_element_local_coord() [2/2]

Vector<double> const& oomph::ElementWithExternalElement::external_element_local_coord ( const unsigned interaction_index,
const unsigned ipt 
) const
inline

Access function to get source element's coords, const version.

151  {
152 #ifdef PARANOID
154 #endif
155 #ifdef RANGE_CHECKING
156  range_check(interaction_index, ipt);
157 #endif
158  return External_element_local_coord[Nintpt * interaction_index + ipt];
159  }

References check_storage_allocated(), External_element_local_coord, Nintpt, and range_check().

◆ external_element_pt() [1/2]

FiniteElement*& oomph::ElementWithExternalElement::external_element_pt ( const unsigned interaction_index,
const unsigned ipt 
)
inline

Access function to source element for specified interaction index at specified integration point

109  {
110 #ifdef PARANOID
112 #endif
113 #ifdef RANGE_CHECKING
114  range_check(interaction_index, ipt);
115 #endif
116  // Return the appropriate entry in the storage array
117  return External_element_pt[Nintpt * interaction_index + ipt];
118  }

References check_storage_allocated(), External_element_pt, Nintpt, and range_check().

Referenced by assign_external_interaction_data_local_eqn_numbers(), oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), oomph::LinearisedAxisymPoroelasticBJS_FSIElement< FLUID_BULK_ELEMENT, POROELASTICITY_BULK_ELEMENT >::contribution_to_total_porous_flux(), oomph::FSI_functions::doc_fsi(), oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(), oomph::FSIWallElement::fluid_load_vector(), oomph::RefineableNavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::get_body_force_nst(), oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::get_dwind_adv_diff_dexternal_element_data(), oomph::FSILinearisedAxisymPoroelasticTractionElement< POROELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::get_pressure(), oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >::get_pressure_fvk(), oomph::FSILinearisedAxisymPoroelasticTractionElement< POROELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::get_traction(), oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::get_wind_adv_diff(), oomph::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::global_flux_contribution_from_helmholtz(), oomph::Multi_domain_functions::locate_zeta_for_local_coordinates(), oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >::node_update_adjacent_fluid_elements(), oomph::FSIWallElement::node_update_adjacent_fluid_elements(), oomph::FSIAxisymmetricLinearElasticityTractionElement< ELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::output(), oomph::LinearisedFSIAxisymmetricNStNoSlipBCElementElement< FLUID_BULK_ELEMENT, SOLID_BULK_ELEMENT >::output(), oomph::LinearisedAxisymPoroelasticBJS_FSIElement< FLUID_BULK_ELEMENT, POROELASTICITY_BULK_ELEMENT >::output(), oomph::FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::HelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::output(), oomph::PMLHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::output(), oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >::output_adjacent_fluid_elements(), output_external_elements(), oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >::output_integration_points(), oomph::RefineableFSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::refineable_fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(), oomph::ProjectableAxisymmetricPoroelasticityElement< AXISYMMETRIC_POROELASTICITY_ELEMENT >::residual_for_projection(), oomph::ProjectableDarcyElement< DARCY_ELEMENT >::residual_for_projection(), oomph::ProjectableElement< ELEMENT >::residual_for_projection(), and MortaringValidationProblem< ELEMENT, NON_MORTAR_ELEMENT >::setup_multi_domain_interaction().

◆ external_element_pt() [2/2]

FiniteElement* const& oomph::ElementWithExternalElement::external_element_pt ( const unsigned interaction_index,
const unsigned ipt 
) const
inline

Access function to source element, const version.

123  {
124 #ifdef PARANOID
126 #endif
127 #ifdef RANGE_CHECKING
128  range_check(interaction_index, ipt);
129 #endif
130  // Return the appropriate entry in the storage array
131  return External_element_pt[Nintpt * interaction_index + ipt];
132  }

References check_storage_allocated(), External_element_pt, Nintpt, and range_check().

◆ external_geometric_data_is_included()

bool oomph::ElementWithExternalElement::external_geometric_data_is_included ( ) const
inline

Is the external geometric data taken into account when forming the Jacobian?

302  {
304  }

References Add_external_geometric_data.

Referenced by RefineableQAxisymCrouzeixRaviartBoussinesqElement::further_build(), and oomph::RefineableNavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::further_build().

◆ external_interaction_field_data_pt()

Vector<Data*> oomph::ElementWithExternalElement::external_interaction_field_data_pt ( ) const
inline

Return vector of pointers to the field Data objects that affect the interactions on the element.

213  {
214  // Find out how many external field data there are
215  const unsigned n_external_interaction_field_data =
217  // Create and populate a temporary vector
218  Vector<Data*> temp_data(n_external_interaction_field_data);
219  for (unsigned i = 0; i < n_external_interaction_field_data; i++)
220  {
221  temp_data[i] = External_interaction_field_data_pt[i];
222  }
223  // Return the temporary data
224  return temp_data;
225  }

References External_interaction_field_data_pt, i, and nexternal_interaction_field_data().

Referenced by oomph::GeneralisedElement::assign_local_eqn_numbers(), and oomph::FSI_functions::doc_fsi().

◆ external_interaction_geometric_data_pt()

Vector<Data*> oomph::ElementWithExternalElement::external_interaction_geometric_data_pt ( ) const
inline

Return vector of pointers to the geometric Data objects that affect the interactions on the element.

252  {
253  // Find out how many external field data there are
254  const unsigned n_external_interaction_geometric_data =
256  // Create and populate a temporary vector
257  Vector<Data*> temp_data(n_external_interaction_geometric_data);
258  for (unsigned i = 0; i < n_external_interaction_geometric_data; i++)
259  {
261  }
262  // Return the temporary data
263  return temp_data;
264  }

References External_interaction_geometric_data_pt, i, and nexternal_interaction_geometric_data().

Referenced by oomph::GeneralisedElement::assign_local_eqn_numbers(), and oomph::FSI_functions::doc_fsi().

◆ fill_in_contribution_to_jacobian()

void oomph::ElementWithExternalElement::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlineprotectedvirtual

Fill in the element's contribution to the Jacobian matrix and the residual vector: Done by finite differencing the residual vector w.r.t. all nodal, internal, external and load Data.

Reimplemented from oomph::GeneralisedElement.

Reimplemented in oomph::RefineableFSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >, oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >, oomph::RefineableFSISolidTractionElement< ELEMENT, DIM >, oomph::FSISolidTractionElement< ELEMENT, DIM >, oomph::FSIDiagHermiteShellElement, oomph::PMLHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >, oomph::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >, oomph::AdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >, oomph::NavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >, oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >, oomph::RefineableNavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >, oomph::HelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >, oomph::TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >, oomph::FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >, oomph::FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >, RefineableLinearisedQCrouzeixRaviartMultiDomainElement, RefineableLinearisedQTaylorHoodMultiDomainElement, LinearisedQCrouzeixRaviartMultiDomainElement, LinearisedQTaylorHoodMultiDomainElement, RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, oomph::ProjectableElement< ELEMENT >, oomph::ProjectableElement< FVK_ELEMENT >, oomph::ProjectableElement< AXISYM_LINEAR_ELAST_ELEMENT >, oomph::ProjectableElement< UNSTEADY_HEAT_ELEMENT >, oomph::ProjectableElement< LINEAR_ELAST_ELEMENT >, oomph::ProjectableElement< CROUZEIX_RAVIART_ELEMENT >, oomph::ProjectableElement< HELMHOLTZ_ELEMENT >, oomph::ProjectableElement< AXISYMMETRIC_POROELASTICITY_ELEMENT >, oomph::ProjectableElement< TAYLOR_HOOD_ELEMENT >, oomph::ProjectableElement< PVD_ELEMENT >, oomph::ProjectableElement< ADR_ELEMENT >, oomph::ProjectableElement< DARCY_ELEMENT >, oomph::ProjectableElement< POISSON_ELEMENT >, oomph::ProjectableElement< FOURIER_DECOMPOSED_HELMHOLTZ_ELEMENT >, oomph::ProjectableElement< TIME_HARMONIC_LINEAR_ELAST_ELEMENT >, oomph::ProjectableElement< LINEAR_HEAT_AND_ELAST_ELEMENT >, oomph::FSIWallElement, and oomph::FaceElementAsGeomObject< ELEMENT >.

429  {
430  // Add the contribution to the residuals
432  // Allocate storage for the full residuals (residuals of entire element)
433  const unsigned n_dof = this->ndof();
434  Vector<double> full_residuals(n_dof);
435  // Get the residuals for the entire element
436  get_residuals(full_residuals);
437  // Add the internal and external by finite differences
438  fill_in_jacobian_from_internal_by_fd(full_residuals, jacobian);
439  fill_in_jacobian_from_external_by_fd(full_residuals, jacobian);
440  fill_in_jacobian_from_nodal_by_fd(full_residuals, jacobian);
442  jacobian);
443  }
void fill_in_jacobian_from_external_interaction_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: element_with_external_element.h:345
virtual void fill_in_jacobian_from_nodal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.cc:3660
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Definition: elements.h:357
virtual void get_residuals(Vector< double > &residuals)
Definition: elements.h:980
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.cc:1199
void fill_in_jacobian_from_internal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.cc:1102

References oomph::GeneralisedElement::fill_in_contribution_to_residuals(), oomph::GeneralisedElement::fill_in_jacobian_from_external_by_fd(), fill_in_jacobian_from_external_interaction_by_fd(), oomph::GeneralisedElement::fill_in_jacobian_from_internal_by_fd(), oomph::FiniteElement::fill_in_jacobian_from_nodal_by_fd(), oomph::GeneralisedElement::get_residuals(), and oomph::GeneralisedElement::ndof().

Referenced by QAxisymCrouzeixRaviartElementWithExternalElement::fill_in_contribution_to_jacobian(), QAxisymAdvectionDiffusionElementWithExternalElement::fill_in_contribution_to_jacobian(), QCrouzeixRaviartElementWithTwoExternalElement< DIM >::fill_in_contribution_to_jacobian(), QAdvectionDiffusionElementWithExternalElement< DIM >::fill_in_contribution_to_jacobian(), oomph::NavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::fill_in_contribution_to_jacobian(), and oomph::AdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::fill_in_contribution_to_jacobian().

◆ fill_in_jacobian_from_external_interaction_by_fd() [1/2]

void oomph::ElementWithExternalElement::fill_in_jacobian_from_external_interaction_by_fd ( DenseMatrix< double > &  jacobian)
inlineprotected

Calculate the contributions to the jacobian from all enternal interaction degrees of freedom (geometric and field data) in the external element using finite differences. This version computes the residuals vector before calculating the jacobian terms.

362  {
363  const unsigned n_dof = this->ndof();
364  // Allocate storage for the residuals
365  Vector<double> residuals(n_dof, 0.0);
366  // Get the residuals for the entire element
367  get_residuals(residuals);
368  // Call the jacobian calculation
370  }

References fill_in_jacobian_from_external_interaction_by_fd(), oomph::GeneralisedElement::get_residuals(), and oomph::GeneralisedElement::ndof().

◆ fill_in_jacobian_from_external_interaction_by_fd() [2/2]

void oomph::ElementWithExternalElement::fill_in_jacobian_from_external_interaction_by_fd ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlineprotected

Calculate the contributions to the jacobian from all external interaction degrees of freedom (geometric and field data) in the external element using finite differences. This version of the function assumes that the residuals vector has already been calculated.

347  {
348  // Get the contribution from the external field data
350  jacobian);
351  // Get the contribution from the external geometric data
353  jacobian);
354  }
void fill_in_jacobian_from_external_interaction_field_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: element_with_external_element.cc:638
void fill_in_jacobian_from_external_interaction_geometric_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: element_with_external_element.cc:720

References fill_in_jacobian_from_external_interaction_field_by_fd(), and fill_in_jacobian_from_external_interaction_geometric_by_fd().

Referenced by oomph::FSIAxisymmetricLinearElasticityTractionElement< ELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::LinearisedFSIAxisymmetricNStNoSlipBCElementElement< FLUID_BULK_ELEMENT, SOLID_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::FSILinearisedAxisymPoroelasticTractionElement< POROELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::FSIHermiteBeamElement::fill_in_contribution_to_jacobian(), fill_in_contribution_to_jacobian(), oomph::FSIWallElement::fill_in_contribution_to_jacobian(), oomph::FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::HelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::RefineableNavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::PMLHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::fill_in_contribution_to_jacobian(), oomph::FSIDiagHermiteShellElement::fill_in_contribution_to_jacobian(), oomph::FSISolidTractionElement< ELEMENT, DIM >::fill_in_contribution_to_jacobian(), oomph::RefineableFSISolidTractionElement< ELEMENT, DIM >::fill_in_contribution_to_jacobian(), oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_jacobian(), oomph::RefineableFSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_contribution_to_jacobian(), and fill_in_jacobian_from_external_interaction_by_fd().

◆ fill_in_jacobian_from_external_interaction_field_by_fd() [1/2]

void oomph::ElementWithExternalElement::fill_in_jacobian_from_external_interaction_field_by_fd ( DenseMatrix< double > &  jacobian)
inlineprotected

Calculate the contributions to the jacobian from the enternal interaction degrees of freedom associated with fields interpolated by the external element using finite differences. This version computes the residuals vector before calculating the jacobian terms.

387  {
388  const unsigned n_dof = this->ndof();
389  // Allocate storage for the residuals
390  Vector<double> residuals(n_dof, 0.0);
391  // Get the residuals for the entire element
392  get_residuals(residuals);
393  // Call the jacobian calculation
395  jacobian);
396  }

References fill_in_jacobian_from_external_interaction_field_by_fd(), oomph::GeneralisedElement::get_residuals(), and oomph::GeneralisedElement::ndof().

◆ fill_in_jacobian_from_external_interaction_field_by_fd() [2/2]

void oomph::ElementWithExternalElement::fill_in_jacobian_from_external_interaction_field_by_fd ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
protected

Calculate the contributions to the jacobian from the external interaction degrees of freedom associated with fields interpolated by the external element using finite differences. This version of the function assumes that the residuals vector has already been calculated.

This function calculates the entries of Jacobian matrix, used in the Newton method, associated with the external interaction degrees of freedom for external fields. It does this using finite differences, rather than an analytical formulation, so can be done in total generality.

640  {
641  // Locally cache the number of data
642  const unsigned n_external_interaction_field_data =
644 
645  // If there is no such data return
646  if (n_external_interaction_field_data == 0)
647  {
648  return;
649  }
650 
651  // Call the update function to ensure that the element is in a
652  // consistent state before finite differencing
654 
655  // Find the number of dofs in the element
656  const unsigned n_dof = ndof();
657 
658  // Create newres vector
659  Vector<double> newres(n_dof);
660 
661  // Integer storage for local unknown
662  int local_unknown = 0;
663 
664  // Use the default finite difference step
665  const double fd_step = Default_fd_jacobian_step;
666 
667  // Loop over the data
668  for (unsigned i = 0; i < n_external_interaction_field_data; i++)
669  {
670  // Find the value of the local unknown
672  // If it's not a boundary condition
673  if (local_unknown >= 0)
674  {
675  // Store a pointer to the field value
676  double* value_pt = External_interaction_field_data_pt[i]->value_pt(
678 
679  // Save the old value of the field value
680  double old_var = *value_pt;
681 
682  // Increment the value
683  *value_pt += fd_step;
684 
685  // Now update any dependent variables
687 
688  // Calculate the new residuals
689  get_residuals(newres);
690 
691  // Do forward finite differences
692  for (unsigned m = 0; m < n_dof; m++)
693  {
694  // Stick the entry into the Jacobian matrix
695  jacobian(m, local_unknown) = (newres[m] - residuals[m]) / fd_step;
696  }
697 
698  // Reset the variables
699  *value_pt = old_var;
700 
701  // Reset any dependent variables
703  }
704  } // End of loop over external interaction data
705 
706  // End of finite difference loop
707  // Final reset of any dependent data
709  }
double * value_pt(const unsigned &i) const
Definition: nodes.h:324
virtual void update_before_external_interaction_field_fd()
Definition: element_with_external_element.h:450
virtual void reset_after_external_interaction_field_fd()
Definition: element_with_external_element.h:456
virtual void reset_in_external_interaction_field_fd(const unsigned &i)
Definition: element_with_external_element.h:470
virtual void update_in_external_interaction_field_fd(const unsigned &i)
Definition: element_with_external_element.h:461
static double Default_fd_jacobian_step
Definition: elements.h:1198
int * m
Definition: level2_cplx_impl.h:294

References oomph::GeneralisedElement::Default_fd_jacobian_step, External_interaction_field_data_index, External_interaction_field_data_local_eqn, External_interaction_field_data_pt, oomph::GeneralisedElement::get_residuals(), i, m, oomph::GeneralisedElement::ndof(), nexternal_interaction_field_data(), reset_after_external_interaction_field_fd(), reset_in_external_interaction_field_fd(), update_before_external_interaction_field_fd(), update_in_external_interaction_field_fd(), and oomph::Data::value_pt().

Referenced by fill_in_jacobian_from_external_interaction_by_fd(), and fill_in_jacobian_from_external_interaction_field_by_fd().

◆ fill_in_jacobian_from_external_interaction_geometric_by_fd() [1/2]

void oomph::ElementWithExternalElement::fill_in_jacobian_from_external_interaction_geometric_by_fd ( DenseMatrix< double > &  jacobian)
inlineprotected

Calculate the contributions to the jacobian from the external interaction degrees of freedom associated with the geometry of the external elements using finite differences. This version computes the residuals vector before calculating the jacobian terms.

413  {
414  const unsigned n_dof = this->ndof();
415  // Allocate storage for the residuals
416  Vector<double> residuals(n_dof, 0.0);
417  // Get the residuals for the entire element
418  get_residuals(residuals);
419  // Call the jacobian calculation
421  jacobian);
422  }

References fill_in_jacobian_from_external_interaction_geometric_by_fd(), oomph::GeneralisedElement::get_residuals(), and oomph::GeneralisedElement::ndof().

◆ fill_in_jacobian_from_external_interaction_geometric_by_fd() [2/2]

void oomph::ElementWithExternalElement::fill_in_jacobian_from_external_interaction_geometric_by_fd ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
protected

Calculate the contributions to the jacobian from the external interaction degrees of freedom associated with the geometry of the external elements using finite differences. This version of the function assumes that the residuals vector has already been calculated.

This function calculates the entries of Jacobian matrix, used in the Newton method, associated with the external interaction degrees of freedom for external geometric data. It does this using finite differences, rather than an analytical formulation, so can be done in total generality.

722  {
723  // Locally cache the number of data
724  const unsigned n_external_interaction_geometric_data =
726  // If there is no such data return
727  if (n_external_interaction_geometric_data == 0)
728  {
729  return;
730  }
731 
732  // Call the update function to ensure that the element is in a
733  // consistent state before finite differencing
735 
736  // Find the number of dofs in the element
737  const unsigned n_dof = ndof();
738 
739  // Create newres vector
740  Vector<double> newres(n_dof);
741 
742  // Integer storage for local unknown
743  int local_unknown = 0;
744 
745  // Use the default finite difference step
746  const double fd_step = Default_fd_jacobian_step;
747 
748  // Loop over the data
749  for (unsigned i = 0; i < n_external_interaction_geometric_data; i++)
750  {
751  // Find the value of the local unknown
753  // If it's not a boundary condition
754  if (local_unknown >= 0)
755  {
756  // Store a pointer to the geometric value
759 
760  // Save the old value of the geometric value
761  double old_var = *value_pt;
762 
763  // Increment the value
764  *value_pt += fd_step;
765 
766  // Now update any dependent variables
768 
769  // Calculate the new residuals
770  get_residuals(newres);
771 
772  // Do forward finite differences
773  for (unsigned m = 0; m < n_dof; m++)
774  {
775  // Stick the entry into the Jacobian matrix
776  jacobian(m, local_unknown) = (newres[m] - residuals[m]) / fd_step;
777  }
778 
779  // Reset the variables
780  *value_pt = old_var;
781 
782  // Reset any dependent variables
784  }
785  } // End of loop over external interaction data
786 
787  // End of finite difference loop
788  // Final reset of any dependent data
790  }
virtual void update_before_external_interaction_geometric_fd()
Definition: element_with_external_element.h:481
virtual void reset_in_external_interaction_geometric_fd(const unsigned &i)
Definition: element_with_external_element.h:501
virtual void reset_after_external_interaction_geometric_fd()
Definition: element_with_external_element.h:487
virtual void update_in_external_interaction_geometric_fd(const unsigned &i)
Definition: element_with_external_element.h:492

References oomph::GeneralisedElement::Default_fd_jacobian_step, External_interaction_geometric_data_index, External_interaction_geometric_data_local_eqn, External_interaction_geometric_data_pt, oomph::GeneralisedElement::get_residuals(), i, m, oomph::GeneralisedElement::ndof(), nexternal_interaction_geometric_data(), reset_after_external_interaction_geometric_fd(), reset_in_external_interaction_geometric_fd(), update_before_external_interaction_geometric_fd(), update_in_external_interaction_geometric_fd(), and oomph::Data::value_pt().

Referenced by fill_in_jacobian_from_external_interaction_by_fd(), and fill_in_jacobian_from_external_interaction_geometric_by_fd().

◆ flush_all_external_element_storage()

void oomph::ElementWithExternalElement::flush_all_external_element_storage ( )

Flush the storage for external elements.

Clear the storage for pointers to external elements and their associated local coordinates.

126  {
127  // Delete the memory if it has been allocated
129  {
130  delete[] External_element_pt;
132  }
133 
135  {
138  }
139 
140  // Reset the number of stored values to zero
142  }

References External_element_local_coord, External_element_pt, and Nexternal_element_storage.

Referenced by ~ElementWithExternalElement().

◆ identify_all_field_data_for_external_interaction()

void oomph::ElementWithExternalElement::identify_all_field_data_for_external_interaction ( Vector< std::set< FiniteElement * >> const &  external_elements_pt,
std::set< std::pair< Data *, unsigned >> &  paired_interaction_data 
)
virtual

Function that must return all the data involved in the desired interactions from the external element

Function that must return all the data involved in the desired interactions from the external element Default is to call the identify_field_data_for_interaction() for each element.

Reimplemented in oomph::FSIWallElement, and oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >.

155  {
156  // Loop over each interaction
157  const unsigned n_interaction = this->ninteraction();
158  for (unsigned i = 0; i < n_interaction; i++)
159  {
160  // Loop over each element in the set
161  for (std::set<FiniteElement*>::const_iterator it =
162  external_elements_pt[i].begin();
163  it != external_elements_pt[i].end();
164  it++)
165  {
166  (*it)->identify_field_data_for_interactions(paired_interaction_data);
167  }
168  } // End of loop over interactions
169  }

References i, and ninteraction().

Referenced by assign_external_interaction_data_local_eqn_numbers().

◆ identify_all_geometric_data_for_external_interaction()

void oomph::ElementWithExternalElement::identify_all_geometric_data_for_external_interaction ( Vector< std::set< FiniteElement * >> const &  external_elements_pt,
std::set< Data * > &  external_geometric_data_pt 
)
virtual

Function that must return all geometric data involved in the desired interactions from the external element

Function that must return all geometric data involved in the desired interactions from the external element Default is to add all geometric data for each element for each interaction

Reimplemented in oomph::FSIWallElement.

181  {
182  // Loop over each interaction
183  const unsigned n_interaction = this->ninteraction();
184  for (unsigned i = 0; i < n_interaction; i++)
185  {
186  // Loop over each element in the set
187  for (std::set<FiniteElement*>::const_iterator it =
188  external_elements_pt[i].begin();
189  it != external_elements_pt[i].end();
190  it++)
191  {
192  (*it)->identify_geometric_data(external_geometric_data_pt);
193  }
194  } // End of loop over interactions
195  }

References i, and ninteraction().

Referenced by assign_external_interaction_data_local_eqn_numbers().

◆ ignore_external_geometric_data()

void oomph::ElementWithExternalElement::ignore_external_geometric_data ( )
inline

◆ ignore_external_interaction_data()

◆ include_external_geometric_data()

void oomph::ElementWithExternalElement::include_external_geometric_data ( )
inline

Do include external geometric data when computing the element's Jacobian. This function should be called to re-enable inclusion of external geometric data.

287  {
289  }

References Add_external_geometric_data.

Referenced by oomph::ProjectableElement< ELEMENT >::disable_projection().

◆ include_external_interaction_data()

void oomph::ElementWithExternalElement::include_external_interaction_data ( )
inline

Do include external geometric data when computing the element's Jacobian This function should be called to re-enable inclusion of external interaction data

295  {
297  }

References Add_external_interaction_data.

Referenced by oomph::ProjectableElement< ELEMENT >::disable_projection().

◆ initialise_external_element_storage()

void oomph::ElementWithExternalElement::initialise_external_element_storage ( )

Initialise storage for pointers to external elements and their local coordinates. This must be called before any of the access functions are used.

Initialise storage for source elements and their associated local coordinates for the specified number of interactions

77  {
78  // Find the number of interactions
79  const unsigned n_interaction = this->Ninteraction;
80  // Find the number of integration points
81  const unsigned n_intpt = this->integral_pt()->nweight();
82 
83  // Work out the required storage
84  const unsigned n_external_element_storage = n_interaction * n_intpt;
85 
86  // If we have not allocated the correct amount of memory,
87  // then do so
88  if (Nexternal_element_storage != n_external_element_storage)
89  {
90  // Allocate storage for the pointers to the elements
91  // Delete old storage, if needed
93  {
94  delete[] External_element_pt;
95  }
96  // Allocate new memory
97  External_element_pt = new FiniteElement*[n_external_element_storage];
98 
99  // Initialise all new pointers to zero
100  for (unsigned i = 0; i < n_external_element_storage; i++)
101  {
102  External_element_pt[i] = 0;
103  }
104 
105  // Alloacte storage for local coordinates
106  // Delete old storage, if needed
108  {
110  }
111  // Allocate the new memory
113  new Vector<double>[n_external_element_storage];
114 
115  // Finally record how much memory we have allocated
116  Nexternal_element_storage = n_external_element_storage;
117  Nintpt = n_intpt;
118  }
119  }

References External_element_local_coord, External_element_pt, i, oomph::FiniteElement::integral_pt(), Nexternal_element_storage, Ninteraction, Nintpt, and oomph::Integral::nweight().

Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().

◆ nexternal_interaction_field_data()

unsigned oomph::ElementWithExternalElement::nexternal_interaction_field_data ( ) const
inline

Return the number of Data items that affect the external interactions in this element. This includes e.g. fluid velocities and pressures in adjacent fluid elements in an FSI problem

206  {
208  }

References Nexternal_interaction_field_data.

Referenced by assign_external_interaction_data_local_eqn_numbers(), oomph::GeneralisedElement::assign_local_eqn_numbers(), describe_local_dofs(), oomph::FSIWallElement::describe_local_dofs(), external_interaction_field_data_pt(), and fill_in_jacobian_from_external_interaction_field_by_fd().

◆ nexternal_interaction_geometric_data()

unsigned oomph::ElementWithExternalElement::nexternal_interaction_geometric_data ( ) const
inline

Return the number of geometric Data items that affect the external interactions in this element: i.e. any geometric Data in the problem that affects the nodal positions in the external elements.

233  {
235  }

References Nexternal_interaction_geometric_data.

Referenced by assign_external_interaction_data_local_eqn_numbers(), oomph::GeneralisedElement::assign_local_eqn_numbers(), describe_local_dofs(), oomph::FSIWallElement::describe_local_dofs(), external_interaction_geometric_data_pt(), and fill_in_jacobian_from_external_interaction_geometric_by_fd().

◆ ninteraction()

◆ operator=()

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

Broken assignment operator.

◆ output_external_elements()

void oomph::ElementWithExternalElement::output_external_elements ( std::ostream &  outfile,
const unsigned interaction_index 
)

Output by plotting vector from integration point to corresponding point in external element for specified interaction index

800  {
801  // Dimension of element
802  unsigned n_dim_el = dim();
803  Vector<double> s(n_dim_el);
804 
805  // Vectors for coordintes
806  unsigned n_dim = node_pt(0)->ndim();
807  Vector<double> x(n_dim);
808  Vector<double> x_ext(n_dim);
809 
810  // Loop over the integration points
811  const unsigned n_intpt = this->integral_pt()->nweight();
812  outfile << "ZONE I=" << n_intpt << std::endl;
813  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
814  {
815  for (unsigned i = 0; i < n_dim_el; i++)
816  {
817  s[i] = integral_pt()->knot(ipt, i);
818  }
819 
820  // Eulerian coordinates of integration point
821  interpolated_x(s, x);
822 
823  // Get pointer to external element
824  FiniteElement* ext_el_pt = external_element_pt(interaction_index, ipt);
825  // Get local coordinate in external element
826  Vector<double> s_ext(
827  external_element_local_coord(interaction_index, ipt));
828 
829  // Eulerian coordinates of point in external element
830  ext_el_pt->interpolated_x(s_ext, x_ext);
831 
832  // Output coords of interation point
833  for (unsigned i = 0; i < n_dim; i++)
834  {
835  outfile << x[i] << " ";
836  }
837  // Write vector to point in external element
838  for (unsigned i = 0; i < n_dim; i++)
839  {
840  outfile << x_ext[i] - x[i] << " ";
841  }
842  outfile << std::endl;
843  }
844  }
Vector< double > & external_element_local_coord(const unsigned &interaction_index, const unsigned &ipt)
Definition: element_with_external_element.h:136
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
unsigned dim() const
Definition: elements.h:2611
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
RealScalar s
Definition: level1_cplx_impl.h:130
list x
Definition: plotDoE.py:28

References oomph::FiniteElement::dim(), external_element_local_coord(), external_element_pt(), i, oomph::FiniteElement::integral_pt(), oomph::FiniteElement::interpolated_x(), oomph::Integral::knot(), oomph::Node::ndim(), oomph::FiniteElement::node_pt(), oomph::Integral::nweight(), s, and plotDoE::x.

◆ range_check()

void oomph::ElementWithExternalElement::range_check ( const unsigned interaction_index,
const unsigned ipt 
) const
inlineprivate

Helper function for range checking in the access functions.

548  {
549  // Boolean flag used to indicate range error
550  bool range_error = false;
551  // String for the error message
552  std::ostringstream error_message;
553  // If there is a range error in the interaction index
554  if (interaction_index >= Ninteraction)
555  {
556  error_message << "Range Error: Interaction " << interaction_index
557  << " is not in the range (0," << Ninteraction - 1 << ")";
558  // There has been a range error
559  range_error = true;
560  }
561 
562  // If there is a range error in the integration point
563  if (ipt >= Nintpt)
564  {
565  error_message << "Range Error: Integration point " << ipt
566  << " is not in the range (0," << Nintpt - 1 << ")";
567  range_error = true;
568  }
569 
570 
571  // If there has been a range error report it
572  if (range_error)
573  {
574  throw OomphLibError(error_message.str(),
577  }
578  }

References Ninteraction, Nintpt, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by external_element_local_coord(), and external_element_pt().

◆ reset_after_external_interaction_field_fd()

virtual void oomph::ElementWithExternalElement::reset_after_external_interaction_field_fd ( )
inlineprotectedvirtual

Function that is call after the finite differencing of the external interaction data associated with external fields This may be overloaded to reset any dependent variables that may have changed during the finite differencing.

Reimplemented in oomph::FSIWallElement.

456 {}

Referenced by fill_in_jacobian_from_external_interaction_field_by_fd().

◆ reset_after_external_interaction_geometric_fd()

virtual void oomph::ElementWithExternalElement::reset_after_external_interaction_geometric_fd ( )
inlineprotectedvirtual

Function that is call after the finite differencing of the external interaction data associated with external geometry. This may be overloaded to reset any dependent variables that may have changed during the finite differencing.

Reimplemented in oomph::FSIWallElement, and oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >.

487 {}

Referenced by fill_in_jacobian_from_external_interaction_geometric_by_fd().

◆ reset_in_external_interaction_field_fd()

virtual void oomph::ElementWithExternalElement::reset_in_external_interaction_field_fd ( const unsigned i)
inlineprotectedvirtual

Function called within the finite difference loop for external interaction data after the values in the i-th external interaction data object associated with external fields are reset. The default behaviour is to call the update function.

Reimplemented in oomph::FSIWallElement.

472  {
474  }

References i, and update_in_external_interaction_field_fd().

Referenced by fill_in_jacobian_from_external_interaction_field_by_fd().

◆ reset_in_external_interaction_geometric_fd()

virtual void oomph::ElementWithExternalElement::reset_in_external_interaction_geometric_fd ( const unsigned i)
inlineprotectedvirtual

Function called within the finite difference loop for external interaction data after the values in the i-th external interaction data object associated with external geometry are reset. The default behaviour is to call the update function.

Reimplemented in oomph::FSIWallElement, and oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >.

References i, and update_in_external_interaction_geometric_fd().

Referenced by fill_in_jacobian_from_external_interaction_geometric_by_fd().

◆ set_ninteraction()

void oomph::ElementWithExternalElement::set_ninteraction ( const unsigned n_interaction)
inline

Set the number of interactions in the element This function is usually called in the specific element's constructor

179  {
180  Ninteraction = n_interaction;
181  }

References Ninteraction.

Referenced by oomph::AdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::AdvectionDiffusionBoussinesqElement(), oomph::ProjectableElement< ELEMENT >::disable_projection(), oomph::FSIWallElement::enable_fluid_loading_on_both_sides(), oomph::ProjectableElement< ELEMENT >::enable_projection(), oomph::FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::FourierDecomposedHelmholtzFluxFromNormalDisplacementBCElement(), oomph::FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::FourierDecomposedTimeHarmonicLinElastLoadedByHelmholtzPressureBCElement(), oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >::FSIAxisymFoepplvonKarmanElement(), oomph::FSIAxisymmetricLinearElasticityTractionElement< ELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::FSIAxisymmetricLinearElasticityTractionElement(), oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::FSIImposeDisplacementByLagrangeMultiplierElement(), oomph::FSILinearisedAxisymPoroelasticTractionElement< POROELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::FSILinearisedAxisymPoroelasticTractionElement(), oomph::HeatedPenetratorFluxElement< ELEMENT >::HeatedPenetratorFluxElement(), oomph::HelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::HelmholtzFluxFromNormalDisplacementBCElement(), oomph::LinearisedAxisymPoroelasticBJS_FSIElement< FLUID_BULK_ELEMENT, POROELASTICITY_BULK_ELEMENT >::LinearisedAxisymPoroelasticBJS_FSIElement(), oomph::LinearisedFSIAxisymmetricNStNoSlipBCElementElement< FLUID_BULK_ELEMENT, SOLID_BULK_ELEMENT >::LinearisedFSIAxisymmetricNStNoSlipBCElementElement(), oomph::NavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::NavierStokesBoussinesqElement(), oomph::PMLHelmholtzFluxFromNormalDisplacementBCElement< HELMHOLTZ_BULK_ELEMENT, ELASTICITY_BULK_ELEMENT >::PMLHelmholtzFluxFromNormalDisplacementBCElement(), oomph::RefineableAdvectionDiffusionBoussinesqElement< AD_ELEMENT, NST_ELEMENT >::RefineableAdvectionDiffusionBoussinesqElement(), oomph::RefineableNavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::RefineableNavierStokesBoussinesqElement(), oomph::FSIWallElement::setup_fsi_wall_element(), oomph::TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement(), and oomph::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement< ELASTICITY_BULK_ELEMENT, HELMHOLTZ_BULK_ELEMENT >::TimeHarmonicLinElastLoadedByPMLHelmholtzPressureBCElement().

◆ storage_has_been_allocated()

bool oomph::ElementWithExternalElement::storage_has_been_allocated ( ) const
inline

Helper function to check if storage has actually been allocated.

91  {
92  // If either of the storage arrays is zero, then storage has not
93  // yet been allocated. Both arrays are allocated at once, so
94  // if one is zero both will (should) be
96  {
97  return false;
98  }
99  else
100  {
101  return true;
102  }
103  }

References External_element_local_coord, and External_element_pt.

◆ update_before_external_interaction_field_fd()

virtual void oomph::ElementWithExternalElement::update_before_external_interaction_field_fd ( )
inlineprotectedvirtual

Function that is called before the finite differencing of any external interaction data associated with external fields. This may be overloaded to update any dependent data before finite differencing takes place.

450 {}

Referenced by fill_in_jacobian_from_external_interaction_field_by_fd().

◆ update_before_external_interaction_geometric_fd()

virtual void oomph::ElementWithExternalElement::update_before_external_interaction_geometric_fd ( )
inlineprotectedvirtual

Function that is called before the finite differencing of any external interaction data associated with external geometry. This may be overloaded to update any dependent data before finite differencing takes place.

Reimplemented in oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >.

481 {}

Referenced by fill_in_jacobian_from_external_interaction_geometric_by_fd().

◆ update_in_external_interaction_field_fd()

virtual void oomph::ElementWithExternalElement::update_in_external_interaction_field_fd ( const unsigned i)
inlineprotectedvirtual

Function called within the finite difference loop for external interaction data after a change in any values in the i-th external interaction data object associated with external fields.

Reimplemented in oomph::FSIWallElement.

463  {
464  }

Referenced by fill_in_jacobian_from_external_interaction_field_by_fd(), and reset_in_external_interaction_field_fd().

◆ update_in_external_interaction_geometric_fd()

virtual void oomph::ElementWithExternalElement::update_in_external_interaction_geometric_fd ( const unsigned i)
inlineprotectedvirtual

Function called within the finite difference loop for external interaction data after a change in any values in the i-th external interaction data object associated with external geometry.

Reimplemented in oomph::FSIWallElement, and oomph::FSIAxisymFoepplvonKarmanElement< NNODE_1D, FLUID_ELEMENT >.

494  {
495  }

Referenced by fill_in_jacobian_from_external_interaction_geometric_by_fd(), and reset_in_external_interaction_geometric_fd().

Member Data Documentation

◆ Add_external_geometric_data

bool oomph::ElementWithExternalElement::Add_external_geometric_data
protected

◆ Add_external_interaction_data

◆ External_element_local_coord

Vector<double>* oomph::ElementWithExternalElement::External_element_local_coord
private

Storage for vectors of local coordinates in external elements that correspond to the appropriate integration / point.

Referenced by check_storage_allocated(), external_element_local_coord(), flush_all_external_element_storage(), initialise_external_element_storage(), and storage_has_been_allocated().

◆ External_element_pt

FiniteElement** oomph::ElementWithExternalElement::External_element_pt
private

Storage for pointers to elements that provide contributions to the residuals of the current element. Potentially a different element contributes to each integration point.

Referenced by check_storage_allocated(), external_element_pt(), flush_all_external_element_storage(), initialise_external_element_storage(), and storage_has_been_allocated().

◆ External_interaction_field_data_index

unsigned* oomph::ElementWithExternalElement::External_interaction_field_data_index
private

Storage for the index of the values in the external field data that affect the interactions in the element

Referenced by assign_external_interaction_data_local_eqn_numbers(), fill_in_jacobian_from_external_interaction_field_by_fd(), and ~ElementWithExternalElement().

◆ External_interaction_field_data_local_eqn

int* oomph::ElementWithExternalElement::External_interaction_field_data_local_eqn
private

Storage for the local equation number associated with the external field data the affect the interactions in the element

Referenced by assign_external_interaction_data_local_eqn_numbers(), fill_in_jacobian_from_external_interaction_field_by_fd(), and ~ElementWithExternalElement().

◆ External_interaction_field_data_pt

Data** oomph::ElementWithExternalElement::External_interaction_field_data_pt
protected

◆ External_interaction_geometric_data_index

unsigned* oomph::ElementWithExternalElement::External_interaction_geometric_data_index
private

Storage for the index of the values in the external geometric data that affect the interactions in the element

Referenced by assign_external_interaction_data_local_eqn_numbers(), fill_in_jacobian_from_external_interaction_geometric_by_fd(), and ~ElementWithExternalElement().

◆ External_interaction_geometric_data_local_eqn

int* oomph::ElementWithExternalElement::External_interaction_geometric_data_local_eqn
private

Storage for the local equation number associated with the external geometric data the affect the interactions in the element

Referenced by assign_external_interaction_data_local_eqn_numbers(), fill_in_jacobian_from_external_interaction_geometric_by_fd(), and ~ElementWithExternalElement().

◆ External_interaction_geometric_data_pt

Data** oomph::ElementWithExternalElement::External_interaction_geometric_data_pt
protected

◆ Nexternal_element_storage

unsigned oomph::ElementWithExternalElement::Nexternal_element_storage
private

Number of entries in the external element storage schemes (Nintergation_pt * Ninteraction)

Referenced by flush_all_external_element_storage(), and initialise_external_element_storage().

◆ Nexternal_interaction_field_data

unsigned oomph::ElementWithExternalElement::Nexternal_interaction_field_data
private

Number of external interaction field data.

Referenced by assign_external_interaction_data_local_eqn_numbers(), and nexternal_interaction_field_data().

◆ Nexternal_interaction_geometric_data

unsigned oomph::ElementWithExternalElement::Nexternal_interaction_geometric_data
private

Number of external interaction geometric data.

Referenced by assign_external_interaction_data_local_eqn_numbers(), and nexternal_interaction_geometric_data().

◆ Ninteraction

unsigned oomph::ElementWithExternalElement::Ninteraction
private

◆ Nintpt

unsigned oomph::ElementWithExternalElement::Nintpt
private

Number of intergation point in the element.

Referenced by external_element_local_coord(), external_element_pt(), initialise_external_element_storage(), and range_check().


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