-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTPZNumericalIntegrator.h
113 lines (67 loc) · 2.67 KB
/
TPZNumericalIntegrator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//
// Created by natalia on 24/05/19.
//
#include "TPZIrregularBlocksMatrix.h"
#include "TPZConstitutiveLawProcessor.h"
#ifdef USING_CUDA
#include "TPZVecGPU.h"
#include "TPZCudaCalls.h"
#endif
#ifdef USING_MKL
#include <mkl.h>
#endif
#ifndef INTPOINTSFEM_TPZNUMERICALINTEGRATOR_H
#define INTPOINTSFEM_TPZNUMERICALINTEGRATOR_H
class TPZNumericalIntegrator {
public:
TPZNumericalIntegrator();
~TPZNumericalIntegrator();
void Multiply(TPZFMatrix<REAL> &coef, TPZFMatrix<REAL> &delta_strain);
void MultiplyTranspose(TPZFMatrix<REAL> &sigma, TPZFMatrix<REAL> &res);
void ResidualIntegration(TPZFMatrix<REAL> & solution ,TPZFMatrix<REAL> &rhs);
void ComputeTangentMatrix(int64_t iel, TPZFMatrix<REAL> &Dep, TPZFMatrix<REAL> &K);
void SetUpIrregularBlocksData(TPZCompMesh * cmesh);
int StressRateVectorSize(int dim);
void SetUpIndexes(TPZCompMesh * cmesh);
void SetUpColoredIndexes(TPZCompMesh * cmesh);
void FillLIndexes(TPZVec<int64_t> & IA, TPZVec<int64_t> & JA);
int64_t me(TPZVec<int64_t> &IA, TPZVec<int64_t> &JA, int64_t & i_dest, int64_t & j_dest);
bool isBuilt() {
if(fBlockMatrix.Rows() != 0) return true;
else return false;
}
void KAssembly(TPZFMatrix<REAL> & solution, TPZVec<STATE> & Kg, TPZFMatrix<STATE> & rhs);
void SetElementIndexes(TPZVec<int> element_indexes) {
fElementIndex = element_indexes;
}
#ifdef USING_CUDA
void Multiply(TPZVecGPU<REAL> &coef, TPZVecGPU<REAL> &delta_strain);
void MultiplyTranspose(TPZVecGPU<REAL> &sigma, TPZVecGPU<REAL> &res);
void ResidualIntegration(TPZFMatrix<REAL> & solution ,TPZVecGPU<REAL> &rhs);
void KAssembly(TPZFMatrix<REAL> & solution, TPZVecGPU<STATE> & Kg, TPZVecGPU<STATE> & rhs);
void TransferDataToGPU();
#endif
private:
TPZVec<int> fElementIndex;
/// Irregular block matrix containing spatial gradients for scalar basis functions of order k
TPZIrregularBlocksMatrix fBlockMatrix;
/// Number of colors grouping no adjacent elements
int64_t fNColor;
/// Degree of Freedom indexes organized element by element with stride ndof
TPZVec<int> fDoFIndexes;
/// Color indexes organized element by element with stride ndof
TPZVec<int> fColorIndexes;
TPZConstitutiveLawProcessor fConstitutiveLawProcessor;
TPZVec<int> fElColorIndex;
TPZVec<int64_t> fFirstColorIndex;
TPZVec<int> fColorLSequence;
TPZVec<int> fFirstColorLIndex;
#ifdef USING_CUDA
TPZCudaCalls fCudaCalls;
TPZVecGPU<int> dDoFIndexes;
TPZVecGPU<int> dColorIndexes;
TPZVecGPU<int> dElColorIndex;
TPZVecGPU<int> dColorLSequence;
#endif
};
#endif //INTPOINTSFEM_TPZNUMERICALINTEGRATOR_H