MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
stepsol.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/stepsol.h,v 1.51 2017/10/14 23:58:06 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32  /*
33  *
34  * Copyright (C) 2003-2017
35  * Giuseppe Quaranta <quaranta@aero.polimi.it>
36  *
37  * Classe che gestisce l'integrazione di un passo temporale
38  *
39  * Classe di base virtuale pura: NonlinearProblem
40  *
41  * metodi:
42  * - Residual, Jacobian e Update che vengono richiesti
43  * da nonlinear solver
44  *
45  * Classe derivata: StepIntegrator
46  * contiene:
47  * - un puntatore al data manager
48  * - le flag per il tipo di output da implementare
49  * - il numero di iterazioni
50  * - le tolleranze per la verifica della convergenza
51  *
52  * metodi:
53  * - Predict e After Predict
54  *
55  */
56 
57 #ifndef STEPSOL_H
58 #define STEPSOL_H
59 
60 #include <unistd.h>
61 #include <cfloat>
62 #include <cmath>
63 #include <deque>
64 
65 /* per il debugging */
66 #include "myassert.h"
67 #include "mynewmem.h"
68 #include "except.h"
69 #include "solman.h"
70 #include "dataman.h"
71 #include "dofown.h"
72 #include "drive.h"
73 #include "nonlinpb.h"
74 #include "nonlin.h"
75 
76 /* Needed for callback declaration; defined in <mbdyn/base/solver.h> */
77 class Solver;
78 class InverseSolver;
79 
81 {
82 
83 public:
84  class ErrGeneric: public MBDynErrBase {
85  public:
87  };
88 
89  enum { DIFFERENTIAL = 0, ALGEBRAIC = 1 };
91 
92 protected:
94  const DataManager::DofVecType *pDofs; /* Dof array, passed by DM */
95 
96  bool outputPred;
97 
102 
103  template<class T>
104  void UpdateLoop(
105  const T* const t,
106  void (T::* pUpd)(const int DCount,
107  const DofOrder::Order Order,
108  const VectorHandler* const pSol) const,
109  const VectorHandler* const pSol = 0
110  ) const;
111 public:
112  StepIntegrator(const integer MaxIt,
113  const doublereal dT,
114  const doublereal dSolutionTol,
115  const integer stp,
116  const integer sts);
117 
118  virtual ~StepIntegrator(void);
119 
120  void SetDataManager(DataManager* pDatMan);
121 
122  virtual integer GetIntegratorNumPreviousStates(void) const;
123 
124  virtual integer GetIntegratorNumUnknownStates(void) const;
125 
126  virtual integer GetIntegratorMaxIters(void) const;
127 
128  virtual doublereal GetIntegratorDTol(void) const;
129 
130  virtual doublereal GetIntegratorDSolTol(void) const;
131 
132  virtual void OutputTypes(const bool fpred);
133 
134  virtual void SetDriveHandler(const DriveHandler* pDH);
135 
136  virtual doublereal
137  Advance(Solver* pS,
138  const doublereal TStep,
139  const doublereal dAlph,
140  const StepChange StType,
141  std::deque<MyVectorHandler*>& qX,
142  std::deque<MyVectorHandler*>& qXPrime,
143  MyVectorHandler*const pX,
144  MyVectorHandler*const pXPrime,
145  integer& EffIter,
146  doublereal& Err,
147  doublereal& SolErr) = 0;
148 };
149 
150 
152  public StepIntegrator,
153  public NonlinearProblem
154 {
155 private:
156  /* needed by EvalProd */
161 
162 protected:
166 public:
167  ImplicitStepIntegrator(const integer MaxIt,
168  const doublereal dT,
169  const doublereal dSolutionTol,
170  const integer stp,
171  const integer sts,
172  const bool bmod_res_test);
173  virtual ~ImplicitStepIntegrator(void);
174 
175  virtual void
176  EvalProd(doublereal Tau, const VectorHandler& f0,
177  const VectorHandler& w, VectorHandler& z) const;
178 
179  /* scale factor for tests */
180  virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal& dCoef) const;
181 
182 };
183 
185  public ImplicitStepIntegrator{
186 private:
188  const int iMaxIterCoef;
190 
191 protected:
192  void UpdateDof(const int DCount,
193  const DofOrder::Order Order,
194  const VectorHandler* const pSol = 0) const;
195 public:
196  DerivativeSolver(const doublereal Tl,
197  const doublereal dSolTl,
198  const doublereal dC,
199  const integer iMaxIt,
200  const bool bmod_res_test,
201  const integer iMaxIterCoef,
202  const doublereal dFactorCoef);
203 
204  ~DerivativeSolver(void);
205 
206  doublereal
207  Advance(Solver* pS,
208  const doublereal TStep,
209  const doublereal /* dAph */,
210  const StepChange /* StType */,
211  std::deque<MyVectorHandler*>& qX,
212  std::deque<MyVectorHandler*>& qXPrime,
213  MyVectorHandler*const pX,
214  MyVectorHandler*const pXPrime,
215  integer& EffIter,
216  doublereal& Err,
217  doublereal& SolErr);
218 
219  void Residual(VectorHandler* pRes) const;
220 
221  void Jacobian(MatrixHandler* pJac) const;
222 
223  void Update(const VectorHandler* pSol) const;
224 
225  /* scale factor for tests */
226  virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal& dAlgebraicEqu) const;
227 };
228 
229 
230 /* classe di base per gli integratori di ordine qualsiasi */
233 {
234 public:
237 
238 protected:
239  void UpdateDof(const int DCount,
240  const DofOrder::Order Order,
241  const VectorHandler* const pSol = 0) const;
242 public:
243  StepNIntegrator(const integer MaxIt,
244  const doublereal dT,
245  const doublereal dSolutionTol,
246  const integer stp,
247  const bool bmod_res_test);
248 
249  virtual ~StepNIntegrator(void);
250 
251  virtual void Residual(VectorHandler* pRes) const;
252 
253  virtual void Jacobian(MatrixHandler* pJac) const;
254 
255  virtual void Update(const VectorHandler* pSol) const;
256 
257  virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal& dAlgebraicEqu) const;
258 
259 protected:
260  virtual void SetCoef(doublereal dT,
261  doublereal dAlpha,
262  enum StepChange NewStep) = 0;
263 };
264 
265 /* classe di base per gli integratori del second'ordine */
267  public StepNIntegrator
268 {
269 protected:
272 
273 public:
274  Step1Integrator(const integer MaxIt,
275  const doublereal dT,
276  const doublereal dSolutionTol,
277  const bool bmod_res_test);
278 
279  virtual ~Step1Integrator(void);
280 
281  virtual doublereal
282  Advance(Solver* pS,
283  const doublereal TStep,
284  const doublereal dAlph,
285  const StepChange StType,
286  std::deque<MyVectorHandler*>& qX,
287  std::deque<MyVectorHandler*>& qXPrime,
288  MyVectorHandler*const pX,
289  MyVectorHandler*const pXPrime,
290  integer& EffIter,
291  doublereal& Err,
292  doublereal& SolErr);
293 
294 protected:
295  void PredictDof(const int DCount,
296  const DofOrder::Order Order,
297  const VectorHandler* const pSol = 0) const;
298  virtual void Predict(void);
299 
300  /* Overridden by dedicated inline functions */
301  virtual doublereal
302  dPredictDerivative(const doublereal& dXm1,
303  const doublereal& dXPm1,
305 
306  /* Overridden by dedicated inline functions */
307  virtual doublereal
308  dPredictState(const doublereal& dXm1,
309  const doublereal& dXP,
310  const doublereal& dXPm1,
312 
313  virtual doublereal
314  dPredDer(const doublereal& dXm1,
315  const doublereal& dXPm1) const = 0;
316 
317  virtual doublereal
318  dPredState(const doublereal& dXm1,
319  const doublereal& dXP,
320  const doublereal& dXPm1) const = 0;
321 
322  virtual doublereal
323  dPredDerAlg(const doublereal& dXm1,
324  const doublereal& dXPm1) const = 0;
325 
326  virtual doublereal
327  dPredStateAlg(const doublereal& dXm1,
328  const doublereal& dXP,
329  const doublereal& dXPm1) const = 0;
330 };
331 
332 
334  public Step1Integrator
335 {
336 public:
338  const doublereal dSolTl,
339  const integer iMaxIt,
340  const bool bmod_res_test);
341 
343 
344 protected:
345  void SetCoef(doublereal dT,
346  doublereal dAlpha,
347  enum StepChange NewStep);
348 
349  doublereal
350  dPredictDerivative(const doublereal& dXm1,
351  const doublereal& dXPm1,
353 
354  doublereal
355  dPredictState(const doublereal& dXm1,
356  const doublereal& dXP,
357  const doublereal& dXPm1,
359 
360  /* Note: uses linear prediction for derivatives
361  * (highest possible order) */
362  doublereal
363  dPredDer(const doublereal& dXm1,
364  const doublereal& dXPm1) const;
365 
366  doublereal
367  dPredState(const doublereal& dXm1,
368  const doublereal& dXP,
369  const doublereal& dXPm1) const;
370 
371  doublereal
372  dPredDerAlg(const doublereal& dXm1,
373  const doublereal& dXPm1) const;
374 
375  doublereal
376  dPredStateAlg(const doublereal& dXm1,
377  const doublereal& dXP,
378  const doublereal& dXPm1) const;
379 };
380 
382  public Step1Integrator
383 {
384 public:
386  const doublereal dSolTl,
387  const integer iMaxIt,
388  const bool bmod_res_test);
389 
391 
392 protected:
393  void SetCoef(doublereal dT,
394  doublereal dAlpha,
395  enum StepChange NewStep);
396 
397  doublereal
398  dPredictDerivative(const doublereal& dXm1,
399  const doublereal& dXPm1,
401 
402  doublereal
403  dPredictState(const doublereal& dXm1,
404  const doublereal& dXP,
405  const doublereal& dXPm1,
407 
408  /* Note: uses linear prediction for derivatives
409  * (highest possible order) */
410  doublereal
411  dPredDer(const doublereal& dXm1,
412  const doublereal& dXPm1) const;
413 
414  doublereal
415  dPredState(const doublereal& dXm1,
416  const doublereal& dXP,
417  const doublereal& dXPm1) const;
418 
419  doublereal
420  dPredDerAlg(const doublereal& dXm1,
421  const doublereal& dXPm1) const;
422 
423  doublereal
424  dPredStateAlg(const doublereal& dXm1,
425  const doublereal& dXP,
426  const doublereal& dXPm1) const;
427 };
428 
429 /* classe di base per gli integratori del second'ordine */
431  public StepNIntegrator
432 {
433 protected:
436 
437 public:
438  Step2Integrator(const integer MaxIt,
439  const doublereal dT,
440  const doublereal dSolutionTol,
441  const bool bmod_res_test);
442 
443  virtual ~Step2Integrator(void);
444 
445  virtual doublereal
446  Advance(Solver* pS,
447  const doublereal TStep,
448  const doublereal dAlph,
449  const StepChange StType,
450  std::deque<MyVectorHandler*>& qX,
451  std::deque<MyVectorHandler*>& qXPrime,
452  MyVectorHandler*const pX,
453  MyVectorHandler*const pXPrime,
454  integer& EffIter,
455  doublereal& Err,
456  doublereal& SolErr);
457 
458 protected:
459  void PredictDof(const int DCount,
460  const DofOrder::Order Order,
461  const VectorHandler* const pSol = 0) const;
462  virtual void Predict(void);
463 
464  /* Overridden by dedicated inline functions */
465  virtual doublereal
466  dPredictDerivative(const doublereal& dXm1,
467  const doublereal& dXm2,
468  const doublereal& dXPm1,
469  const doublereal& dXPm2,
471 
472  /* Overridden by dedicated inline functions */
473  virtual doublereal
474  dPredictState(const doublereal& dXm1,
475  const doublereal& dXm2,
476  const doublereal& dXP,
477  const doublereal& dXPm1,
478  const doublereal& dXPm2,
480 
481  virtual doublereal
482  dPredDer(const doublereal& dXm1,
483  const doublereal& dXm2,
484  const doublereal& dXPm1,
485  const doublereal& dXPm2) const = 0;
486 
487  virtual doublereal
488  dPredState(const doublereal& dXm1,
489  const doublereal& dXm2,
490  const doublereal& dXP,
491  const doublereal& dXPm1,
492  const doublereal& dXPm2) const = 0;
493  virtual doublereal
494  dPredDerAlg(const doublereal& dXm1,
495  const doublereal& dXPm1,
496  const doublereal& dXPm2) const = 0;
497 
498  virtual doublereal
499  dPredStateAlg(const doublereal& dXm1,
500  const doublereal& dXP,
501  const doublereal& dXPm1,
502  const doublereal& dXPm2) const = 0;
503 
504  virtual void SetCoef(doublereal dT,
505  doublereal dAlpha,
506  enum StepChange NewStep) = 0;
507 };
508 
509 /* NostroMetodo - begin */
510 
512  public Step2Integrator
513 {
514 protected:
517 
518  doublereal a[2][2];
519  doublereal b[3][2];
520 
523 
524 public:
525  MultistepSolver(const doublereal Tl,
526  const doublereal dSolTol,
527  const integer iMaxIt,
528  const DriveCaller* pRho,
529  const DriveCaller* pAlgRho,
530  const bool bmod_res_test);
531 
532  ~MultistepSolver(void);
533 
534 protected:
535  void SetCoef(doublereal dT,
536  doublereal dAlpha,
537  enum StepChange NewStep);
538 
539  void SetDriveHandler(const DriveHandler* pDH);
540 
541  doublereal
542  dPredictDerivative(const doublereal& dXm1,
543  const doublereal& dXm2,
544  const doublereal& dXPm1,
545  const doublereal& dXPm2,
547 
548  doublereal
549  dPredictState(const doublereal& dXm1,
550  const doublereal& dXm2,
551  const doublereal& dXP,
552  const doublereal& dXPm1,
553  const doublereal& dXPm2,
555 
556  /* Note: uses cubic prediction for derivatives
557  * (highest possible order) */
558  doublereal
559  dPredDer(const doublereal& dXm1,
560  const doublereal& dXm2,
561  const doublereal& dXPm1,
562  const doublereal& dXPm2) const;
563 
564  doublereal
565  dPredState(const doublereal& dXm1,
566  const doublereal& dXm2,
567  const doublereal& dXP,
568  const doublereal& dXPm1,
569  const doublereal& dXPm2) const;
570 
571  doublereal
572  dPredDerAlg(const doublereal& dXm1,
573  const doublereal& dXPm1,
574  const doublereal& dXPm2) const;
575 
576  doublereal
577  dPredStateAlg(const doublereal& dXm1,
578  const doublereal& dXP,
579  const doublereal& dXPm1,
580  const doublereal& dXPm2) const;
581 };
582 
583 /* NostroMetodo - end */
584 
585 
586 /* Hope - begin */
587 
588 class HopeSolver :
589  public Step2Integrator
590 {
591 protected:
594 
595  bool bStep;
596 
597  doublereal a[2][2];
598  doublereal b[2][2];
599 
602 
603 public:
604  HopeSolver(const doublereal Tl,
605  const doublereal dSolTol,
606  const integer iMaxIt,
607  const DriveCaller* pRho,
608  const DriveCaller* pAlgRho,
609  const bool bmod_res_test);
610 
611  ~HopeSolver(void);
612 
613 protected:
614  void SetCoef(doublereal dT,
615  doublereal dAlpha,
616  enum StepChange NewStep);
617 
618  void SetDriveHandler(const DriveHandler* pDH);
619 
620  doublereal
621  dPredictDerivative(const doublereal& dXm1,
622  const doublereal& dXm2,
623  const doublereal& dXPm1,
624  const doublereal& dXPm2,
626 
627  doublereal
628  dPredictState(const doublereal& dXm1,
629  const doublereal& dXm2,
630  const doublereal& dXP,
631  const doublereal& dXPm1,
632  const doublereal& dXPm2,
634 
635  /* Note: uses cubic prediction for derivatives
636  * (highest possible order) */
637  doublereal
638  dPredDer(const doublereal& dXm1,
639  const doublereal& dXm2,
640  const doublereal& dXPm1,
641  const doublereal& dXPm2) const;
642 
643  doublereal
644  dPredState(const doublereal& dXm1,
645  const doublereal& dXm2,
646  const doublereal& dXP,
647  const doublereal& dXPm1,
648  const doublereal& dXPm2) const;
649 
650  doublereal
651  dPredDerAlg(const doublereal& dXm1,
652  const doublereal& dXPm1,
653  const doublereal& dXPm2) const;
654 
655  doublereal
656  dPredStateAlg(const doublereal& dXm1,
657  const doublereal& dXP,
658  const doublereal& dXPm1,
659  const doublereal& dXPm2) const;
660 };
661 
662 /* Hope - end */
663 
664 /* InverseDynamics - Begin*/
665 
667  public StepIntegrator,
668  public NonlinearProblem
669 {
670 private:
671  /* needed by EvalProd */
674 
675  /* FIXME: Need this? */
678 
680  mutable bool m_bJacobian;
681 
682 protected:
688 
689 public:
691  const doublereal dT,
692  const doublereal dSolutionTol,
693  const integer stp,
694  const integer sts,
695  const bool bmod_res_test);
696 
698 
699  virtual void
700  EvalProd(doublereal Tau, const VectorHandler& f0,
701  const VectorHandler& w, VectorHandler& z) const;
702 
703  /* scale factor for tests */
704  virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal& dCoef) const;
705 
706  /* Needed for compatibility with class StepIntegrator */
707  virtual doublereal
709  const doublereal TStep,
710  const doublereal dAlph,
711  const StepChange StType,
712  std::deque<MyVectorHandler*>& qX,
713  std::deque<MyVectorHandler*>& qXPrime,
714  MyVectorHandler*const pX,
715  MyVectorHandler*const pXPrime,
716  integer& EffIter,
717  doublereal& Err,
718  doublereal& SolErr)
719  {
720  silent_cerr("InverseDynamicsStepSolver::Advance()");
722  };
723 
724  /* Real Advancer */
725  virtual doublereal
726  Advance(InverseSolver* pS,
727  const doublereal TStep,
728  const StepChange StType,
729  MyVectorHandler*const pX,
730  MyVectorHandler*const pXPrime,
731  MyVectorHandler*const pXPrimePrime,
732  MyVectorHandler*const pLambda,
733  integer& EffIter,
734  doublereal& Err,
735  doublereal& SolErr);
736 
737  void Residual(VectorHandler* pRes) const ;
738 
739  void Jacobian(MatrixHandler* pJac) const ;
740 
741  void Update(const VectorHandler* pSol) const ;
742 
744 
745  InverseDynamics::Order GetOrder(void) const;
746 
747  bool bJacobian(void) const;
748 };
749 
750 /* InverseDynamics - End*/
751 
752 #endif /* STEPSOL_H */
const doublereal dFactorCoef
Definition: stepsol.h:189
doublereal dCoef
Definition: stepsol.h:187
doublereal dPredStateAlg(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1352
Step1Integrator(const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const bool bmod_res_test)
Definition: stepsol.cc:560
doublereal np[2]
Definition: stepsol.h:601
void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)
Definition: stepsol.cc:851
doublereal dPredDer(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1319
doublereal dPredStateAlg(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1161
void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)
Definition: stepsol.cc:1018
doublereal dPredDerAlg(const doublereal &dXm1, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1153
bool outputPred
Definition: stepsol.h:96
virtual doublereal dPredDer(const doublereal &dXm1, const doublereal &dXPm1) const =0
void UpdateDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
Definition: stepsol.cc:407
doublereal dPredictState(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:868
integer unkstates
Definition: stepsol.h:101
virtual void EvalProd(doublereal Tau, const VectorHandler &f0, const VectorHandler &w, VectorHandler &z) const
Definition: stepsol.cc:145
doublereal dPredDer(const doublereal &dXm1, const doublereal &dXPm1) const
Definition: stepsol.cc:881
virtual void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)=0
virtual doublereal dPredDerAlg(const doublereal &dXm1, const doublereal &dXPm1, const doublereal &dXPm2) const =0
~DerivativeSolver(void)
Definition: stepsol.cc:264
void Jacobian(MatrixHandler *pJac) const
Definition: stepsol.cc:400
ImplicitStepIntegrator(const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const integer sts, const bool bmod_res_test)
Definition: stepsol.cc:124
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
StepIntegrator(const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const integer sts)
Definition: stepsol.cc:51
VectorHandler * pXPrimeCurr
Definition: stepsol.h:684
MyVectorHandler XTau
Definition: stepsol.h:672
DerivativeSolver(const doublereal Tl, const doublereal dSolTl, const doublereal dC, const integer iMaxIt, const bool bmod_res_test, const integer iMaxIterCoef, const doublereal dFactorCoef)
Definition: stepsol.cc:249
integer steps
Definition: stepsol.h:100
void Jacobian(MatrixHandler *pJac) const
Definition: stepsol.cc:1698
#define MBDYN_EXCEPT_ARGS_PASSTHRU
Definition: except.h:55
bool bEvalProdCalledFirstTime
Definition: stepsol.h:160
doublereal dPredState(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const
Definition: stepsol.cc:888
static double * f0
std::vector< Dof > DofVecType
Definition: dataman.h:801
virtual void OutputTypes(const bool fpred)
Definition: stepsol.cc:111
virtual void Predict(void)
Definition: stepsol.cc:615
doublereal dPredictState(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:1294
doublereal dSolTol
Definition: stepsol.h:99
virtual doublereal Advance(Solver *pS, const doublereal TStep, const doublereal dAlph, const StepChange StType, std::deque< MyVectorHandler * > &qX, std::deque< MyVectorHandler * > &qXPrime, MyVectorHandler *const pX, MyVectorHandler *const pXPrime, integer &EffIter, doublereal &Err, doublereal &SolErr)=0
doublereal dPredDerAlg(const doublereal &dXm1, const doublereal &dXPm1) const
Definition: stepsol.cc:896
virtual ~Step2Integrator(void)
Definition: stepsol.cc:705
virtual integer GetIntegratorMaxIters(void) const
Definition: stepsol.cc:93
virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal &dCoef) const
Definition: stepsol.cc:210
#define MBDYN_EXCEPT_ARGS_DECL
Definition: except.h:43
doublereal Advance(Solver *pS, const doublereal TStep, const doublereal, const StepChange, std::deque< MyVectorHandler * > &qX, std::deque< MyVectorHandler * > &qXPrime, MyVectorHandler *const pX, MyVectorHandler *const pXPrime, integer &EffIter, doublereal &Err, doublereal &SolErr)
Definition: stepsol.cc:270
DriveOwner AlgebraicRho
Definition: stepsol.h:516
VectorHandler * pXPrev
Definition: stepsol.h:270
virtual doublereal dPredictState(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2, DofOrder::Order o=DofOrder::DIFFERENTIAL) const =0
void SetOrder(InverseDynamics::Order iOrder)
Definition: stepsol.cc:1510
virtual doublereal dPredictDerivative(const doublereal &dXm1, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const =0
doublereal dPredictDerivative(const doublereal &dXm1, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:938
StepNIntegrator(const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const bool bmod_res_test)
Definition: stepsol.cc:446
DriveOwner AlgebraicRho
Definition: stepsol.h:593
void SetDataManager(DataManager *pDatMan)
Definition: stepsol.cc:74
virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal &dAlgebraicEqu) const
Definition: stepsol.cc:547
VectorHandler * pXPrimePrev
Definition: stepsol.h:271
Step2Integrator(const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const bool bmod_res_test)
Definition: stepsol.cc:692
MyVectorHandler XTau
Definition: stepsol.h:157
VectorHandler * pXPrev2
Definition: stepsol.h:434
DriveOwner Rho
Definition: stepsol.h:515
doublereal dPredictDerivative(const doublereal &dXm1, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:860
bool bJacobian(void) const
Definition: stepsol.cc:1522
InverseDynamicsStepSolver(const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const integer sts, const bool bmod_res_test)
Definition: stepsol.cc:1378
doublereal dPredictDerivative(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXPm1, const doublereal &dXPm2, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:1102
CrankNicolsonIntegrator(const doublereal Tl, const doublereal dSolTl, const integer iMaxIt, const bool bmod_res_test)
Definition: stepsol.cc:836
virtual doublereal dPredState(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2) const =0
virtual doublereal dPredictDerivative(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXPm1, const doublereal &dXPm2, DofOrder::Order o=DofOrder::DIFFERENTIAL) const =0
InverseDynamics::Order iOrder
Definition: stepsol.h:679
doublereal a[2][2]
Definition: stepsol.h:597
void Residual(VectorHandler *pRes) const
Definition: stepsol.cc:393
doublereal mp[2]
Definition: stepsol.h:521
virtual doublereal dPredStateAlg(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const =0
InverseDynamics::Order GetOrder(void) const
Definition: stepsol.cc:1516
const DataManager::DofVecType * pDofs
Definition: stepsol.h:94
doublereal b[2][2]
Definition: stepsol.h:598
doublereal dPredState(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1142
doublereal dPredStateAlg(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const
Definition: stepsol.cc:903
~HopeSolver(void)
Definition: stepsol.cc:1188
virtual doublereal dPredState(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const =0
doublereal dPredState(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const
Definition: stepsol.cc:966
virtual doublereal Advance(Solver *pS, const doublereal TStep, const doublereal dAlph, const StepChange StType, std::deque< MyVectorHandler * > &qX, std::deque< MyVectorHandler * > &qXPrime, MyVectorHandler *const pX, MyVectorHandler *const pXPrime, integer &EffIter, doublereal &Err, doublereal &SolErr)
Definition: stepsol.cc:623
doublereal dPredDerAlg(const doublereal &dXm1, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1344
DataManager * pDM
Definition: stepsol.h:93
HopeSolver(const doublereal Tl, const doublereal dSolTol, const integer iMaxIt, const DriveCaller *pRho, const DriveCaller *pAlgRho, const bool bmod_res_test)
Definition: stepsol.cc:1175
void Update(const VectorHandler *pSol) const
Definition: stepsol.cc:428
MyVectorHandler SavedState
Definition: stepsol.h:158
VectorHandler * pXPrimePrimeCurr
Definition: stepsol.h:685
virtual doublereal GetIntegratorDTol(void) const
Definition: stepsol.cc:99
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
virtual ~StepIntegrator(void)
Definition: stepsol.cc:68
virtual void Predict(void)
Definition: stepsol.cc:757
VectorHandler * pXCurr
Definition: stepsol.h:163
bool bStep
Definition: stepsol.h:595
integer MaxIters
Definition: stepsol.h:98
void UpdateDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
Definition: stepsol.cc:516
void PredictDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
Definition: stepsol.cc:714
virtual doublereal Advance(Solver *pS, const doublereal TStep, const doublereal dAlph, const StepChange StType, std::deque< MyVectorHandler * > &qX, std::deque< MyVectorHandler * > &qXPrime, MyVectorHandler *const pX, MyVectorHandler *const pXPrime, integer &EffIter, doublereal &Err, doublereal &SolErr)
Definition: stepsol.h:708
virtual void Jacobian(MatrixHandler *pJac) const
Definition: stepsol.cc:472
void SetDriveHandler(const DriveHandler *pDH)
Definition: stepsol.cc:1011
virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal &dCoef) const
Definition: stepsol.cc:1471
doublereal dPredictState(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:946
doublereal dPredDerAlg(const doublereal &dXm1, const doublereal &dXPm1) const
Definition: stepsol.cc:974
virtual ~StepNIntegrator(void)
Definition: stepsol.cc:458
MyVectorHandler SavedDerState
Definition: stepsol.h:159
doublereal dPredictState(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:1115
void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)
Definition: stepsol.cc:1201
~ImplicitEulerIntegrator(void)
Definition: stepsol.cc:923
doublereal dPredDer(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1133
virtual doublereal dPredictState(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const =0
Order
Definition: shapefnc.h:42
virtual void EvalProd(doublereal Tau, const VectorHandler &f0, const VectorHandler &w, VectorHandler &z) const
Definition: stepsol.cc:1406
~MultistepSolver(void)
Definition: stepsol.cc:1005
virtual doublereal dPredStateAlg(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2) const =0
doublereal db0Differential
Definition: stepsol.h:235
virtual void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)=0
MyVectorHandler SavedState
Definition: stepsol.h:673
Definition: solver.h:78
void Residual(VectorHandler *pRes) const
Definition: stepsol.cc:1683
virtual void SetDriveHandler(const DriveHandler *pDH)
Definition: stepsol.cc:117
MultistepSolver(const doublereal Tl, const doublereal dSolTol, const integer iMaxIt, const DriveCaller *pRho, const DriveCaller *pAlgRho, const bool bmod_res_test)
Definition: stepsol.cc:992
MyVectorHandler SavedDerState
Definition: stepsol.h:676
const int iMaxIterCoef
Definition: stepsol.h:188
ImplicitEulerIntegrator(const doublereal Tl, const doublereal dSolTl, const integer iMaxIt, const bool bmod_res_test)
Definition: stepsol.cc:914
VectorHandler * pXPrimePrev
Definition: stepsol.h:435
doublereal dPredState(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXP, const doublereal &dXPm1, const doublereal &dXPm2) const
Definition: stepsol.cc:1328
doublereal dPredStateAlg(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const
Definition: stepsol.cc:981
VectorHandler * pXCurr
Definition: stepsol.h:683
virtual doublereal Advance(Solver *pS, const doublereal TStep, const doublereal dAlph, const StepChange StType, std::deque< MyVectorHandler * > &qX, std::deque< MyVectorHandler * > &qXPrime, MyVectorHandler *const pX, MyVectorHandler *const pXPrime, integer &EffIter, doublereal &Err, doublereal &SolErr)
Definition: stepsol.cc:765
void Update(const VectorHandler *pSol) const
Definition: stepsol.cc:1705
virtual integer GetIntegratorNumPreviousStates(void) const
Definition: stepsol.cc:81
doublereal dPredDer(const doublereal &dXm1, const doublereal &dXPm1) const
Definition: stepsol.cc:959
ErrGeneric(MBDYN_EXCEPT_ARGS_DECL)
Definition: stepsol.h:86
virtual ~Step1Integrator(void)
Definition: stepsol.cc:571
virtual void Update(const VectorHandler *pSol) const
Definition: stepsol.cc:538
doublereal db0Algebraic
Definition: stepsol.h:236
DriveOwner Rho
Definition: stepsol.h:592
virtual doublereal TestScale(const NonlinearSolverTest *pTest, doublereal &dAlgebraicEqu) const
Definition: stepsol.cc:439
doublereal a[2][2]
Definition: stepsol.h:518
void PredictDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
Definition: stepsol.cc:581
void UpdateLoop(const T *const t, void(T::*pUpd)(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol) const, const VectorHandler *const pSol=0) const
doublereal b[3][2]
Definition: stepsol.h:519
void SetDriveHandler(const DriveHandler *pDH)
Definition: stepsol.cc:1194
virtual doublereal dPredDer(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXPm1, const doublereal &dXPm2) const =0
double doublereal
Definition: colamd.c:52
doublereal mp[2]
Definition: stepsol.h:600
long int integer
Definition: colamd.c:51
virtual void Residual(VectorHandler *pRes) const
Definition: stepsol.cc:464
VectorHandler * pLambdaCurr
Definition: stepsol.h:686
void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)
Definition: stepsol.cc:929
doublereal np[2]
Definition: stepsol.h:522
~CrankNicolsonIntegrator(void)
Definition: stepsol.cc:845
doublereal dTol
Definition: stepsol.h:99
VectorHandler * pXPrimePrev2
Definition: stepsol.h:435
doublereal dPredictDerivative(const doublereal &dXm1, const doublereal &dXm2, const doublereal &dXPm1, const doublereal &dXPm2, DofOrder::Order o=DofOrder::DIFFERENTIAL) const
Definition: stepsol.cc:1281
VectorHandler * pXPrev
Definition: stepsol.h:434
virtual integer GetIntegratorNumUnknownStates(void) const
Definition: stepsol.cc:87
virtual doublereal GetIntegratorDSolTol(void) const
Definition: stepsol.cc:105
virtual doublereal dPredDerAlg(const doublereal &dXm1, const doublereal &dXPm1) const =0
virtual ~ImplicitStepIntegrator(void)
Definition: stepsol.cc:139