Anasazi Version of the Day
Loading...
Searching...
No Matches
ModeLaplace3DQ2.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_Q2_H
20#define MODE_LAPLACE_3D_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
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 ModeLaplace3DQ2 : 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 Lz;
64 int nZ;
65
66 double *x;
67 double *y;
68 double *z;
69
70 static const int dofEle;
71 static const int maxConnect;
72#ifndef M_PI
73 static const double M_PI;
74#endif
75
76 // Private member functions
77 void preProcess();
78 void makeMap();
79 int countElements(bool *isTouched);
80 void makeMyElementsTopology(int *elemTopo, bool *isTouched);
81 void makeMyConnectivity(int *elemTopo, int numEle, int *connectivity, int *numNz);
82 void makeStiffness(int *elemTopo, int numEle, int *connectivity, int *numNz);
83 void makeElementaryStiffness(double *kel) const;
84 void makeMass(int *elemTopo, int numEle, int *connectivity, int *numNz);
85 void makeElementaryMass(double *kel) const;
86
87 // Don't define these functions
88 ModeLaplace3DQ2(const ModeLaplace3DQ2 &ref);
89 ModeLaplace3DQ2& operator=(const ModeLaplace3DQ2 &ref);
90
91 public:
92
93 ModeLaplace3DQ2(const Epetra_Comm &_Comm, double _Lx, int _nX, double _Ly, int _nY,
94 double _Lz, int _nZ);
95
96 ~ModeLaplace3DQ2();
97
98 const Epetra_Operator* getStiffness() const { return K; }
99 const Epetra_Operator* getMass() const { return M; }
100
101 double getFirstMassEigenValue() const;
102
103 int eigenCheck(const Epetra_MultiVector &Q, double *lambda, double *normWeight) const;
104
105 void memoryInfo() const;
106 void problemInfo() const;
107
108};
109
110#endif