30 #ifndef OOMPH_ELEMENT_WITH_EXTERNAL_ELEMENT_HEADER
31 #define OOMPH_ELEMENT_WITH_EXTERNAL_ELEMENT_HEADER
35 #include <oomph-lib-config.h>
113 #ifdef RANGE_CHECKING
122 const unsigned& ipt)
const
127 #ifdef RANGE_CHECKING
137 const unsigned& interaction_index,
const unsigned& ipt)
142 #ifdef RANGE_CHECKING
150 const unsigned& interaction_index,
const unsigned& ipt)
const
155 #ifdef RANGE_CHECKING
166 const unsigned& interaction_index);
192 Vector<std::set<FiniteElement*>>
const& external_elements_pt,
193 std::set<std::pair<Data*, unsigned>>& paired_interaction_data);
198 Vector<std::set<FiniteElement*>>
const& external_elements_pt,
199 std::set<Data*>& external_geometric_data_pt);
215 const unsigned n_external_interaction_field_data =
219 for (
unsigned i = 0;
i < n_external_interaction_field_data;
i++)
254 const unsigned n_external_interaction_geometric_data =
257 Vector<Data*> temp_data(n_external_interaction_geometric_data);
258 for (
unsigned i = 0;
i < n_external_interaction_geometric_data;
i++)
321 const bool& store_local_dof_pt)
337 const bool& store_local_dof_pt);
363 const unsigned n_dof = this->
ndof();
388 const unsigned n_dof = this->
ndof();
414 const unsigned n_dof = this->
ndof();
433 const unsigned n_dof = this->
ndof();
530 std::ostringstream 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";
541 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
547 const unsigned& ipt)
const
550 bool range_error =
false;
552 std::ostringstream error_message;
556 error_message <<
"Range Error: Interaction " << interaction_index
557 <<
" is not in the range (0," <<
Ninteraction - 1 <<
")";
565 error_message <<
"Range Error: Integration point " << ipt
566 <<
" is not in the range (0," <<
Nintpt - 1 <<
")";
575 OOMPH_CURRENT_FUNCTION,
576 OOMPH_EXCEPTION_LOCATION);
A class that represents a collection of data; each Data object may contain many different individual ...
This is a base class for all elements that require external sources (e.g. FSI, multi-domain problems ...
virtual void update_before_external_interaction_field_fd()
Function that is called before the finite differencing of any external interaction data associated wi...
void output_external_elements(std::ostream &outfile, const unsigned &interaction_index)
Output by plotting vector from integration point to corresponding point in external element for speci...
ElementWithExternalElement(const ElementWithExternalElement &)=delete
Broken copy constructor.
unsigned Nexternal_interaction_field_data
Number of external interaction field data.
Vector< double > & external_element_local_coord(const unsigned &interaction_index, const unsigned &ipt)
Access function to get source element's local coords for specified interaction index at specified int...
FiniteElement *const & external_element_pt(const unsigned &interaction_index, const unsigned &ipt) const
Access function to source element, const version.
bool storage_has_been_allocated() const
Helper function to check if storage has actually been allocated.
void set_ninteraction(const unsigned &n_interaction)
Set the number of interactions in the element This function is usually called in the specific element...
bool external_geometric_data_is_included() const
Is the external geometric data taken into account when forming the Jacobian?
void initialise_external_element_storage()
Initialise storage for pointers to external elements and their local coordinates. This must be called...
void include_external_geometric_data()
Do include external geometric data when computing the element's Jacobian. This function should be cal...
unsigned Nexternal_element_storage
Number of entries in the external element storage schemes (Nintergation_pt * Ninteraction)
virtual void update_before_external_interaction_geometric_fd()
Function that is called before the finite differencing of any external interaction data associated wi...
void operator=(const ElementWithExternalElement &)=delete
Broken assignment operator.
void describe_local_dofs(std::ostream &out, const std::string &curr_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
virtual void reset_in_external_interaction_geometric_fd(const unsigned &i)
Function called within the finite difference loop for external interaction data after the values in t...
FiniteElement *& external_element_pt(const unsigned &interaction_index, const unsigned &ipt)
Access function to source element for specified interaction index at specified integration point.
unsigned Nexternal_interaction_geometric_data
Number of external interaction geometric data.
virtual void reset_after_external_interaction_field_fd()
Function that is call after the finite differencing of the external interaction data associated with ...
virtual void identify_all_geometric_data_for_external_interaction(Vector< std::set< FiniteElement * >> const &external_elements_pt, std::set< Data * > &external_geometric_data_pt)
Function that must return all geometric data involved in the desired interactions from the external e...
bool add_external_geometric_data()
Are we including external geometric data in the element's Jacobian.
unsigned nexternal_interaction_geometric_data() const
Return the number of geometric Data items that affect the external interactions in this element: i....
unsigned * External_interaction_field_data_index
Storage for the index of the values in the external field data that affect the interactions in the el...
void fill_in_jacobian_from_external_interaction_field_by_fd(DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the enternal interaction degrees of freedom associat...
unsigned nexternal_interaction_field_data() const
Return the number of Data items that affect the external interactions in this element....
virtual void reset_in_external_interaction_field_fd(const unsigned &i)
Function called within the finite difference loop for external interaction data after the values in t...
virtual ~ElementWithExternalElement()
The destructor, clean up any allocated memory.
void ignore_external_interaction_data()
Do not include any external interaction data when computing the element's Jacobian.
void fill_in_jacobian_from_external_interaction_field_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the external interaction degrees of freedom associat...
void check_storage_allocated() const
Helper function to check that storage has actually been allocated.
FiniteElement ** External_element_pt
Storage for pointers to elements that provide contributions to the residuals of the current element....
void range_check(const unsigned &interaction_index, const unsigned &ipt) const
Helper function for range checking in the access functions.
Data ** External_interaction_field_data_pt
/ Storage for pointers to external field Data that affect the interactions in the elemenet
Vector< Data * > external_interaction_field_data_pt() const
Return vector of pointers to the field Data objects that affect the interactions on the element.
Vector< double > * External_element_local_coord
Storage for vectors of local coordinates in external elements that correspond to the appropriate inte...
int * External_interaction_field_data_local_eqn
Storage for the local equation number associated with the external field data the affect the interact...
void fill_in_jacobian_from_external_interaction_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from all external interaction degrees of freedom (geometr...
void fill_in_jacobian_from_external_interaction_by_fd(DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from all enternal interaction degrees of freedom (geometr...
virtual void reset_after_external_interaction_geometric_fd()
Function that is call after the finite differencing of the external interaction data associated with ...
bool Add_external_geometric_data
Boolean flag to indicate whether to include the external geometric data.
bool add_external_interaction_data()
Are we including external data in the element's Jacobian.
void include_external_interaction_data()
Do include external geometric data when computing the element's Jacobian This function should be call...
virtual void update_in_external_interaction_geometric_fd(const unsigned &i)
Function called within the finite difference loop for external interaction data after a change in any...
Data ** External_interaction_geometric_data_pt
/ Storage for pointers to external geometric Data that affect the interactions in the elemenet
void assign_internal_and_external_local_eqn_numbers(const bool &store_local_dof_pt)
Overload the assign internal and external local equation number scheme so that the interaction data i...
unsigned * External_interaction_geometric_data_index
Storage for the index of the values in the external geometric data that affect the interactions in th...
bool Add_external_interaction_data
Boolean flag to indicate whether to include the external data.
void fill_in_jacobian_from_external_interaction_geometric_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the external interaction degrees of freedom associat...
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)
Function that must return all the data involved in the desired interactions from the external element...
void ignore_external_geometric_data()
Do not include any external geometric data when computing the element's Jacobian. This function shoul...
unsigned ninteraction() const
Return the number of interactions in the element.
Vector< Data * > external_interaction_geometric_data_pt() const
Return vector of pointers to the geometric Data objects that affect the interactions on the element.
void fill_in_jacobian_from_external_interaction_geometric_by_fd(DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the external interaction degrees of freedom associat...
void assign_external_interaction_data_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for those Data values involved in the external interactions that af...
unsigned Nintpt
Number of intergation point in the element.
unsigned Ninteraction
Number of interactions.
int * External_interaction_geometric_data_local_eqn
Storage for the local equation number associated with the external geometric data the affect the inte...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the element's contribution to the Jacobian matrix and the residual vector: Done by finite dif...
virtual void update_in_external_interaction_field_fd(const unsigned &i)
Function called within the finite difference loop for external interaction data after a change in any...
ElementWithExternalElement()
Constructor. Initialise member data and pointers to data associated with the external elements to zer...
void flush_all_external_element_storage()
Flush the storage for external elements.
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.
A general Finite Element class.
virtual void fill_in_jacobian_from_nodal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the nodal degrees of freedom using finite difference...
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the external degrees of freedom using finite differe...
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the elemental contribution to the residuals vector. Note that this function will NOT initialise t...
void fill_in_jacobian_from_internal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the internal degrees of freedom using finite differe...
unsigned ndof() const
Return the number of equations/dofs in the element.
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
virtual void assign_internal_and_external_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for the internal and external Data This must be called after the gl...
An OomphLibError object which should be thrown when an run-time error is encountered....
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...