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

#include <schurmh.h>

Inheritance diagram for SchurMatrixHandler:
Collaboration diagram for SchurMatrixHandler:

Classes

class  ErrGeneric
 

Public Member Functions

 SchurMatrixHandler (int LocSize, int IntSize, MatrixHandler *pBM, integer *pGlobToLoc, doublereal *pdEv=0)
 
virtual ~SchurMatrixHandler (void)
 
virtual integer iGetNumRows (void) const
 
virtual integer iGetNumCols (void) const
 
MatrixHandlerGetBMat (void)
 
void SetBMat (MatrixHandler *pBM)
 
doublerealGetCMat (void)
 
virtual void Reset (void)
 
virtual void Resize (integer, integer)
 
virtual void MatEFCReset (void)
 
virtual void PutCoef (integer iRow, integer iCol, const doublereal &dCoef)
 
virtual void IncCoef (integer iRow, integer iCol, const doublereal &dCoef)
 
virtual void DecCoef (integer iRow, integer iCol, const doublereal &dCoef)
 
virtual const doublerealdGetCoef (integer iRow, integer iCol) const
 
virtual const doublerealoperator() (integer iRow, integer iCol) const
 
virtual doublerealoperator() (integer iRow, integer iCol)
 
virtual doublerealGetECol (const integer iCol) const
 
virtual doublerealGetEColSol (const integer iCol) const
 
virtual VectorHandlerCompNewg (VectorHandler &g, const VectorHandler &f) const
 
virtual void CompLocSchur (void)
 
virtual VectorHandlerCompNewf (VectorHandler &f, const VectorHandler &g) const
 
virtual void PrintMatrix (void)
 
- Public Member Functions inherited from MatrixHandler
virtual ~MatrixHandler (void)
 
virtual void ResizeReset (integer, integer)
 
virtual const doublerealpdGetMat (void) const
 
virtual doublerealpdGetMat (void)
 
virtual integerpiGetRows (void) const
 
virtual integerpiGetCols (void) const
 
virtual integer PacMat (void)
 
virtual MatrixHandleroperator= (const MatrixHandler &MH)
 
virtual MatrixHandleroperator+= (const SubMatrixHandler &SubMH)
 
virtual MatrixHandleroperator-= (const SubMatrixHandler &SubMH)
 
virtual MatrixHandleroperator+= (const VariableSubMatrixHandler &SubMH)
 
virtual MatrixHandleroperator-= (const VariableSubMatrixHandler &SubMH)
 
virtual MatrixHandlerScalarMul (const doublereal &d)
 
virtual MatrixHandlerMatMatMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatMatIncMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatIncMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatMatDecMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatDecMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual VectorHandlerMatVecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatVecIncMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecIncMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatVecDecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecDecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual doublereal ConditionNumber (enum Norm_t eNorm=NORM_1) const
 
virtual doublereal Norm (enum Norm_t eNorm=NORM_1) const
 

Protected Attributes

integer LSize
 
integer ISize
 
MatrixHandlerpB
 
MyVectorHandlerpE
 
doublerealpdE
 
SpMapMatrixHandlerpF
 
MyVectorHandlerpC
 
doublerealpdC
 
integerpGTL
 
bool bExtpdE
 

Additional Inherited Members

- Public Types inherited from MatrixHandler
enum  Norm_t { NORM_1, NORM_INF }
 
- Protected Member Functions inherited from MatrixHandler
virtual MatrixHandlerMatMatMul_base (void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatMul_base (void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
 
virtual VectorHandlerMatVecMul_base (void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecMul_base (void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
 

Detailed Description

Definition at line 52 of file schurmh.h.

Constructor & Destructor Documentation

SchurMatrixHandler::SchurMatrixHandler ( int  LocSize,
int  IntSize,
MatrixHandler pBM,
integer pGlobToLoc,
doublereal pdEv = 0 
)

Definition at line 82 of file schurmh.cc.

References bExtpdE, ISize, LSize, pC, pdC, pdE, pE, pF, SAFENEWARR, and SAFENEWWITHCONSTRUCTOR.

84 : LSize(LocSize),
85 ISize(IntSize),
86 pB(pBM),
87 pE(0),
88 pdE(0),
89 pF(0),
90 pC(0),
91 pdC(0),
92 pGTL(pGlobToLoc),
93 bExtpdE(pdEv != 0 ? true : false)
94 {
95  if (!bExtpdE) {
97  pdEv = pdE;
98  }
99 
102  MyVectorHandler(LSize*ISize, pdEv));
110 
111 #ifdef DEBUG
112  IsValid();
113 #endif /* DEBUG */
114 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
doublereal * pdE
Definition: schurmh.h:63
integer * pGTL
Definition: schurmh.h:72
MyVectorHandler * pC
Definition: schurmh.h:65
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
MyVectorHandler * pE
Definition: schurmh.h:62
doublereal * pdC
Definition: schurmh.h:66
MatrixHandler * pB
Definition: schurmh.h:61
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
double doublereal
Definition: colamd.c:52
integer LSize
Definition: schurmh.h:60
SchurMatrixHandler::~SchurMatrixHandler ( void  )
virtual

Definition at line 116 of file schurmh.cc.

References bExtpdE, pC, pdC, pdE, pE, pF, SAFEDELETE, and SAFEDELETEARR.

117 {
118  if (pE != 0) {
119  SAFEDELETE(pE);
120  }
121  if (pC != 0) {
122  SAFEDELETE(pC);
123  }
124  if (pF != 0) {
125  SAFEDELETE(pF);
126  }
127  if (!bExtpdE && pdE != 0) {
129  }
130  if (pdC != 0) {
132  }
133 }
SpMapMatrixHandler * pF
Definition: schurmh.h:64
doublereal * pdE
Definition: schurmh.h:63
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
MyVectorHandler * pC
Definition: schurmh.h:65
MyVectorHandler * pE
Definition: schurmh.h:62
doublereal * pdC
Definition: schurmh.h:66
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

void SchurMatrixHandler::CompLocSchur ( void  )
inlinevirtual

Reimplemented in SchurMatrixHandlerUm.

Definition at line 436 of file schurmh.h.

References ISize, LSize, pdC, pdE, and pF.

437 {
438  for (int j = 0; j < ISize; j++) {
439  int iColc = j * ISize;
440  int iCole = j * LSize;
441 
442  for (int k = 0; k < LSize; k++) {
443  for (int i = 0; i < ISize; i++) {
444  pdC[i + iColc] -=
445  pF->operator()(i + 1, k + 1) * pdE[k + iCole];
446  }
447  }
448  }
449 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
doublereal * pdE
Definition: schurmh.h:63
doublereal * pdC
Definition: schurmh.h:66
integer LSize
Definition: schurmh.h:60
VectorHandler & SchurMatrixHandler::CompNewf ( VectorHandler f,
const VectorHandler g 
) const
inlinevirtual

Reimplemented in SchurMatrixHandlerUm.

Definition at line 452 of file schurmh.h.

References ASSERT, VectorHandler::DecCoef(), VectorHandler::iGetSize(), ISize, LSize, and pdE.

453 {
454 #ifdef DEBUG
455  ASSERT(f.iGetSize() == LSize);
456  ASSERT(g.iGetSize() == ISize);
457 #endif /* DEBUG */
458 
459  for (int j = 0; j < ISize; j++) {
460  int iColx = j * LSize;
461  for (int i = 0; i < LSize; i++) {
462  if (pdE[i + iColx] != 0) {
463  f.DecCoef(i + 1, pdE[i + iColx]*g(j + 1));
464  }
465  }
466  }
467  return f;
468 }
integer ISize
Definition: schurmh.h:60
doublereal * pdE
Definition: schurmh.h:63
virtual integer iGetSize(void) const =0
virtual void DecCoef(integer iRow, const doublereal &dCoef)=0
#define ASSERT(expression)
Definition: colamd.c:977
integer LSize
Definition: schurmh.h:60

Here is the call graph for this function:

VectorHandler & SchurMatrixHandler::CompNewg ( VectorHandler g,
const VectorHandler f 
) const
inlinevirtual

Definition at line 422 of file schurmh.h.

References ASSERT, VectorHandler::iGetSize(), ISize, LSize, MatrixHandler::MatVecDecMul(), and pF.

423 {
424 #ifdef DEBUG
425  ASSERT(f.iGetSize() == LSize);
426  ASSERT(g.iGetSize() == ISize);
427 #endif /* DEBUG */
428 
429  pF->MatVecDecMul(g, f);
430 
431  return g;
432 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
virtual integer iGetSize(void) const =0
virtual VectorHandler & MatVecDecMul(VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:362
#define ASSERT(expression)
Definition: colamd.c:977
integer LSize
Definition: schurmh.h:60

Here is the call graph for this function:

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

Reimplemented from MatrixHandler.

Reimplemented in SchurMatrixHandlerUm.

Definition at line 265 of file schurmh.h.

References MatrixHandler::DecCoef(), SpMapMatrixHandler::DecCoef(), MyVectorHandler::DecCoef(), ISize, LSize, MBDYN_EXCEPT_ARGS, pB, pC, pE, pF, and pGTL.

267 {
268 #ifdef DEBUG
269  IsValid();
270 #endif /* DEBUG */
271 
272  if (pGTL[iRow] > 0) {
273  if (pGTL[iCol] > 0) {
274  pB->DecCoef(pGTL[iRow], pGTL[iCol], dCoef);
275  return;
276 
277  } else if (pGTL[iCol] < 0) {
278  pE->DecCoef(pGTL[iRow] - (pGTL[iCol] + 1)*LSize, dCoef);
279  return;
280  }
281 
282  } else if (pGTL[iRow] < 0) {
283  if (pGTL[iCol] > 0) {
284  pF->DecCoef(-pGTL[iRow], pGTL[iCol], dCoef);
285  return;
286 
287  } else if (pGTL[iCol] < 0) {
288  pC->DecCoef(-pGTL[iRow] - (pGTL[iCol] + 1)*ISize, dCoef);
289  return;
290  }
291  }
292 
293 #ifdef USE_MPI
294  silent_cerr("SchurMatrixHandler::DecCoef() "
295  "Process(" << MBDynComm.Get_rank() << "): "
296  "trying to operate on nonlocal indices "
297  << iRow << "," << iCol << std::endl);
298 #else /* ! USE_MPI */
299  silent_cerr("SchurMatrixHandler::DecCoef() "
300  "trying to operate on nonlocal indices "
301  << iRow << "," << iCol << std::endl);
302 #endif /* ! USE_MPI */
303 
305 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
void DecCoef(integer ix, integer iy, const doublereal &inc)
Definition: spmapmh.h:170
integer * pGTL
Definition: schurmh.h:72
virtual void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:379
MyVectorHandler * pC
Definition: schurmh.h:65
virtual void DecCoef(integer iRow, const doublereal &dCoef)
Definition: vh.h:291
MyVectorHandler * pE
Definition: schurmh.h:62
MatrixHandler * pB
Definition: schurmh.h:61
integer LSize
Definition: schurmh.h:60

Here is the call graph for this function:

const doublereal & SchurMatrixHandler::dGetCoef ( integer  iRow,
integer  iCol 
) const
inlinevirtual

Reimplemented from MatrixHandler.

Reimplemented in SchurMatrixHandlerUm.

Definition at line 308 of file schurmh.h.

References ISize, LSize, pB, pC, pE, pF, pGTL, and Zero1.

309 {
310 #ifdef DEBUG
311  IsValid();
312 #endif /* DEBUG */
313 
314  if (pGTL[iRow] > 0) {
315  if (pGTL[iCol] > 0) {
316  return pB->operator()(pGTL[iRow], pGTL[iCol]);
317 
318  } else if(pGTL[iCol] < 0) {
319  return pE->operator()(pGTL[iRow] - (pGTL[iCol] + 1)*LSize);
320  }
321 
322  } else if (pGTL[iRow] < 0) {
323  if (pGTL[iCol] > 0) {
324  return pF->operator()(-pGTL[iRow], pGTL[iCol]);
325 
326  } else if (pGTL[iCol] < 0) {
327  return pC->operator()(-pGTL[iRow] - (pGTL[iCol] + 1)*ISize);
328  }
329  }
330 
331 #ifdef USE_MPI
332  silent_cerr("SchurMatrixHandler::dGetCoef() "
333  "Process(" << MBDynComm.Get_rank() << "): "
334  "trying to operate on nonlocal indices "
335  << iRow << "," << iCol << std::endl);
336 #else /* ! USE_MPI */
337  silent_cerr("SchurMatrixHandler::dGetCoef() "
338  "trying to operate on nonlocal indices "
339  << iRow << "," << iCol << std::endl);
340 #endif /* ! USE_MPI */
341 
343 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
integer * pGTL
Definition: schurmh.h:72
MyVectorHandler * pC
Definition: schurmh.h:65
const doublereal Zero1
MyVectorHandler * pE
Definition: schurmh.h:62
MatrixHandler * pB
Definition: schurmh.h:61
integer LSize
Definition: schurmh.h:60
MatrixHandler * SchurMatrixHandler::GetBMat ( void  )

Definition at line 62 of file schurmh.cc.

References pB.

63 {
64  return pB;
65 }
MatrixHandler * pB
Definition: schurmh.h:61
doublereal * SchurMatrixHandler::GetCMat ( void  )

Definition at line 77 of file schurmh.cc.

References pdC.

78 {
79  return pdC;
80 }
doublereal * pdC
Definition: schurmh.h:66
doublereal * SchurMatrixHandler::GetECol ( const integer  iCol) const
inlinevirtual

Reimplemented in SchurMatrixHandlerUm.

Definition at line 144 of file schurmh.h.

References LSize, and pdE.

145 {
146  return &pdE[LSize*iCol];
147 }
doublereal * pdE
Definition: schurmh.h:63
integer LSize
Definition: schurmh.h:60
doublereal * SchurMatrixHandler::GetEColSol ( const integer  iCol) const
inlinevirtual

Reimplemented in SchurMatrixHandlerUm.

Definition at line 150 of file schurmh.h.

References LSize, and pdE.

151 {
152  return &pdE[LSize*iCol];
153 }
doublereal * pdE
Definition: schurmh.h:63
integer LSize
Definition: schurmh.h:60
integer SchurMatrixHandler::iGetNumCols ( void  ) const
virtual

Implements MatrixHandler.

Definition at line 55 of file schurmh.cc.

References ISize, and LSize.

56 {
57  return LSize + ISize;
58 }
integer ISize
Definition: schurmh.h:60
integer LSize
Definition: schurmh.h:60
integer SchurMatrixHandler::iGetNumRows ( void  ) const
virtual

Implements MatrixHandler.

Definition at line 49 of file schurmh.cc.

References ISize, and LSize.

50 {
51  return LSize + ISize;
52 }
integer ISize
Definition: schurmh.h:60
integer LSize
Definition: schurmh.h:60
void SchurMatrixHandler::IncCoef ( integer  iRow,
integer  iCol,
const doublereal dCoef 
)
inlinevirtual

Reimplemented from MatrixHandler.

Reimplemented in SchurMatrixHandlerUm.

Definition at line 222 of file schurmh.h.

References MatrixHandler::IncCoef(), SpMapMatrixHandler::IncCoef(), MyVectorHandler::IncCoef(), ISize, LSize, MBDYN_EXCEPT_ARGS, pB, pC, pE, pF, and pGTL.

224 {
225 #ifdef DEBUG
226  IsValid();
227 #endif /* DEBUG */
228 
229  if (pGTL[iRow] > 0) {
230  if (pGTL[iCol] > 0) {
231  pB->IncCoef(pGTL[iRow], pGTL[iCol], dCoef);
232  return;
233 
234  } else if (pGTL[iCol] < 0) {
235  pE->IncCoef(pGTL[iRow] - (pGTL[iCol] + 1)*LSize, dCoef);
236  return;
237  }
238 
239  } else if (pGTL[iRow] < 0) {
240  if (pGTL[iCol] > 0) {
241  pF->IncCoef(-pGTL[iRow], pGTL[iCol], dCoef);
242  return;
243 
244  } else if (pGTL[iCol] < 0) {
245  pC->IncCoef(-pGTL[iRow] - (pGTL[iCol] + 1)*ISize, dCoef);
246  return;
247  }
248  }
249 
250 #ifdef USE_MPI
251  silent_cerr("SchurMatrixHandler::IncCoef() "
252  "Process(" << MBDynComm.Get_rank() << "): "
253  "trying to operate on nonlocal indices "
254  << iRow << "," << iCol << std::endl);
255 #else /* ! USE_MPI */
256  silent_cerr("SchurMatrixHandler::IncCoef() "
257  "trying to operate on nonlocal indices "
258  << iRow << "," << iCol << std::endl);
259 #endif /* ! USE_MPI */
260 
262 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
virtual void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:374
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
integer * pGTL
Definition: schurmh.h:72
MyVectorHandler * pC
Definition: schurmh.h:65
MyVectorHandler * pE
Definition: schurmh.h:62
MatrixHandler * pB
Definition: schurmh.h:61
integer LSize
Definition: schurmh.h:60
void IncCoef(integer ix, integer iy, const doublereal &inc)
Definition: spmapmh.h:153
virtual void IncCoef(integer iRow, const doublereal &dCoef)
Definition: vh.h:278

Here is the call graph for this function:

void SchurMatrixHandler::MatEFCReset ( void  )
inlinevirtual

Reimplemented in SchurMatrixHandlerUm.

Definition at line 156 of file schurmh.h.

References pC, pE, pF, MyVectorHandler::Reset(), and SpMapMatrixHandler::Reset().

Referenced by Reset().

157 {
158 #ifdef DEBUG
159  IsValid();
160 #endif /* DEBUG */
161 
162  pE->Reset();
163  pF->Reset();
164  pC->Reset();
165 }
SpMapMatrixHandler * pF
Definition: schurmh.h:64
void Reset(void)
Definition: spmapmh.cc:161
MyVectorHandler * pC
Definition: schurmh.h:65
virtual void Reset(void)
Definition: vh.cc:459
MyVectorHandler * pE
Definition: schurmh.h:62

Here is the call graph for this function:

const doublereal & SchurMatrixHandler::operator() ( integer  iRow,
integer  iCol 
) const
inlinevirtual

Implements MatrixHandler.

Definition at line 384 of file schurmh.h.

References ISize, LSize, pB, pC, pE, pF, pGTL, and Zero1.

385 {
386 #ifdef DEBUG
387  IsValid();
388 #endif /* DEBUG */
389 
390  if (pGTL[iRow] > 0) {
391  if (pGTL[iCol] > 0) {
392  return pB->operator()(pGTL[iRow], pGTL[iCol]);
393 
394  } else if (pGTL[iCol] < 0) {
395  return pE->operator()(pGTL[iRow] - (pGTL[iCol] + 1)*LSize);
396  }
397 
398  } else {
399  if (pGTL[iCol] > 0) {
400  return pF->operator()(-pGTL[iRow], pGTL[iCol]);
401 
402  } else if (pGTL[iCol] < 0) {
403  return pC->operator()(-pGTL[iRow] - (pGTL[iCol] + 1)*ISize);
404  }
405  }
406 
407 #ifdef USE_MPI
408  silent_cerr("SchurMatrixHandler::operator() "
409  "Process(" << MBDynComm.Get_rank() << "): "
410  "trying to operate on nonlocal indices "
411  << iRow << "," << iCol << std::endl);
412 #else /* ! USE_MPI */
413  silent_cerr("SchurMatrixHandler::operator() "
414  "trying to operate on nonlocal indices "
415  << iRow << "," << iCol << std::endl);
416 #endif /* ! USE_MPI */
417 
419 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
integer * pGTL
Definition: schurmh.h:72
MyVectorHandler * pC
Definition: schurmh.h:65
const doublereal Zero1
MyVectorHandler * pE
Definition: schurmh.h:62
MatrixHandler * pB
Definition: schurmh.h:61
integer LSize
Definition: schurmh.h:60
doublereal & SchurMatrixHandler::operator() ( integer  iRow,
integer  iCol 
)
inlinevirtual

Implements MatrixHandler.

Definition at line 346 of file schurmh.h.

References ISize, LSize, MBDYN_EXCEPT_ARGS, pB, pC, pE, pF, and pGTL.

347 {
348 #ifdef DEBUG
349  IsValid();
350 #endif /* DEBUG */
351 
352  if (pGTL[iRow] > 0) {
353  if (pGTL[iCol] > 0) {
354  return (*pB)(pGTL[iRow], pGTL[iCol]);
355 
356  } else if (pGTL[iCol] < 0) {
357  return (*pE)(pGTL[iRow] - (pGTL[iCol] + 1)*LSize);
358  }
359 
360  } else {
361  if (pGTL[iCol] > 0) {
362  return (*pF)(-pGTL[iRow], pGTL[iCol]);
363 
364  } else if (pGTL[iCol] < 0) {
365  return (*pC)(-pGTL[iRow] - (pGTL[iCol] + 1)*ISize);
366  }
367  }
368 
369 #ifdef USE_MPI
370  silent_cerr("SchurMatrixHandler::operator() "
371  "Process(" << MBDynComm.Get_rank() << "): "
372  "trying to operate on nonlocal indices "
373  << iRow << "," << iCol << std::endl);
374 #else /* ! USE_MPI */
375  silent_cerr("SchurMatrixHandler::operator() "
376  "trying to operate on nonlocal indices "
377  << iRow << "," << iCol << std::endl);
378 #endif /* ! USE_MPI */
379 
381 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
integer * pGTL
Definition: schurmh.h:72
MyVectorHandler * pC
Definition: schurmh.h:65
MyVectorHandler * pE
Definition: schurmh.h:62
MatrixHandler * pB
Definition: schurmh.h:61
integer LSize
Definition: schurmh.h:60
void SchurMatrixHandler::PrintMatrix ( void  )
inlinevirtual

Reimplemented in SchurMatrixHandlerUm.

Definition at line 471 of file schurmh.h.

References ISize, LSize, pB, pdC, pdE, and pF.

472 {
473  silent_cout("Schur Matrix " << std::endl);
474 
475  for (int i = 0; i < LSize; i++) {
476  for (int j = 0; j < LSize; j++) {
477  silent_cout(pB->operator()(i + 1, j + 1) << " ");
478  }
479 
480  for (int j = 0; j < ISize; j++) {
481  silent_cout(pdE[i + j*LSize] << " ");
482  }
483  silent_cout(std::endl);
484  }
485 
486  for (int i = 0; i < ISize; i++) {
487  for (int j = 0; j < LSize; j++) {
488  silent_cout(pF->operator()(i + 1, j + 1) << " ");
489  }
490 
491  for (int j = 0; j < ISize; j++) {
492  silent_cout(pdC[i + j*ISize] << " ");
493  }
494  silent_cout(std::endl);
495  }
496 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
doublereal * pdE
Definition: schurmh.h:63
doublereal * pdC
Definition: schurmh.h:66
MatrixHandler * pB
Definition: schurmh.h:61
integer LSize
Definition: schurmh.h:60
void SchurMatrixHandler::PutCoef ( integer  iRow,
integer  iCol,
const doublereal dCoef 
)
inlinevirtual

Reimplemented from MatrixHandler.

Reimplemented in SchurMatrixHandlerUm.

Definition at line 179 of file schurmh.h.

References ISize, LSize, MBDYN_EXCEPT_ARGS, pB, pC, pE, pF, pGTL, MatrixHandler::PutCoef(), MyVectorHandler::PutCoef(), and SpMapMatrixHandler::PutCoef().

181 {
182 #ifdef DEBUG
183  IsValid();
184 #endif /* DEBUG */
185 
186  if (pGTL[iRow] > 0) {
187  if (pGTL[iCol] > 0) {
188  pB->PutCoef(pGTL[iRow], pGTL[iCol], dCoef);
189  return;
190 
191  } else if (pGTL[iCol] < 0) {
192  pE->PutCoef(pGTL[iRow] - (pGTL[iCol] + 1)*LSize, dCoef);
193  return;
194  }
195 
196  } else if (pGTL[iRow] < 0) {
197  if (pGTL[iCol] > 0) {
198  pF->PutCoef(-pGTL[iRow], pGTL[iCol], dCoef);
199  return;
200 
201  } else if (pGTL[iCol] < 0) {
202  pC->PutCoef(-pGTL[iRow] - (pGTL[iCol] + 1)*ISize, dCoef);
203  return;
204  }
205  }
206 
207 #ifdef USE_MPI
208  silent_cerr("SchurMatrixHandler::PutCoef() "
209  "Process(" << MBDynComm.Get_rank() << "): "
210  "trying to operate on nonlocal indices "
211  << iRow << "," << iCol << std::endl);
212 #else /* ! USE_MPI */
213  silent_cerr("SchurMatrixHandler::PutCoef() "
214  "trying to operate on nonlocal indices "
215  << iRow << "," << iCol << std::endl);
216 #endif /* ! USE_MPI */
217 
219 }
integer ISize
Definition: schurmh.h:60
SpMapMatrixHandler * pF
Definition: schurmh.h:64
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
integer * pGTL
Definition: schurmh.h:72
virtual void PutCoef(integer iRow, const doublereal &dCoef)
Definition: vh.h:261
MyVectorHandler * pC
Definition: schurmh.h:65
virtual void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:384
MyVectorHandler * pE
Definition: schurmh.h:62
void PutCoef(integer ix, integer iy, const doublereal &val)
Definition: spmapmh.h:187
MatrixHandler * pB
Definition: schurmh.h:61
integer LSize
Definition: schurmh.h:60

Here is the call graph for this function:

void SchurMatrixHandler::Reset ( void  )
inlinevirtual

Implements MatrixHandler.

Reimplemented in SchurMatrixHandlerUm.

Definition at line 168 of file schurmh.h.

References MatEFCReset(), pB, and MatrixHandler::Reset().

169 {
170 #ifdef DEBUG
171  IsValid();
172 #endif /* DEBUG */
173 
174  pB->Reset();
175  MatEFCReset();
176 }
virtual void MatEFCReset(void)
Definition: schurmh.h:156
virtual void Reset(void)=0
MatrixHandler * pB
Definition: schurmh.h:61

Here is the call graph for this function:

void SchurMatrixHandler::Resize ( integer  ,
integer   
)
virtual

Implements MatrixHandler.

Definition at line 152 of file schurmh.cc.

References MBDYN_EXCEPT_ARGS.

153 {
154  silent_cerr("cannot resize a SchurMatrixHandler" << std::endl);
156 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
void SchurMatrixHandler::SetBMat ( MatrixHandler pBM)

Definition at line 69 of file schurmh.cc.

References pB.

70 {
71  pB = pBM;
72 }
MatrixHandler * pB
Definition: schurmh.h:61

Member Data Documentation

bool SchurMatrixHandler::bExtpdE
protected

Definition at line 74 of file schurmh.h.

Referenced by SchurMatrixHandler(), and ~SchurMatrixHandler().


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