MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ThirdOrderIntegrator Class Referenceabstract

#include <thirdorderstepsol.h>

Inheritance diagram for ThirdOrderIntegrator:
Collaboration diagram for ThirdOrderIntegrator:

Public Member Functions

 ThirdOrderIntegrator (const doublereal dT, const doublereal dSolutionTol, const integer iMaxIt, const bool bmod_res_test)
 
virtual ~ThirdOrderIntegrator (void)
 
virtual void Residual (VectorHandler *pRes) const
 
virtual void Jacobian (MatrixHandler *pJac) const
 
virtual void Update (const VectorHandler *pSol) const
 
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)
 
- Public Member Functions inherited from ImplicitStepIntegrator
 ImplicitStepIntegrator (const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const integer sts, const bool bmod_res_test)
 
virtual ~ImplicitStepIntegrator (void)
 
virtual void EvalProd (doublereal Tau, const VectorHandler &f0, const VectorHandler &w, VectorHandler &z) const
 
virtual doublereal TestScale (const NonlinearSolverTest *pTest, doublereal &dCoef) const
 
- Public Member Functions inherited from StepIntegrator
 StepIntegrator (const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const integer sts)
 
virtual ~StepIntegrator (void)
 
void SetDataManager (DataManager *pDatMan)
 
virtual integer GetIntegratorNumPreviousStates (void) const
 
virtual integer GetIntegratorNumUnknownStates (void) const
 
virtual integer GetIntegratorMaxIters (void) const
 
virtual doublereal GetIntegratorDTol (void) const
 
virtual doublereal GetIntegratorDSolTol (void) const
 
virtual void OutputTypes (const bool fpred)
 
virtual void SetDriveHandler (const DriveHandler *pDH)
 
- Public Member Functions inherited from NonlinearProblem
virtual ~NonlinearProblem (void)
 

Protected Member Functions

void PredictDof_for_AfterPredict (const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
 
void RealPredictDof (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 SetCoef (doublereal dT, doublereal dAlpha, enum StepChange NewStep)=0
 
virtual void Predict (void)
 
- Protected Member Functions inherited from StepIntegrator
template<class T >
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
 

Protected Attributes

VectorHandlerpXPrev
 
VectorHandlerpXPrimePrev
 
doublereal dT
 
doublereal rho
 
doublereal theta
 
doublereal w0
 
doublereal w1
 
doublereal w2
 
doublereal jx11
 
doublereal jx12
 
doublereal jx21
 
doublereal jx22
 
doublereal m0
 
doublereal m1
 
doublereal n0
 
doublereal n1
 
bool bAdvanceCalledFirstTime
 
MyVectorHandler Restmp
 
std::vector< boolEqIsAlgebraic
 
std::vector< boolEqIsDifferential
 
SpMapMatrixHandler Jacxi_xp
 
SpMapMatrixHandler Jacxi_x
 
SpMapMatrixHandler Jac_xp
 
SpMapMatrixHandler Jac_x
 
MatrixHandlerpJacxi_xp
 
MatrixHandlerpJacxi_x
 
MatrixHandlerpJac_xp
 
MatrixHandlerpJac_x
 
- Protected Attributes inherited from ImplicitStepIntegrator
VectorHandlerpXCurr
 
VectorHandlerpXPrimeCurr
 
bool bModResTest
 
- Protected Attributes inherited from StepIntegrator
DataManagerpDM
 
const DataManager::DofVecTypepDofs
 
bool outputPred
 
integer MaxIters
 
doublereal dTol
 
doublereal dSolTol
 
integer steps
 
integer unkstates
 

Additional Inherited Members

- Public Types inherited from StepIntegrator
enum  { DIFFERENTIAL = 0, ALGEBRAIC = 1 }
 
enum  StepChange { NEWSTEP, REPEATSTEP }
 

Detailed Description

Definition at line 40 of file thirdorderstepsol.h.

Constructor & Destructor Documentation

ThirdOrderIntegrator::ThirdOrderIntegrator ( const doublereal  dT,
const doublereal  dSolutionTol,
const integer  iMaxIt,
const bool  bmod_res_test 
)

Definition at line 52 of file thirdorderstepsol.cc.

References Jac_x, Jac_xp, Jacxi_x, Jacxi_xp, pJac_x, pJac_xp, pJacxi_x, and pJacxi_xp.

56 : ImplicitStepIntegrator(iMaxIt, dT, dSolutionTol, 1, 2, bmod_res_test),
57 pXPrev(0),
58 pXPrimePrev(0),
60 {
62  pJacxi_x = &Jacxi_x;
63  pJac_xp = &Jac_xp;
64  pJac_x = &Jac_x;
65 };
VectorHandler * pXPrimePrev
VectorHandler * pXPrev
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
SpMapMatrixHandler Jacxi_x
SpMapMatrixHandler Jac_x
MatrixHandler * pJac_x
MatrixHandler * pJac_xp
MatrixHandler * pJacxi_xp
MatrixHandler * pJacxi_x
SpMapMatrixHandler Jacxi_xp
SpMapMatrixHandler Jac_xp
ThirdOrderIntegrator::~ThirdOrderIntegrator ( void  )
virtual

Definition at line 67 of file thirdorderstepsol.cc.

References NO_OP.

67  {
68  NO_OP;
69 };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

doublereal ThirdOrderIntegrator::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

Implements StepIntegrator.

Definition at line 72 of file thirdorderstepsol.cc.

References DofOrder::ALGEBRAIC, ASSERT, bAdvanceCalledFirstTime, StepIntegrator::dSolTol, StepIntegrator::dTol, EqIsAlgebraic, EqIsDifferential, DataManager::iGetNumDofs(), Jac_x, Jac_xp, Jacxi_x, Jacxi_xp, DataManager::LinkToSolution(), StepIntegrator::MaxIters, StepIntegrator::pDM, StepIntegrator::pDofs, Solver::pGetNonlinearSolver(), Predict(), ImplicitStepIntegrator::pXCurr, pXPrev, ImplicitStepIntegrator::pXPrimeCurr, pXPrimePrev, MyVectorHandler::Resize(), SpMapMatrixHandler::Resize(), Restmp, SetCoef(), and NonlinearSolver::Solve().

83 {
85  integer n = pDM->iGetNumDofs();
86  Restmp.Resize(n);
87  EqIsAlgebraic.resize(n);
88  EqIsDifferential.resize(n);
89  DataManager::DofIterator_const CurrDof = pDofs->begin();
90  for (int iCntm1 = 0; iCntm1 < n;
91  iCntm1++, ++CurrDof)
92  {
93  ASSERT(CurrDof != pDofs->end());
94  EqIsAlgebraic[iCntm1] = (
95  CurrDof->EqOrder == DofOrder::ALGEBRAIC);
96  EqIsDifferential[iCntm1] = (!EqIsAlgebraic[iCntm1]);
97  }
98  CurrDof = pDofs->begin();
99  Jacxi_xp.Resize(n, n);
100  Jacxi_x.Resize(n, n);
101  Jac_xp.Resize(n, n);
102  Jac_x.Resize(n, n);
103  bAdvanceCalledFirstTime = false;
104  }
105  pXCurr = pX;
106  pXPrev = qX[0];
107 
108  pXPrimeCurr = pXPrime;
109  pXPrimePrev = qXPrime[0];
110 
111  SetCoef(TStep, dAlph, StType);
112 
113  Predict();
115 
116  Err = 0.;
117  pS->pGetNonlinearSolver()->Solve(this, pS, MaxIters, dTol,
118  EffIter, Err, dSolTol, SolErr);
119 
120  return Err;
121 };
VectorHandler * pXPrimePrev
VectorHandler * pXPrev
MyVectorHandler Restmp
std::vector< bool > EqIsAlgebraic
SpMapMatrixHandler Jacxi_x
SpMapMatrixHandler Jac_x
doublereal dSolTol
Definition: stepsol.h:99
virtual void Resize(integer iSize)
Definition: vh.cc:347
void LinkToSolution(VectorHandler &XCurr, VectorHandler &XPrimeCurr)
Definition: dataman2.cc:172
const DataManager::DofVecType * pDofs
Definition: stepsol.h:94
std::vector< bool > EqIsDifferential
DataManager * pDM
Definition: stepsol.h:93
virtual void Predict(void)
void Resize(integer ir, integer ic)
Definition: spmapmh.cc:174
virtual NonlinearSolver * pGetNonlinearSolver(void) const
Definition: solver.h:404
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
VectorHandler * pXCurr
Definition: stepsol.h:163
integer MaxIters
Definition: stepsol.h:98
DofVecType::const_iterator DofIterator_const
Definition: dataman.h:802
#define ASSERT(expression)
Definition: colamd.c:977
virtual void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)=0
SpMapMatrixHandler Jacxi_xp
virtual void Solve(const NonlinearProblem *pNLP, Solver *pS, const integer iMaxIter, const doublereal &Tol, integer &iIterCnt, doublereal &dErr, const doublereal &SolTol, doublereal &dSolErr)=0
long int integer
Definition: colamd.c:51
doublereal dTol
Definition: stepsol.h:99
integer iGetNumDofs(void) const
Definition: dataman.h:809
SpMapMatrixHandler Jac_xp

Here is the call graph for this function:

void ThirdOrderIntegrator::Jacobian ( MatrixHandler pJac) const
virtual

Implements NonlinearProblem.

Definition at line 258 of file thirdorderstepsol.cc.

References ASSERT, DataManager::AssJac(), DataManager::AssRes(), MyVectorHandler::Attach(), DEBUGCOUTFNAME, DataManager::dGetTime(), dT, EqIsDifferential, SpMapMatrixHandler::FakeThirdOrderMulAndSumWithShift(), DataManager::iGetNumDofs(), Jac_x, Jac_xp, Jacxi_x, Jacxi_xp, jx11, jx12, jx21, jx22, DataManager::LinkToSolution(), SpMapMatrixHandler::MulAndSumWithShift(), VectorHandler::pdGetVec(), StepIntegrator::pDM, pJac_x, pJac_xp, pJacxi_x, pJacxi_xp, ImplicitStepIntegrator::pXCurr, ImplicitStepIntegrator::pXPrimeCurr, MatrixHandler::Reset(), Restmp, DataManager::SetTime(), theta, and DataManager::Update().

259 {
260  DEBUGCOUTFNAME("ThirdOrderIntegrator::Jacobian");
261  ASSERT(pDM != NULL);
262 
263  integer iNumDofs = pDM->iGetNumDofs();
264 
265  MyVectorHandler state, stateder;
266  pJac->Reset();
267 #if 0
268  pJacxi_x->Reset();
269  pJacxi_xp->Reset();
270  pJac_x->Reset();
271  pJac_xp->Reset();
272 #endif
273  /* theta*dT */
274  state.Attach(iNumDofs, pXCurr->pdGetVec()+iNumDofs);
275  stateder.Attach(iNumDofs, pXPrimeCurr->pdGetVec()+iNumDofs);
276  pDM->SetTime(pDM->dGetTime() + theta*dT);
277  pDM->LinkToSolution(state, stateder);
278  pDM->Update();
279 #warning This trick does not work with Coulomb friction (and other elements too)
280  /*
281  The reason is that
282  a) Colomb friction residual (and other elements) can throw
283  to signal the need of a new jacobian
284  b) Have internal states that depend on the order of residual
285  calls
286  However, this is needed for all the elements (almost all)
287  that compute something during residual and use it
288  later during Jacobain computation
289  */
290  pDM->AssRes(Restmp, 1.);
291  pDM->AssJac(*pJacxi_x, 1.);
292  pDM->AssJac(*pJacxi_xp, 0.);
293 
294  /* dT */
295  pDM->SetTime(pDM->dGetTime() - theta*dT);
297  pDM->Update();
298  pDM->AssRes(Restmp, 1.);
299  pDM->AssJac(*pJac_x, 1.);
300  pDM->AssJac(*pJac_xp, 0.);
301 
302 
303  /* Attenzione: a differenza di quanto riportato a p. 16,
304  * "Unconditionally stable multistep integration of ordinary
305  * differential and differential-algebraic equations with
306  * controlled algorithmic dissipation for multibody dynamic
307  * applications"
308  * qui il tempo finale e' in cima, il tempo theta in basso
309  */
310 
311  /* 2,2 */
312  // doublereal J22_x = (1.+3.*rho)/(6.*rho*(1.+rho))*dT;
313  Jacxi_x.MulAndSumWithShift(*pJac, jx22, iNumDofs, iNumDofs);
314  Jacxi_xp.FakeThirdOrderMulAndSumWithShift(*pJac, EqIsDifferential, 1. - jx22, iNumDofs, iNumDofs);
315 
316  /* 2,1 */
317  // doublereal J21_x = -1./(6.*rho*(1.+rho)*(1.+rho))*dT;
318  Jacxi_x.MulAndSumWithShift(*pJac, jx21, iNumDofs, 0);
320 
321  /* 1,2 */
322  // doublereal J12_x = (1.+rho)*(1.+rho)/(6.*rho)*dT;
323  Jac_x.MulAndSumWithShift(*pJac, jx12, 0, iNumDofs);
325 
326  /* 1,1 */
327  // doublereal J11_x = (2.*rho-1.)/(6.*rho)*dT;
328  Jac_x.MulAndSumWithShift(*pJac, jx11, 0, 0);
330 
331  return;
332 };
MyVectorHandler Restmp
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual doublereal * pdGetVec(void) const =0
SpMapMatrixHandler Jacxi_x
SpMapMatrixHandler Jac_x
doublereal dGetTime(void) const
Definition: dataman2.cc:165
MatrixHandler * pJac_x
MatrixHandler * pJac_xp
virtual void AssRes(VectorHandler &ResHdl, doublereal dCoef)
Definition: elman.cc:498
virtual void Reset(void)=0
void LinkToSolution(VectorHandler &XCurr, VectorHandler &XPrimeCurr)
Definition: dataman2.cc:172
std::vector< bool > EqIsDifferential
MatrixHandler & MulAndSumWithShift(MatrixHandler &out, doublereal s=1., integer drow=0, integer dcol=0) const
Definition: spmapmh.cc:269
DataManager * pDM
Definition: stepsol.h:93
MatrixHandler * pJacxi_xp
MatrixHandler * pJacxi_x
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
VectorHandler * pXCurr
Definition: stepsol.h:163
virtual void AssJac(MatrixHandler &JacHdl, doublereal dCoef)
Definition: elman.cc:392
#define ASSERT(expression)
Definition: colamd.c:977
MatrixHandler & FakeThirdOrderMulAndSumWithShift(MatrixHandler &out, std::vector< bool > b, doublereal s=1., integer drow=0, integer dcol=0) const
Definition: spmapmh.cc:296
void SetTime(const doublereal &dTime, const doublereal &dTimeStep=-1., const integer &iStep=-1, bool bServePending=true)
Definition: dataman2.cc:139
SpMapMatrixHandler Jacxi_xp
virtual void Update(void) const
Definition: dataman2.cc:2511
void Attach(integer iSize, doublereal *pd, integer iMSize=0)
Definition: vh.cc:418
long int integer
Definition: colamd.c:51
integer iGetNumDofs(void) const
Definition: dataman.h:809
SpMapMatrixHandler Jac_xp

Here is the call graph for this function:

void ThirdOrderIntegrator::Predict ( void  )
protectedvirtual

Definition at line 198 of file thirdorderstepsol.cc.

References DataManager::AfterPredict(), ASSERT, DEBUGCOUTFNAME, DataManager::LinkToSolution(), StepIntegrator::pDM, StepIntegrator::pDofs, PredictDof_for_AfterPredict(), ImplicitStepIntegrator::pXCurr, ImplicitStepIntegrator::pXPrimeCurr, RealPredictDof(), and StepIntegrator::UpdateLoop().

Referenced by Advance().

199 {
200  DEBUGCOUTFNAME("ThirdOrderIntegrator::Predict");
201  ASSERT(pDM != NULL);
202 
203 #ifdef USE_SCHUR
204  SchurDataManager* pSDM;
205  if ((pSDM = dynamic_cast<SchurDataManager*> (pDM)) != 0) {
206  silent_cerr("Warning: ThirdOrderIntegrator currently is "
207  << "untested with the parallel solver" << std::endl);
208  }
209 #endif // USE_SCHUR
210 
211  DataManager::DofIterator_const CurrDof = pDofs->begin();
212 
213  /*
214  * Linear combination of previous step state and derivative
215  * etc....
216  */
217  /*
218  * Predict for AfterPredict
219  */
222  pDM->AfterPredict();
223 
224  /*
225  * Vero Predict
226  */
228  return;
229 };
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
void PredictDof_for_AfterPredict(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
virtual void AfterPredict(void) const
Definition: dataman2.cc:2472
void LinkToSolution(VectorHandler &XCurr, VectorHandler &XPrimeCurr)
Definition: dataman2.cc:172
const DataManager::DofVecType * pDofs
Definition: stepsol.h:94
DataManager * pDM
Definition: stepsol.h:93
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
VectorHandler * pXCurr
Definition: stepsol.h:163
DofVecType::const_iterator DofIterator_const
Definition: dataman.h:802
#define ASSERT(expression)
Definition: colamd.c:977
void RealPredictDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
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

Here is the call graph for this function:

void ThirdOrderIntegrator::PredictDof_for_AfterPredict ( const int  DCount,
const DofOrder::Order  Order,
const VectorHandler *const  pSol = 0 
) const
protected

Definition at line 124 of file thirdorderstepsol.cc.

References DofOrder::ALGEBRAIC, DofOrder::DIFFERENTIAL, dT, MBDYN_EXCEPT_ARGS, VectorHandler::PutCoef(), ImplicitStepIntegrator::pXCurr, pXPrev, ImplicitStepIntegrator::pXPrimeCurr, and pXPrimePrev.

Referenced by Predict().

126  {
127  if (Order == DofOrder::DIFFERENTIAL) {
128  doublereal dXnm1 = pXPrev->operator()(DCount);
129  doublereal dXPnm1 =
130  pXPrimePrev->operator()(DCount);
131 
132  doublereal dXn = dXnm1+dXPnm1*dT;
133  doublereal dXPn = dXPnm1;
134 
135  pXPrimeCurr->PutCoef(DCount, dXPn);
136  pXCurr->PutCoef(DCount, dXn);
137 
138  } else if (Order == DofOrder::ALGEBRAIC) {
139  doublereal dXnm1 = pXPrev->operator()(DCount);
140  //doublereal dXInm1 = pXPrimePrev->operator()(DCount);
141  doublereal dXn = dXnm1;
142  doublereal dXIn = dXnm1*dT;
143 
144  pXCurr->PutCoef(DCount, dXn);
145  pXPrimeCurr->PutCoef(DCount, dXIn);
146 
147  } else {
148  silent_cerr("ThirdOrderIntegrator::PredictDof_for_AfterPredict:"
149  << "unknown order for dof "
150  << DCount<< std::endl);
152  }
153 }
VectorHandler * pXPrimePrev
VectorHandler * pXPrev
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
VectorHandler * pXCurr
Definition: stepsol.h:163
Order
Definition: shapefnc.h:42
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

void ThirdOrderIntegrator::RealPredictDof ( const int  DCount,
const DofOrder::Order  Order,
const VectorHandler *const  pSol = 0 
) const
protected

Definition at line 154 of file thirdorderstepsol.cc.

References DofOrder::ALGEBRAIC, DofOrder::DIFFERENTIAL, dT, DataManager::iGetNumDofs(), VectorHandler::IncCoef(), MBDYN_EXCEPT_ARGS, StepIntegrator::pDM, VectorHandler::PutCoef(), ImplicitStepIntegrator::pXCurr, pXPrev, ImplicitStepIntegrator::pXPrimeCurr, pXPrimePrev, and theta.

Referenced by Predict().

156  {
157  integer iNumDofs = pDM->iGetNumDofs();
158  //simple copy of predicted state
159  pXPrimeCurr->PutCoef(DCount+iNumDofs,
160  pXPrimeCurr->operator()(DCount));
161  pXCurr->PutCoef(DCount+iNumDofs, pXCurr->operator()(DCount));
162  if (Order == DofOrder::DIFFERENTIAL) {
163  //doublereal dXPnm1 =
164  // pXPrimePrev->operator()(DCount);
165 
166  /* tempo theta*/
167 // doublereal dXn = dXPnm1*(theta-1.)*dT;
168 // pXCurr->IncCoef(DCount+iNumDofs, dXn);
169 // pXCurr->PutCoef(DCount+iNumDofs,
170 // m0*pXCurr->operator()(DCount)+m1*pXPrev->operator()(DCount)
171 // +dT*(n0*pXPrimeCurr->operator()(DCount)+
172 // n1*pXPrimePrev->operator()(DCount)));
173  pXCurr->IncCoef(DCount+iNumDofs,
174  pXPrimePrev->operator()(DCount)*theta*dT);
175  } else if (Order == DofOrder::ALGEBRAIC) {
176  //doublereal dXnm1 = pXPrev->operator()(DCount);
177 
178  /* tempo theta*/
179 // doublereal dXIn = dXnm1*(theta-1.)*dT;
180 // pXPrimeCurr->IncCoef(DCount+iNumDofs, dXIn);
181 // pXPrimeCurr->PutCoef(DCount+iNumDofs,
182 // m0*pXPrimeCurr->operator()(DCount)+m1*pXPrimePrev->operator()(DCount)
183 // +dT*(n0*pXCurr->operator()(DCount)+
184 // n1*pXPrev->operator()(DCount)));
185 // pXCurr->PutCoef(DCount+iNumDofs,
186 // pXPrev->operator()(DCount));
187  pXPrimeCurr->IncCoef(DCount+iNumDofs,
188  pXPrev->operator()(DCount)*theta*dT);
189  } else {
190  silent_cerr("ThirdOrderIntegrator::RealPredictDof: "
191  << "unknown order for dof "
192  << DCount<< std::endl);
194  }
195 }
VectorHandler * pXPrimePrev
VectorHandler * pXPrev
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
DataManager * pDM
Definition: stepsol.h:93
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
VectorHandler * pXCurr
Definition: stepsol.h:163
Order
Definition: shapefnc.h:42
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
long int integer
Definition: colamd.c:51
integer iGetNumDofs(void) const
Definition: dataman.h:809

Here is the call graph for this function:

void ThirdOrderIntegrator::Residual ( VectorHandler pRes) const
virtual

Implements NonlinearProblem.

Definition at line 231 of file thirdorderstepsol.cc.

References ASSERT, DataManager::AssRes(), MyVectorHandler::Attach(), DEBUGCOUTFNAME, DataManager::dGetTime(), dT, DataManager::iGetNumDofs(), DataManager::LinkToSolution(), VectorHandler::pdGetVec(), StepIntegrator::pDM, ImplicitStepIntegrator::pXCurr, ImplicitStepIntegrator::pXPrimeCurr, DataManager::SetTime(), theta, and DataManager::Update().

232 {
233  DEBUGCOUTFNAME("ThirdOrderIntegrator::Residual");
234  ASSERT(pDM != NULL);
235 
236  integer iNumDofs = pDM->iGetNumDofs();
237 
238  MyVectorHandler state, stateder, res;
239 
240  /* theta*dT */
241  state.Attach(iNumDofs, pXCurr->pdGetVec()+iNumDofs);
242  stateder.Attach(iNumDofs, pXPrimeCurr->pdGetVec()+iNumDofs);
243  res.Attach(iNumDofs, pRes->pdGetVec()+iNumDofs);
244  pDM->SetTime(pDM->dGetTime() + theta*dT);
245  pDM->LinkToSolution(state, stateder);
246  pDM->Update();
247  pDM->AssRes(res, 1.);
248 
249  /* dT */
250  pDM->SetTime(pDM->dGetTime() - theta*dT);
252  pDM->Update();
253  pDM->AssRes(*pRes, 1.);
254 
255  return;
256 };
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual doublereal * pdGetVec(void) const =0
doublereal dGetTime(void) const
Definition: dataman2.cc:165
virtual void AssRes(VectorHandler &ResHdl, doublereal dCoef)
Definition: elman.cc:498
void LinkToSolution(VectorHandler &XCurr, VectorHandler &XPrimeCurr)
Definition: dataman2.cc:172
DataManager * pDM
Definition: stepsol.h:93
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
VectorHandler * pXCurr
Definition: stepsol.h:163
#define ASSERT(expression)
Definition: colamd.c:977
void SetTime(const doublereal &dTime, const doublereal &dTimeStep=-1., const integer &iStep=-1, bool bServePending=true)
Definition: dataman2.cc:139
virtual void Update(void) const
Definition: dataman2.cc:2511
void Attach(integer iSize, doublereal *pd, integer iMSize=0)
Definition: vh.cc:418
long int integer
Definition: colamd.c:51
integer iGetNumDofs(void) const
Definition: dataman.h:809

Here is the call graph for this function:

virtual void ThirdOrderIntegrator::SetCoef ( doublereal  dT,
doublereal  dAlpha,
enum StepChange  NewStep 
)
protectedpure virtual
void ThirdOrderIntegrator::Update ( const VectorHandler pSol) const
virtual

Implements NonlinearProblem.

Definition at line 364 of file thirdorderstepsol.cc.

References ASSERT, DEBUGCOUTFNAME, StepIntegrator::pDM, DataManager::Update(), UpdateDof(), and StepIntegrator::UpdateLoop().

365 {
366  DEBUGCOUTFNAME("ThirdOrderIntegrator::Predict");
367  ASSERT(pDM != NULL);
368 
369 #ifdef USE_SCHUR
370  SchurDataManager* pSDM;
371  if ((pSDM = dynamic_cast<SchurDataManager*> (pDM)) != 0) {
372  silent_cerr("Warning: ThirdOrderIntegrator is untested "
373  << "with the parallel solver" << std::endl);
374  }
375 #endif // USE_SCHUR
376 
378  pDM->Update();
379  return;
380 };
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
void UpdateDof(const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
DataManager * pDM
Definition: stepsol.h:93
#define ASSERT(expression)
Definition: colamd.c:977
virtual void Update(void) const
Definition: dataman2.cc:2511
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

Here is the call graph for this function:

void ThirdOrderIntegrator::UpdateDof ( const int  DCount,
const DofOrder::Order  Order,
const VectorHandler *const  pSol = 0 
) const
protected

Definition at line 334 of file thirdorderstepsol.cc.

References DofOrder::ALGEBRAIC, DofOrder::DIFFERENTIAL, dT, DataManager::iGetNumDofs(), VectorHandler::IncCoef(), m0, MBDYN_EXCEPT_ARGS, n0, StepIntegrator::pDM, ImplicitStepIntegrator::pXCurr, ImplicitStepIntegrator::pXPrimeCurr, w0, and w1.

Referenced by Update().

336  {
337  integer iNumDofs = pDM->iGetNumDofs();
338  doublereal dxp = pSol->operator()(DCount);
339  doublereal dxp_xi = pSol->operator()(DCount+iNumDofs);
340  if (Order == DofOrder::DIFFERENTIAL) {
341 
342  pXPrimeCurr->IncCoef(DCount, dxp);
343  pXPrimeCurr->IncCoef(DCount+iNumDofs, dxp_xi);
344 
345  pXCurr->IncCoef(DCount, dT*(w1*dxp_xi+w0*dxp));
346  pXCurr->IncCoef(DCount+iNumDofs,
347  dT*(m0*w1*dxp_xi+(m0*w0+n0)*dxp));
348 
349  } else if (Order == DofOrder::ALGEBRAIC) {
350  pXCurr->IncCoef(DCount, dxp);
351  pXCurr->IncCoef(DCount+iNumDofs, dxp_xi);
352 
353  pXPrimeCurr->IncCoef(DCount, dT*(w1*dxp_xi+w0*dxp));
354  pXPrimeCurr->IncCoef(DCount+iNumDofs,
355  dT*(m0*w1*dxp_xi+(m0*w0+n0)*dxp));
356  } else {
357  silent_cerr("unknown order for dof "
358  << DCount<< std::endl);
360  }
361 };
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
DataManager * pDM
Definition: stepsol.h:93
VectorHandler * pXPrimeCurr
Definition: stepsol.h:164
VectorHandler * pXCurr
Definition: stepsol.h:163
Order
Definition: shapefnc.h:42
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
integer iGetNumDofs(void) const
Definition: dataman.h:809

Here is the call graph for this function:

Member Data Documentation

bool ThirdOrderIntegrator::bAdvanceCalledFirstTime
protected

Definition at line 54 of file thirdorderstepsol.h.

Referenced by Advance().

std::vector<bool> ThirdOrderIntegrator::EqIsAlgebraic
protected

Definition at line 56 of file thirdorderstepsol.h.

Referenced by Advance().

std::vector<bool> ThirdOrderIntegrator::EqIsDifferential
protected

Definition at line 56 of file thirdorderstepsol.h.

Referenced by Advance(), and Jacobian().

SpMapMatrixHandler ThirdOrderIntegrator::Jac_x
protected

Definition at line 57 of file thirdorderstepsol.h.

Referenced by Advance(), Jacobian(), and ThirdOrderIntegrator().

SpMapMatrixHandler ThirdOrderIntegrator::Jac_xp
protected

Definition at line 57 of file thirdorderstepsol.h.

Referenced by Advance(), Jacobian(), and ThirdOrderIntegrator().

SpMapMatrixHandler ThirdOrderIntegrator::Jacxi_x
protected

Definition at line 57 of file thirdorderstepsol.h.

Referenced by Advance(), Jacobian(), and ThirdOrderIntegrator().

SpMapMatrixHandler ThirdOrderIntegrator::Jacxi_xp
protected

Definition at line 57 of file thirdorderstepsol.h.

Referenced by Advance(), Jacobian(), and ThirdOrderIntegrator().

doublereal ThirdOrderIntegrator::jx11
protected
doublereal ThirdOrderIntegrator::jx12
protected
doublereal ThirdOrderIntegrator::jx21
protected
doublereal ThirdOrderIntegrator::jx22
protected
doublereal ThirdOrderIntegrator::m0
protected
doublereal ThirdOrderIntegrator::m1
protected
doublereal ThirdOrderIntegrator::n0
protected
doublereal ThirdOrderIntegrator::n1
protected
MatrixHandler * ThirdOrderIntegrator::pJac_x
protected

Definition at line 58 of file thirdorderstepsol.h.

Referenced by Jacobian(), and ThirdOrderIntegrator().

MatrixHandler * ThirdOrderIntegrator::pJac_xp
protected

Definition at line 58 of file thirdorderstepsol.h.

Referenced by Jacobian(), and ThirdOrderIntegrator().

MatrixHandler * ThirdOrderIntegrator::pJacxi_x
protected

Definition at line 58 of file thirdorderstepsol.h.

Referenced by Jacobian(), and ThirdOrderIntegrator().

MatrixHandler* ThirdOrderIntegrator::pJacxi_xp
protected

Definition at line 58 of file thirdorderstepsol.h.

Referenced by Jacobian(), and ThirdOrderIntegrator().

VectorHandler* ThirdOrderIntegrator::pXPrev
protected

Definition at line 44 of file thirdorderstepsol.h.

Referenced by Advance(), PredictDof_for_AfterPredict(), and RealPredictDof().

VectorHandler* ThirdOrderIntegrator::pXPrimePrev
protected

Definition at line 45 of file thirdorderstepsol.h.

Referenced by Advance(), PredictDof_for_AfterPredict(), and RealPredictDof().

MyVectorHandler ThirdOrderIntegrator::Restmp
mutableprotected

Definition at line 55 of file thirdorderstepsol.h.

Referenced by Advance(), and Jacobian().

doublereal ThirdOrderIntegrator::rho
protected
doublereal ThirdOrderIntegrator::theta
protected
doublereal ThirdOrderIntegrator::w0
protected
doublereal ThirdOrderIntegrator::w1
protected
doublereal ThirdOrderIntegrator::w2
protected

The documentation for this class was generated from the following files: