33 #ifndef OOMPH_HIJACKED_ELEMENTS_HEADER 34 #define OOMPH_HIJACKED_ELEMENTS_HEADER 129 template<
class ELEMENT>
140 ELEMENT(element_pt, face_index),
147 const int &face_index,
148 const unsigned &
id=0) :
149 ELEMENT(element_pt, face_index,id),
160 const bool &return_data=
true)
163 Data *temp_data_pt = 0;
168 {temp_data_pt =
new HijackedData(i,this->internal_data_pt(n));}
184 const bool &return_data=
true)
187 Data *temp_data_pt = 0;
191 {temp_data_pt =
new HijackedData(i,this->external_data_pt(n));}
206 const bool &return_data=
true)
209 Data *temp_data_pt = 0;
229 const bool &return_data=
true)
233 if(solid_node_pt == 0)
235 std::string error_message =
"Failed to cast to SolidNode\n ";
237 "You may be trying to hijack a non-elastic element\n";
240 OOMPH_CURRENT_FUNCTION,
241 OOMPH_EXCEPTION_LOCATION);
245 Data *temp_data_pt = 0;
265 const bool &return_data=
true)
269 if(spine_node_pt == 0)
271 std::string error_message =
"Failed to cast to SpineNode\n ";
273 "You may be trying to hijack a non-spine element\n";
276 OOMPH_CURRENT_FUNCTION,
277 OOMPH_EXCEPTION_LOCATION);
281 Data *temp_data_pt = 0;
287 spine_pt()->spine_height_pt());
292 spine_height_pt()->eqn_number_pt(i));
317 ELEMENT::assign_local_eqn_numbers(store_local_dof_pt);
326 unsigned n_dof = this->ndof();
327 for(
unsigned i=0;
i<n_dof;
i++)
339 unsigned long hijacked_eqn_number= *(*it);
343 if(hijacked_eqn_number == this->eqn_number(
i))
360 ELEMENT::get_residuals(residuals);
364 for(
unsigned i=0;
i<n_hijacked;
i++)
379 ELEMENT::get_jacobian(residuals,jacobian);
382 unsigned n_dof = this->ndof();
383 for(
unsigned i=0;
i<n_hijacked;
i++)
390 for(
unsigned j=0;j<n_dof;j++)
406 template<
class ELEMENT>
422 template<
class ELEMENT>
438 template<
class ELEMENT>
Hijacked()
Constructor, call the constructors of the base elements.
FaceGeometry()
Constructor.
void hijack_global_eqn(long *const &global_eqn_pt)
Mark the global equation, addressed by global_eqn_pt, as hijacked by this element.
long * eqn_number_pt(const unsigned &i)
Return the pointer to the equation number of the i-th stored variable.
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.
A general Finite Element class.
Custom Data class that is used when HijackingData. The class always contains a single value that is c...
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...
Vector< int > * Hijacked_local_eqn_number_pt
Pointer to a vector of integers containing the local equation numbers of any hijacked variables in th...
double *& residual_multiplier_pt()
Return the pointer to the residual multiplier.
static double Default_residual_multiplier
Static default value for the double that multiplies the original residuals.
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...
virtual ~HijackedElementBase()
Destructor, destroy the storage for the equation numbers.
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...
A class that represents a collection of data; each Data object may contain many different individual ...
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
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...
Hijacked(FiniteElement *const &element_pt, const int &face_index)
Constructor used for hijacking face elements.
void get_residuals(Vector< double > &residuals)
Get the residuals from the underlying element, but then wipe the entries in the residual vector that ...
FaceGeometry()
Constructor.
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...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem). The idea is that the Eulerian positions are stored in a Data object and the Lagrangian coordinates are stored in addition. The pointer that addresses the Eulerian positions is set to the pointer to Value in the Data object. Hence, SolidNode uses knowledge of the internal structure of Data and must be a friend of the Data class. In order to allow a mesh to deform via an elastic-style equation in deforming-domain problems, the positions are stored separately from the values, so that elastic problems may be combined with any other type of problem.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
Hijacked elements are elements in which one or more Data values that affect the element's residuals...
void unhijack_global_eqn(long *const &global_eqn_pt)
The global equation, addressed by global_eqn_pt, is no longer hijacked by this element.
FaceGeometry()
Constructor.
Spine *& spine_pt()
Access function to spine.
std::set< long * > * Hijacked_global_eqn_number_pt
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...
void unhijack_all_data()
Reset the hijacked data pt, so that none of the equations in the element are hijacked.
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...
HijackedElementBase()
Constructor, initialise the pointer to the equation numbers for the storage to zero.
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 ...