Class SegmentBase

Class Documentation

class Mechatronix::SegmentBase

Segment base class.

Public Functions

inline SegmentBase()
inline virtual ~SegmentBase()
inline SegmentBase(SegmentBase const &seg)

build a copy of the segment seg

SegmentBase const &operator=(SegmentBase const &seg)

assign a copy of the segment seg

inline void reset()
inline integer numNodes() const

return the number of nodes of the segment

real_type ssNode(integer i) const

return the i-th node of the segment

inline real_type ssMin() const

return the first node of the segment

inline real_type ssMax() const

return the last node of the segment

inline real_type ssLength() const

return the lenght of the segment

inline real_type ssFraction(real_type s) const

return the fraction od the segment addessed

real_type ssTrapezoid(real_type s, real_type a, real_type b) const

return the fraction od the segment addessed

real_type ssTrapezoidAbsolute(real_type s, real_type a, real_type b) const

return the fraction od the segment addessed

void setLength(real_type len)

Set segment length.

void setRange(real_type s0, real_type s1)

Set segment s range.

void rescale(real_type s0, real_type s1)

Set segment s range.

inline real_type ds_xMin() const
inline real_type ds_xMax() const
inline real_type ds_yMin(integer column) const
inline real_type ds_yMax(integer column) const
inline real_type ds_yMin(char const *column) const
inline real_type ds_yMax(char const *column) const
inline real_type ds_eval(real_type s, integer column) const

access to SplineSet

inline real_type ds_eval(real_type s, char const *column) const

access to SplineSet

inline real_type ds_eval(real_type s, integer indep, integer column) const

access to SplineSet

inline real_type ds_eval(real_type s, char const *indep, char const *column) const

access to SplineSet

inline real_type ds_eval_D(real_type s, integer column) const

access to SplineSet first derivative

inline real_type ds_eval_D(real_type s, char const *column) const

access to SplineSet first derivative

inline real_type ds_eval_D(real_type s, integer indep, integer column) const

access to SplineSet first derivative

inline real_type ds_eval_D(real_type s, char const *indep, char const *column) const

access to SplineSet first derivative

inline real_type ds_eval_DD(real_type s, integer column) const

access to SplineSet second derivative

inline real_type ds_eval_DD(real_type s, char const *column) const

access to SplineSet second derivative

inline real_type ds_eval_DD(real_type s, integer indep, integer column) const

access to SplineSet second derivative

inline real_type ds_eval_DD(real_type s, char const *indep, char const *column) const

access to SplineSet second derivative

inline real_type ds_eval_DDD(real_type s, integer column) const

access to SplineSet third derivative

inline real_type ds_eval_DDD(real_type s, char const *column) const

access to SplineSet third derivative

inline real_type ds_eval_DDD(real_type s, integer indep, integer column) const

access to SplineSet third derivative

inline real_type ds_eval_DDD(real_type s, char const *indep, char const *column) const

access to SplineSet third derivative

void setup(integer nseg, real_type s0, real_type hdefault, GenericContainer const &S)

Setup a segment

Possible constructors

*  { :length => [1,2,3], :n => [10,10,10] }
*

*  { :length => lseg } // USE hdefault
*  { :length => lseg, :n => N }
*  { :length => lseg, :h => hseg }
*  { :length => lseg, :nodes => [0,...,1] }
*

*  { :length => lseg, :density_function => { :cheb => N } }
*  { :length => lseg, :density_function => { :cheb_L => N } }
*  { :length => lseg, :density_function => { :cheb_R => N } }
*  { :length => lseg, :density_function => { :hcheb => [hmin,hmax] } }
*  { :length => lseg, :density_function => { :hcheb_L => [hmin,hmax] } }
*  { :length => lseg, :density_function => { :hcheb_R => [hmin,hmax] } }
*  { :length => lseg, :density_function => { :L => N, :rho => r } }
*  { :length => lseg, :density_function => { :R => N, :rho => r } }
*  { :length => lseg, :density_function => { :C => N, :rho => r } }
*  { :length => lseg, :density_function => { :hL => [hmin,hmax], :rho => r } }
*  { :length => lseg, :density_function => { :hR => [hmin,hmax], :rho => r } }
*  { :length => lseg, :density_function => { :hC => [hmin,hmax], :rho => r } }
*

in addition

*  { SEGMENT DEFINITION, :data_set => {...} }
*
Parameters
  • nseg – the segment number (use for the error message)

  • s0 – initial coordinate of the segment

  • hdefault – interval length if not specified

  • S – generic container with meshing description

void generateMeshByNumNodes(integer N)

Mesh the segment with N equal intervals

Parameters

N – the number of intervals the segment is split

void generateMeshByStepSize(real_type h)

Mesh the segment with equal intervals of lenght h

Parameters

h – the (desidered) length of the intervals

void generateMeshByPartitions(real_type *len, integer *n, integer nsub)

Split the segment in nsub partition \( [s_k,s_{k+1}] \) of length \( l_k = s_{k+1}-s_{k} \). Each partition is meshed with \( n_k \) equal intervals.

Parameters
  • len – vector of lengths of the sub-intervals

  • n – vector of integers with the number of subdivision for each sub-interval

  • nsub – length of vector len and n.

void generateMeshByCoordinates(real_type const s[], integer ns)

Generate the mesh at the positions given by s. ns is the the number of nodes.

Parameters
  • s – the vector of curvilinear coordinates where to put nodes

  • ns – length of vector s

void generateMeshByChebyshev(integer N)

Mesh the segment with N intervals using Chebyshev symmetric distribution

Parameters

N – the number of intervals the segment is split

void generateMeshByChebyshevLeft(integer N)

Mesh the segment with N intervals using Chebyshev distribution. Node on the Left are smaller

Parameters

N – the number of intervals the segment is split

void generateMeshByChebyshevRight(integer N)

Mesh the segment with N intervals using Chebyshev distribution. Node on the Right are smaller

Parameters

N – the number of intervals the segment is split

void hGenerateMeshByChebyshev(real_type hmin, real_type hmax)

Mesh the segment with N intervals using symmetric Chebyshev distribution. N is computed in order to satisfy that hmin is the length of the border segment and hmax is the length of the internal maximum length interval.

Parameters
  • hmin – minim lenght interval

  • hmax – maximum lenght interval

void hGenerateMeshByChebyshevLeft(real_type hmin, real_type hmax)

Mesh the segment with N intervals using Chebyshev distribution.

Parameters
  • hmin – minim lenght (of the leftmost interval)

  • hmax – maximum lenght (of the rightmost interval)

void hGenerateMeshByChebyshevRight(real_type hmin, real_type hmax)

Mesh the segment with N intervals using Chebyshev distribution.

Parameters
  • hmin – minim lenght (of the rightmost interval)

  • hmax – maximum lenght (of the leftmost interval)

void generateMeshByDensityLeft(integer N, real_type rho)

Mesh the segment with N intervals using desity function.

Parameters
  • N – number of interval

  • rho – ratio of the length of two consecutive interval, left to right

void generateMeshByDensityRight(integer N, real_type rho)

Mesh the segment with N intervals using desity function.

Parameters
  • N – number of interval

  • rho – ratio of the length of two consecutive interval, right to left

void generateMeshByDensity(integer N, real_type rho)

Mesh the segment with N intervals using desity function.

Parameters
  • N – number of interval

  • rho – ratio of the length of two consecutive interval on the two half of the segment

void hGenerateMeshByDensityLeft(real_type hmin, real_type hmax, real_type rho)

Mesh the segment with N intervals using desity function.

Parameters
  • hmin – length of the smaller interval

  • hmax – length of the bigger interval

  • rho – ratio of the length of two consecutive interval, left to right

void hGenerateMeshByDensityRight(real_type hmin, real_type hmax, real_type rho)

Mesh the segment with N intervals using desity function.

Parameters
  • hmin – length of the smaller interval

  • hmax – length of the bigger interval

  • rho – ratio of the length of two consecutive interval, right to left

void hGenerateMeshByDensity(real_type hmin, real_type hmax, real_type rho)

Mesh the segment with N intervals using desity function.

Parameters
  • hmin – length of the smaller interval

  • hmax – length of the bigger interval

  • rho – ratio of the length of two consecutive interval on the two part of the segment

void writeToStream(ostream_type &s) const

write a human readable description of the segment

void dump(ostream_type &s) const

dump a list of the nodes of the segment

inline void dataSetup(GenericContainer const &gc)
virtual string info() const

Print out class information.

inline void info(ostream_type &stream) const

Protected Attributes

real_type m_s0

initial coordinate of the segment

real_type m_slen

curvilinear length of the segment

vector<real_type> m_ssNodeList

node list of the segment

Splines::SplineSet m_data_set