All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
maxwell_contact.h
1 /* Copyright (C) 2004-2014 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 _MAXWELL_CONTACT_H_
21 #define _MAXWELL_CONTACT_H_
22 
23 #include <mbsim/links/contact.h>
24 #include <mbsim/numerics/linear_complementarity_problem/linear_complementarity_problem.h>
25 #include <map>
26 
27 namespace MBSim {
28 
29  class ContactKinematics;
30  class GeneralizedForceLaw;
31  class GeneralizedImpactLaw;
32  class FrictionForceLaw;
33  class FrictionImpactLaw;
34  class InfluenceFunction;
35 
50  class MaxwellContact : public Contact {
51  public:
56  MaxwellContact(const std::string &name = "");
57 
61  virtual ~MaxwellContact();
62 
63  /* INHERITED INTERFACE OF ELEMENT */
64  virtual std::string getType() const {
65  return "MaxwellContact";
66  }
67  /***************************************************/
68 
69  virtual void init(InitStage stage);
70  virtual void initializeContourCouplings();
71  virtual void initializeUsingXML(xercesc::DOMElement *element);
72 
81  void addContourCoupling(Contour *contour1, Contour *contour2, InfluenceFunction *fct);
82 
83  void setDampingCoefficient(double d) { dampingCoefficient = d; }
84 
85  void setGapLimit(double gLim_) { gLim = gLim_; }
86 
90  virtual void updatePossibleContactPoints();
91 
97  virtual void updateInfluenceMatrix();
98 
102  void updateRigidBodyGap();
103 
110  virtual double computeInfluenceCoefficient(const std::pair<int, int> & contactIndex);
111 
119  virtual double computeInfluenceCoefficient(const std::pair<int, int> & contactIndex, const std::pair<int, int> & couplingContactIndex);
120 
121  /*
122  * \brief computes the "material constant" to have a good guess for the lambda-vector
123  */
124  virtual void computeMaterialConstant();
125 
126  virtual void updateGeneralizedNormalForce();
127 
128  protected:
135  std::vector<std::pair<int, int> > possibleContactPoints;
136 
141 
146 
147  /*
148  * \brief vector of rigid body distances(gaps) for the active contacts
149  */
150  fmatvec::Vec rigidBodyGap;
151 
155  std::map<std::pair<Contour*, Contour*>, InfluenceFunction*> influenceFunctions;
156 
161 
166 
170  double gLim;
171 
175  double matConst;
176 
181 
192 
193  private:
194  struct xmlInfo {
195  InfluenceFunction * function;
196  std::string name1;
197  std::string name2;
198  };
199  std::vector<xmlInfo> referenceXML;
200  };
201 
202 }
203 
204 #endif /* _CONTACT_H_ */
205 
virtual ~MaxwellContact()
destructor
Definition: maxwell_contact.cc:50
class for contacts
Definition: contact.h:48
class to solve a linear complementarity problem
Definition: linear_complementarity_problem.h:38
virtual void updatePossibleContactPoints()
saves all possible contacts in a vector
Definition: maxwell_contact.cc:142
fmatvec::SymMat C
Influence matrix between contact points.
Definition: maxwell_contact.h:145
basic class for contour definition for rigid (which do not know about their shape) and flexible (they...
Definition: contour.h:40
int DEBUGLEVEL
print INFO output?
Definition: maxwell_contact.h:191
double dampingCoefficient
coefficient for possible contact damping
Definition: maxwell_contact.h:165
std::vector< std::pair< int, int > > possibleContactPoints
saves the indices of all active contacts in pairs
Definition: maxwell_contact.h:135
void updateRigidBodyGap()
update the rigid body distances (gaps) for the single contacts
Definition: maxwell_contact.cc:176
void addContourCoupling(Contour *contour1, Contour *contour2, InfluenceFunction *fct)
add a function that represents the coupling between two contours
Definition: maxwell_contact.cc:63
double gLim
relative contact point distance limit under which damping is active
Definition: maxwell_contact.h:170
virtual double computeInfluenceCoefficient(const std::pair< int, int > &contactIndex)
computes the coupling factor for the influence matrix on one contact point (two contours) ...
Definition: maxwell_contact.cc:187
fmatvec::Vec solution0
Solution of the last time, where contact has to be solved (can be used as starting guess for the next...
Definition: maxwell_contact.h:160
std::map< std::pair< Contour *, Contour * >, InfluenceFunction * > influenceFunctions
saves the influence functions for a pair of contours. The key is the pair of contour names ...
Definition: maxwell_contact.h:155
Definition: maxwell_contact.h:194
InitStage
The stages of the initialization.
Definition: element.h:97
std::string name
name of element
Definition: element.h:298
MaxwellContact(const std::string &name="")
constructor
Definition: maxwell_contact.cc:47
bool matConstSetted
parameter to save if matConst has been computed already
Definition: maxwell_contact.h:180
function describing the influence between the deformations on a body
Definition: influence_function.h:45
class for contacts
Definition: maxwell_contact.h:50
LinearComplementarityProblem LCP
variable for the LCP
Definition: maxwell_contact.h:140
virtual void updateInfluenceMatrix()
updates the influence matrix C
Definition: maxwell_contact.cc:153
virtual std::string getType() const
Definition: maxwell_contact.h:64
virtual void init(InitStage stage)
plots time series header
Definition: maxwell_contact.cc:78
double matConst
parameter for guessing starting values of contact force (average eigenvalue of influence-matrix) ...
Definition: maxwell_contact.h:175

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML