33 #ifndef OOMPH_SPINES_HEADER 34 #define OOMPH_SPINES_HEADER 101 const unsigned n_geom_data = geom_data_pt.size();
111 for(
unsigned i=0;
i<n_geom_data;
i++)
128 const unsigned n_geom_data = geom_data_pt.size();
138 for(
unsigned i=0;
i<n_geom_data;
i++)
186 unsigned n_geom_data=geom_data_pt.size();
188 for (
unsigned i=1;
i<n_geom_data;
i++)
220 unsigned n_geom_object=geom_object_pt.size();
222 for (
unsigned i=0;
i<n_geom_object;
i++)
334 SpineNode(
const unsigned &n_dim,
const unsigned &n_position_type,
335 const unsigned &initial_nvalue) :
336 Node(n_dim,n_position_type,initial_nvalue), Spine_pt(0), Fraction(0),
337 Spine_mesh_pt(0), Node_update_fct_id(0) {}
341 const unsigned &n_position_type,
342 const unsigned &initial_nvalue) :
343 Node(time_stepper_pt,n_dim,n_position_type,initial_nvalue), Spine_pt(0),
344 Fraction(0), Spine_mesh_pt(0), Node_update_fct_id(0) {}
359 return Spine_mesh_pt;
367 void node_update(
const bool& update_all_time_levels_for_new_node=
false);
422 template<
class ELEMENT>
439 void complete_setup_of_dependencies();
448 Spine_geometric_index(0) {}
454 Spine_geometric_index(0) {}
459 if(Spine_geometric_index)
461 delete[] Spine_geometric_index;
469 #ifdef RANGE_CHECKING 470 const unsigned n_node = this->nnode();
473 std::ostringstream error_message;
474 error_message <<
"Range Error: Node number " << n
475 <<
" is not in the range (0," 478 OOMPH_CURRENT_FUNCTION,
479 OOMPH_EXCEPTION_LOCATION);
485 if(Spine_geometric_index[n]==this->
ngeom_data())
487 std::ostringstream error_stream;
489 <<
"SpineNode " << n <<
" does not have a Spine attached,\n" 490 <<
"so you can't get its local equation number.\n" 491 <<
"Check that the Mesh is correctly associating Spines with is Nodes\n";
493 OOMPH_CURRENT_FUNCTION,
494 OOMPH_EXCEPTION_LOCATION);
497 return this->geometric_data_local_eqn(Spine_geometric_index[n],0);
506 template<
class ELEMENT>
522 template<
class ELEMENT>
538 template<
class ELEMENT>
584 unsigned long nspine()
const {
return Spine_pt.size();}
588 {Spine_pt.push_back(spine_pt);}
595 if(!dynamic_cast<SpineNode*>(Node_pt[n]))
597 std::ostringstream error_message;
598 error_message <<
"Node " << n <<
"is a " 599 <<
typeid(Node_pt[n]).name()
600 <<
", not a SpineNode" << std::endl;
603 OOMPH_CURRENT_FUNCTION,
604 OOMPH_EXCEPTION_LOCATION);
608 return (dynamic_cast<SpineNode*>(Node_pt[n]));
622 "Can't execute element_node_pt(...) for non FiniteElements",
623 OOMPH_CURRENT_FUNCTION,
624 OOMPH_EXCEPTION_LOCATION);
626 if(!dynamic_cast<SpineNode*>(el_pt->
node_pt(n)))
628 std::ostringstream error_message;
629 error_message <<
"Node " << n <<
"is a " 630 <<
typeid(el_pt->
node_pt(n)).name()
631 <<
", not a SpineNode" << std::endl;
634 OOMPH_CURRENT_FUNCTION,
635 OOMPH_EXCEPTION_LOCATION);
639 return(dynamic_cast<SpineNode*>(
640 dynamic_cast<FiniteElement*>(Element_pt[e])->node_pt(n)));
661 void describe_spine_dofs(std::ostream& out,
667 const bool &preserve_existing_data)
668 {this->set_spine_time_stepper(time_stepper_pt,preserve_existing_data);}
672 void set_spine_time_stepper(
TimeStepper*
const &time_stepper_pt,
673 const bool &preserve_existing_data);
677 void set_consistent_pinned_spine_values_for_continuation(
683 bool does_pointer_correspond_to_spine_data(
double*
const ¶meter_pt);
689 void node_update(
const bool& update_all_solid_nodes=
false);
693 virtual void spine_node_update(
SpineNode* spine_node_pt)=0;
696 #pragma clang diagnostic push 697 #pragma clang diagnostic ignored "-Woverloaded-virtual" 701 void dump(std::ofstream &dump_file)
const;
704 #pragma clang diagnostic pop 709 void read(std::ifstream &restart_file);
724 template<
class ELEMENT>
734 const unsigned n_node = this->nnode();
736 if (Spine_geometric_index) {
delete[] Spine_geometric_index;}
737 Spine_geometric_index =
new unsigned[n_node];
740 for(
unsigned n=0;n<n_node;n++)
744 this->node_pt(n))->spine_pt();
753 const unsigned n_node_update_data = this->
ngeom_data();
754 for(
unsigned i=0;
i<n_node_update_data;
i++)
758 Spine_geometric_index[n] =
i;
768 Spine_geometric_index[n] = this->
ngeom_data();
Vector< double > Geom_parameter
Vector that stores doubles that are used in the geometric updates.
void complete_setup_of_dependencies()
Complete the setup of additional dependencies. Overloads empty virtual function in GeneralisedElement...
FaceGeometry()
Constructor.
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 set_geom_parameter(const Vector< double > &geom_parameter)
Set vector of geometric parameters that are involved in the node update operations for this Spine...
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...
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 (...
SpineFiniteElement()
Empty constructor.
FaceGeometry()
Constructor.
double & height()
Access function to spine height.
double & fraction()
Set reference to fraction along spine.
Vector< Data * > & vector_geom_data_pt()
Return the vector of geometric data.
int spine_local_eqn(const unsigned &n)
Return the local equation number corresponding to the height of the spine at the n-th node...
A policy class that serves only to establish the interface for assigning the spine equation numbers...
double & geom_parameter(const unsigned &i)
Return i-th geometric parameter that is involved in the node update operations for this Spine...
A general Finite Element class.
Vector< Data * > Geom_data_pt
Data that stores the spine height.
unsigned ngeom_object() const
Return the number of geometric objects, zero if no spine.
unsigned & node_update_fct_id()
Access function to ID of node update function (within specific mesh)
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
GeomObject ** all_geom_object_pt()
Return the vector of all geometric objects.
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.
virtual ~SpineFiniteElement()
Emtpty virtual destructor.
FaceGeometry()
Constructor.
Spine *& spine_pt(const unsigned long &i)
Return the i-th spine in the mesh.
unsigned ngeom_parameter()
Number of geometric parameters that are involved in the node update operations for this Spine...
Spine()
Default constructor: Create the Spine and initialise its height to zero.
void add_spine_pt(Spine *const &spine_pt)
Add a spine to the mesh.
const Spine * spine_pt(const unsigned long &i) const
Return the i-th spine in the mesh (const version)
~Spine()
Destructor: Wipe Data object that stores the Spine height. All other objects (geometric Data and geom...
unsigned ngeom_data() const
Return the number of geometric data, zero if no spine.
Data *& geom_data_pt(const unsigned &i)
Return i-th geometric Data that is involved in the node update operations for this Spine...
SpineElement(FiniteElement *const &element_pt, const int &face_index)
Constructor used for spine face elements.
void add_geom_parameter(const double &geom_parameter)
Add geometric parameter involved in the node update operations for this Spine.
A class that represents a collection of data; each Data object may contain many different individual ...
unsigned ngeom_data()
Number of geometric Data that is involved in the node update operations for this Spine.
SpineNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SpineNode.
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...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Data * spine_height_pt() const
Access function to Data object that stores the spine height (const version)
Data ** all_geom_data_pt()
Return the vector of all geometric data.
GeneralisedTimestepper used to store the arclength derivatives and pervious solutions required in con...
Vector< GeomObject * > Geom_object_pt
Vector that stores the pointers to geometric objects that is involved in the node update operation...
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...
unsigned long nspine() const
Return the number of spines in the mesh.
Spine * Spine_pt
Private internal data pointer to a 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...
unsigned ngeom_object()
Number of geometric objects that is involved in the node update operations for this Spine...
double & h()
Access function to spine height.
unsigned Node_update_fct_id
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...
GeomObject * geom_object_pt(const unsigned &i) const
Return i-th geometric object that is involved in the node update operations for this Spine...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
double Fraction
Private double that represents the fixed fraction along the spine.
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...
GeomObject *& geom_object_pt(const unsigned &i)
Return i-th 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 (...
The SpineElement<ELEMENT> class takes an existing element as a template parameter and adds the necess...
SpineMesh * Spine_mesh_pt
Pointer to SpineMesh that this node is a part of. (The mesh implements the node update function(s)) ...
Data *& spine_height_pt()
Access function to Data object that stores the spine height.
Spine *& spine_pt()
Access function to spine.
SpineNode(const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Steady Constructor, initialise pointers to zero.
SpineMesh *& spine_mesh_pt()
Access function to Pointer to SpineMesh that this node is a part of and which implements the node upd...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
~SpineElement()
Destructor, clean up the storage allocated to the local equation numbers.
Spine(const double &height)
Constructor: Create the Spine and initialise its height to the specified value.
void complete_setup_of_dependencies()
Complete the setup of additional dependencies. Overloads empty virtual function in GeneralisedElement...
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.
unsigned * Spine_geometric_index
Array to hold the index of the geometric data associated with the spine height of the spine that affe...
SpineElement()
Constructor, call the constructor of the base element.
Vector< Spine * > Spine_pt
A Spine mesh contains a Vector of pointers to spines.