oomph::PerturbedSpine Class Reference

#include <perturbed_spines.h>

Public Member Functions

 PerturbedSpine (Spine *&base_spine_pt)
 
 PerturbedSpine (TimeStepper *const &time_stepper_pt, Spine *&base_spine_pt)
 
 PerturbedSpine (Spine *&base_spine_pt, const double &height)
 
 ~PerturbedSpine ()
 
Spine *& base_spine_pt ()
 Access function to pointer to base spine. More...
 
doubleheight (const unsigned &i)
 Access function to i-th component of spine "height". More...
 
doubleheight (const unsigned &t, const unsigned &i)
 
Data *& height_pt ()
 Access function to Data object that stores the spine "heights". More...
 
Dataheight_pt () const
 
PerturbedSpineNode *& node_at_bottom_of_spine_pt ()
 Access function to SpineNode at bottom of spine. More...
 
PerturbedSpineNodenode_at_bottom_of_spine_pt () const
 
PerturbedSpineNode *& node_at_top_of_spine_pt ()
 Access function to SpineNode at top of spine. More...
 
PerturbedSpineNodenode_at_top_of_spine_pt () const
 
unsigned ngeom_data ()
 
void set_geom_data_pt (const Vector< Data * > &geom_data_pt)
 
void add_geom_data_pt (Data *geom_data_pt)
 
Data *& geom_data_pt (const unsigned &i)
 
Datageom_data_pt (const unsigned &i) const
 
Vector< Data * > & vector_geom_data_pt ()
 Return the vector of geometric data. More...
 
unsigned ngeom_object ()
 
void set_geom_object_pt (const Vector< GeomObject * > &geom_object_pt)
 
void add_geom_object_pt (GeomObject *geom_object_pt)
 
GeomObject *& geom_object_pt (const unsigned &i)
 
GeomObjectgeom_object_pt (const unsigned &i) const
 
Vector< GeomObject * > & vector_geom_object_pt ()
 Return vector of all geometric objects that affect this spine. More...
 
unsigned ngeom_parameter ()
 
void set_geom_parameter (const Vector< double > &geom_parameter)
 
void add_geom_parameter (const double &geom_parameter)
 
doublegeom_parameter (const unsigned &i)
 
const doublegeom_parameter (const unsigned &i) const
 

Private Attributes

SpineBase_spine_pt
 Pointer to corresponding (real) spine in the base problem. More...
 
Vector< Data * > Geom_data_pt
 Vector that stores the pointers to additional geometric Data. More...
 
Vector< GeomObject * > Geom_object_pt
 
Vector< doubleGeom_parameter
 
PerturbedSpineNodeNode_at_bottom_of_spine_pt
 
PerturbedSpineNodeNode_at_top_of_spine_pt
 

Detailed Description

PerturbedSpines are used for algebraic node update operations in free-surface fluid problems in which we wish to model a perturbation to the ‘base’ position of the free-surface. Perturbed spines work in an analogous manner to their ‘standard’ counterparts. In addition, each PerturbedSpine stores a pointer to its corresponding ‘base’ Spine.

Constructor & Destructor Documentation

◆ PerturbedSpine() [1/3]

oomph::PerturbedSpine::PerturbedSpine ( Spine *&  base_spine_pt)
inline

Default constructor: Create the PerturbedSpine and initialise its two "heights" to zero. Pass a pointer to the corresponding (real) spine in the base problem.

57  {
58  Geom_data_pt.resize(1);
59 
60  // Create Data for the two "heights". By default they are free
61  Geom_data_pt[0] = new Data(2);
62  }
Spine *& base_spine_pt()
Access function to pointer to base spine.
Definition: perturbed_spines.h:98
Spine * Base_spine_pt
Pointer to corresponding (real) spine in the base problem.
Definition: perturbed_spines.h:247
Vector< Data * > Geom_data_pt
Vector that stores the pointers to additional geometric Data.
Definition: perturbed_spines.h:250

References Geom_data_pt.

◆ PerturbedSpine() [2/3]

oomph::PerturbedSpine::PerturbedSpine ( TimeStepper *const &  time_stepper_pt,
Spine *&  base_spine_pt 
)
inline

Default constructor (unsteady version): Create the PerturbedSpine and initialise its two "heights" to zero. Pass a pointer to the corresponding (real) spine in the base problem.

69  {
70  Geom_data_pt.resize(1);
71 
72  // Create Data for the two "heights". By default they are free
73  Geom_data_pt[0] = new Data(time_stepper_pt,2);
74  }

References Geom_data_pt.

◆ PerturbedSpine() [3/3]

oomph::PerturbedSpine::PerturbedSpine ( Spine *&  base_spine_pt,
const double height 
)
inline

Constructor: Create the PerturbedSpine and initialise its heights to the specified value. Pass a pointer to the corresponding (real) spine in the base problem.

81  {
82  Geom_data_pt.resize(1);
83 
84  // Create Data for the two "heights". By default they are free
85  Geom_data_pt[0] = new Data(2);
86 
87  // Set value
88  for(unsigned i=0;i<2;i++) { Geom_data_pt[0]->set_value(i,height); }
89  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
double & height(const unsigned &i)
Access function to i-th component of spine "height".
Definition: perturbed_spines.h:101

References Geom_data_pt, height(), and i.

◆ ~PerturbedSpine()

oomph::PerturbedSpine::~PerturbedSpine ( )
inline

Destructor: Wipe Data object that stores the PerturbedSpine height. All other objects (geometric Data and geometric objects) were created outside the PerturbedSpine and must be deleted there.

95 { delete Geom_data_pt[0]; }

References Geom_data_pt.

Member Function Documentation

◆ add_geom_data_pt()

void oomph::PerturbedSpine::add_geom_data_pt ( Data geom_data_pt)
inline

Add (pointer to) geometric Data that is involved in the node update operations for this PerturbedSpine

166  {
167  Geom_data_pt.push_back(geom_data_pt);
168  }
Data *& geom_data_pt(const unsigned &i)
Definition: perturbed_spines.h:172

References geom_data_pt(), and Geom_data_pt.

◆ add_geom_object_pt()

void oomph::PerturbedSpine::add_geom_object_pt ( GeomObject geom_object_pt)
inline

Add (pointer to) geometric object that is involved in the node update operations for this PerturbedSpine

200  {
201  Geom_object_pt.push_back(geom_object_pt);
202  }
Vector< GeomObject * > Geom_object_pt
Definition: perturbed_spines.h:254
GeomObject *& geom_object_pt(const unsigned &i)
Definition: perturbed_spines.h:206

References geom_object_pt(), and Geom_object_pt.

◆ add_geom_parameter()

void oomph::PerturbedSpine::add_geom_parameter ( const double geom_parameter)
inline

Add geometric parameter involved in the node update operations for this PerturbedSpine

231  { Geom_parameter.push_back(geom_parameter); }
Vector< double > Geom_parameter
Definition: perturbed_spines.h:258
double & geom_parameter(const unsigned &i)
Definition: perturbed_spines.h:235

References geom_parameter(), and Geom_parameter.

◆ base_spine_pt()

Spine* & oomph::PerturbedSpine::base_spine_pt ( )
inline

◆ geom_data_pt() [1/2]

Data*& oomph::PerturbedSpine::geom_data_pt ( const unsigned i)
inline

Return i-th geometric Data that is involved in the node update operations for this PerturbedSpine

172 {return Geom_data_pt[i];}

References Geom_data_pt, and i.

Referenced by add_geom_data_pt(), oomph::PerturbedSpineNode::all_geom_data_pt(), and set_geom_data_pt().

◆ geom_data_pt() [2/2]

Data* oomph::PerturbedSpine::geom_data_pt ( const unsigned i) const
inline

Return i-th geometric Data that is involved in the node update operations for this PerturbedSpine. Const version

176 {return Geom_data_pt[i];}

References Geom_data_pt, and i.

◆ geom_object_pt() [1/2]

GeomObject*& oomph::PerturbedSpine::geom_object_pt ( const unsigned i)
inline

Return i-th geometric object that is involved in the node update operations for this PerturbedSpine

206 { return Geom_object_pt[i]; }

References Geom_object_pt, and i.

Referenced by add_geom_object_pt(), oomph::PerturbedSpineNode::all_geom_object_pt(), and set_geom_object_pt().

◆ geom_object_pt() [2/2]

GeomObject* oomph::PerturbedSpine::geom_object_pt ( const unsigned i) const
inline

Return i-th geometric object that is involved in the node update operations for this PerturbedSpine. Const version

211  {
212  return Geom_object_pt[i];
213  }

References Geom_object_pt, and i.

◆ geom_parameter() [1/2]

double& oomph::PerturbedSpine::geom_parameter ( const unsigned i)
inline

Return i-th geometric parameter that is involved in the node update operations for this PerturbedSpine

236  { return Geom_parameter[i]; }

References Geom_parameter, and i.

Referenced by add_geom_parameter(), and set_geom_parameter().

◆ geom_parameter() [2/2]

const double& oomph::PerturbedSpine::geom_parameter ( const unsigned i) const
inline

Return i-th geometric parameter that is involved in the node update operations for this PerturbedSpine. Const version

241  { return Geom_parameter[i]; }

References Geom_parameter, and i.

◆ height() [1/2]

◆ height() [2/2]

double& oomph::PerturbedSpine::height ( const unsigned t,
const unsigned i 
)
inline

Access function to t-th history value of the i-th component of the perturbed spine "height"

109  {
110  return *(Geom_data_pt[0]->value_pt(t,i));
111  }
t
Definition: plotPSD.py:36

References Geom_data_pt, i, and plotPSD::t.

◆ height_pt() [1/2]

Data*& oomph::PerturbedSpine::height_pt ( )
inline

◆ height_pt() [2/2]

Data* oomph::PerturbedSpine::height_pt ( ) const
inline

Access function to Data object that stores the spine "heights" (const version)

118 { return Geom_data_pt[0]; }

References Geom_data_pt.

◆ ngeom_data()

unsigned oomph::PerturbedSpine::ngeom_data ( )
inline

Number of geometric Data that is involved in the node update operations for this PerturbedSpine

148 { return Geom_data_pt.size(); }

References Geom_data_pt.

Referenced by oomph::PerturbedSpineNode::ngeom_data().

◆ ngeom_object()

unsigned oomph::PerturbedSpine::ngeom_object ( )
inline

Number of geometric objects that is involved in the node update operations for this PerturbedSpine

183 {return Geom_object_pt.size();}

References Geom_object_pt.

Referenced by oomph::PerturbedSpineNode::ngeom_object().

◆ ngeom_parameter()

unsigned oomph::PerturbedSpine::ngeom_parameter ( )
inline

Number of geometric parameters that are involved in the node update operations for this PerturbedSpine

220 { return Geom_parameter.size(); }

References Geom_parameter.

◆ node_at_bottom_of_spine_pt() [1/2]

PerturbedSpineNode*& oomph::PerturbedSpine::node_at_bottom_of_spine_pt ( )
inline

Access function to SpineNode at bottom of spine.

122  {
124  }
PerturbedSpineNode * Node_at_bottom_of_spine_pt
Definition: perturbed_spines.h:262

References Node_at_bottom_of_spine_pt.

◆ node_at_bottom_of_spine_pt() [2/2]

PerturbedSpineNode* oomph::PerturbedSpine::node_at_bottom_of_spine_pt ( ) const
inline

Access function to SpineNode at bottom of spine (const version)

129  {
131  }

References Node_at_bottom_of_spine_pt.

◆ node_at_top_of_spine_pt() [1/2]

PerturbedSpineNode*& oomph::PerturbedSpine::node_at_top_of_spine_pt ( )
inline

Access function to SpineNode at top of spine.

135  {
137  }
PerturbedSpineNode * Node_at_top_of_spine_pt
Definition: perturbed_spines.h:263

References Node_at_top_of_spine_pt.

◆ node_at_top_of_spine_pt() [2/2]

PerturbedSpineNode* oomph::PerturbedSpine::node_at_top_of_spine_pt ( ) const
inline

Access function to SpineNode at top of spine (const version)

142  {
144  }

References Node_at_top_of_spine_pt.

◆ set_geom_data_pt()

void oomph::PerturbedSpine::set_geom_data_pt ( const Vector< Data * > &  geom_data_pt)
inline

Set vector of (pointers to) geometric Data that is involved in the node update operations for this PerturbedSpine. Wipes any previously existing geometric Data.

154  {
155  unsigned n_geom_data=geom_data_pt.size();
156  Geom_data_pt.resize(n_geom_data+1);
157  for (unsigned i=1;i<n_geom_data;i++)
158  {
160  }
161  }

References geom_data_pt(), Geom_data_pt, and i.

◆ set_geom_object_pt()

void oomph::PerturbedSpine::set_geom_object_pt ( const Vector< GeomObject * > &  geom_object_pt)
inline

Set vector of (pointers to) geometric objects that is involved in the node update operations for this PerturbedSpine

188  {
189  unsigned n_geom_object=geom_object_pt.size();
190  Geom_object_pt.resize(n_geom_object);
191  for (unsigned i=0;i<n_geom_object;i++)
192  {
194  }
195  }

References geom_object_pt(), Geom_object_pt, and i.

◆ set_geom_parameter()

void oomph::PerturbedSpine::set_geom_parameter ( const Vector< double > &  geom_parameter)
inline

Set vector of geometric parameters that are involved in the node update operations for this PerturbedSpine. Wipes any previously existing geometric parameters

References geom_parameter(), and Geom_parameter.

◆ vector_geom_data_pt()

Vector<Data*>& oomph::PerturbedSpine::vector_geom_data_pt ( )
inline

Return the vector of geometric data.

179 {return Geom_data_pt;}

References Geom_data_pt.

◆ vector_geom_object_pt()

Vector<GeomObject*>& oomph::PerturbedSpine::vector_geom_object_pt ( )
inline

Return vector of all geometric objects that affect this spine.

216 { return Geom_object_pt; }

References Geom_object_pt.

Member Data Documentation

◆ Base_spine_pt

Spine* oomph::PerturbedSpine::Base_spine_pt
private

Pointer to corresponding (real) spine in the base problem.

Referenced by base_spine_pt().

◆ Geom_data_pt

Vector<Data*> oomph::PerturbedSpine::Geom_data_pt
private

Vector that stores the pointers to additional geometric Data.

Referenced by add_geom_data_pt(), geom_data_pt(), height(), height_pt(), ngeom_data(), PerturbedSpine(), set_geom_data_pt(), vector_geom_data_pt(), and ~PerturbedSpine().

◆ Geom_object_pt

Vector<GeomObject*> oomph::PerturbedSpine::Geom_object_pt
private

Vector that stores the pointers to geometric objects that is involved in the node update operation

Referenced by add_geom_object_pt(), geom_object_pt(), ngeom_object(), set_geom_object_pt(), and vector_geom_object_pt().

◆ Geom_parameter

Vector<double> oomph::PerturbedSpine::Geom_parameter
private

Vector that stores doubles that are used in the geometric updates

Referenced by add_geom_parameter(), geom_parameter(), ngeom_parameter(), and set_geom_parameter().

◆ Node_at_bottom_of_spine_pt

PerturbedSpineNode* oomph::PerturbedSpine::Node_at_bottom_of_spine_pt
private

Store a pointer to the nodes at either end of the spine so that a unit vector in the direction of the spine can be calculated

Referenced by node_at_bottom_of_spine_pt().

◆ Node_at_top_of_spine_pt

PerturbedSpineNode* oomph::PerturbedSpine::Node_at_top_of_spine_pt
private

Referenced by node_at_top_of_spine_pt().


The documentation for this class was generated from the following file: