29 #ifndef OOMPH_HIJACKED_ELEMENTS_HEADER
30 #define OOMPH_HIJACKED_ELEMENTS_HEADER
130 template<
class ELEMENT>
147 const int& face_index,
148 const unsigned&
id = 0)
162 const bool& return_data =
true)
165 Data* temp_data_pt = 0;
172 temp_data_pt =
new HijackedData(
i, this->internal_data_pt(n));
190 const bool& return_data =
true)
193 Data* temp_data_pt = 0;
199 temp_data_pt =
new HijackedData(
i, this->external_data_pt(n));
216 const bool& return_data =
true)
219 Data* temp_data_pt = 0;
242 const bool& return_data =
true)
246 if (solid_node_pt == 0)
248 std::string error_message =
"Failed to cast to SolidNode\n ";
249 error_message +=
"You may be trying to hijack a non-elastic element\n";
252 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
256 Data* temp_data_pt = 0;
281 const bool& return_data =
true)
285 if (spine_node_pt == 0)
287 std::string error_message =
"Failed to cast to SpineNode\n ";
288 error_message +=
"You may be trying to hijack a non-spine element\n";
291 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
295 Data* temp_data_pt = 0;
336 ELEMENT::assign_local_eqn_numbers(store_local_dof_pt);
345 unsigned n_dof = this->ndof();
346 for (
unsigned i = 0;
i < n_dof;
i++)
349 for (std::set<long*>::iterator it =
359 unsigned long hijacked_eqn_number = *(*it);
363 if (hijacked_eqn_number == this->eqn_number(
i))
380 ELEMENT::get_residuals(residuals);
384 for (
unsigned i = 0;
i < n_hijacked;
i++)
398 ELEMENT::get_jacobian(residuals, jacobian);
401 unsigned n_dof = this->ndof();
402 for (
unsigned i = 0;
i < n_hijacked;
i++)
409 for (
unsigned j = 0; j < n_dof; j++)
423 template<
class ELEMENT>
437 template<
class ELEMENT>
452 template<
class ELEMENT>
A class that represents a collection of data; each Data object may contain many different individual ...
long * eqn_number_pt(const unsigned &i)
Return the pointer to the equation number of the i-th stored variable.
FaceGeometry()
Constructor.
FaceGeometry()
Constructor.
FaceGeometry()
Constructor.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
Custom Data class that is used when HijackingData. The class always contains a single value that is c...
HijackedElement base class that provides storage and access funcitons for pointers to the global equa...
void unhijack_all_data()
Reset the hijacked data pt, so that none of the equations in the element are hijacked.
double * Residual_multiplier_pt
Pointer to a double that multiplies the contribution to the residuals from the original element....
const double & residual_multiplier() const
Return the value of the residual multiplier.
double *& residual_multiplier_pt()
Return the pointer to the residual multiplier.
std::set< long * > * Hijacked_global_eqn_number_pt
Pointer to a Set of pointers to the equation numbers that will be hijacked by this element....
void unhijack_global_eqn(long *const &global_eqn_pt)
The global equation, addressed by global_eqn_pt, is no longer hijacked by this element.
void hijack_global_eqn(long *const &global_eqn_pt)
Mark the global equation, addressed by global_eqn_pt, as hijacked by this element.
HijackedElementBase()
Constructor, initialise the pointer to the equation numbers for the storage to zero.
Vector< int > * Hijacked_local_eqn_number_pt
Pointer to a vector of integers containing the local equation numbers of any hijacked variables in th...
virtual ~HijackedElementBase()
Destructor, destroy the storage for the equation numbers.
static double Default_residual_multiplier
Static default value for the double that multiplies the original residuals.
Hijacked elements are elements in which one or more Data values that affect the element's residuals,...
void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Get the residuals and Jacobian matrix from the underlying element, but then wipe the entries in the r...
Data * hijack_nodal_position_value(const unsigned &n, const unsigned &i, const bool &return_data=true)
Hijack the i-th positional value stored at node n. Optionaly return a custom-made (copied) data objec...
Data * hijack_nodal_spine_value(const unsigned &n, const unsigned &i, const bool &return_data=true)
Hijack the i-th value stored at the spine that affects local node n. Optionally return a custom-made ...
Hijacked(FiniteElement *const &element_pt, const int &face_index)
Constructor used for hijacking face elements.
Data * hijack_internal_value(const unsigned &n, const unsigned &i, const bool &return_data=true)
Hijack the i-th value stored at internal data n. Optionally return a custom-made (copied) data object...
Data * hijack_external_value(const unsigned &n, const unsigned &i, const bool &return_data=true)
Hijack the i-th value stored at external data n. Optionally return a custom-made (copied) data object...
Hijacked()
Constructor, call the constructors of the base elements.
Hijacked(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Constructor used for hijacking face elements with specification of ID of additional variables.
Data * hijack_nodal_value(const unsigned &n, const unsigned &i, const bool &return_data=true)
Hijack the i-th value stored at node n. Optionally return a custom-made (copied) data object that con...
void get_residuals(Vector< double > &residuals)
Get the residuals from the underlying element, but then wipe the entries in the residual vector that ...
void assign_local_eqn_numbers(const bool &store_local_dof_pt)
Set up the local equation numbers for the underlying element, then set up the local arrays to hold th...
An OomphLibError object which should be thrown when an run-time error is encountered....
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
Class for nodes that live on spines. The assumption is that each Node lies at a fixed fraction on a s...
Spine *& spine_pt()
Access function to spine.
Data *& spine_height_pt()
Access function to Data object that stores the spine height.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...