Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ModeLaplace3DQ1.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 MODE_LAPLACE_3D_Q1_H
20 #define MODE_LAPLACE_3D_Q1_H
21 
22 #include "Epetra_ConfigDefs.h"
23 
24 #include "Epetra_Comm.h"
25 #include "Epetra_CrsMatrix.h"
26 #include "Epetra_MultiVector.h"
27 #include "Epetra_Operator.h"
28 #include "Epetra_RowMatrix.h"
29 
30 #include "CheckingTools.h"
31 #include "ModeLaplace.h"
32 #include "SortingTools.h"
33 
34 
35 // Chaco partition routine
36 #ifdef _USE_CHACO
37 extern "C" {
38  int interface(int, int*, int*, int *, float*, float*, float*, float*, char*,
39  char*, short int*, int, int, int[3], double*, int, int, int, int,
40  int, double, long);
41 }
42 #endif
43 
44 class ModeLaplace3DQ1 : public ModeLaplace {
45 
46  private:
47 
48  const CheckingTools myVerify;
49  const Epetra_Comm &MyComm;
50  const SortingTools mySort;
51 
52  Epetra_Map *Map;
53  Epetra_Operator *K;
54  Epetra_Operator *M;
55 
56  double Lx;
57  int nX;
58 
59  double Ly;
60  int nY;
61 
62  double Lz;
63  int nZ;
64 
65  double *x;
66  double *y;
67  double *z;
68 
69  static const int dofEle;
70  static const int maxConnect;
71 #ifndef M_PI
72  static const double M_PI;
73 #endif
74 
75  // Private member functions
76  void preProcess();
77  void makeMap();
78  int countElements(bool *isTouched);
79  void makeMyElementsTopology(int *elemTopo, bool *isTouched);
80  void makeMyConnectivity(int *elemTopo, int numEle, int *connectivity, int *numNz);
81  void makeStiffness(int *elemTopo, int numEle, int *connectivity, int *numNz);
82  void makeMass(int *elemTopo, int numEle, int *connectivity, int *numNz);
83 
84  // Don't define these functions
85  ModeLaplace3DQ1(const ModeLaplace3DQ1 &ref);
86  ModeLaplace3DQ1& operator=(const ModeLaplace3DQ1 &ref);
87 
88  public:
89 
90  ModeLaplace3DQ1(const Epetra_Comm &_Comm, double _Lx, int _nX, double _Ly, int _nY,
91  double _Lz, int _nZ);
92 
93  ~ModeLaplace3DQ1();
94 
95  const Epetra_Operator* getStiffness() const { return K; }
96  const Epetra_Operator* getMass() const { return M; }
97 
98  double getFirstMassEigenValue() const;
99 
100  int eigenCheck(const Epetra_MultiVector &Q, double *lambda, double *normWeight) const;
101 
102  void memoryInfo() const;
103  void problemInfo() const;
104 
105 };
106 
107 #endif