Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ModalTools.h
1 // @HEADER
2 // *****************************************************************************
3 // Anasazi: Block Eigensolvers Package
4 //
5 // Copyright 2004 NTESS and the Anasazi contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 // This software is a result of the research described in the report
11 //
12 // "A comparison of algorithms for modal analysis in the absence
13 // of a sparse direct method", P. Arbenz, R. Lehoucq, and U. Hetmaniuk,
14 // Sandia National Laboratories, Technical report SAND2003-1028J.
15 //
16 // It is based on the Epetra, AztecOO, and ML packages defined in the Trilinos
17 // framework ( http://trilinos.org/ ).
18 
19 #ifndef MODAL_TOOLS_H
20 #define MODAL_TOOLS_H
21 
22 #include "Epetra_ConfigDefs.h"
23 
24 #include "Epetra_BLAS.h"
25 #include "Epetra_Comm.h"
26 #include "Epetra_LAPACK.h"
27 #include "Epetra_LocalMap.h"
28 #include "Epetra_Map.h"
29 #include "Epetra_MultiVector.h"
30 #include "Epetra_Operator.h"
31 #include "Epetra_Time.h"
32 #include "Epetra_Vector.h"
33 
34 #include "FortranRoutines.h"
35 
36 class ModalTools {
37 
38  private:
39 
40  const FortranRoutines callFortran;
41  const Epetra_BLAS callBLAS;
42  const Epetra_LAPACK callLAPACK;
43 
44  const Epetra_Comm &MyComm;
45  const Epetra_Time MyWatch;
46 
47  double eps;
48 
49  double timeQtMult;
50  double timeQMult;
51  double timeProj_MassMult;
52  double timeNorm_MassMult;
53  double timeProj;
54  double timeNorm;
55 
56  int numProj_MassMult;
57  int numNorm_MassMult;
58 
59  public:
60 
61  ModalTools(const Epetra_Comm &_Comm);
62 
63  int makeSimpleLumpedMass(const Epetra_Operator *M, double *weight) const;
64 
65  int massOrthonormalize(Epetra_MultiVector &X, Epetra_MultiVector &MX,
66  const Epetra_Operator *M, const Epetra_MultiVector &Q, int howMany,
67  int type = 0, double *WS = 0, double kappa = 1.5625);
68 
69  void localProjection(int numRow, int numCol, int length,
70  double *U, int ldU, double *MatV, int ldV,
71  double *UtMatV, int ldUtMatV, double *work) const;
72 
73  int directSolver(int, double*, int, double*, int, int&, double*, int, double*, int,
74  int = 0) const;
75 
76  double getTimeProj() const { return timeProj; }
77  double getTimeProj_QtMult() const { return timeQtMult; }
78  double getTimeProj_QMult() const { return timeQMult; }
79  double getTimeProj_MassMult() const { return timeProj_MassMult; }
80  int getNumProj_MassMult() const { return numProj_MassMult; }
81 
82  double getTimeNorm() const { return timeNorm; }
83  double getTimeNorm_MassMult() const { return timeNorm_MassMult; }
84  int getNumNorm_MassMult() const { return numNorm_MassMult; }
85 
86 };
87 
88 
89 #endif