All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
spatial_contact_search.h
1 /* Copyright (C) 2004-2010 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 _SPATIAL_CONTACT_SEARCH_H_
21 #define _SPATIAL_CONTACT_SEARCH_H_
22 
23 #include <fmatvec/fmatvec.h>
24 
25 namespace MBSim {
26 
27  template <typename Sig> class Function;
28  template <typename Sig> class DistanceFunction;
29 
39  public:
47 
48  /* GETTER / SETTER */
49  void setInitialValue(const fmatvec::Vec2 &s0_) { s0 = s0_; }
50  void setNodes(const fmatvec::Vec &nodesU_, const fmatvec::Vec &nodesV_) {
51  nodesU = nodesU_;
52  nodesV = nodesV_;
53  }
54  void setSearchAll(bool searchAll_) { searchAll = searchAll_; }
55  /*************************************************/
56 
66  void setEqualSpacing(const int nU, const int nV, const double U0, const double V0, const double dU, const double dV);
67 
72  fmatvec::Vec2 slv();
73 
74 // /*!
75 // * \brief solve for all potential contact points
76 // * \return matrix holding LagrangeParameterPosition in col(0) and respective distances in col(1)
77 // */
78 // fmatvec::Mat slvAll();
79 
80  protected:
84  std::vector<double> searchVdirection(double u);
85 
86  private:
91 
95  Function<fmatvec::SqrMat(fmatvec::Vec)> *jac; // TODO::check the template type
96 
100  fmatvec::Vec2 s0;
101 
106 
110  bool searchAll;
111  };
112 }
113 
114 #endif
Definition: distance_function.h:27
fmatvec::Vec2 slv()
solve for the one potential contact point with minimal distance (might be negative) ...
Definition: spatial_contact_search.cc:42
std::vector< double > searchVdirection(double u)
solve for all potential contact points
Definition: spatial_contact_search.cc:128
SpatialContactSearch(DistanceFunction< fmatvec::Vec(fmatvec::Vec)> *func_=0, Function< fmatvec::SqrMat(fmatvec::Vec)> *jac_=0)
constructor
Definition: spatial_contact_search.h:46
void setEqualSpacing(const int nU, const int nV, const double U0, const double V0, const double dU, const double dV)
set equally distanced nodes
Definition: spatial_contact_search.cc:30
Function< fmatvec::SqrMat(fmatvec::Vec)> * jac
Jacobian of root function part of distance function.
Definition: spatial_contact_search.h:95
bool searchAll
all area searching by Regular-Falsi or known initial value for Newton-Method?
Definition: spatial_contact_search.h:110
fmatvec::Vec nodesU
nodes defining search-areas for Regula-Falsi
Definition: spatial_contact_search.h:105
Definition: planar_contour.h:31
DistanceFunction< fmatvec::Vec(fmatvec::Vec)> * func
distance-function holding all information for contact-search
Definition: spatial_contact_search.h:90
fmatvec::Vec2 s0
initial value for Newton method
Definition: spatial_contact_search.h:100
general class for contact search with respect to two contour-parameter
Definition: spatial_contact_search.h:38

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML