34 #ifndef OOMPH_ELEMENT_WITH_EXTERNAL_ELEMENT_HEADER 35 #define OOMPH_ELEMENT_WITH_EXTERNAL_ELEMENT_HEADER 39 #include <oomph-lib-config.h> 123 #ifdef RANGE_CHECKING 132 const unsigned &ipt)
const 137 #ifdef RANGE_CHECKING 147 const unsigned &interaction_index,
153 #ifdef RANGE_CHECKING 161 (
const unsigned &interaction_index,
const unsigned &ipt)
const 166 #ifdef RANGE_CHECKING 177 const unsigned &interaction_index);
198 Vector<std::set<FiniteElement*> >
const &external_elements_pt,
199 std::set<std::pair<Data*,unsigned> > &paired_interaction_data);
204 Vector<std::set<FiniteElement*> >
const &external_elements_pt,
205 std::set<Data*> &external_geometric_data_pt);
219 const unsigned n_external_interaction_field_data =
223 for(
unsigned i=0;
i<n_external_interaction_field_data;
i++)
250 const unsigned n_external_interaction_geometric_data =
253 Vector<Data*> temp_data(n_external_interaction_geometric_data);
254 for(
unsigned i=0;
i<n_external_interaction_geometric_data;
i++)
305 const bool &store_local_dof_pt)
321 const bool &store_local_dof_pt);
347 const unsigned n_dof = this->
ndof();
373 const unsigned n_dof = this->
ndof();
399 const unsigned n_dof = this->
ndof();
418 const unsigned n_dof = this->
ndof();
508 std::ostringstream error_stream;
510 <<
"Storage for the external elements has not been allocated.\n" 511 <<
"initialise_external_element_storage() must be called.\n" 512 <<
"This tends to be done automatically during the multi-domain\n" 513 <<
"setup procedures -- you're most likely to get this error\n" 514 <<
"because you have not specified the number of interactions\n" 515 <<
"that your ElementWithExternalElement is involved in.\n" 516 <<
"You ought to specify this with a call to\n\n" 517 <<
" ElementWithExternalElement::set_ninteraction(...)\n\n";
520 OOMPH_CURRENT_FUNCTION,
521 OOMPH_EXCEPTION_LOCATION);
526 void range_check(
const unsigned& interaction_index,
const unsigned& ipt)
530 bool range_error =
false;
532 std::ostringstream error_message;
536 error_message <<
"Range Error: Interaction " << interaction_index
537 <<
" is not in the range (0," 546 error_message <<
"Range Error: Integration point " << ipt
547 <<
" is not in the range (0," 557 OOMPH_CURRENT_FUNCTION,
558 OOMPH_EXCEPTION_LOCATION);
void initialise_external_element_storage()
Initialise storage for pointers to external elements and their local coordinates. This must be called...
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
Vector< Data * > external_interaction_geometric_data_pt() const
Return vector of pointers to the geometric Data objects that affect the interactions on the element...
Data ** External_interaction_field_data_pt
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...
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...
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...
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...
int * External_interaction_field_data_local_eqn
Storage for the local equation number associated with the external field data the affect the interact...
void flush_all_external_element_storage()
Flush the storage for external elements.
bool Add_external_interaction_data
Boolean flag to indicate whether to include the external data.
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...
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...
A general Finite Element class.
virtual void reset_after_external_interaction_geometric_fd()
Function that is call after the finite differencing of the external interaction data associated with ...
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 set_ninteraction(const unsigned &n_interaction)
Set the number of interactions in the element This function is usually called in the specific element...
int * External_interaction_geometric_data_local_eqn
Storage for the local equation number associated with the external geometric data the affect the inte...
void check_storage_allocated() const
Helper function to check that storage has actually been allocated.
ElementWithExternalElement()
Constructor. Initialise member data and pointers to data associated with the external elements to zer...
Vector< Data * > external_interaction_field_data_pt() const
Return vector of pointers to the field Data objects that affect the interactions on the element...
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...
void ignore_external_interaction_data()
Do not include any external interaction data when computing the element's Jacobian.
unsigned Nexternal_element_storage
Number of entries in the external element storage schemes (Nintergation_pt * Ninteraction) ...
unsigned ndof() const
Return the number of equations/dofs in the element.
bool add_external_geometric_data()
Are we including external geometric data in the element's Jacobian.
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...
bool Add_external_geometric_data
Boolean flag to indicate whether to include the external geometric data.
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 Nexternal_interaction_geometric_data
Number of external interaction geometric data.
unsigned * External_interaction_geometric_data_index
Storage for the index of the values in the external geometric data that affect the interactions in th...
A class that represents a collection of data; each Data object may contain many different individual ...
unsigned nexternal_interaction_field_data() const
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.
unsigned nexternal_interaction_geometric_data() const
Return the number of geometric Data items that affect the external interactions in this element: i...
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...
unsigned Ninteraction
Number of interactions.
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...
Vector< double > * External_element_local_coord
Storage for vectors of local coordinates in external elements that correspond to the appropriate inte...
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...
unsigned ninteraction() const
Return the number of interactions in the element.
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_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
bool add_external_interaction_data()
Are we including external data in the element's Jacobian.
void operator=(const ElementWithExternalElement &)
Broken assignment operator.
FiniteElement ** External_element_pt
Storage for pointers to elements that provide contributions to the residuals of the current element...
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...
ElementWithExternalElement(const ElementWithExternalElement &)
Broken copy constructor.
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_interaction_geometric_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the external interaction degrees of freedom associat...
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
virtual void update_before_external_interaction_field_fd()
Function that is called before the finite differencing of any external interaction data associated wi...
unsigned Nintpt
Number of intergation point in the element.
FiniteElement *& external_element_pt(const unsigned &interaction_index, const unsigned &ipt)
Access function to source element for specified interaction index at specified integration point...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void ignore_external_geometric_data()
Do not include any external geometric data when computing the element's Jacobian. This function shoul...
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...
bool storage_has_been_allocated() const
Helper function to check if storage has actually been allocated.
virtual void update_before_external_interaction_geometric_fd()
Function that is called before the finite differencing of.
void range_check(const unsigned &interaction_index, const unsigned &ipt) const
Helper function for range checking in the access functions.
virtual void reset_after_external_interaction_field_fd()
Function that is call after the finite differencing of the external interaction data associated with ...
FiniteElement *const & external_element_pt(const unsigned &interaction_index, const unsigned &ipt) const
Access function to source element, const version.
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 ...
bool external_geometric_data_is_included() const
Is the external geometric data taken into account when forming the Jacobian?
Data ** External_interaction_geometric_data_pt
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...
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...
void include_external_geometric_data()
Do include external geometric data when computing the element's Jacobian. This function should be cal...
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...
virtual ~ElementWithExternalElement()
The destructor, clean up any allocated memory.
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...