oomph::StraightLine Class Reference

#include <geom_objects.h>

+ Inheritance diagram for oomph::StraightLine:

Public Member Functions

 StraightLine (const Vector< Data * > &geom_data_pt)
 
 StraightLine (const double &height)
 Constructor: Pass height (pinned by default) More...
 
 StraightLine (const StraightLine &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const StraightLine &)=delete
 Broken assignment operator. More...
 
 ~StraightLine ()
 Destructor: Clean up if necessary. More...
 
void position (const Vector< double > &zeta, Vector< double > &r) const
 Position Vector at Lagrangian coordinate zeta. More...
 
void position (const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void dposition (const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 
unsigned ngeom_data () const
 How many items of Data does the shape of the object depend on? More...
 
Datageom_data_pt (const unsigned &j)
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 
 GeomObject (const GeomObject &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const GeomObject &)=delete
 Broken assignment operator. More...
 
virtual ~GeomObject ()
 (Empty) destructor More...
 
unsigned nlagrangian () const
 Access function to # of Lagrangian coordinates. More...
 
unsigned ndim () const
 Access function to # of Eulerian coordinates. More...
 
void set_nlagrangian_and_ndim (const unsigned &n_lagrangian, const unsigned &n_dim)
 Set # of Lagrangian and Eulerian coordinates. More...
 
TimeStepper *& time_stepper_pt ()
 
TimeSteppertime_stepper_pt () const
 
virtual void position (const double &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void dposition_dt (const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
 
virtual void locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 
virtual void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 

Private Attributes

Vector< Data * > Geom_data_pt
 Vector of pointers to Data items that affects the object's shape. More...
 
bool Must_clean_up
 Do I need to clean up? More...
 

Additional Inherited Members

- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 

Detailed Description

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Steady, straight 1D line in 2D space

\[ x = \zeta \]

\[ y = H \]

Constructor & Destructor Documentation

◆ StraightLine() [1/3]

oomph::StraightLine::StraightLine ( const Vector< Data * > &  geom_data_pt)
inline

Constructor: One item of geometric data:

Geom_data_pt[0]->value(0) = height
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
Definition: geom_objects.h:624
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
458  : GeomObject(1, 2)
459  {
460 #ifdef PARANOID
461  if (geom_data_pt.size() != 1)
462  {
463  std::ostringstream error_message;
464  error_message << "geom_data_pt should have size 1, not "
465  << geom_data_pt.size() << std::endl;
466 
467  if (geom_data_pt[0]->nvalue() != 1)
468  {
469  error_message << "geom_data_pt[0] should have 1 value, not "
470  << geom_data_pt[0]->nvalue() << std::endl;
471  }
472 
473  throw OomphLibError(error_message.str(),
476  }
477 #endif
478  Geom_data_pt.resize(1);
479  Geom_data_pt[0] = geom_data_pt[0];
480 
481  // Data has been created externally: Must not clean up
482  Must_clean_up = false;
483  }
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
GeomObject()
Default constructor.
Definition: geom_objects.h:104
bool Must_clean_up
Do I need to clean up?
Definition: geom_objects.h:627
Data * geom_data_pt(const unsigned &j)
Definition: geom_objects.h:617
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References geom_data_pt(), Geom_data_pt, Must_clean_up, oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ StraightLine() [2/3]

oomph::StraightLine::StraightLine ( const double height)
inline

Constructor: Pass height (pinned by default)

486  : GeomObject(1, 2)
487  {
488  // Create Data for straight-line object: The only geometric data is the
489  // height which is pinned
490  Geom_data_pt.resize(1);
491 
492  // Create data: One value, no timedependence, free by default
493  Geom_data_pt[0] = new Data(1);
494 
495  // I've created the data, I need to clean up
496  Must_clean_up = true;
497 
498  // Pin the data
499  Geom_data_pt[0]->pin(0);
500 
501  // Give it a value: Initial height
502  Geom_data_pt[0]->set_value(0, height);
503  }

References Geom_data_pt, Global_Physical_Variables::height(), and Must_clean_up.

◆ StraightLine() [3/3]

oomph::StraightLine::StraightLine ( const StraightLine dummy)
delete

Broken copy constructor.

◆ ~StraightLine()

oomph::StraightLine::~StraightLine ( )
inline

Destructor: Clean up if necessary.

514  {
515  // Do I need to clean up?
516  if (Must_clean_up)
517  {
518  delete Geom_data_pt[0];
519  Geom_data_pt[0] = 0;
520  }
521  }

References Geom_data_pt, and Must_clean_up.

Member Function Documentation

◆ d2position() [1/2]

virtual void oomph::StraightLine::d2position ( const Vector< double > &  zeta,
RankThreeTensor< double > &  ddrdzeta 
) const
inlinevirtual

2nd derivative of position Vector w.r.t. to coordinates: \( \frac{d^2R_i}{d \zeta_\alpha d \zeta_\beta}\) = ddrdzeta(alpha,beta,i). Evaluated at current time.

Reimplemented from oomph::GeomObject.

577  {
578  // Derivative of tangent vector
579  ddrdzeta(0, 0, 0) = 0.0;
580  ddrdzeta(0, 0, 1) = 0.0;
581  }

◆ d2position() [2/2]

virtual void oomph::StraightLine::d2position ( const Vector< double > &  zeta,
Vector< double > &  r,
DenseMatrix< double > &  drdzeta,
RankThreeTensor< double > &  ddrdzeta 
) const
inlinevirtual

Posn Vector and its 1st & 2nd derivatives w.r.t. to coordinates: \( \frac{dR_i}{d \zeta_\alpha}\) = drdzeta(alpha,i). \( \frac{d^2R_i}{d \zeta_\alpha d \zeta_\beta}\) = ddrdzeta(alpha,beta,i). Evaluated at current time.

Reimplemented from oomph::GeomObject.

594  {
595  // Position Vector
596  r[0] = zeta[0];
597  r[1] = Geom_data_pt[0]->value(0);
598 
599  // Tangent vector
600  drdzeta(0, 0) = 1.0;
601  drdzeta(0, 1) = 0.0;
602 
603  // Derivative of tangent vector
604  ddrdzeta(0, 0, 0) = 0.0;
605  ddrdzeta(0, 0, 1) = 0.0;
606  }
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
r
Definition: UniformPSDSelfTest.py:20

References Geom_data_pt, UniformPSDSelfTest::r, and Eigen::zeta().

◆ dposition()

virtual void oomph::StraightLine::dposition ( const Vector< double > &  zeta,
DenseMatrix< double > &  drdzeta 
) const
inlinevirtual

Derivative of position Vector w.r.t. to coordinates: \( \frac{dR_i}{d \zeta_\alpha}\) = drdzeta(alpha,i). Evaluated at current time.

Reimplemented from oomph::GeomObject.

565  {
566  // Tangent vector
567  drdzeta(0, 0) = 1.0;
568  drdzeta(0, 1) = 0.0;
569  }

◆ geom_data_pt()

Data* oomph::StraightLine::geom_data_pt ( const unsigned j)
inlinevirtual

Return pointer to the j-th Data item that the object's shape depends on

Reimplemented from oomph::GeomObject.

618  {
619  return Geom_data_pt[j];
620  }
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References Geom_data_pt, and j.

Referenced by StraightLine().

◆ ngeom_data()

unsigned oomph::StraightLine::ngeom_data ( ) const
inlinevirtual

How many items of Data does the shape of the object depend on?

Reimplemented from oomph::GeomObject.

611  {
612  return Geom_data_pt.size();
613  }

References Geom_data_pt.

◆ operator=()

void oomph::StraightLine::operator= ( const StraightLine )
delete

Broken assignment operator.

◆ position() [1/2]

void oomph::StraightLine::position ( const unsigned t,
const Vector< double > &  zeta,
Vector< double > &  r 
) const
inlinevirtual

Parametrised position on object: r(zeta). Evaluated at previous timestep. t=0: current time; t>0: previous timestep.

Reimplemented from oomph::GeomObject.

539  {
540 #ifdef PARANOID
541  if (t > Geom_data_pt[0]->time_stepper_pt()->nprev_values())
542  {
543  std::ostringstream error_message;
544  error_message << "t > nprev_values() " << t << " "
545  << Geom_data_pt[0]->time_stepper_pt()->nprev_values()
546  << std::endl;
547 
548  throw OomphLibError(error_message.str(),
551  }
552 #endif
553 
554  // Position Vector at time level t
555  r[0] = zeta[0];
556  r[1] = Geom_data_pt[0]->value(t, 0);
557  }
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
t
Definition: plotPSD.py:36

References Geom_data_pt, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, UniformPSDSelfTest::r, plotPSD::t, oomph::GeomObject::time_stepper_pt(), and Eigen::zeta().

◆ position() [2/2]

void oomph::StraightLine::position ( const Vector< double > &  zeta,
Vector< double > &  r 
) const
inlinevirtual

Position Vector at Lagrangian coordinate zeta.

Implements oomph::GeomObject.

526  {
527  // Position Vector
528  r[0] = zeta[0];
529  r[1] = Geom_data_pt[0]->value(0);
530  }

References Geom_data_pt, UniformPSDSelfTest::r, and Eigen::zeta().

Member Data Documentation

◆ Geom_data_pt

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

Vector of pointers to Data items that affects the object's shape.

Referenced by d2position(), geom_data_pt(), ngeom_data(), position(), StraightLine(), and ~StraightLine().

◆ Must_clean_up

bool oomph::StraightLine::Must_clean_up
private

Do I need to clean up?

Referenced by StraightLine(), and ~StraightLine().


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