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