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

#include <schurmh.h>

Inheritance diagram for SchurVectorHandler:
Collaboration diagram for SchurVectorHandler:

Classes

class  ErrGeneric
 

Public Member Functions

 SchurVectorHandler (int LocSize, int IntSize, VectorHandler *pLocVec, integer *pGlobToLoc)
 
 SchurVectorHandler (int LocSize, int IntSize, VectorHandler *pLocV, VectorHandler *pIntV, integer *pGlobToLoc)
 
 ~SchurVectorHandler (void)
 
doublerealpdGetVec (void) const
 
integer iGetSize (void) const
 
virtual void Reset (void)
 
void Resize (integer iNewSize)
 
VectorHandlerGetIVec (void)
 
VectorHandlerGetLVec (void)
 
void PutCoef (integer iRow, const doublereal &dCoef)
 
void IncCoef (integer iRow, const doublereal &dCoef)
 
void DecCoef (integer iRow, const doublereal &dCoef)
 
const doublerealdGetCoef (integer iRow) const
 
const doublerealoperator() (integer iRow) const
 
doublerealoperator() (integer iRow)
 
void PrintVector (void)
 
- Public Member Functions inherited from VectorHandler
virtual ~VectorHandler (void)
 
virtual void ResizeReset (integer)
 
virtual void Add (integer iRow, const Vec3 &v)
 
virtual void Sub (integer iRow, const Vec3 &v)
 
virtual void Put (integer iRow, const Vec3 &v)
 
virtual VectorHandlerScalarAddMul (const VectorHandler &VH, const doublereal &d)
 
virtual VectorHandlerScalarAddMul (const VectorHandler &VH, const VectorHandler &VH1, const doublereal &d)
 
virtual VectorHandlerScalarMul (const VectorHandler &VH, const doublereal &d)
 
virtual VectorHandleroperator+= (const VectorHandler &VH)
 
virtual VectorHandleroperator+= (const SubVectorHandler &SubVH)
 
virtual VectorHandleroperator-= (const VectorHandler &VH)
 
virtual VectorHandleroperator*= (const doublereal &d)
 
virtual VectorHandleroperator= (const VectorHandler &VH)
 
virtual doublereal Dot (void) const
 
virtual doublereal Norm (void) const
 
virtual doublereal InnerProd (const VectorHandler &VH) const
 

Private Attributes

integer LSize
 
integer ISize
 
VectorHandlerpLV
 
VectorHandlerpIV
 
bool bExtpIV
 
integerpGTL
 

Detailed Description

Definition at line 502 of file schurmh.h.

Constructor & Destructor Documentation

SchurVectorHandler::SchurVectorHandler ( int  LocSize,
int  IntSize,
VectorHandler pLocVec,
integer pGlobToLoc 
)

Definition at line 162 of file schurmh.cc.

References pIV, and SAFENEWWITHCONSTRUCTOR.

164 : LSize(LocSize),
165 ISize(IntSize),
166 pLV(pLocVec),
167 pIV(0),
168 bExtpIV(false),
169 pGTL(pGlobToLoc)
170 {
173  MyVectorHandler(IntSize));
174 }
VectorHandler * pLV
Definition: schurmh.h:511
integer * pGTL
Definition: schurmh.h:514
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
VectorHandler * pIV
Definition: schurmh.h:512
SchurVectorHandler::SchurVectorHandler ( int  LocSize,
int  IntSize,
VectorHandler pLocV,
VectorHandler pIntV,
integer pGlobToLoc 
)

Definition at line 176 of file schurmh.cc.

References NO_OP.

179 : LSize(LocSize),
180 ISize(IntSize),
181 pLV(pLocV),
182 pIV(pIntV),
183 bExtpIV(pIntV != 0 ? true : false),
184 pGTL(pGlobToLoc)
185 {
186  NO_OP;
187 }
VectorHandler * pLV
Definition: schurmh.h:511
integer * pGTL
Definition: schurmh.h:514
#define NO_OP
Definition: myassert.h:74
VectorHandler * pIV
Definition: schurmh.h:512
SchurVectorHandler::~SchurVectorHandler ( void  )

Definition at line 190 of file schurmh.cc.

References bExtpIV, pIV, and SAFEDELETE.

191 {
192  if (!bExtpIV && pIV != 0) {
193  SAFEDELETE(pIV);
194  }
195 }
VectorHandler * pIV
Definition: schurmh.h:512
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

void SchurVectorHandler::DecCoef ( integer  iRow,
const doublereal dCoef 
)
inlinevirtual

Implements VectorHandler.

Definition at line 658 of file schurmh.h.

References VectorHandler::DecCoef(), MBDYN_EXCEPT_ARGS, pGTL, pIV, and pLV.

659 {
660 #ifdef DEBUG
661  IsValid();
662 #endif /* DEBUG */
663 
664  if (pGTL[iRow] > 0) {
665  pLV->DecCoef(pGTL[iRow], dCoef);
666 
667  } else if (pGTL[iRow] < 0) {
668  pIV->DecCoef(-pGTL[iRow], dCoef);
669 
670  } else {
671 #ifdef USE_MPI
672  silent_cerr("SchurVectorHandler::DecCoef "
673  "Process(" << MBDynComm.Get_rank() << "): "
674  "trying to operate on nonlocal index "
675  << iRow << std::endl);
676 #else /* ! USE_MPI */
677  silent_cerr("SchurVectorHandler::DecCoef "
678  "trying to operate on nonlocal index "
679  << iRow << std::endl);
680 #endif /* ! USE_MPI */
682  }
683  return;
684 }
VectorHandler * pLV
Definition: schurmh.h:511
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
integer * pGTL
Definition: schurmh.h:514
virtual void DecCoef(integer iRow, const doublereal &dCoef)=0
VectorHandler * pIV
Definition: schurmh.h:512

Here is the call graph for this function:

const doublereal & SchurVectorHandler::dGetCoef ( integer  iRow) const
inlinevirtual

Implements VectorHandler.

Definition at line 687 of file schurmh.h.

References pGTL, pIV, pLV, and Zero1.

688 {
689 #ifdef DEBUG
690  IsValid();
691 #endif /* DEBUG */
692 
693  if (pGTL[iRow] > 0) {
694  return pLV->operator()(pGTL[iRow]);
695 
696  } else if (pGTL[iRow] < 0) {
697  return pIV->operator()(-pGTL[iRow]);
698 
699  } else {
700 #ifdef USE_MPI
701  silent_cerr("SchurVectorHandler::dGetCoef "
702  "Process(" << MBDynComm.Get_rank() << "): "
703  "trying to operate on nonlocal index "
704  << iRow << std::endl);
705 #else /* ! USE_MPI */
706  silent_cerr("SchurVectorHandler::dGetCoef "
707  "trying to operate on nonlocal index "
708  << iRow << std::endl);
709 #endif /* ! USE_MPI */
710  return Zero1;
711  }
712 }
VectorHandler * pLV
Definition: schurmh.h:511
integer * pGTL
Definition: schurmh.h:514
const doublereal Zero1
VectorHandler * pIV
Definition: schurmh.h:512
VectorHandler * SchurVectorHandler::GetIVec ( void  )
inline

Definition at line 588 of file schurmh.h.

References pIV.

589 {
590  return pIV;
591 }
VectorHandler * pIV
Definition: schurmh.h:512
VectorHandler * SchurVectorHandler::GetLVec ( void  )
inline

Definition at line 594 of file schurmh.h.

References pLV.

595 {
596  return pLV;
597 }
VectorHandler * pLV
Definition: schurmh.h:511
integer SchurVectorHandler::iGetSize ( void  ) const
inlinevirtual

Implements VectorHandler.

Definition at line 567 of file schurmh.h.

References ISize, and LSize.

568 {
569  return LSize + ISize;
570 }
void SchurVectorHandler::IncCoef ( integer  iRow,
const doublereal dCoef 
)
inlinevirtual

Implements VectorHandler.

Definition at line 629 of file schurmh.h.

References VectorHandler::IncCoef(), MBDYN_EXCEPT_ARGS, pGTL, pIV, and pLV.

630 {
631 #ifdef DEBUG
632  IsValid();
633 #endif /* DEBUG */
634 
635  if (pGTL[iRow] > 0) {
636  pLV->IncCoef(pGTL[iRow], dCoef);
637 
638  } else if (pGTL[iRow] < 0) {
639  pIV->IncCoef(-pGTL[iRow], dCoef);
640 
641  } else {
642 #ifdef USE_MPI
643  silent_cerr("SchurVectorHandler::IncCoef "
644  "Process(" << MBDynComm.Get_rank() << "): "
645  "trying to operate on nonlocal index "
646  << iRow << std::endl);
647 #else /* ! USE_MPI */
648  silent_cerr("SchurVectorHandler::IncCoef "
649  "trying to operate on nonlocal index "
650  << iRow << std::endl);
651 #endif /* ! USE_MPI */
653  }
654  return;
655 }
VectorHandler * pLV
Definition: schurmh.h:511
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
integer * pGTL
Definition: schurmh.h:514
VectorHandler * pIV
Definition: schurmh.h:512

Here is the call graph for this function:

const doublereal & SchurVectorHandler::operator() ( integer  iRow) const
inlinevirtual

Implements VectorHandler.

Definition at line 715 of file schurmh.h.

References pGTL, pIV, pLV, and Zero1.

716 {
717 #ifdef DEBUG
718  IsValid();
719 #endif /* DEBUG */
720 
721  if (pGTL[iRow] > 0) {
722  return pLV->operator()(pGTL[iRow]);
723 
724  } else if (pGTL[iRow] < 0) {
725  return pIV->operator()(-pGTL[iRow]);
726 
727  } else {
728 #ifdef USE_MPI
729  silent_cerr("SchurVectorHandler::operator()"
730  "Process(" << MBDynComm.Get_rank() << "): "
731  "trying to operate on nonlocal index "
732  << iRow << std::endl);
733 #else /* ! USE_MPI */
734  silent_cerr("SchurVectorHandler::operator()"
735  "trying to operate on nonlocal index "
736  << iRow << std::endl);
737 #endif /* ! USE_MPI */
738  return Zero1;
739  }
740 }
VectorHandler * pLV
Definition: schurmh.h:511
integer * pGTL
Definition: schurmh.h:514
const doublereal Zero1
VectorHandler * pIV
Definition: schurmh.h:512
doublereal & SchurVectorHandler::operator() ( integer  iRow)
inlinevirtual

Implements VectorHandler.

Definition at line 743 of file schurmh.h.

References MBDYN_EXCEPT_ARGS.

744 {
745  silent_cerr("SchurVectorHandler::operator() "
746  "cannot be used on nonlocal index "
747  << iRow << std::endl);
748 
750 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal * SchurVectorHandler::pdGetVec ( void  ) const
inlinevirtual

Implements VectorHandler.

Definition at line 557 of file schurmh.h.

References VectorHandler::pdGetVec(), and pLV.

558 {
559  silent_cerr("You shouldn't have asked for "
560  "the internal pointer of a SchurVectorHandler"
561  << std::endl);
562  return pLV->pdGetVec();
563 }
VectorHandler * pLV
Definition: schurmh.h:511
virtual doublereal * pdGetVec(void) const =0

Here is the call graph for this function:

void SchurVectorHandler::PrintVector ( void  )
inline

Definition at line 753 of file schurmh.h.

References ISize, LSize, pIV, and pLV.

754 {
755  silent_cout("Schur Vector " << std::endl);
756 
757  for (int j = 0; j < LSize; j++) {
758  silent_cout(pLV->operator()(j + 1) << " " << std::endl);
759  }
760 
761  for (int j = 0; j < ISize; j++) {
762  silent_cout(pIV->operator()(j + 1) << " " << std::endl);
763  }
764 }
VectorHandler * pLV
Definition: schurmh.h:511
VectorHandler * pIV
Definition: schurmh.h:512
void SchurVectorHandler::PutCoef ( integer  iRow,
const doublereal dCoef 
)
inlinevirtual

Implements VectorHandler.

Definition at line 600 of file schurmh.h.

References MBDYN_EXCEPT_ARGS, pGTL, pIV, pLV, and VectorHandler::PutCoef().

601 {
602 #ifdef DEBUG
603  IsValid();
604 #endif /* DEBUG */
605 
606  if (pGTL[iRow] > 0) {
607  pLV->PutCoef(pGTL[iRow], dCoef);
608 
609  } else if (pGTL[iRow] < 0 ) {
610  pIV->PutCoef(-pGTL[iRow], dCoef);
611 
612  } else {
613 #ifdef USE_MPI
614  silent_cerr("SchurVectorHandler::PutCoef() "
615  "Process(" << MBDynComm.Get_rank() << "): "
616  "trying to operate on nonlocal index "
617  << iRow << std::endl);
618 #else /* ! USE_MPI */
619  silent_cerr("SchurVectorHandler::PutCoef() "
620  "trying to operate on nonlocal index "
621  << iRow << std::endl);
622 #endif /* ! USE_MPI */
624  }
625  return;
626 }
VectorHandler * pLV
Definition: schurmh.h:511
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
integer * pGTL
Definition: schurmh.h:514
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
VectorHandler * pIV
Definition: schurmh.h:512

Here is the call graph for this function:

void SchurVectorHandler::Reset ( void  )
inlinevirtual

Implements VectorHandler.

Definition at line 581 of file schurmh.h.

References pIV, pLV, and VectorHandler::Reset().

582 {
583  pLV->Reset();
584  pIV->Reset();
585 }
virtual void Reset(void)=0
VectorHandler * pLV
Definition: schurmh.h:511
VectorHandler * pIV
Definition: schurmh.h:512

Here is the call graph for this function:

void SchurVectorHandler::Resize ( integer  iNewSize)
inlinevirtual

Implements VectorHandler.

Definition at line 573 of file schurmh.h.

574 {
575  silent_cerr("Why are you trying to resize a SchurVector ???? "
576  << "No Operation Performed!!" << std::endl);
577 }

Member Data Documentation

bool SchurVectorHandler::bExtpIV
private

Definition at line 513 of file schurmh.h.

Referenced by ~SchurVectorHandler().

integer SchurVectorHandler::ISize
private

Definition at line 510 of file schurmh.h.

Referenced by iGetSize(), and PrintVector().

integer SchurVectorHandler::LSize
private

Definition at line 510 of file schurmh.h.

Referenced by iGetSize(), and PrintVector().

integer* SchurVectorHandler::pGTL
private

Definition at line 514 of file schurmh.h.

Referenced by DecCoef(), dGetCoef(), IncCoef(), operator()(), and PutCoef().

VectorHandler* SchurVectorHandler::pIV
private
VectorHandler* SchurVectorHandler::pLV
private

Definition at line 511 of file schurmh.h.

Referenced by DecCoef(), dGetCoef(), GetLVec(), IncCoef(), operator()(), pdGetVec(), PrintVector(), PutCoef(), and Reset().


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