All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
sphere_polynomialfrustum.h
1 /* Copyright (C) 2004-2012 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 SPHERE_POLYNOMIALFRUSTUM_H_
21 #define SPHERE_POLYNOMIALFRUSTUM_H_
22 
23 #include "contact_kinematics.h"
24 
25 #include <mbsim/contours/polynomial_frustum.h>
26 #include <mbsim/contours/sphere.h>
27 #include <mbsim/numerics/nonlinear_algebra/multi_dimensional_newton_method.h>
28 
29 namespace MBSim {
30 
31  class PolyFurstumSphereContact : public Function<fmatvec::Vec(fmatvec::Vec)> {
32  public:
33  PolyFurstumSphereContact(const PolynomialFrustum * frustum) : sphereCenter(fmatvec::Vec3()), rS(0.), frustum(frustum) {
34  }
35 
36  virtual ~PolyFurstumSphereContact() {
37  }
38 
39  void setCenter(const fmatvec::Vec3 & sphereCenter_) {
40  sphereCenter = sphereCenter_;
41  rS = sqrt(sphereCenter(1) * sphereCenter(1) + sphereCenter(2) * sphereCenter(2));
42  }
43 
44  fmatvec::Vec operator()(const fmatvec::Vec &x);
45 
46  protected:
50  fmatvec::Vec3 sphereCenter;
51 
55  double rS;
56 
61  };
62 
64  public:
66  }
67 
69  }
70 
71  void setCenter(const fmatvec::Vec3 & sphereCenter_) {
72  sphereCenter = sphereCenter_;
73  rS = sqrt(sphereCenter(1) * sphereCenter(1) + sphereCenter(2) * sphereCenter(2));
74  }
75 
76  virtual fmatvec::SqrMat operator ()(const fmatvec::Vec & x);
77 
78  protected:
82  fmatvec::Vec3 sphereCenter;
83 
87  double rS;
88 
93  };
94 
101  public:
104 
105  /* INHERITED INTERFACE OF CONTACTKINEAMTICS */
106  void assignContours(const std::vector<Contour*> &contour);
107  virtual void updateg(double& g, std::vector<ContourFrame*> &cFrame, int index = 0);
108  virtual void updatewb(fmatvec::Vec& wb, double g, std::vector<ContourFrame*> &cFrame) {
109  throw MBSimError("(ContactKinematicsAreaPolynomialFrustum::updatewb): not implemented!");
110  }
111 
112  protected:
113 
117  int isphere;
118 
122  int ifrustum;
123 
128 
133 
138 
139  /*
140  * \brief function for contact search
141  */
143 
148 
153 
158 
163 
164 
165 
166  };
167 
168 } /* namespace MBSim */
169 #endif /* SPHERE_POLYNOMIALFRUSTUM_H_ */
fmatvec::Vec3 sphereCenter
center of the sphere in coordinates of the frustum
Definition: sphere_polynomialfrustum.h:50
This criteria function class applies the infinity norm globally on the complete vector and compares i...
Definition: criteria_functions.h:170
Newton method for multidimensional root finding.
Definition: multi_dimensional_newton_method.h:41
fmatvec::Vec3 sphereCenter
center of the sphere
Definition: sphere_polynomialfrustum.h:82
fmatvec::Vec x
solution vector of nonlinear system
Definition: sphere_polynomialfrustum.h:162
virtual void updateg(double &g, std::vector< ContourFrame * > &cFrame, int index=0)
compute normal distance, possible contact point positions and orientation (cf. contact.cc)
Definition: sphere_polynomialfrustum.cc:85
Sphere * sphere
pointer to the contour class for the sphere
Definition: sphere_polynomialfrustum.h:127
Definition: sphere_polynomialfrustum.h:63
GlobalResidualCriteriaFunction * criteria
residual function for newton
Definition: sphere_polynomialfrustum.h:152
const PolynomialFrustum * frustum
polynomial parameters of the frustum
Definition: sphere_polynomialfrustum.h:92
base class for square Jacobians used for the newton method
Definition: newton_method_jacobian_functions.h:31
sphere
Definition: sphere.h:36
Frustum contour with a polynomial radius over height course.
Definition: polynomial_frustum.h:38
const PolynomialFrustum * frustum
polynomial parameters of the frustum
Definition: sphere_polynomialfrustum.h:60
void assignContours(const std::vector< Contour * > &contour)
treats ordering of contours
Definition: sphere_polynomialfrustum.cc:57
PolyFurstumSphereContactJacobian * jacobian
jacobian function for solution
Definition: sphere_polynomialfrustum.h:147
MBSim::StandardDampingFunction * damping
damping function for newton
Definition: sphere_polynomialfrustum.h:157
Definition: sphere_polynomialfrustum.h:31
PolynomialFrustum * frustum
pointer to the contour class for the polynomial frustum
Definition: sphere_polynomialfrustum.h:132
Definition: planar_contour.h:31
int isphere
contour index of sphere (in cpData)
Definition: sphere_polynomialfrustum.h:117
virtual void updatewb(fmatvec::Vec &wb, double g, std::vector< ContourFrame * > &cFrame)
compute acceleration in terms of contour parameters for event driven integration
Definition: sphere_polynomialfrustum.h:108
MBSim::MultiDimensionalNewtonMethod newton
Newton solver for nonlinear problem.
Definition: sphere_polynomialfrustum.h:137
double rS
radial coordinate of the sphere center in the 2D description
Definition: sphere_polynomialfrustum.h:55
basic error class for mbsim
Definition: mbsim_event.h:38
Definition: damping_functions.h:64
basic class for contact kinematical calculations
Definition: contact_kinematics.h:39
class for contact kinematics between convex frustum and a sphere
Definition: sphere_polynomialfrustum.h:100
int ifrustum
contour index of frustum (in cpData)
Definition: sphere_polynomialfrustum.h:122
double rS
radial coordinate of the sphere center in the 2D description
Definition: sphere_polynomialfrustum.h:87

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML