ParametricCurve.h
1 /******************************************************************************
2 
3  (c) 2004-2014 Scientific Computation Research Center,
4  Rensselaer Polytechnic Institute. All rights reserved.
5 
6  The LICENSE-SCOREC file included with this distribution describes the terms
7  of the SCOREC Non-Commercial License this program is distributed under.
8 
9 *******************************************************************************/
10 #ifndef PARAMETRICCURVE_H
11 #define PARAMETRICCURVE_H
12 
13 #include "CMAFwd.h"
14 
19  public:
20  virtual ~ParametricCurve() {
21  }
22 
23  inline int eval(Point1d in_t,
24  Point3d & out_xyz) {
25  return v_eval(in_t, out_xyz);
26  }
27 
28  inline int order(void) {
29  return v_order();
30  }
31 
32  inline int deriv1(Point1d in_t, Point3d & out_xyz)
33  {
34  return v_deriv1(in_t, out_xyz);
35  }
36 
39  inline void deriv1_fd(const Point1d in_t, Point3d & dxyz_dt, double step = 1.0e-3) {
40  Point3d pt2, pt1;
41  Point1d t = in_t;
42  this->eval(t + step, pt2);
43  this->eval(t, pt1);
44  dxyz_dt = (pt2 - pt1) / step;
45  }
46 
47  protected:
48  virtual int v_eval(Point1d in_t, Point3d & out_xyz) = 0;
49  virtual int v_order(void) = 0;
50  virtual int v_deriv1(Point1d in_t, Point3d & out_xyz) = 0;
51 
52 };
53 #endif //PARAMETRICCURVE_H
interface class for all parametric curves The parametric curves use the same coordinate system as the...
Definition: ParametricCurve.h:18
void deriv1_fd(const Point1d in_t, Point3d &dxyz_dt, double step=1.0e-3)
Evaluate first derivative numerically by finite difference.
Definition: ParametricCurve.h:39