MBSim

Project Page
contour_interpolation.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _CONTOUR_INTERPOLATION_H_
21 #define _CONTOUR_INTERPOLATION_H_
22 
23 #include "mbsim/contour.h"
24 #include "mbsim/contours/point.h"
25 
26 namespace MBSim {
27 
34  class ContourInterpolation : public Contour {
35  public:
42  ContourInterpolation(const std::string &name, int parameters_, int nPoints_);
48  void setPoint(Point *pointN, int n);
52  std::vector<Point*> getPoints() const {return iPoints;}
53  Point* getPoint(const int n) const {return iPoints[n];}
57  int getNPoints() const {return numberOfPoints;}
67  virtual bool testInsideBounds(const ContourPointData &cp) = 0;
74  virtual double computePointWeight(const fmatvec::Vec &s, int i) = 0;
82  virtual double computePointWeight(const fmatvec::Vec &s, int i, int diff) = 0;
86  fmatvec::Vec computePointWeights(const fmatvec::Vec &s);
87 
88  fmatvec::Vec computeWrOC(const fmatvec::Vec& s);// {ContourPointData cp; cp.type=EXTINTERPOL;cp.alpha=s; return computeWrOC(cp);};
89  fmatvec::Vec computeWvC (const fmatvec::Vec& s);// {ContourPointData cp; cp.type=EXTINTERPOL;cp.alpha=s; return computeWvC (cp);};
90  fmatvec::Mat computeWt (const fmatvec::Vec& s);// {ContourPointData cp; cp.type=EXTINTERPOL;cp.alpha=s; return computeWt (cp);};
91  fmatvec::Vec computeWn (const fmatvec::Vec& s);// {ContourPointData cp; cp.type=EXTINTERPOL;cp.alpha=s; return computeWn (cp);};
92 
93  fmatvec::Vec computeWrOC(const ContourPointData &cp);
94  fmatvec::Vec computeWvC (const ContourPointData &cp);
95 
96  fmatvec::Mat computeWt (const ContourPointData &cp);
97  virtual fmatvec::Vec computeWn (const ContourPointData &cp) = 0;
98 
99  protected:
103  std::vector<Point*> iPoints;
112  };
113 }
114 
115 #endif /* _CONTOUR_INTERPOLATION_H_ */