29 #ifndef OOMPH_SPINES_HEADER
30 #define OOMPH_SPINES_HEADER
103 for (
unsigned i = 0;
i < n_geom_data;
i++)
131 for (
unsigned i = 0;
i < n_geom_data;
i++)
183 for (
unsigned i = 1;
i < n_geom_data;
i++)
229 for (
unsigned i = 0;
i < n_geom_object;
i++)
348 const unsigned& n_position_type,
349 const unsigned& initial_nvalue)
350 :
Node(n_dim, n_position_type, initial_nvalue),
360 const unsigned& n_dim,
361 const unsigned& n_position_type,
362 const unsigned& initial_nvalue)
404 void node_update(
const bool& update_all_time_levels_for_new_node =
false);
473 template<
class ELEMENT>
523 #ifdef RANGE_CHECKING
524 const unsigned n_node = this->
nnode();
527 std::ostringstream error_message;
528 error_message <<
"Range Error: Node number " << n
529 <<
" is not in the range (0," << n_node - 1 <<
")";
531 OOMPH_CURRENT_FUNCTION,
532 OOMPH_EXCEPTION_LOCATION);
540 std::ostringstream error_stream;
541 error_stream <<
"SpineNode " << n
542 <<
" does not have a Spine attached,\n"
543 <<
"so you can't get its local equation number.\n"
544 <<
"Check that the Mesh is correctly associating Spines "
547 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
558 template<
class ELEMENT>
573 template<
class ELEMENT>
588 template<
class ELEMENT>
653 std::ostringstream error_message;
654 error_message <<
"Node " << n <<
"is a " <<
typeid(
Node_pt[n]).name()
655 <<
", not a SpineNode" << std::endl;
658 OOMPH_CURRENT_FUNCTION,
659 OOMPH_EXCEPTION_LOCATION);
677 "Can't execute element_node_pt(...) for non FiniteElements",
678 OOMPH_CURRENT_FUNCTION,
679 OOMPH_EXCEPTION_LOCATION);
683 std::ostringstream error_message;
684 error_message <<
"Node " << n <<
"is a "
685 <<
typeid(el_pt->
node_pt(n)).name() <<
", not a SpineNode"
689 OOMPH_CURRENT_FUNCTION,
690 OOMPH_EXCEPTION_LOCATION);
722 const bool& preserve_existing_data)
730 const bool& preserve_existing_data);
746 void node_update(
const bool& update_all_solid_nodes =
false);
753 #pragma clang diagnostic push
754 #pragma clang diagnostic ignored "-Woverloaded-virtual"
758 void dump(std::ofstream& dump_file)
const;
761 #pragma clang diagnostic pop
766 void read(std::ifstream& restart_file);
780 template<
class ELEMENT>
785 SpineNode>::complete_setup_of_dependencies();
790 const unsigned n_node = this->nnode();
792 if (Spine_geometric_index)
794 delete[] Spine_geometric_index;
796 Spine_geometric_index =
new unsigned[n_node];
799 for (
unsigned n = 0; n < n_node; n++)
802 Spine*
const spine_pt =
803 static_cast<SpineNode*
>(this->node_pt(n))->spine_pt();
812 const unsigned n_node_update_data = this->ngeom_data();
813 for (
unsigned i = 0;
i < n_node_update_data;
i++)
815 if (this->Geom_data_pt[
i] == spine_height_data_pt)
817 Spine_geometric_index[n] =
i;
827 Spine_geometric_index[n] = this->ngeom_data();
GeneralisedTimestepper used to store the arclength derivatives and pervious solutions required in con...
A class that represents a collection of data; each Data object may contain many different individual ...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
int geometric_data_local_eqn(const unsigned &n, const unsigned &i)
Return the local equation number corresponding to the i-th value at the n-th geometric data object.
unsigned ngeom_data() const
Return the number of geometric data upon which the shape of the element depends.
Specific implementation of the class for specified element and node type.
FaceGeometry()
Constructor.
FaceGeometry()
Constructor.
FaceGeometry()
Constructor.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned nnode() const
Return the number of nodes.
/////////////////////////////////////////////////////////////////////
Vector< Node * > Node_pt
Vector of pointers to nodes.
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
An OomphLibError object which should be thrown when an run-time error is encountered....
The SpineElement<ELEMENT> class takes an existing element as a template parameter and adds the necess...
unsigned * Spine_geometric_index
Array to hold the index of the geometric data associated with the spine height of the spine that affe...
~SpineElement()
Destructor, clean up the storage allocated to the local equation numbers.
void complete_setup_of_dependencies()
Complete the setup of additional dependencies. Overloads empty virtual function in GeneralisedElement...
int spine_local_eqn(const unsigned &n)
Return the local equation number corresponding to the height of the spine at the n-th node.
SpineElement(FiniteElement *const &element_pt, const int &face_index)
Constructor used for spine face elements.
SpineElement()
Constructor, call the constructor of the base element.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
SpineFiniteElement()
Empty constructor.
virtual ~SpineFiniteElement()
Emtpty virtual destructor.
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
void set_consistent_pinned_spine_values_for_continuation(ContinuationStorageScheme *const &continuation_stepper_pt)
Set any pinned spine "history" values to be consistent for continuation problems.
const Spine * spine_pt(const unsigned long &i) const
Return the i-th spine in the mesh (const version)
void read(std::ifstream &restart_file)
Overload the read function so that the spine data is read from the restart file.
void dump(std::ofstream &dump_file) const
Overload the dump function so that the spine data is dumped.
void add_spine_pt(Spine *const &spine_pt)
Add a spine to the mesh.
Vector< Spine * > Spine_pt
A Spine mesh contains a Vector of pointers to spines.
SpineNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SpineNode.
bool does_pointer_correspond_to_spine_data(double *const ¶meter_pt)
Check whether the pointer parameter_pt addresses data stored in the spines.
unsigned long nspine() const
Return the number of spines in the mesh.
void describe_spine_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the Spine. The ostream specifies the output stream to which the desc...
void set_spine_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the time stepper forthe spine data that is stored in the mesh.
virtual void spine_node_update(SpineNode *spine_node_pt)=0
Update function for given spine node – this must be implemented by all specific SpineMeshes.
Spine *& spine_pt(const unsigned long &i)
Return the i-th spine in the mesh.
void node_update(const bool &update_all_solid_nodes=false)
Update function to update all nodes of mesh [Doesn't make sense to use this mesh with SolidElements a...
virtual ~SpineMesh()
Destructor to clean up the memory allocated to the spines.
void set_mesh_level_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Overload the mesh_level timestepper function to set the timestepper data for the spines.
unsigned long assign_global_spine_eqn_numbers(Vector< double * > &Dof_pt)
Assign spines to Spine_pt vector of element.
SpineNode * element_node_pt(const unsigned long &e, const unsigned &n)
Return the n-th local SpineNode in element e. This is required to cast the nodes in a spine mesh to b...
Class for nodes that live on spines. The assumption is that each Node lies at a fixed fraction on a s...
Data ** all_geom_data_pt()
Return the vector of all geometric data.
SpineNode(TimeStepper *const &time_stepper_pt, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Unsteady Constructor, initialise pointers to zero.
GeomObject ** all_geom_object_pt()
Return the vector of all geometric objects.
unsigned ngeom_data() const
Return the number of geometric data, zero if no spine.
double & h()
Access function to spine height.
SpineMesh *& spine_mesh_pt()
Access function to Pointer to SpineMesh that this node is a part of and which implements the node upd...
SpineMesh * Spine_mesh_pt
Pointer to SpineMesh that this node is a part of. (The mesh implements the node update function(s))
double Fraction
Private double that represents the fixed fraction along the spine.
Spine * Spine_pt
Private internal data pointer to a spine.
unsigned Node_update_fct_id
ID of node update function (within specific mesh – useful if there are multiple node update functions...
Spine *& spine_pt()
Access function to spine.
unsigned & node_update_fct_id()
Access function to ID of node update function (within specific mesh)
double & fraction()
Set reference to fraction along spine.
SpineNode(const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Steady Constructor, initialise pointers to zero.
unsigned ngeom_object() const
Return the number of geometric objects, zero if no spine.
void node_update(const bool &update_all_time_levels_for_new_node=false)
Overload thet node update function, call the update function in the Node's SpineMesh.
Spines are used for algebraic node update operations in free-surface fluid problems: They form the ba...
~Spine()
Destructor: Wipe Data object that stores the Spine height. All other objects (geometric Data and geom...
Spine(const double &height, const Vector< Data * > &geom_data_pt, const Vector< GeomObject * > &geom_object_pt)
Constructor: Create the Spine and initialise its height to the specified value. Store the vector of (...
Data * spine_height_pt() const
Access function to Data object that stores the spine height (const version)
GeomObject * geom_object_pt(const unsigned &i) const
Return i-th geometric object that is involved in the node update operations for this Spine....
void set_geom_data_pt(const Vector< Data * > &geom_data_pt)
Set vector of (pointers to) geometric Data that is involved in the node update operations for this Sp...
void add_geom_data_pt(Data *geom_data_pt)
Add (pointer to) geometric Data that is involved in the node update operations for this Spine.
unsigned ngeom_object()
Number of geometric objects that is involved in the node update operations for this Spine.
Vector< Data * > Geom_data_pt
Data that stores the spine height.
void set_geom_object_pt(const Vector< GeomObject * > &geom_object_pt)
Set vector of (pointers to) geometric objects that is involved in the node update operations for this...
void add_geom_parameter(const double &geom_parameter)
Add geometric parameter involved in the node update operations for this Spine.
GeomObject *& geom_object_pt(const unsigned &i)
Return i-th geometric object that is involved in the node update operations for this Spine.
unsigned ngeom_data()
Number of geometric Data that is involved in the node update operations for this Spine.
void set_geom_parameter(const Vector< double > &geom_parameter)
Set vector of geometric parameters that are involved in the node update operations for this Spine....
double & height()
Access function to spine height.
Spine(const double &height)
Constructor: Create the Spine and initialise its height to the specified value.
unsigned ngeom_parameter()
Number of geometric parameters that are involved in the node update operations for this Spine.
Data * geom_data_pt(const unsigned &i) const
Return i-th geometric Data that is involved in the node update operations for this Spine....
double & geom_parameter(const unsigned &i)
Return i-th geometric parameter that is involved in the node update operations for this Spine.
Vector< Data * > & vector_geom_data_pt()
Return the vector of geometric data.
Spine()
Default constructor: Create the Spine and initialise its height to zero.
Vector< double > Geom_parameter
Vector that stores doubles that are used in the geometric updates.
Vector< GeomObject * > Geom_object_pt
Vector that stores the pointers to geometric objects that is involved in the node update operation.
Data *& geom_data_pt(const unsigned &i)
Return i-th geometric Data that is involved in the node update operations for this Spine.
Data *& spine_height_pt()
Access function to Data object that stores the spine height.
Vector< GeomObject * > & vector_geom_object_pt()
Return the vector of all geometric objects that affect this spine.
const double & geom_parameter(const unsigned &i) const
Return i-th geometric parameter that is involved in the node update operations for this Spine....
void add_geom_object_pt(GeomObject *geom_object_pt)
Add (pointer to) geometric object that is involved in the node update operations for this Spine.
Spine(const double &height, const Vector< Data * > &geom_data_pt)
Constructor: Create the Spine and initialise its height to the specified value. Store the vector of (...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...