00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef NUMERICS_DAMPINGFUNCITONS_H_
00021 #define NUMERICS_DAMPINGFUNCITONS_H_
00022
00023 #include <mbsim/numerics/functions/criteria_functions.h>
00024
00025 namespace MBSim {
00026
00027 class DampingFunction : public fmatvec::Function<double(fmatvec::Vec,fmatvec::Vec)> {
00028 public:
00032 DampingFunction();
00033
00034
00035
00036
00037 virtual ~DampingFunction() {
00038 }
00039
00040
00041 void setFunction(Function<fmatvec::Vec(fmatvec::Vec)> * function_) {
00042 function = function_;
00043 }
00044 void setCriteriaFunction(CriteriaFunction * criteria_) {
00045 criteria = criteria_;
00046 }
00047
00048
00049 virtual double operator ()(const fmatvec::Vec & x, const fmatvec::Vec & dx) = 0;
00050
00051 protected:
00055 Function<fmatvec::Vec(fmatvec::Vec)> *function;
00056
00060 CriteriaFunction * criteria;
00061
00062 };
00063
00064 class StandardDampingFunction : public DampingFunction {
00065
00066 public:
00070 StandardDampingFunction(unsigned int kmax_ = 300);
00071
00072
00073
00074
00075 virtual ~StandardDampingFunction() {
00076 }
00077
00078 virtual double operator ()(const fmatvec::Vec &x, const fmatvec::Vec &dx);
00079
00080 protected:
00084 unsigned int kmax;
00085 };
00086 }
00087 #endif //NUMERICS_DAMPINGFUNCITONS_H_