Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ModeLaplace2DQ2.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_2D_Q2_H
20 #define MODE_LAPLACE_2D_Q2_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 
45 class ModeLaplace2DQ2 : public ModeLaplace {
46 
47  private:
48 
49  const CheckingTools myVerify;
50  const Epetra_Comm &MyComm;
51  const SortingTools mySort;
52 
53  Epetra_Map *Map;
54  Epetra_Operator *K;
55  Epetra_Operator *M;
56 
57  double Lx;
58  int nX;
59 
60  double Ly;
61  int nY;
62 
63  double *x;
64  double *y;
65 
66  static const int dofEle;
67  static const int maxConnect;
68 #ifndef M_PI
69  static const double M_PI;
70 #endif
71 
72  // Private member functions
73  void preProcess();
74  void makeMap();
75  int countElements(bool *isTouched);
76  void makeMyElementsTopology(int *elemTopo, bool *isTouched);
77  void makeMyConnectivity(int *elemTopo, int numEle, int *connectivity, int *numNz);
78  void makeStiffness(int *elemTopo, int numEle, int *connectivity, int *numNz);
79  void makeElementaryStiffness(double *kel) const;
80  void makeMass(int *elemTopo, int numEle, int *connectivity, int *numNz);
81  void makeElementaryMass(double *mel) const;
82 
83  // Don't define these functions
84  ModeLaplace2DQ2(const ModeLaplace2DQ2 &ref);
85  ModeLaplace2DQ2& operator=(const ModeLaplace2DQ2 &ref);
86 
87  public:
88 
89  ModeLaplace2DQ2(const Epetra_Comm &_Comm, double _Lx, int _nX, double _Ly, int _nY);
90 
91  ~ModeLaplace2DQ2();
92 
93  const Epetra_Operator* getStiffness() const { return K; }
94  const Epetra_Operator* getMass() const { return M; }
95 
96  double getFirstMassEigenValue() const;
97 
98  int eigenCheck(const Epetra_MultiVector &Q, double *lambda, double *normWeight) const;
99 
100  void memoryInfo() const;
101  void problemInfo() const;
102 
103 };
104 
105 #endif