MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
thirdorderstepsol.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/thirdorderstepsol.h,v 1.25 2017/01/12 14:46:11 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 #ifndef THIRD_ORDER_STEPSOL_H
33 
34 #define THIRD_ORDER_STEPSOL_H
35 
36 #include <solver.h>
37 #include <stepsol.h>
38 #include <spmapmh.h>
39 
42 {
43 protected:
46 
53 
56  std::vector<bool> EqIsAlgebraic, EqIsDifferential;
59 
60  void PredictDof_for_AfterPredict(const int DCount,
61  const DofOrder::Order Order,
62  const VectorHandler* const pSol = 0) const;
63  void RealPredictDof(const int DCount,
64  const DofOrder::Order Order,
65  const VectorHandler* const pSol = 0) const;
66  void UpdateDof(const int DCount,
67  const DofOrder::Order Order,
68  const VectorHandler* const pSol = 0) const;
69 public:
71  const doublereal dSolutionTol,
72  const integer iMaxIt,
73  const bool bmod_res_test);
74 
75  virtual ~ThirdOrderIntegrator(void);
76 
77  virtual void Residual(VectorHandler* pRes) const;
78 
79  virtual void Jacobian(MatrixHandler* pJac) const;
80 
81  virtual void Update(const VectorHandler* pSol) const;
82 
83  /* scale factor for tests */
84 // virtual doublereal TestScale(const NonlinearSolverTest *pTest) const;
85 
86  virtual doublereal
87  Advance(Solver* pS,
88  const doublereal TStep,
89  const doublereal dAlph,
90  const StepChange StType,
91  std::deque<MyVectorHandler*>& qX,
92  std::deque<MyVectorHandler*>& qXPrime,
93  MyVectorHandler*const pX,
94  MyVectorHandler*const pXPrime,
95  integer& EffIter,
96  doublereal& Err,
97  doublereal& SolErr);
98 
99 protected:
100  virtual void SetCoef(doublereal dT,
101  doublereal dAlpha,
102  enum StepChange NewStep) = 0;
103  virtual void Predict(void);
104 
105 };
106 
108  public ThirdOrderIntegrator
109 {
110 private:
112 
113 public:
115  const doublereal dSolutionTol,
116  const integer iMaxIt,
117  const DriveCaller* pRho,
118  const bool bmod_res_test);
119 
120  virtual ~TunableThirdOrderIntegrator(void);
121  void SetDriveHandler(const DriveHandler* pDH);
122 
123 protected:
124  void SetCoef(doublereal dT,
125  doublereal dAlpha,
126  enum StepChange NewStep);
127 };
128 
130  public ThirdOrderIntegrator
131 {
132 public:
134  const doublereal dSolutionTol,
135  const integer iMaxIt,
136  const bool bmod_res_test);
137 
138  virtual ~AdHocThirdOrderIntegrator(void);
139 
140 protected:
141  void SetCoef(doublereal dT,
142  doublereal dAlpha,
143  enum StepChange NewStep);
144 };
145 
146 #endif /* THIRD_ORDER_STEPSOL_H */
VectorHandler * pXPrimePrev
AdHocThirdOrderIntegrator(const doublereal dT, const doublereal dSolutionTol, const integer iMaxIt, const bool bmod_res_test)
VectorHandler * pXPrev
MyVectorHandler Restmp
std::vector< bool > EqIsAlgebraic
void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)
void PredictDof_for_AfterPredict(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
void UpdateDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
virtual void Jacobian(MatrixHandler *pJac) const
void SetDriveHandler(const DriveHandler *pDH)
SpMapMatrixHandler Jacxi_x
SpMapMatrixHandler Jac_x
MatrixHandler * pJac_x
MatrixHandler * pJac_xp
virtual void Update(const VectorHandler *pSol) const
virtual ~AdHocThirdOrderIntegrator(void)
std::vector< bool > EqIsDifferential
virtual void Predict(void)
MatrixHandler * pJacxi_xp
MatrixHandler * pJacxi_x
void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)
virtual ~ThirdOrderIntegrator(void)
Order
Definition: shapefnc.h:42
Definition: solver.h:78
virtual void Residual(VectorHandler *pRes) const
ThirdOrderIntegrator(const doublereal dT, const doublereal dSolutionTol, const integer iMaxIt, const bool bmod_res_test)
virtual void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)=0
void RealPredictDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
SpMapMatrixHandler Jacxi_xp
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)
virtual ~TunableThirdOrderIntegrator(void)
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
SpMapMatrixHandler Jac_xp
TunableThirdOrderIntegrator(const doublereal dT, const doublereal dSolutionTol, const integer iMaxIt, const DriveCaller *pRho, const bool bmod_res_test)