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

#include <mfree.h>

Inheritance diagram for MatrixFreeSolver:
Collaboration diagram for MatrixFreeSolver:

Public Types

enum  SolverType {
  UNKNOWN = -1, BICGSTAB, GMRES, DEFAULT = GMRES,
  LAST
}
 
- Public Types inherited from NonlinearSolver
enum  Type {
  UNKNOWN = -1, NEWTONRAPHSON, MATRIXFREE, LINESEARCH,
  DEFAULT = NEWTONRAPHSON, LASTSOLVERTYPE
}
 

Public Member Functions

 MatrixFreeSolver (const Preconditioner::PrecondType PType, const integer iPStep, doublereal ITol, integer MaxIt, doublereal etaMx, doublereal T, const NonlinearSolverOptions &options)
 
 ~MatrixFreeSolver (void)
 
- Public Member Functions inherited from NonlinearSolver
 NonlinearSolver (const NonlinearSolverOptions &options)
 
virtual void SetTest (NonlinearSolverTest *pr, NonlinearSolverTest *ps)
 
virtual ~NonlinearSolver (void)
 
virtual bool MakeResTest (Solver *pS, const NonlinearProblem *pNLP, const VectorHandler &Vec, const doublereal &dTol, doublereal &dTest, doublereal &dTestDiff)
 
virtual void Solve (const NonlinearProblem *pNLP, Solver *pS, const integer iMaxIter, const doublereal &Tol, integer &iIterCnt, doublereal &dErr, const doublereal &SolTol, doublereal &dSolErr)=0
 
virtual integer TotalAssembledJacobian (void)
 
virtual NonlinearSolverTestpGetResTest (void)
 
virtual NonlinearSolverTestpGetSolTest (void)
 
- Public Member Functions inherited from SolverDiagnostics
 SolverDiagnostics (unsigned OF=OUTPUT_DEFAULT, DriveCaller *pOM=0)
 
virtual ~SolverDiagnostics (void)
 
void SetNoOutput (void)
 
void SetOutputMeter (DriveCaller *pOM)
 
void SetOutputDriveHandler (const DriveHandler *pDH)
 
void SetOutputFlags (unsigned OF)
 
void AddOutputFlags (unsigned OF)
 
void DelOutputFlags (unsigned OF)
 
MatrixHandler::Norm_t GetCondMatNorm (void) const
 
bool outputMeter (void) const
 
bool outputIters (void) const
 
bool outputRes (void) const
 
bool outputSol (void) const
 
bool outputJac (void) const
 
bool outputStep (void) const
 
bool outputBailout (void) const
 
bool outputCounter (void) const
 
bool outputMatrixConditionNumber (void) const
 
bool outputSolverConditionNumber (void) const
 
bool outputSolverConditionStat (void) const
 
bool outputCPUTime (void) const
 
bool outputMsg (void) const
 

Protected Attributes

PreconditionerpPM
 
VectorHandlerpRes
 
doublereal IterTol
 
integer MaxLinIt
 
doublereal Tau
 
doublereal gamma
 
doublereal etaMax
 
integer PrecondIter
 
bool bBuildMat
 
const NonlinearProblempPrevNLP
 
- Protected Attributes inherited from NonlinearSolver
integer Size
 
integer TotJac
 
NonlinearSolverTestpResTest
 
NonlinearSolverTestpSolTest
 
- Protected Attributes inherited from SolverDiagnostics
unsigned OutputFlags
 
DriveCallerpOutputMeter
 
- Protected Attributes inherited from NonlinearSolverOptions
bool bHonorJacRequest
 
enum
NonlinearSolverOptions::ScaleFlags 
eScaleFlags
 
doublereal dScaleAlgebraic
 

Additional Inherited Members

- Protected Types inherited from NonlinearSolver
enum  CPUTimeType { CPU_RESIDUAL, CPU_JACOBIAN, CPU_LINEAR_SOLVER, CPU_LAST_TYPE }
 
- Protected Types inherited from SolverDiagnostics
enum  {
  OUTPUT_NONE = 0x0000, OUTPUT_ITERS = 0x0001, OUTPUT_RES = 0x0002, OUTPUT_SOL = 0x0004,
  OUTPUT_JAC = 0x0008, OUTPUT_BAILOUT = 0x0010, OUTPUT_MSG = 0x0020, OUTPUT_COUNTER = 0x0040,
  OUTPUT_MAT_COND_NUM_1 = 0x0080, OUTPUT_MAT_COND_NUM_INF = 0x0100, OUTPUT_SOLVER_COND_NUM = 0x0200, OUTPUT_SOLVER_COND_STAT = 0x400,
  OUTPUT_CPU_TIME = 0x800, OUTPUT_MAT_COND_NUM = OUTPUT_MAT_COND_NUM_1 | OUTPUT_MAT_COND_NUM_INF, OUTPUT_DEFAULT = OUTPUT_MSG, OUTPUT_STEP = (OUTPUT_ITERS | OUTPUT_RES | OUTPUT_SOL | OUTPUT_JAC | OUTPUT_MAT_COND_NUM | OUTPUT_SOLVER_COND_NUM),
  OUTPUT_MASK = 0x07FF
}
 
- Protected Types inherited from NonlinearSolverOptions
enum  ScaleFlags { SCALE_ALGEBRAIC_EQUATIONS_NO = 0, SCALE_ALGEBRAIC_EQUATIONS_YES = 1 }
 
- Protected Member Functions inherited from NonlinearSolver
virtual bool MakeSolTest (Solver *pS, const VectorHandler &Vec, const doublereal &dTol, doublereal &dTest)
 
doublereal dGetCondMax () const
 
doublereal dGetCondMin () const
 
doublereal dGetCondAvg () const
 
doublereal dGetTimeCPU (CPUTimeType eType) const
 
void AddCond (doublereal dCond)
 
void AddTimeCPU (doublereal dTime, CPUTimeType eType)
 
- Protected Member Functions inherited from NonlinearSolverOptions
 NonlinearSolverOptions (bool bHonorJacRequest=false, enum ScaleFlags eScaleFlags=SCALE_ALGEBRAIC_EQUATIONS_NO, doublereal dScaleAlgebraic=1.)
 

Detailed Description

Definition at line 46 of file mfree.h.

Member Enumeration Documentation

Enumerator
UNKNOWN 
BICGSTAB 
GMRES 
DEFAULT 
LAST 

Definition at line 49 of file mfree.h.

49  {
50  UNKNOWN = -1,
51 
52  BICGSTAB,
53  GMRES,
54 
55  DEFAULT = GMRES,
56 
57  LAST
58  };

Constructor & Destructor Documentation

MatrixFreeSolver::MatrixFreeSolver ( const Preconditioner::PrecondType  PType,
const integer  iPStep,
doublereal  ITol,
integer  MaxIt,
doublereal  etaMx,
doublereal  T,
const NonlinearSolverOptions options 
)

Definition at line 47 of file mfree.cc.

References Preconditioner::FULLJACOBIANMATRIX, MBDYN_EXCEPT_ARGS, pPM, and SAFENEW.

55 : NonlinearSolver(options),
56 pPM(NULL),
57 pRes(NULL),
58 IterTol(ITol),
59 MaxLinIt(MaxIt),
60 Tau(T),
62 etaMax(etaMx),
63 PrecondIter(iPStep),
64 bBuildMat(true),
65 pPrevNLP(NULL)
66 {
67 
68  switch(PType) {
71  break;
72 
73  default:
74  silent_cerr("Unknown Preconditioner type; aborting"
75  << std::endl);
77  }
78 }
Preconditioner * pPM
Definition: mfree.h:61
const doublereal defaultGamma
Definition: mfree.cc:45
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
bool bBuildMat
Definition: mfree.h:69
integer PrecondIter
Definition: mfree.h:68
const NonlinearProblem * pPrevNLP
Definition: mfree.h:70
#define SAFENEW(pnt, item)
Definition: mynewmem.h:695
doublereal IterTol
Definition: mfree.h:63
NonlinearSolver(const NonlinearSolverOptions &options)
Definition: nonlin.cc:434
integer MaxLinIt
Definition: mfree.h:64
doublereal Tau
Definition: mfree.h:65
VectorHandler * pRes
Definition: mfree.h:62
doublereal etaMax
Definition: mfree.h:67
doublereal gamma
Definition: mfree.h:66
MatrixFreeSolver::~MatrixFreeSolver ( void  )

Definition at line 80 of file mfree.cc.

References pPM, and SAFEDELETE.

81 {
82  if (pPM) {
83  SAFEDELETE(pPM);
84  pPM = 0;
85  }
86 }
Preconditioner * pPM
Definition: mfree.h:61
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Data Documentation

bool MatrixFreeSolver::bBuildMat
protected

Definition at line 69 of file mfree.h.

Referenced by BiCGStab::Solve(), and Gmres::Solve().

doublereal MatrixFreeSolver::etaMax
protected

Definition at line 67 of file mfree.h.

Referenced by BiCGStab::Solve(), and Gmres::Solve().

doublereal MatrixFreeSolver::gamma
protected

Definition at line 66 of file mfree.h.

Referenced by BiCGStab::Solve(), and Gmres::Solve().

doublereal MatrixFreeSolver::IterTol
protected

Definition at line 63 of file mfree.h.

integer MatrixFreeSolver::MaxLinIt
protected

Definition at line 64 of file mfree.h.

Referenced by Gmres::Gmres(), BiCGStab::Solve(), Gmres::Solve(), and Gmres::~Gmres().

Preconditioner* MatrixFreeSolver::pPM
protected

Definition at line 61 of file mfree.h.

Referenced by MatrixFreeSolver(), BiCGStab::Solve(), Gmres::Solve(), and ~MatrixFreeSolver().

const NonlinearProblem* MatrixFreeSolver::pPrevNLP
protected

Definition at line 70 of file mfree.h.

Referenced by BiCGStab::Solve(), and Gmres::Solve().

integer MatrixFreeSolver::PrecondIter
protected

Definition at line 68 of file mfree.h.

Referenced by BiCGStab::Solve(), and Gmres::Solve().

VectorHandler* MatrixFreeSolver::pRes
protected

Definition at line 62 of file mfree.h.

Referenced by BiCGStab::Solve(), and Gmres::Solve().

doublereal MatrixFreeSolver::Tau
protected

Definition at line 65 of file mfree.h.

Referenced by BiCGStab::Solve(), and Gmres::Solve().


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