spines.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //Header file for spine nodes, elements and meshes
31 
32 //Include guards to prevent multiple inclusion of the header
33 #ifndef OOMPH_SPINES_HEADER
34 #define OOMPH_SPINES_HEADER
35 
36 
37 #include<string>
38 
39 //oomph-lib headers
40 #include "nodes.h"
41 #include "elements.h"
42 #include "mesh.h"
43 #include "geom_objects.h"
45 
46 namespace oomph
47 {
48 
49 
50 //=================================================================
51 /// Spines are used for algebraic node update operations in free-surface
52 /// fluid problems: They form the back-bones along which nodes in a
53 /// a free-surface mesh are located. Typically, the free surface is
54 /// located at the "end" of the spine; the nodes in the interior
55 /// of the mesh are located at fixed fractions along the spine. The
56 /// key Data member of the Spine object is its "height" --
57 /// usually an unknown in the problem -- which is used by the
58 /// SpineNode's node update function to update the SpineNode's position.
59 ///
60 /// In more complex problems (such as the case where a fluid layer is deposited
61 /// on an elastic body), the node update function can depend on additional
62 /// information, such as the GeomObject representation of the
63 /// elastic body, and additional Data objects wich
64 /// specify the position on the GeomObject from which the Spine
65 /// emanates. The Spine class therefore provides storage for
66 /// pointers to GeomObjects and storage for any additional geometric
67 /// Data that may be required during node update operations.
68 //=================================================================
69 class Spine
70 {
71 
72 public:
73 
74  /// \short Default constructor: Create the Spine and initialise its
75  /// height to zero.
77  {
78  Geom_data_pt.resize(1);
79  // Create Data for height. By default it's free
80  Geom_data_pt[0] = new Data(1);
81  }
82 
83  /// \short Constructor: Create the Spine and initialise its
84  /// height to the specified value
85  Spine(const double& height)
86  {
87  Geom_data_pt.resize(1);
88  // Create Data for height. By default it's free
89  Geom_data_pt[0] = new Data(1);
90  // Set value
91  Geom_data_pt[0]->set_value(0,height);
92  }
93 
94  /// \short Constructor: Create the Spine and initialise its
95  /// height to the specified value. Store the vector of (pointers to)
96  /// the additional geometric Data that is required during
97  /// the node update operation for this Spine.
98  Spine(const double& height, const Vector<Data*>& geom_data_pt)
99  {
100  //Find the number of geometric data passed
101  const unsigned n_geom_data = geom_data_pt.size();
102  //Now allocate enough storage for the spine height and additional
103  //geometric data
104  Geom_data_pt.resize(n_geom_data+1);
105 
106  // Create Data for height. By default it's free
107  Geom_data_pt[0] = new Data(1);
108  // Set value
109  Geom_data_pt[0]->set_value(0,height);
110  //Add the additional geometric data
111  for(unsigned i=0;i<n_geom_data;i++)
112  {
113  Geom_data_pt[i+1] = geom_data_pt[i];
114  }
115  }
116 
117  /// \short Constructor: Create the Spine and initialise its
118  /// height to the specified value. Store the vector of (pointers to)
119  /// the additional geometric Data that is required during
120  /// the node update operation; also store vector of (pointers to)
121  /// GeomObjects that is required during the node update operation
122  /// for this Spine
123  Spine(const double& height, const Vector<Data*>& geom_data_pt,
125  : Geom_object_pt(geom_object_pt)
126  {
127  //Find the number of geometric data passed
128  const unsigned n_geom_data = geom_data_pt.size();
129  //Now allocate enough storage for the spine height and additional
130  //geometric data
131  Geom_data_pt.resize(n_geom_data+1);
132 
133  // Create Data for height. By default it's free
134  Geom_data_pt[0] = new Data(1);
135  // Set value
136  Geom_data_pt[0]->set_value(0,height);
137  //Add the additional geometric data
138  for(unsigned i=0;i<n_geom_data;i++)
139  {
140  Geom_data_pt[i+1] = geom_data_pt[i];
141  }
142  }
143 
144 
145 
146  /// \short Destructor: Wipe Data object that stores the
147  /// Spine height. All other objects (geometric Data and
148  /// geometric objects) were created outside the Spine
149  /// and must be deleted there.
151  {
152  // Kill spine height
153  delete Geom_data_pt[0];
154  }
155 
156 
157  /// Access function to spine height
158  double& height()
159  {
160  return *(Geom_data_pt[0]->value_pt(0));
161  }
162 
163  /// Access function to Data object that stores the spine height
165  {
166  return Geom_data_pt[0];
167  }
168 
169  /// \short Access function to Data object that stores the spine height
170  /// (const version)
172  {
173  return Geom_data_pt[0];
174  }
175 
176 
177  /// \short Number of geometric Data that is involved in the
178  /// node update operations for this Spine
179  unsigned ngeom_data(){return Geom_data_pt.size();}
180 
181  /// \short Set vector of (pointers to) geometric Data that is
182  /// involved in the node update operations for this Spine.
183  /// Wipes any previously existing geometric Data.
185  {
186  unsigned n_geom_data=geom_data_pt.size();
187  Geom_data_pt.resize(n_geom_data+1);
188  for (unsigned i=1;i<n_geom_data;i++)
189  {
190  Geom_data_pt[i+1]=geom_data_pt[i];
191  }
192  }
193 
194  /// \short Add (pointer to) geometric Data that is
195  /// involved in the node update operations for this Spine
197  {
198  Geom_data_pt.push_back(geom_data_pt);
199  }
200 
201  /// \short Return i-th geometric Data that is involved in the
202  /// node update operations for this Spine
203  Data*& geom_data_pt(const unsigned& i){return Geom_data_pt[i];}
204 
205  /// \short Return i-th geometric Data that is involved in the
206  /// node update operations for this Spine. Const version
207  Data* geom_data_pt(const unsigned& i) const {return Geom_data_pt[i];}
208 
209  /// \short Return the vector of geometric data
211 
212  /// \short Number of geometric objects that is involved in the
213  /// node update operations for this Spine
214  unsigned ngeom_object(){return Geom_object_pt.size();}
215 
216  /// \short Set vector of (pointers to) geometric objects that is
217  /// involved in the node update operations for this Spine
219  {
220  unsigned n_geom_object=geom_object_pt.size();
221  Geom_object_pt.resize(n_geom_object);
222  for (unsigned i=0;i<n_geom_object;i++)
223  {
224  Geom_object_pt[i]=geom_object_pt[i];
225  }
226  }
227 
228  /// \short Add (pointer to) geometric object that is
229  /// involved in the node update operations for this Spine
231  {
232  Geom_object_pt.push_back(geom_object_pt);
233  }
234 
235  /// \short Return i-th geometric object that is involved in the
236  /// node update operations for this Spine
237  GeomObject*& geom_object_pt(const unsigned& i){return Geom_object_pt[i];}
238 
239  /// \short Return i-th geometric object that is involved in the
240  /// node update operations for this Spine. Const version
241  GeomObject* geom_object_pt(const unsigned& i) const
242  {
243  return Geom_object_pt[i];
244  }
245 
246  /// \short Return the vector of all geometric objects that affect this
247  /// spine
249 
250  /// \short Number of geometric parameters that are involved in the
251  /// node update operations for this Spine
252  unsigned ngeom_parameter(){return Geom_parameter.size();}
253 
254  /// \short Set vector of geometric parameters that are
255  /// involved in the node update operations for this Spine.
256  /// Wipes any previously existing geometric parameters
259 
260  /// \short Add geometric parameter
261  /// involved in the node update operations for this Spine
262  void add_geom_parameter(const double &geom_parameter)
263  {Geom_parameter.push_back(geom_parameter);}
264 
265  /// \short Return i-th geometric parameter that is involved in the
266  /// node update operations for this Spine
267  double& geom_parameter(const unsigned& i)
268  {return Geom_parameter[i];}
269 
270  /// \short Return i-th geometric parameter that is involved in the
271  /// node update operations for this Spine. Const version
272  const double &geom_parameter(const unsigned& i) const
273  {return Geom_parameter[i];}
274 
275 
276 private:
277 
278  /// Data that stores the spine height
279  //Data* Spine_height_pt;
280 
281  /// Vector that stores the pointers to additional geometric Data
283 
284  /// \short Vector that stores the pointers to geometric objects that is
285  /// involved in the node update operation
287 
288  /// \short Vector that stores doubles that are used in the geometric updates
290 
291 };
292 
293 
294 
295 
296 
297 
298 // Forward declaration
299 class SpineMesh;
300 
301 
302 //=====================================================================
303 /// Class for nodes that live on spines. The assumption is that each Node
304 /// lies at a fixed fraction on a single spine (although more complex
305 /// behaviour could be included by adding more variables to the spine).
306 /// In general, more complex node updating should be handled by the classes
307 /// implemented for algebraic node updates.
308 //=====================================================================
309 class SpineNode : public Node
310 {
311 
312 
313  private:
314 
315  /// Private internal data pointer to a spine
317 
318  ///Private double that represents the fixed fraction along the spine
319  double Fraction;
320 
321  /// \short Pointer to SpineMesh that this node is a part of.
322  /// (The mesh implements the node update function(s))
324 
325  /// ID of node update function (within specific mesh -- useful if there
326  /// are multiple node update functions, e.g. in two-layer problems.
328 
329 
330 public:
331 
332 
333  ///Steady Constructor, initialise pointers to zero
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) {}
338 
339  ///Unsteady Constructor, initialise pointers to zero
340  SpineNode(TimeStepper* const &time_stepper_pt, const unsigned &n_dim,
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) {}
345 
346  /// Access function to spine
347  Spine* &spine_pt() {return Spine_pt;}
348 
349  ///Set reference to fraction along spine
350  double &fraction() {return Fraction;}
351 
352  /// Access function to ID of node update function (within specific mesh)
353  unsigned& node_update_fct_id() {return Node_update_fct_id;}
354 
355  /// \short Access function to Pointer to SpineMesh that this node is a part of
356  /// and which implements the node update function(s)
358  {
359  return Spine_mesh_pt;
360  }
361 
362  ///Access function to spine height
363  double &h() {return Spine_pt->height();}
364 
365  /// Overload thet node update function, call
366  /// the update function in the Node's SpineMesh
367  void node_update(const bool& update_all_time_levels_for_new_node=false);
368 
369  /// \short Return the number of geometric data, zero if no spine.
370  unsigned ngeom_data() const {
371  if(Spine_pt) {return Spine_pt->ngeom_data();}
372  else {return 0;}
373  }
374 
375  /// Return the number of geometric objects, zero if no spine.
376  unsigned ngeom_object() const {
377  if(Spine_pt) {return Spine_pt->ngeom_object();}
378  else {return 0;}
379  }
380 
381  ///Return the vector of all geometric data
383  {return &(Spine_pt->geom_data_pt(0));}
384 
385  ///Return the vector of all geometric objects
387  {return &(Spine_pt->geom_object_pt(0));}
388 
389 };
390 
391 
392 ///////////////////////////////////////////////////////////////////////
393 ///////////////////////////////////////////////////////////////////////
394 ///////////////////////////////////////////////////////////////////////
395 
396 
397 
398 //=======================================================================
399 /// \short A policy class that serves only to establish the interface for
400 /// assigning the spine equation numbers
401 //=======================================================================
403 {
404  public:
405 
406  /// Empty constructor
408 
409  /// Emtpty virtual destructor
411 
412 };
413 
414 
415 //========================================================================
416 /// \short The SpineElement<ELEMENT> class takes an existing element as a
417 /// template parameter and adds the necessary additional functionality to
418 /// allow the element to be update using the Method of Spines.
419 /// A vector of pointers to spines and storage for the local equation
420 /// numbers associated with the spines are added to the element.
421 //========================================================================
422 template<class ELEMENT>
423 class SpineElement :
424 public ElementWithSpecificMovingNodes<ELEMENT,SpineNode>,
425 public SpineFiniteElement
426 {
427  private:
428 
429  /// \short Array to hold the index of the geometric data associated with
430  /// the spine height of the spine that affects the n-th node
432 
433  /// \short Complete the setup of additional dependencies. Overloads
434  /// empty virtual function in GeneralisedElement to determine the "geometric
435  /// Data", i.e. the Data that affects the element's shape.
436  /// This function is called (for all elements) at the very beginning of the
437  /// equation numbering procedure to ensure that all dependencies
438  /// are accounted for.
439  void complete_setup_of_dependencies();
440 
441 
442 public:
443 
444  /// Constructor, call the constructor of the base element
448  Spine_geometric_index(0) {}
449 
450  /// Constructor used for spine face elements
451  SpineElement(FiniteElement* const &element_pt, const int &face_index) :
452  ElementWithSpecificMovingNodes<ELEMENT,SpineNode>(element_pt,face_index),
454  Spine_geometric_index(0) {}
455 
456  /// Destructor, clean up the storage allocated to the local equation numbers
458  {
459  if(Spine_geometric_index)
460  {
461  delete[] Spine_geometric_index;
462  }
463  }
464 
465  /// \short Return the local equation number corresponding to the height
466  /// of the spine at the n-th node
467  inline int spine_local_eqn(const unsigned &n)
468  {
469 #ifdef RANGE_CHECKING
470  const unsigned n_node = this->nnode();
471  if(n >= n_node)
472  {
473  std::ostringstream error_message;
474  error_message << "Range Error: Node number " << n
475  << " is not in the range (0,"
476  << n_node-1 << ")";
477  throw OomphLibError(error_message.str(),
478  OOMPH_CURRENT_FUNCTION,
479  OOMPH_EXCEPTION_LOCATION);
480  }
481 #endif
482 
483 #ifdef PARANOID
484  //If there is no spine then you can't get the local equation
485  if(Spine_geometric_index[n]==this->ngeom_data())
486  {
487  std::ostringstream error_stream;
488  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";
492  throw OomphLibError(error_stream.str(),
493  OOMPH_CURRENT_FUNCTION,
494  OOMPH_EXCEPTION_LOCATION);
495  }
496 #endif
497  return this->geometric_data_local_eqn(Spine_geometric_index[n],0);
498  }
499 
500 };
501 
502 //=======================================================================
503 /// \short Explicit definition of the face geometry for spine elements:
504 /// The same as the face geometry of the underlying element
505 //=======================================================================
506 template<class ELEMENT>
507 class FaceGeometry<SpineElement<ELEMENT> >:
508 public virtual FaceGeometry<ELEMENT>
509 {
510  public:
511 
512  ///Constructor
513  FaceGeometry() : FaceGeometry<ELEMENT>() {}
514 
515  protected:
516 };
517 
518 //=====================================================================
519 /// \short Explicit definition of the face geometry for spine elements:
520 /// The same as the face geometry of the underlying element
521 //=======================================================================
522 template<class ELEMENT>
524 public virtual FaceGeometry<FaceGeometry<ELEMENT> >
525 {
526  public:
527 
528  ///Constructor
530 
531  protected:
532 };
533 
534 //=====================================================================
535 /// \short Explicit definition of the face geometry for spine elements:
536 /// The same as the face geometry of the underlying element
537 //=======================================================================
538 template<class ELEMENT>
540 public virtual FaceGeometry<FaceGeometry<ELEMENT> >
541 {
542  public:
543 
544  ///Constructor
546 
547  protected:
548 };
549 
550 
551 
552 //////////////////////////////////////////////////////////////////////////
553 //////////////////////////////////////////////////////////////////////////
554 //////////////////////////////////////////////////////////////////////////
555 
556 
557 
558 //========================================================================
559 /// General SpineMesh class.
560 ///
561 /// Derived from Mesh with virtual so that
562 /// spine meshes can be derived from general meshes, without
563 /// multiple copies of Mesh objects.
564 //========================================================================
565 class SpineMesh : public virtual Mesh
566 {
567  protected:
568 
569  /// A Spine mesh contains a Vector of pointers to spines
571 
572 public:
573 
574  /// Destructor to clean up the memory allocated to the spines
575  virtual ~SpineMesh();
576 
577  /// Return the i-th spine in the mesh
578  Spine*& spine_pt(const unsigned long &i) {return Spine_pt[i];}
579 
580  /// Return the i-th spine in the mesh (const version)
581  const Spine* spine_pt(const unsigned long &i) const {return Spine_pt[i];}
582 
583  /// Return the number of spines in the mesh
584  unsigned long nspine() const {return Spine_pt.size();}
585 
586  /// Add a spine to the mesh
587  void add_spine_pt(Spine* const &spine_pt)
588  {Spine_pt.push_back(spine_pt);}
589 
590  /// Return a pointer to the n-th global SpineNode
591  //Can safely cast the nodes to SpineNodes
592  SpineNode* node_pt(const unsigned long &n)
593  {
594 #ifdef PARANOID
595  if(!dynamic_cast<SpineNode*>(Node_pt[n]))
596  {
597  std::ostringstream error_message;
598  error_message << "Node " << n << "is a "
599  << typeid(Node_pt[n]).name()
600  << ", not a SpineNode" << std::endl;
601 
602  throw OomphLibError(error_message.str(),
603  OOMPH_CURRENT_FUNCTION,
604  OOMPH_EXCEPTION_LOCATION);
605  }
606 #endif
607  //Return a cast to the pointer to the node
608  return (dynamic_cast<SpineNode*>(Node_pt[n]));
609  }
610 
611  /// \short Return the n-th local SpineNode in element e.
612  /// This is required to cast the nodes in a spine mesh to be
613  /// SpineNodes and therefore allow access to the extra SpineNode data
614  SpineNode* element_node_pt(const unsigned long &e, const unsigned &n)
615  {
616 #ifdef PARANOID
617  // Try to cast to FiniteElement
618  FiniteElement* el_pt=dynamic_cast<FiniteElement*>(Element_pt[e]);
619  if (el_pt==0)
620  {
621  throw OomphLibError(
622  "Can't execute element_node_pt(...) for non FiniteElements",
623  OOMPH_CURRENT_FUNCTION,
624  OOMPH_EXCEPTION_LOCATION);
625  }
626  if(!dynamic_cast<SpineNode*>(el_pt->node_pt(n)))
627  {
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;
632 
633  throw OomphLibError(error_message.str(),
634  OOMPH_CURRENT_FUNCTION,
635  OOMPH_EXCEPTION_LOCATION);
636  }
637 #endif
638  //Return a cast to the node pointer
639  return(dynamic_cast<SpineNode*>(
640  dynamic_cast<FiniteElement*>(Element_pt[e])->node_pt(n)));
641  }
642 
643  /// Assign spines to Spine_pt vector of element
644  //N.B.: Since SpineElement<ELEMENT>'s are templated, we need the template in
645  //this function so that we can do the dynamic cast to a SpineElement<ELEMENT>
646  //template<class ELEMENT>
647  //void add_spine_to_element(const unsigned long &e, Spine* spine)
648  // {dynamic_cast<ELEMENT*>(Element_pt[e])->add_spine(spine);}
649 
650  /// Assign equation numbers for spines
651  unsigned long assign_global_spine_eqn_numbers(Vector<double *> &Dof_pt);
652 
653  /// \short Function to describe the dofs of the Spine. The ostream
654  /// specifies the output stream to which the description
655  /// is written; the string stores the currently
656  /// assembled output that is ultimately written to the
657  /// output stream by Data::describe_dofs(...); it is typically
658  /// built up incrementally as we descend through the
659  /// call hierarchy of this function when called from
660  /// Problem::describe_dofs(...)
661  void describe_spine_dofs(std::ostream& out,
662  const std::string& current_string) const;
663 
664  /// \short Overload the mesh_level timestepper function to set the
665  /// timestepper data for the spines
666  void set_mesh_level_time_stepper(TimeStepper* const &time_stepper_pt,
667  const bool &preserve_existing_data)
668  {this->set_spine_time_stepper(time_stepper_pt,preserve_existing_data);}
669 
670  /// \short Set the time stepper forthe spine data that is stored in
671  /// the mesh.
672  void set_spine_time_stepper(TimeStepper* const &time_stepper_pt,
673  const bool &preserve_existing_data);
674 
675  /// \short Set any pinned spine "history" values to be consistent for
676  /// continuation problems
677  void set_consistent_pinned_spine_values_for_continuation(
678  ContinuationStorageScheme* const &continuation_stepper_pt);
679 
680 
681  /// \short Check whether the pointer parameter_pt addresses data stored
682  /// in the spines
683  bool does_pointer_correspond_to_spine_data(double* const &parameter_pt);
684 
685  /// \short Update function to update all nodes of mesh
686  /// [Doesn't make sense to use this mesh with SolidElements anyway,
687  /// so we buffer the case if update_all_solid_nodes is set to
688  /// true.]
689  void node_update(const bool& update_all_solid_nodes=false);
690 
691  /// \short Update function for given spine node -- this must be implemented
692  /// by all specific SpineMeshes.
693  virtual void spine_node_update(SpineNode* spine_node_pt)=0;
694 
695 #ifdef __clang__
696 #pragma clang diagnostic push
697 #pragma clang diagnostic ignored "-Woverloaded-virtual"
698 #endif
699 
700  /// \short Overload the dump function so that the spine data is dumped
701  void dump(std::ofstream &dump_file) const;
702 
703 #ifdef __clang__
704 #pragma clang diagnostic pop
705 #endif
706 
707  /// \short Overload the read function so that the spine data is read
708  /// from the restart file
709  void read(std::ifstream &restart_file);
710 
711 };
712 
713 
714 ///////////////////////////////////////////////////////////////////
715 ///////////////////////////////////////////////////////////////////
716 //Functions for the SpineElement class
717 ///////////////////////////////////////////////////////////////////
718 ///////////////////////////////////////////////////////////////////
719 
720 
721 //=================================================================
722 /// Construct and fill the node_update_data vector
723 //=================================================================
724 template<class ELEMENT>
726 {
727  // Call function of underlying element
730 
731  //Sort out the spine index stuff
732  //Find the data that correspond to spine heights
733  {
734  const unsigned n_node = this->nnode();
735  //Allocate memory
736  if (Spine_geometric_index) {delete[] Spine_geometric_index;}
737  Spine_geometric_index = new unsigned[n_node];
738 
739  //Now loop over data and find out where it fits
740  for(unsigned n=0;n<n_node;n++)
741  {
742  //Find pointer to the spine
743  Spine* const spine_pt = static_cast<SpineNode*>(
744  this->node_pt(n))->spine_pt();
745 
746  //If there is a spine then find the pointer to the data
747  if(spine_pt)
748  {
749  //Find the pointer to the data
750  Data* spine_height_data_pt = spine_pt->spine_height_pt();
751 
752  //Now find the index of the corresponding spine
753  const unsigned n_node_update_data = this->ngeom_data();
754  for(unsigned i=0;i<n_node_update_data;i++)
755  {
756  if(this->Geom_data_pt[i]==spine_height_data_pt)
757  {
758  Spine_geometric_index[n] = i;
759  break;
760  }
761  }
762  }
763  //Otherwise issue a warning
764  else
765  {
766  //Set the spine_geometric_index out of range,
767  //which will cause the spine_local_eqn to return a pinned value
768  Spine_geometric_index[n] = this->ngeom_data();
769  }
770  }
771  }
772 
773 }
774 
775 }
776 
777 #endif
Vector< double > Geom_parameter
Vector that stores doubles that are used in the geometric updates.
Definition: spines.h:289
void complete_setup_of_dependencies()
Complete the setup of additional dependencies. Overloads empty virtual function in GeneralisedElement...
Definition: spines.h:725
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...
Definition: spines.h:184
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...
Definition: spines.h:257
Vector< GeomObject * > & vector_geom_object_pt()
Return the vector of all geometric objects that affect this spine.
Definition: spines.h:248
const double & geom_parameter(const unsigned &i) const
Return i-th geometric parameter that is involved in the node update operations for this Spine...
Definition: spines.h:272
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 (...
Definition: spines.h:123
SpineFiniteElement()
Empty constructor.
Definition: spines.h:407
cstr elem_len * i
Definition: cfortran.h:607
double & height()
Access function to spine height.
Definition: spines.h:158
double & fraction()
Set reference to fraction along spine.
Definition: spines.h:350
Vector< Data * > & vector_geom_data_pt()
Return the vector of geometric data.
Definition: spines.h:210
int spine_local_eqn(const unsigned &n)
Return the local equation number corresponding to the height of the spine at the n-th node...
Definition: spines.h:467
A policy class that serves only to establish the interface for assigning the spine equation numbers...
Definition: spines.h:402
double & geom_parameter(const unsigned &i)
Return i-th geometric parameter that is involved in the node update operations for this Spine...
Definition: spines.h:267
A general Finite Element class.
Definition: elements.h:1274
Vector< Data * > Geom_data_pt
Data that stores the spine height.
Definition: spines.h:282
unsigned ngeom_object() const
Return the number of geometric objects, zero if no spine.
Definition: spines.h:376
unsigned & node_update_fct_id()
Access function to ID of node update function (within specific mesh)
Definition: spines.h:353
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:852
GeomObject ** all_geom_object_pt()
Return the vector of all geometric objects.
Definition: spines.h:386
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.
Definition: spines.h:666
e
Definition: cfortran.h:575
virtual ~SpineFiniteElement()
Emtpty virtual destructor.
Definition: spines.h:410
Spine *& spine_pt(const unsigned long &i)
Return the i-th spine in the mesh.
Definition: spines.h:578
unsigned ngeom_parameter()
Number of geometric parameters that are involved in the node update operations for this Spine...
Definition: spines.h:252
Spine()
Default constructor: Create the Spine and initialise its height to zero.
Definition: spines.h:76
void add_spine_pt(Spine *const &spine_pt)
Add a spine to the mesh.
Definition: spines.h:587
const Spine * spine_pt(const unsigned long &i) const
Return the i-th spine in the mesh (const version)
Definition: spines.h:581
~Spine()
Destructor: Wipe Data object that stores the Spine height. All other objects (geometric Data and geom...
Definition: spines.h:150
unsigned ngeom_data() const
Return the number of geometric data, zero if no spine.
Definition: spines.h:370
Data *& geom_data_pt(const unsigned &i)
Return i-th geometric Data that is involved in the node update operations for this Spine...
Definition: spines.h:203
SpineElement(FiniteElement *const &element_pt, const int &face_index)
Constructor used for spine face elements.
Definition: spines.h:451
void add_geom_parameter(const double &geom_parameter)
Add geometric parameter involved in the node update operations for this Spine.
Definition: spines.h:262
A class that represents a collection of data; each Data object may contain many different individual ...
Definition: nodes.h:89
unsigned ngeom_data()
Number of geometric Data that is involved in the node update operations for this Spine.
Definition: spines.h:179
SpineNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SpineNode.
Definition: spines.h:592
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...
Definition: spines.h:196
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2109
Data * spine_height_pt() const
Access function to Data object that stores the spine height (const version)
Definition: spines.h:171
Data ** all_geom_data_pt()
Return the vector of all geometric data.
Definition: spines.h:382
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...
Definition: spines.h:286
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...
Definition: spines.h:218
unsigned long nspine() const
Return the number of spines in the mesh.
Definition: spines.h:584
Spine * Spine_pt
Private internal data pointer to a spine.
Definition: spines.h:316
Data * geom_data_pt(const unsigned &i) const
Return i-th geometric Data that is involved in the node update operations for this Spine...
Definition: spines.h:207
unsigned ngeom_object()
Number of geometric objects that is involved in the node update operations for this Spine...
Definition: spines.h:214
double & h()
Access function to spine height.
Definition: spines.h:363
unsigned Node_update_fct_id
Definition: spines.h:327
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...
Definition: spines.h:230
GeomObject * geom_object_pt(const unsigned &i) const
Return i-th geometric object that is involved in the node update operations for this Spine...
Definition: spines.h:241
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn&#39;t been defined.
double Fraction
Private double that represents the fixed fraction along the spine.
Definition: spines.h:319
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...
Definition: spines.h:614
GeomObject *& geom_object_pt(const unsigned &i)
Return i-th geometric object that is involved in the node update operations for this Spine...
Definition: spines.h:237
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 (...
Definition: spines.h:98
The SpineElement<ELEMENT> class takes an existing element as a template parameter and adds the necess...
Definition: spines.h:423
SpineMesh * Spine_mesh_pt
Pointer to SpineMesh that this node is a part of. (The mesh implements the node update function(s)) ...
Definition: spines.h:323
Data *& spine_height_pt()
Access function to Data object that stores the spine height.
Definition: spines.h:164
Spine *& spine_pt()
Access function to spine.
Definition: spines.h:347
SpineNode(const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Steady Constructor, initialise pointers to zero.
Definition: spines.h:334
SpineMesh *& spine_mesh_pt()
Access function to Pointer to SpineMesh that this node is a part of and which implements the node upd...
Definition: spines.h:357
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
~SpineElement()
Destructor, clean up the storage allocated to the local equation numbers.
Definition: spines.h:457
A general mesh class.
Definition: mesh.h:74
Spine(const double &height)
Constructor: Create the Spine and initialise its height to the specified value.
Definition: spines.h:85
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.
Definition: spines.h:340
unsigned * Spine_geometric_index
Array to hold the index of the geometric data associated with the spine height of the spine that affe...
Definition: spines.h:431
SpineElement()
Constructor, call the constructor of the base element.
Definition: spines.h:445
Vector< Spine * > Spine_pt
A Spine mesh contains a Vector of pointers to spines.
Definition: spines.h:570