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

#include <stepsol.h>

Inheritance diagram for Step1Integrator:
Collaboration diagram for Step1Integrator:

Public Member Functions

 Step1Integrator (const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const bool bmod_res_test)
 
virtual ~Step1Integrator (void)
 
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 StepNIntegrator
 StepNIntegrator (const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const bool bmod_res_test)
 
virtual ~StepNIntegrator (void)
 
virtual void Residual (VectorHandler *pRes) const
 
virtual void Jacobian (MatrixHandler *pJac) const
 
virtual void Update (const VectorHandler *pSol) const
 
virtual doublereal TestScale (const NonlinearSolverTest *pTest, doublereal &dAlgebraicEqu) const
 
- 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
 
- 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 (const int DCount, const DofOrder::Order Order, const VectorHandler *const pSol=0) const
 
virtual void Predict (void)
 
virtual doublereal dPredictDerivative (const doublereal &dXm1, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const =0
 
virtual doublereal dPredictState (const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1, DofOrder::Order o=DofOrder::DIFFERENTIAL) const =0
 
virtual doublereal dPredDer (const doublereal &dXm1, const doublereal &dXPm1) const =0
 
virtual doublereal dPredState (const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const =0
 
virtual doublereal dPredDerAlg (const doublereal &dXm1, const doublereal &dXPm1) const =0
 
virtual doublereal dPredStateAlg (const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const =0
 
- Protected Member Functions inherited from StepNIntegrator
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
 
- 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
 
- 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 }
 
- Public Attributes inherited from StepNIntegrator
doublereal db0Differential
 
doublereal db0Algebraic
 

Detailed Description

Definition at line 266 of file stepsol.h.

Constructor & Destructor Documentation

Step1Integrator::Step1Integrator ( const integer  MaxIt,
const doublereal  dT,
const doublereal  dSolutionTol,
const bool  bmod_res_test 
)

Definition at line 560 of file stepsol.cc.

References NO_OP.

564 : StepNIntegrator(MaxIt, dT, dSolutionTol, 1, bmod_res_test),
565 pXPrev(NULL),
566 pXPrimePrev(NULL)
567 {
568  NO_OP;
569 }
VectorHandler * pXPrev
Definition: stepsol.h:270
StepNIntegrator(const integer MaxIt, const doublereal dT, const doublereal dSolutionTol, const integer stp, const bool bmod_res_test)
Definition: stepsol.cc:446
#define NO_OP
Definition: myassert.h:74
VectorHandler * pXPrimePrev
Definition: stepsol.h:271
Step1Integrator::~Step1Integrator ( void  )
virtual

Definition at line 571 of file stepsol.cc.

References NO_OP.

572 {
573  NO_OP;
574 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

doublereal Step1Integrator::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 623 of file stepsol.cc.

References DataManager::AfterConvergence(), DataManager::AfterPredict(), ASSERT, DataManager::dGetTime(), StepIntegrator::dSolTol, StepIntegrator::dTol, DataManager::iGetNumDofs(), DataManager::LinkToSolution(), StepIntegrator::MaxIters, StepIntegrator::outputPred, StepIntegrator::pDM, Solver::pGetNonlinearSolver(), Predict(), ImplicitStepIntegrator::pXCurr, pXPrev, ImplicitStepIntegrator::pXPrimeCurr, pXPrimePrev, StepNIntegrator::SetCoef(), and NonlinearSolver::Solve().

633 {
634  ASSERT(pDM != NULL);
635  pXCurr = pX;
636  pXPrev = qX[0];
637 
638  pXPrimeCurr = pXPrime;
639  pXPrimePrev = qXPrime[0];
640 
641  /* predizione */
642  SetCoef(TStep, dAph, StType);
643  Predict();
645  pDM->AfterPredict();
646 
647 #ifdef DEBUG
648  integer iNumDofs = pDM->iGetNumDofs();
649  if (outputPred) {
650  std::cout << "After prediction, time=" << pDM->dGetTime() << std::endl;
651  std::cout << "Dof: | XCurr ";
652  for (unsigned idx = 0; idx < qX.size(); idx++) {
653  std::cout << "| XPrev[" << idx << "] ";
654  }
655  std::cout << "| XPrime ";
656  for (unsigned idx = 0; idx < qXPrime.size(); idx++) {
657  std::cout << "| XPPrev[" << idx << "] ";
658  }
659  std::cout << "|" << std::endl;
660  for (int iTmpCnt = 1; iTmpCnt <= iNumDofs; iTmpCnt++) {
661  std::cout << std::setw(8) << iTmpCnt << ": ";
662  std::cout << std::setw(12) << pX->operator()(iTmpCnt);
663  for (unsigned int ivec = 0; ivec < qX.size(); ivec++) {
664  std::cout << std::setw(12)
665  << (qX[ivec])->operator()(iTmpCnt);
666  }
667  std::cout << std::setw(12) << pXPrime->operator()(iTmpCnt);
668  for (unsigned int ivec = 0; ivec < qXPrime.size(); ivec++) {
669  std::cout << std::setw(12)
670  << (qXPrime[ivec])->operator()(iTmpCnt);
671  }
672  std::cout << " " << pDM->DataManager::GetDofDescription(iTmpCnt) << std::endl;
673  }
674  }
675 #endif /* DEBUG */
676 
677  Err = 0.;
678  pS->pGetNonlinearSolver()->Solve(this, pS, MaxIters, dTol,
679  EffIter, Err, dSolTol, SolErr);
680 
681  /* if it gets here, it surely converged */
683 
684  return Err;
685 }
bool outputPred
Definition: stepsol.h:96
virtual void SetCoef(doublereal dT, doublereal dAlpha, enum StepChange NewStep)=0
doublereal dGetTime(void) const
Definition: dataman2.cc:165
virtual void Predict(void)
Definition: stepsol.cc:615
doublereal dSolTol
Definition: stepsol.h:99
VectorHandler * pXPrev
Definition: stepsol.h:270
VectorHandler * pXPrimePrev
Definition: stepsol.h:271
virtual void AfterConvergence(void) const
Definition: dataman2.cc:2527
virtual void AfterPredict(void) const
Definition: dataman2.cc:2472
void LinkToSolution(VectorHandler &XCurr, VectorHandler &XPrimeCurr)
Definition: dataman2.cc:172
DataManager * pDM
Definition: stepsol.h:93
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
#define ASSERT(expression)
Definition: colamd.c:977
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

Here is the call graph for this function:

virtual doublereal Step1Integrator::dPredDer ( const doublereal dXm1,
const doublereal dXPm1 
) const
protectedpure virtual

Implemented in ImplicitEulerIntegrator, and CrankNicolsonIntegrator.

Referenced by PredictDof().

virtual doublereal Step1Integrator::dPredDerAlg ( const doublereal dXm1,
const doublereal dXPm1 
) const
protectedpure virtual

Implemented in ImplicitEulerIntegrator, and CrankNicolsonIntegrator.

Referenced by PredictDof().

virtual doublereal Step1Integrator::dPredictDerivative ( const doublereal dXm1,
const doublereal dXPm1,
DofOrder::Order  o = DofOrder::DIFFERENTIAL 
) const
protectedpure virtual
virtual doublereal Step1Integrator::dPredictState ( const doublereal dXm1,
const doublereal dXP,
const doublereal dXPm1,
DofOrder::Order  o = DofOrder::DIFFERENTIAL 
) const
protectedpure virtual
virtual doublereal Step1Integrator::dPredState ( const doublereal dXm1,
const doublereal dXP,
const doublereal dXPm1 
) const
protectedpure virtual

Implemented in ImplicitEulerIntegrator, and CrankNicolsonIntegrator.

Referenced by PredictDof().

virtual doublereal Step1Integrator::dPredStateAlg ( const doublereal dXm1,
const doublereal dXP,
const doublereal dXPm1 
) const
protectedpure virtual

Implemented in ImplicitEulerIntegrator, and CrankNicolsonIntegrator.

Referenced by PredictDof().

void Step1Integrator::Predict ( void  )
protectedvirtual

Definition at line 615 of file stepsol.cc.

References ASSERT, DEBUGCOUTFNAME, StepIntegrator::pDM, PredictDof(), and StepIntegrator::UpdateLoop().

Referenced by Advance().

616 {
617  DEBUGCOUTFNAME("Step1Integrator::Predict");
618  ASSERT(pDM != NULL);
620 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
DataManager * pDM
Definition: stepsol.h:93
#define ASSERT(expression)
Definition: colamd.c:977
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

Here is the call graph for this function:

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

Definition at line 581 of file stepsol.cc.

References DofOrder::ALGEBRAIC, DofOrder::DIFFERENTIAL, dPredDer(), dPredDerAlg(), dPredState(), dPredStateAlg(), MBDYN_EXCEPT_ARGS, VectorHandler::PutCoef(), ImplicitStepIntegrator::pXCurr, pXPrev, ImplicitStepIntegrator::pXPrimeCurr, and pXPrimePrev.

Referenced by Predict().

584 {
585  if (Order == DofOrder::DIFFERENTIAL) {
586  doublereal dXnm1 = pXPrev->operator()(DCount);
587  doublereal dXPnm1 = pXPrimePrev->operator()(DCount);
588  doublereal dXPn = dPredDer(dXnm1, dXPnm1);
589  doublereal dXn = dPredState(dXnm1, dXPn, dXPnm1);
590  pXPrimeCurr->PutCoef(DCount, dXPn);
591  pXCurr->PutCoef(DCount, dXn);
592 
593  } else if (Order == DofOrder::ALGEBRAIC) {
594  doublereal dXnm1 = pXPrev->operator()(DCount);
595  doublereal dXInm1 =
596  pXPrimePrev->operator()(DCount);
597 
598  doublereal dXn = dPredDerAlg(dXInm1, dXnm1);
599  doublereal dXIn = dPredStateAlg(dXInm1, dXn, dXnm1);
600 
601  pXCurr->PutCoef(DCount, dXn);
602  pXPrimeCurr->PutCoef(DCount, dXIn);
603 
604  } else {
605  silent_cerr("Step1Integrator::"
606  "PredictDof(): "
607  "unknown order for local dof "
608  << DCount << std::endl);
610  }
611 }
virtual doublereal dPredDer(const doublereal &dXm1, const doublereal &dXPm1) const =0
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
VectorHandler * pXPrev
Definition: stepsol.h:270
VectorHandler * pXPrimePrev
Definition: stepsol.h:271
virtual doublereal dPredStateAlg(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const =0
virtual doublereal dPredState(const doublereal &dXm1, const doublereal &dXP, const doublereal &dXPm1) const =0
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
virtual doublereal dPredDerAlg(const doublereal &dXm1, const doublereal &dXPm1) const =0

Here is the call graph for this function:

Member Data Documentation

VectorHandler* Step1Integrator::pXPrev
protected

Definition at line 270 of file stepsol.h.

Referenced by Advance(), and PredictDof().

VectorHandler* Step1Integrator::pXPrimePrev
protected

Definition at line 271 of file stepsol.h.

Referenced by Advance(), and PredictDof().


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