mbsim  4.0.0
MBSim Kernel
contact_utils.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 _CONTACT_UTILS_H_
21#define _CONTACT_UTILS_H_
22
23//#include "mbsim/contours/contour_interpolation.h"
24//#include "mbsim/dynamic_system_solver.h"
25#include "fmatvec/fmatvec.h"
26
27//#include <vector>
28
29namespace MBSim {
30
31 class ContactKinematics;
32
38 double computeAngleOnUnitCircle(const fmatvec::Vec3& r);
39
45 fmatvec::Vec2 computeAnglesOnUnitSphere(const fmatvec::Vec3& r);
46
51 fmatvec::Vec3 orthonormal(const fmatvec::Vec3 &n);
52
59 ContactKinematics* findContactPairingRigidRigid(const std::type_info &contour0, const std::type_info &contour1);
60
61// /*!
62// * \brief apply contact between ContourInterpolation surfaces, using node-to-surface pairings, with both as master
63// * \author Roland Zander
64// * \date 2009-07-14 some comments (Thorsten Schindler)
65// */
66// template <class T>
67// void ContactContourInterpolation(DynamicSystemSolver *ds, T *contact, ContourInterpolation *contour0, ContourInterpolation *contour1) {
68// ContactContourInterpolation(ds,contact,contour0,contour1,0);
69// }
70//
71// /*!
72// * \brief apply contact between ContourInterploation surfaces, using node-to-surface pairings, defining master contour 1 or 2, default 0 for both
73// * \author Roland Zander
74// * \date 2009-07-14 some comments (Thorsten Schindler)
75// */
76// template <class T>
77// void ContactContourInterpolation(DynamicSystemSolver *ds, const T *contact, ContourInterpolation *contour0, ContourInterpolation *contour1, int master) {
78// ContourInterpolation *contour[2];
79// contour[0] = contour0;
80// contour[1] = contour1;
81// std::string contactName = contact->getName();
82//
83// int cStart, cEnd;
84// switch(master) {
85// case 0: cStart = 0; cEnd = 1; break;
86// case 1: cStart = 1; cEnd = 1; break;
87// case 2: cStart = 0; cEnd = 0; break;
88// }
89//
90// for(int c = cStart;c<cEnd+1;c++) { // loop with respect to contours
91// int numberOfPoints = contour[c]->getNPoints();
92// char contourName;
93// switch(c) {
94// case 0: contourName = 'A';break;
95// case 1: contourName = 'B';break;
96// }
97// for(int i = 0;i<numberOfPoints; i++) { // use all points
98// std::stringstream number;
99// std::string name = contactName + number.str();
100//
101// T *newContact = new T( contact , name );
102//
103// newContact->connect(contour[c]->getPoint(i),contour[1-c]);
104// ds->addLink(newContact);
105// }
106// }
107// }
108
109}
110
111#endif /* _CONTACT_UTILS_H_ */
basic class for contact kinematical calculations
Definition: contact_kinematics.h:41
namespace MBSim
Definition: bilateral_constraint.cc:30