Anasazi Version of the Day
Loading...
Searching...
No Matches
ModeLaplace2DQ1.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_Q1_H
20#define MODE_LAPLACE_2D_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
37extern "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
45class ModeLaplace2DQ1 : 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 makeMass(int *elemTopo, int numEle, int *connectivity, int *numNz);
80
81 // Don't define these functions
82 ModeLaplace2DQ1(const ModeLaplace2DQ1 &ref);
83 ModeLaplace2DQ1& operator=(const ModeLaplace2DQ1 &ref);
84
85 public:
86
87 ModeLaplace2DQ1(const Epetra_Comm &_Comm, double _Lx, int _nX, double _Ly, int _nY);
88
89 ~ModeLaplace2DQ1();
90
91 const Epetra_Operator* getStiffness() const { return K; }
92 const Epetra_Operator* getMass() const { return M; }
93
94 double getFirstMassEigenValue() const;
95
96 int eigenCheck(const Epetra_MultiVector &Q, double *lambda, double *normWeight) const;
97
98 void memoryInfo() const;
99 void problemInfo() const;
100
101};
102
103#endif