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

#include <precond_.h>

Inheritance diagram for FullJacobianPr:
Collaboration diagram for FullJacobianPr:

Public Member Functions

 ~FullJacobianPr (void)
 
void Precond (VectorHandler &b, VectorHandler &x, SolutionManager *pSM) const
 
- Public Member Functions inherited from Preconditioner
virtual ~Preconditioner (void)
 

Additional Inherited Members

- Public Types inherited from Preconditioner
enum  PrecondType { UNKNOWN = -1, FULLJACOBIANMATRIX }
 

Detailed Description

Definition at line 45 of file precond_.h.

Constructor & Destructor Documentation

FullJacobianPr::~FullJacobianPr ( void  )

Definition at line 49 of file precond.cc.

References NO_OP.

50 {
51  NO_OP;
52 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void FullJacobianPr::Precond ( VectorHandler b,
VectorHandler x,
SolutionManager pSM 
) const
virtual

Implements Preconditioner.

Definition at line 56 of file precond.cc.

References VectorHandler::pdGetVec(), SolutionManager::pdSetResVec(), SolutionManager::pdSetSolVec(), SolutionManager::pResHdl(), SolutionManager::pSolHdl(), and SolutionManager::Solve().

58 {
59  /*
60  * To be conservative, restore the existing vectors when done :)
61  */
62  doublereal *pdr = 0, *pds = 0;
63 
64  /*
65  * FIXME: what if they're null, but in general need be different?
66  *
67  * better do a
68 
69  bool bChangePointers(doublereal *newRhs, doublereal *newSol,
70  doublereal *&oldRhs, doublereal *&oldSol)
71 
72  * that, if both are needed does what expected, otherwise
73  * copies rhs in sol and uses only sol
74  */
75  if (pSM->pSolHdl() != pSM->pResHdl()) {
76  pdr = pSM->pdSetResVec(b.pdGetVec());
77  pds = pSM->pdSetSolVec(x.pdGetVec());
78 
79  } else {
80  x = b;
81  pdr = pSM->pdSetResVec(x.pdGetVec());
82  }
83 
84  pSM->Solve();
85 
86  (void)pSM->pdSetResVec(pdr);
87  if (pds != 0 && pds != pdr) {
88  (void)pSM->pdSetSolVec(pds);
89  }
90 }
virtual VectorHandler * pResHdl(void) const =0
virtual doublereal * pdGetVec(void) const =0
doublereal * pdSetSolVec(doublereal *pd)
Definition: solman.cc:101
doublereal * pdSetResVec(doublereal *pd)
Definition: solman.cc:93
virtual void Solve(void)=0
virtual VectorHandler * pSolHdl(void) const =0
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:


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