MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
friction.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/friction.cc,v 1.53 2017/01/12 14:46:43 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 2003-2017
7  *
8  * Marco Morandini <morandini@aero.polimi.it>
9  *
10  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
11  * via La Masa, 34 - 20156 Milano, Italy
12  * http://www.aero.polimi.it
13  *
14  * Changing this copyright notice is forbidden.
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation (version 2 of the License).
19  *
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29  */
30 
31 /* Copyright (C) 2003 Marco Morandini*/
32 
33 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
34 
35 #include <cmath>
36 
37 #include "mbpar.h"
38 #include "datamanforward.h"
39 #include "friction.h"
40 #include "submat.h"
41 
42 int sign(const doublereal x) {
43  if (x >= 0.) {
44  return 1;
45  } else if (x < 0.) {
46  return -1;
47  }
48  return 0;
49 };
50 
51 void
55  const unsigned int solution_startdof)
56 {
57  NO_OP;
58 }
59 
61  const doublereal s0,
62  const doublereal s1,
63  const doublereal s2,
64  const doublereal k,
65  const BasicScalarFunction *const ff) :
66 sigma0(s0),
67 sigma1(s1),
68 sigma2(s2),
69 kappa(k),
70 fss(dynamic_cast<const DifferentiableScalarFunction&>(*ff)),
71 f(0.)
72 {
73  NO_OP;
74 }
75 
76 void
78  VectorHandler&X,
79  VectorHandler&XP,
81  const unsigned int solution_startdof)
82 {
83  X.PutCoef(solution_startdof+1,f/sigma0);
84 }
85 
86 unsigned int ModLugreFriction::iGetNumDof(void) const {
87  return 1;
88 };
89 
90 std::ostream&
91 ModLugreFriction::DescribeDof(std::ostream& out, const char *prefix, bool bInitial) const
92 {
93  return out << prefix
94  << "[1]: ModLugreFriction state" << std::endl;
95 }
96 
97 void
98 ModLugreFriction::DescribeDof(std::vector<std::string>& desc, bool bInitial, int i) const
99 {
100  ASSERT(i == -1 || i == 0);
101  desc.resize(1);
102  desc[0] = "ModLugreFriction state";
103 }
104 
105 std::ostream&
106 ModLugreFriction::DescribeEq(std::ostream& out, const char *prefix, bool bInitial) const
107 {
108  return out << prefix
109  << "[1]: ModLugreFriction equation" << std::endl;
110 }
111 
112 void
113 ModLugreFriction::DescribeEq(std::vector<std::string>& desc, bool bInitial, int i) const
114 {
115  ASSERT(i == -1 || i == 0);
116  desc.resize(1);
117  desc[0] = "ModLugreFriction equation";
118 }
119 
121  ASSERTMSGBREAK(i<iGetNumDof(), "INDEX ERROR in ModLugreFriction::GetDofType");
122  return DofOrder::DIFFERENTIAL;
123 };
124 
126  ASSERTMSGBREAK(i<iGetNumDof(), "INDEX ERROR in ModLugreFriction::GetEqType");
127  return DofOrder::DIFFERENTIAL;
128 };
129 
131  return fss(std::abs(v))*sign(v);
132 };
133 
135  return fss.ComputeDiff(std::abs(v),1)*sign(v);
136 };
137 
139  const doublereal v) const {
140 
141  doublereal zss = fs(v)/sigma0;
142  doublereal zba = kappa*zss;
143 
144  if (sign(v)==sign(z)) {
145  if (std::abs(z) <= std::abs(zba)) {
146  } else if ((std::abs(zba)<=std::abs(z)) &&
147  (std::abs(z)<=std::abs(zss))) {
148  return 0.5*std::sin(M_PI*sigma0*z/(fs(v)*(1.-kappa))
149  -M_PI*(1.+kappa)/(2*(1.-kappa)))+0.5;
150  } else {
151  return 1.;
152  }
153  }
154  return 0.;
155 };
156 
158  const doublereal v) const {
159 
160  doublereal zss = fs(v)/sigma0;
161  doublereal zba = kappa*zss;
162  doublereal der;
163 
164  if (sign(v)==sign(z)) {
165  if (std::fabs(z) <= std::fabs(zba)) {
166  der = 0.;
167  } else if ((std::fabs(zba) <= std::fabs(z)) &&
168  (std::fabs(z) <= std::fabs(zss))) {
169  der = -M_PI/2*std::cos(M_PI*sigma0*z/fs(v)/(1.-kappa)
170  -M_PI*(1.+kappa)/2./(1.-kappa))
171  *sigma0*z/std::pow(fs(v),2)/(1.-kappa)
172  *fsd(v);
173  } else {
174  der = 0.;
175  }
176  } else {
177  der = 0.;
178  }
179  return der;
180 };
181 
183  const doublereal v) const {
184 
185  doublereal zss = fs(v)/sigma0;
186  doublereal zba = kappa*zss;
187  doublereal der;
188 
189  if (sign(v)==sign(z)) {
190  if (std::fabs(z) <= std::fabs(zba)) {
191  der = 0;
192  } else if ((std::fabs(zba) <= std::fabs(z)) &&
193  (std::fabs(z) <= std::fabs(zss))) {
194  der = 0.5*M_PI*sigma0/fs(v)/(1.-kappa)
195  *std::cos(M_PI*sigma0*z/fs(v)/(1.-kappa)
196  -M_PI*(1.+kappa)/2./(1.-kappa));
197  } else {
198  der = 0;
199  }
200  } else {
201  der = 0;
202  }
203  return der;
204 };
205 
207  return f;
208 };
209 
211  SubVectorHandler& WorkVec,
212  const unsigned int startdof,
213  const unsigned int solution_startdof,
214  const doublereal F,
215  const doublereal v,
216  const VectorHandler& X,
218  doublereal z = X(solution_startdof+1);
219  doublereal zp = XP(solution_startdof+1);
220  f = sigma0*z + sigma1*zp + sigma2*v;
221  WorkVec.IncCoef(startdof+1,zp-v+alpha(z,v)*v*z/fs(v)*sigma0);
222 };
223 
225  FullSubMatrixHandler& WorkMat,
226  ExpandableRowVector& dfc,
227  const unsigned int startdof,
228  const unsigned int solution_startdof,
229  const doublereal dCoef,
230  const doublereal F,
231  const doublereal v,
232  const VectorHandler& X,
233  const VectorHandler& XP,
234  const ExpandableRowVector& dF,
235  const ExpandableRowVector& dv) const {
236 
237  doublereal z = X(solution_startdof+1);
238  //doublereal zp = XP(solution_startdof+1);
239 /*
240  * attrito
241  */
242  dfc.ReDim(2);
243  dfc.Set(sigma0*dCoef+sigma1, 1, startdof+1);
244  dfc.Set(sigma2, 2); dfc.Link(2, &dv);
245 
246 /*
247  * z
248  */
249  doublereal alph = alpha(z,v);
250  doublereal fsc = fs(v);
251  WorkMat.IncCoef(startdof+1,startdof+1,-1.);
252  WorkMat.IncCoef(startdof+1,startdof+1,
253  -alphad_z(z,v)*v*z/fsc*sigma0*dCoef-
254  alph*v/fsc*sigma0*dCoef);
255  dv.Add(WorkMat,startdof+1,
256  1.-
257  alphad_v(z,v)*v*z/fsc*sigma0-
258  alph*z/fsc*sigma0+
259  alph*v*z/(fsc*fsc)*fsd(v)*sigma0);
260 // std::cout << alphad_z(z,v) << std::endl;
261 /*
262  * callback: dfc[] = df/d{F,v,(z+dCoef,zp)}
263  */
264 };
265 
266 //----------------------
268  const BasicScalarFunction *const ff,
269  const doublereal s2,
270  const doublereal vr) :
271 converged_sticked(true),
272 status(sticked),
273 transition_type(null),
274 converged_v(0),
275 first_iter(true),
276 first_switch(true),
277 previous_switch_v(0),
278 current_velocity(0),
279 sigma2(s2),
280 vel_ratio(vr),
281 current_friction_force(0),
282 fss(dynamic_cast<const DifferentiableScalarFunction&>(*ff)),
283 f(0)
284 {
285  NO_OP;
286 }
287 
288 void
290  VectorHandler&X,
291  VectorHandler&XP,
293  const unsigned int solution_startdof)
294 {
295  X.PutCoef(solution_startdof+1,f);
296 }
297 
298 unsigned int DiscreteCoulombFriction::iGetNumDof(void) const {
299  return 1;
300 };
301 
302 std::ostream&
303 DiscreteCoulombFriction::DescribeDof(std::ostream& out, const char *prefix, bool bInitial) const
304 {
305  return out << prefix
306  << "[1]: DiscreteCoulombFriction state" << std::endl;
307 }
308 
309 void
310 DiscreteCoulombFriction::DescribeDof(std::vector<std::string>& desc, bool bInitial, int i) const
311 {
312  ASSERT(i == -1 || i == 0);
313  desc.resize(1);
314  desc[0] = "DiscreteCoulombFriction state";
315 }
316 
317 std::ostream&
318 DiscreteCoulombFriction::DescribeEq(std::ostream& out, const char *prefix, bool bInitial) const
319 {
320  return out << prefix
321  << "[1]: DiscreteCoulombFriction equation" << std::endl;
322 }
323 
324 void
325 DiscreteCoulombFriction::DescribeEq(std::vector<std::string>& desc, bool bInitial, int i) const
326 {
327  ASSERT(i == -1 || i == 0);
328  desc.resize(1);
329  desc[0] = "DiscreteCoulombFriction equation";
330 }
331 
333  ASSERTMSGBREAK(i<iGetNumDof(), "INDEX ERROR in ModLugreFriction::GetDofType");
334  return DofOrder::ALGEBRAIC;
335 };
336 
338  ASSERTMSGBREAK(i<iGetNumDof(), "INDEX ERROR in ModLugreFriction::GetEqType");
339  return DofOrder::DIFFERENTIAL;
340 };
341 
343  return current_friction_force;
344 };
345 
347  const doublereal F,
348  const doublereal v,
349  const VectorHandler&X,
350  const VectorHandler&XP,
351  const unsigned int solution_startdof) {
352  f = X(solution_startdof+1);
353 // std::cerr << " ** ";
354 // std::cerr << f << " " << v << " " << status << " " << transition_type << " ";
355  converged_v = v;
356  current_velocity = v;
357  previous_switch_v = v;
359  first_iter = true;
360  first_switch = true;
361  if (status == sticking) {
362 //* std::cerr << "sticking" << std::endl;
363  status = sticked;
364  } else if (status == sliding) {
365 //* std::cerr << "sliding" << std::endl;
366  } else {
367 //* std::cerr << "sticked" << std::endl;
368  }
369 // std::cerr << status << " " << transition_type << std::endl;
370 //* std::cerr << "CONVERGENZA; v = " << v << "; f = " << f << std::endl;
371 };
372 
373 
375  SubVectorHandler& WorkVec,
376  const unsigned int startdof,
377  const unsigned int solution_startdof,
378  const doublereal F,
379  const doublereal v,
380  const VectorHandler& X,
382 // std::cerr << "Chimata residuo. Status:" << status << std::endl;
383  f = X(solution_startdof+1);
384 // if ((std::fabs(f)-fss(0) > 1.0E-6) && (first_iter == false)) {
385 //* std::cerr << "Attrito: " << f << " " << (std::fabs(f)-fss(0))/fss(0) << " - " << std::endl;
386 //* std::cerr << "v: " << v << std::endl;
387  transition_type = null;
388 // std::cerr << "Attrito: " << f << " " << std::fabs(f)/fss(0) << " - " << std::endl;
389 // if ((std::fabs(std::fabs(f)-fss(0))/fss(0) > 1.0E-6)) {
390  if (std::fabs(f)-fss(0) > 1.0E-6*fss(0)) {
391  //unconditionally switch to sliding
392  if (status == sticked) {
393  transition_type = from_sticked_to_sliding;
394 //* std::cerr << "switch to sliding from sticked: " << transition_type << std::endl;
395  } else if (status == sticking) {
396  transition_type = from_sticking_to_sliding;
397 //* std::cerr << "switch to sliding from sticking: " << transition_type << std::endl;
398  } else if (status == sliding) {
399  //do nothing
400 // std::cerr << "DiscreteCoulombFriction::AssRes message:\n"
401 // << "you shold not go here1! What's wrong?\n"
402 // << "status: " << status << "\n"
403 // << "transition: " << transition_type << "\n"
404 // << "error: " << fabs(f)-fss(0)
405 // << std::endl;
406  } else {
407  silent_cerr("DiscreteCoulombFriction::AssRes() "
408  "logical error1" << std::endl);
409  }
410  status = sliding;
411  }
412  //else
413  if (status == sliding) {
414 // std::cerr << "v*current_velocity: " << v*current_velocity << std::endl;
415  if (v*current_velocity < 0.) {
416 //* std::cerr << "sono dentro; v: " << v <<
417 //* " previous_switch_v: " << previous_switch_v << std::endl;
418 //* std::cerr << "current velocity: " << current_velocity << std::endl;
419  if (((transition_type != from_sticked_to_sliding) ||
420  (transition_type != from_sticking_to_sliding)) &&
421  ((std::fabs(v-current_velocity) < std::fabs(previous_switch_v)) ||
422  (first_switch == true))) {
423 //* std::cerr << "Passo a sticking $$" << std::endl;;
424  first_switch = false;
425  status = sticking;
426  transition_type = from_sliding_to_sticking;
427  previous_switch_v = vel_ratio*(v-current_velocity);
428  saved_sliding_velocity = v;
429  saved_sliding_friction = f;
430 // std::cerr << "switch to sticking: " << transition_type << std::endl;
431  }
432  }
433  }
434 
435  switch (status) {
436  case sticking: {
437  //switch to sticking: null velocity at the end of time step
438 // std::cerr << "sono qui1" << std::endl;
439  current_friction_force = f;
440  WorkVec.IncCoef(startdof+1,v);
441  break;
442  }
443  case sliding: {
444  //still sliding
445  //cur_sticking = false;
446  switch (transition_type) {
447  case from_sticked_to_sliding: {
448 // std::cerr << "sono qui2" << std::endl;
449  current_friction_force = sign(f)*fss(v)+sigma2*v;
450  break;
451  }
452  case from_sticking_to_sliding: {
453  current_friction_force = sign(saved_sliding_friction)*fss(v)+sigma2*v;
454  break;
455  }
456  default: {
457  if (std::fabs(v) > 0.) {
458 // std::cerr << "sono qui3" << std::endl;
459 // std::cerr << "v: " << v << std::endl;
460  if (sign(v) == sign(current_velocity)) {
461  current_friction_force = sign(v)*fss(v)+sigma2*v;
462 //* std::cerr << "quixxxx" << std::endl;
463  } else {
464  current_friction_force = sign(f)*fss(v)+sigma2*v;
465 //* std::cerr << "quiyyyy" << std::endl;
466  }
467  } else {
468  //limit the force value while taking the sticking force direction
469  current_friction_force = sign(f)*fss(v)+sigma2*v;
470  }
471  if (std::abs(v) < std::abs(current_velocity) && !first_iter) {
472 //* std::cerr << "Aggiorno current velocity" << std::endl;
473  current_velocity = v;
474  }
475  break;
476  }
477  }
478  //save friction force value in the (algebric) state
479 // std::cerr << "sono qui5" << std::endl;
480  WorkVec.IncCoef(startdof+1,f-current_friction_force);
481  break;
482  }
483  case sticked: {
484  current_friction_force = f;
485  WorkVec.IncCoef(startdof+1,v);
486  break;
487  }
488  default: {
489  silent_cerr("DiscreteCoulombFriction::AssRes() "
490  "logical error" << std::endl);
491  }
492  }
493  //update status
494  first_iter = false;
495  if (transition_type != null) {
497  }
498 // current_velocity = v;
499 };
500 
502  FullSubMatrixHandler& WorkMat,
503  ExpandableRowVector& dfc,
504  const unsigned int startdof,
505  const unsigned int solution_startdof,
506  const doublereal dCoef,
507  const doublereal F,
508  const doublereal v,
509  const VectorHandler& X,
510  const VectorHandler& XP,
511  const ExpandableRowVector& dF,
512  const ExpandableRowVector& dv) const {
513 //* std::cerr << "Chimata jacobiano. Status:" << status << std::endl;
514  switch (status) {
515  case sticking:
516  case sticked: {
517  //null velocity at the end of time step
518  //WorkVec.IncCoef(startdof+1,v);
519  dv.Sub(WorkMat,startdof+1);
520  dfc.ReDim(1);
521  dfc.Set(1.,1,startdof+1);
522  break;
523  }
524  case sliding: {
525  //still sliding
527  //cur_sticking = false;
528  //save friction force value in the (algebric) state
529  //WorkVec.IncCoef(startdof+1,f-current_friction_force);
530  WorkMat.IncCoef(startdof+1,startdof+1,-1);
531  dv.Add(WorkMat,startdof+1,
533  dfc.ReDim(1);
534  dfc.Set(sign(current_friction_force-sigma2*v)*fss.ComputeDiff(v)+sigma2,1); dfc.Link(1, &dv);
535  break;
536  }
537  default: {
538  silent_cerr("DiscreteCoulombFriction::AssJac() "
539  "logical error" << std::endl);
540  }
541  }
542 };
543 
544 
545 
546 //------------------------
548  return 1.;
549 }
550 
552  const doublereal f,
553  const doublereal F,
554  const doublereal v) {
555  return f;
556 };
557 
559  ExpandableRowVector& dShc,
560  const doublereal f,
561  const doublereal F,
562  const doublereal v,
563  const ExpandableRowVector& dfc,
564  const ExpandableRowVector& dF,
565  const ExpandableRowVector& dv) const {
566  dShc.ReDim(1);
567  dShc.Set(1. ,1);
568  dShc.Link(1,&dfc);
569 };
570 
572  {};
573 
575  return shc;
576 }
577 
579  const doublereal f,
580  const doublereal F,
581  const doublereal v) {
582  shc = f/std::sqrt(1.+f*f);
583  return shc;
584 };
585 
587  ExpandableRowVector& dShc,
588  const doublereal f,
589  const doublereal F,
590  const doublereal v,
591  const ExpandableRowVector& dfc,
592  const ExpandableRowVector& dF,
593  const ExpandableRowVector& dv) const {
594  doublereal dsh_fc = 1./std::sqrt(1.+f*f)-0.5*std::pow(1.+f*f,-3./2.)*f;
595 // dShc.ReDim(2);
596 // dShc.Set(0.,1);
597 // dShc.Link(1,&dF);
598 // dShc.Set(dsh_fc,2);
599 // dShc.Link(2,&dfc);
600  dShc.ReDim(1);
601  dShc.Set(dsh_fc,1);
602  dShc.Link(1,&dfc);
603 };
604 
605 
606 //---------------------------------------
607 
609  DataManager * pDM)
610 {
611  const char* sKeyWords[] = {
612  "modlugre",
613  "discrete" "coulomb",
614  NULL
615  };
616  enum KeyWords {
617  MODLUGRE = 0,
618  DISCRETECOULOMB,
620  };
621  /* token corrente */
622  KeyWords FuncType;
623 
624  KeyTable K(HP, sKeyWords);
625 
626  FuncType = KeyWords(HP.IsKeyWord());
627  switch (FuncType) {
628  case MODLUGRE: {
629  doublereal sigma0 = HP.GetReal();
630  doublereal sigma1 = HP.GetReal();
631  doublereal sigma2 = HP.GetReal();
632  doublereal kappa = HP.GetReal();
633  const BasicScalarFunction*const sf =
634  ParseScalarFunction(HP, pDM);
635  return new ModLugreFriction(sigma0, sigma1, sigma2, kappa, sf);
636  break;
637  }
638  case DISCRETECOULOMB: {
639  const BasicScalarFunction*const sf =
640  ParseScalarFunction(HP, pDM);
641  doublereal sigma2 = 0.;
642  doublereal vel_ratio = 0.8;
643  if (HP.IsKeyWord("sigma2")) {
644  sigma2 = HP.GetReal();
645  }
646  if (HP.IsKeyWord("velocity" "ratio")) {
647  vel_ratio = HP.GetReal();
648  }
649  return new DiscreteCoulombFriction(sf,sigma2, vel_ratio);
650  break;
651  }
652  default: {
653  silent_cerr("ParseFriction(): unrecognized friction type "
654  "at line " << HP.GetLineData() << std::endl);
656  break;
657  }
658  }
659  return 0;
660 };
661 
663  const char* sKeyWords[] = {
664  "simple",
665  "simple" "plane" "hinge",
666  "screw" "joint",
667  NULL
668  };
669  enum KeyWords {
670  SIMPLE = 0,
671  SIMPLEPLANEHINGE,
672  SCREWJOINT,
674  };
675  /* token corrente */
676  KeyWords FuncType;
677 
678  KeyTable K(HP, sKeyWords);
679 
680  FuncType = KeyWords(HP.IsKeyWord());
681  switch (FuncType) {
682  case SIMPLE: {
683  return new SimpleShapeCoefficient();
684  break;
685  }
686  case SIMPLEPLANEHINGE: {
687  return new SimplePlaneHingeJointSh_c();
688  break;
689  }
690  case SCREWJOINT: {
691  doublereal radius(0.), hta(0.);
692  if (HP.IsKeyWord("radius")) {
693  radius = HP.GetReal();
694  } else {
695  pedantic_cerr("ScrewJointShapeCoefficient: missing keyword \"radius\" at line "
696  << HP.GetLineData());
697  }
698  if (HP.IsKeyWord("half" "thread" "angle")) {
699  hta = HP.GetReal();
700  } else {
701  pedantic_cerr("ScrewJointShapeCoefficient: missing keyword \"half thread angle\" at line "
702  << HP.GetLineData());
703  }
704  return new ScrewJointSh_c(radius, hta);
705  break;
706  }
707  default: {
708  silent_cerr("ParseShapeCoefficient(): "
709  "unrecognized shape coefficient type "
710  "at line " << HP.GetLineData() << std::endl);
712  break;
713  }
714  }
715  return 0;
716 };
unsigned int iGetNumDof(void) const
Definition: friction.cc:86
doublereal current_friction_force
Definition: friction.h:231
#define M_PI
Definition: gradienttest.cc:67
#define ASSERTMSGBREAK(expr, msg)
Definition: myassert.h:222
void Set(doublereal xx, integer i, integer iidx)
Definition: JacSubMatrix.cc:95
doublereal f
Definition: friction.h:142
virtual doublereal Sh_c(void) const
Definition: friction.cc:547
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
GradientExpression< UnaryExpr< FuncSin, Expr > > sin(const GradientExpression< Expr > &u)
Definition: gradient.h:2977
DiscreteCoulombFriction(const BasicScalarFunction *const ff, const doublereal s2, const doublereal vr)
Definition: friction.cc:267
doublereal alpha(const doublereal z, const doublereal v) const
Definition: friction.cc:138
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0, const unsigned int solution_startdof=0)
Definition: friction.cc:77
void Add(doublereal xx, integer i)
const doublereal fs(const doublereal &v) const
Definition: friction.cc:130
DofOrder::Order GetDofType(unsigned int i) const
Definition: friction.cc:332
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: friction.h:45
const DifferentiableScalarFunction & fss
Definition: friction.h:141
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: friction.cc:303
BasicFriction *const ParseFriction(MBDynParser &HP, DataManager *pDM)
Definition: friction.cc:608
void AssJac(FullSubMatrixHandler &WorkMat, ExpandableRowVector &dfc, const unsigned int startdof, const unsigned int solution_startdof, const doublereal dCoef, const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP, const ExpandableRowVector &dF, const ExpandableRowVector &dv) const
Definition: friction.cc:224
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0, const unsigned int solution_startdof=0)
Definition: friction.cc:289
BasicShapeCoefficient *const ParseShapeCoefficient(MBDynParser &HP)
Definition: friction.cc:662
#define NO_OP
Definition: myassert.h:74
std::vector< Hint * > Hints
Definition: simentity.h:89
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: friction.cc:106
void AfterConvergence(const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP, const unsigned int solution_startdof)
Definition: friction.cc:346
void AssRes(SubVectorHandler &WorkVec, const unsigned int startdof, const unsigned int solution_startdof, const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP)
Definition: friction.cc:374
void ReDim(const integer n)
Definition: JacSubMatrix.cc:50
const doublereal sigma2
Definition: friction.h:139
DofOrder::Order GetDofType(unsigned int i) const
Definition: friction.cc:120
virtual void dSh_c(ExpandableRowVector &dShc, const doublereal f, const doublereal F, const doublereal v, const ExpandableRowVector &dfc, const ExpandableRowVector &dF, const ExpandableRowVector &dv) const
Definition: friction.cc:558
ModLugreFriction(const doublereal sigma0, const doublereal sigma1, const doublereal sigma2, const doublereal kappa, const BasicScalarFunction *const ff)
Definition: friction.cc:60
const doublereal fsd(const doublereal &v) const
Definition: friction.cc:134
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: friction.cc:318
void AssJac(FullSubMatrixHandler &WorkMat, ExpandableRowVector &dfc, const unsigned int startdof, const unsigned int solution_startdof, const doublereal dCoef, const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP, const ExpandableRowVector &dF, const ExpandableRowVector &dv) const
Definition: friction.cc:501
virtual doublereal Sh_c(void) const
Definition: friction.cc:574
Definition: mbdyn.h:77
doublereal alphad_z(const doublereal z, const doublereal v) const
Definition: friction.cc:182
void AssRes(SubVectorHandler &WorkVec, const unsigned int startdof, const unsigned int solution_startdof, const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP)
Definition: friction.cc:210
DofOrder::Order GetEqType(unsigned int i) const
Definition: friction.cc:337
#define ASSERT(expression)
Definition: colamd.c:977
virtual doublereal ComputeDiff(const doublereal x, const integer order=1) const =0
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: friction.cc:91
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
KeyWords
Definition: dataman4.cc:94
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
void Link(const integer i, const ExpandableRowVector *const xp, const integer rhs_block=1)
Definition: JacSubMatrix.cc:68
status_type status
Definition: friction.h:220
const DifferentiableScalarFunction & fss
Definition: friction.h:233
void dSh_c(ExpandableRowVector &dShc, const doublereal f, const doublereal F, const doublereal v, const ExpandableRowVector &dfc, const ExpandableRowVector &dF, const ExpandableRowVector &dv) const
Definition: friction.cc:586
doublereal fc(void) const
Definition: friction.cc:342
unsigned int iGetNumDof(void) const
Definition: friction.cc:298
doublereal fc(void) const
Definition: friction.cc:206
doublereal previous_switch_v
Definition: friction.h:225
doublereal current_velocity
Definition: friction.h:226
void Sub(doublereal xx, integer i)
doublereal alphad_v(const doublereal z, const doublereal v) const
Definition: friction.cc:157
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
const doublereal kappa
Definition: friction.h:140
int sign(const doublereal x)
Definition: friction.cc:42
double doublereal
Definition: colamd.c:52
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
const BasicScalarFunction *const ParseScalarFunction(MBDynParser &HP, DataManager *const pDM)
doublereal converged_v
Definition: friction.h:222
DofOrder::Order GetEqType(unsigned int i) const
Definition: friction.cc:125
const doublereal sigma1
Definition: friction.h:138
const doublereal sigma0
Definition: friction.h:137
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056