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

#include <nonlin.h>

Inheritance diagram for NonlinearSolverTestRange:
Collaboration diagram for NonlinearSolverTestRange:

Public Member Functions

 NonlinearSolverTestRange (NonlinearSolverTest *pTest, integer iFirstIndex=-1, integer iLastIndex=-1)
 
virtual ~NonlinearSolverTestRange (void)
 
virtual void TestOne (doublereal &dRes, const VectorHandler &Vec, const integer &iIndex, doublereal dCoef) const
 
virtual void TestMerge (doublereal &dResCurr, const doublereal &dResNew) const
 
virtual doublereal TestPost (const doublereal &dRes) const
 
virtual const doublerealdScaleCoef (const integer &iIndex) const
 
void SetRange (integer iFirstIndex, integer iLastIndex)
 
- Public Member Functions inherited from NonlinearSolverTest
virtual ~NonlinearSolverTest (void)
 
virtual doublereal MakeTest (Solver *pS, const integer &Size, const VectorHandler &Vec, bool bResidual=false, doublereal dScaleAlgEqu=1., doublereal *pTestDiff=0)
 

Protected Member Functions

bool bIsValid (const integer &iIndex) const
 

Protected Attributes

integer m_iFirstIndex
 
integer m_iLastIndex
 
NonlinearSolverTestm_pTest
 

Additional Inherited Members

- Public Types inherited from NonlinearSolverTest
enum  Type { NONE, NORM, MINMAX, LASTNONLINEARSOLVERTEST }
 

Detailed Description

Definition at line 166 of file nonlin.h.

Constructor & Destructor Documentation

NonlinearSolverTestRange::NonlinearSolverTestRange ( NonlinearSolverTest pTest,
integer  iFirstIndex = -1,
integer  iLastIndex = -1 
)

Definition at line 353 of file nonlin.cc.

References NO_OP.

354 : m_iFirstIndex(iFirstIndex), m_iLastIndex(iLastIndex), m_pTest(pTest)
355 {
356  NO_OP;
357 }
NonlinearSolverTest * m_pTest
Definition: nonlin.h:170
#define NO_OP
Definition: myassert.h:74
NonlinearSolverTestRange::~NonlinearSolverTestRange ( void  )
virtual

Definition at line 359 of file nonlin.cc.

References m_pTest.

360 {
361  delete m_pTest;
362 }
NonlinearSolverTest * m_pTest
Definition: nonlin.h:170

Member Function Documentation

bool NonlinearSolverTestRange::bIsValid ( const integer iIndex) const
protected

Definition at line 346 of file nonlin.cc.

References ASSERT, m_iFirstIndex, and m_iLastIndex.

Referenced by dScaleCoef(), and TestOne().

347 {
348  ASSERT(m_iFirstIndex > 0);
350  return (iIndex >= m_iFirstIndex && iIndex <= m_iLastIndex);
351 }
#define ASSERT(expression)
Definition: colamd.c:977
const doublereal & NonlinearSolverTestRange::dScaleCoef ( const integer iIndex) const
virtual

Reimplemented from NonlinearSolverTest.

Definition at line 396 of file nonlin.cc.

References bIsValid(), NonlinearSolverTest::dScaleCoef(), m_pTest, and Zero1.

397 {
398  if (bIsValid(iIndex)) {
399  return m_pTest->dScaleCoef(iIndex);
400  }
401 
403 }
NonlinearSolverTest * m_pTest
Definition: nonlin.h:170
bool bIsValid(const integer &iIndex) const
Definition: nonlin.cc:346
const doublereal Zero1
virtual const doublereal & dScaleCoef(const integer &iIndex) const
Definition: nonlin.cc:167

Here is the call graph for this function:

void NonlinearSolverTestRange::SetRange ( integer  iFirstIndex,
integer  iLastIndex 
)

Definition at line 406 of file nonlin.cc.

References m_iFirstIndex, m_iLastIndex, and MBDYN_EXCEPT_ARGS.

Referenced by DataManager::IDSetTest().

407 {
408  if (iFirstIndex <= 0) {
409  silent_cerr("NonlinearSolverTestRange: invalid iFirstIndex=" << iFirstIndex << std::endl);
411  }
412 
413  if (iLastIndex <= iFirstIndex) {
414  silent_cerr("NonlinearSolverTestRange: invalid iLastIndex=" << iLastIndex << " (iFirstIndex=" << iFirstIndex << ")" << std::endl);
416  }
417 
418  m_iFirstIndex = iFirstIndex;
419  m_iLastIndex = iLastIndex;
420 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
void NonlinearSolverTestRange::TestMerge ( doublereal dResCurr,
const doublereal dResNew 
) const
virtual

Implements NonlinearSolverTest.

Definition at line 384 of file nonlin.cc.

References m_pTest, and NonlinearSolverTest::TestMerge().

385 {
386  m_pTest->TestMerge(dResCurr, dResNew);
387 }
NonlinearSolverTest * m_pTest
Definition: nonlin.h:170
virtual void TestMerge(doublereal &dResCurr, const doublereal &dResNew) const =0

Here is the call graph for this function:

void NonlinearSolverTestRange::TestOne ( doublereal dRes,
const VectorHandler Vec,
const integer iIndex,
doublereal  dCoef 
) const
virtual

Implements NonlinearSolverTest.

Definition at line 375 of file nonlin.cc.

References bIsValid(), m_pTest, and NonlinearSolverTest::TestOne().

377 {
378  if (bIsValid(iIndex)) {
379  m_pTest->TestOne(dRes, Vec, iIndex, dCoef);
380  }
381 }
NonlinearSolverTest * m_pTest
Definition: nonlin.h:170
bool bIsValid(const integer &iIndex) const
Definition: nonlin.cc:346
virtual void TestOne(doublereal &dRes, const VectorHandler &Vec, const integer &iIndex, doublereal dCoef) const =0

Here is the call graph for this function:

doublereal NonlinearSolverTestRange::TestPost ( const doublereal dRes) const
virtual

Reimplemented from NonlinearSolverTest.

Definition at line 390 of file nonlin.cc.

References m_pTest, and NonlinearSolverTest::TestPost().

391 {
392  return m_pTest->TestPost(dRes);
393 }
NonlinearSolverTest * m_pTest
Definition: nonlin.h:170
virtual doublereal TestPost(const doublereal &dRes) const
Definition: nonlin.cc:155

Here is the call graph for this function:

Member Data Documentation

integer NonlinearSolverTestRange::m_iFirstIndex
protected

Definition at line 168 of file nonlin.h.

Referenced by bIsValid(), and SetRange().

integer NonlinearSolverTestRange::m_iLastIndex
protected

Definition at line 169 of file nonlin.h.

Referenced by bIsValid(), and SetRange().

NonlinearSolverTest* NonlinearSolverTestRange::m_pTest
protected

Definition at line 170 of file nonlin.h.

Referenced by dScaleCoef(), TestMerge(), TestOne(), TestPost(), and ~NonlinearSolverTestRange().


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