-
Notifications
You must be signed in to change notification settings - Fork 7
/
solver_tdma.h
92 lines (84 loc) · 2.95 KB
/
solver_tdma.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
///////////////////////////////////////////////////////////////////////////////
///
/// \file solver_tdma.h
///
/// \brief Tri-Diagonal Matrix Algorithm Solver
///
/// \author Mingang Jin, Qingyan Chen
/// Purdue University
/// Jin55@purdue.edu, YanChen@purdue.edu
/// Wangda Zuo
/// University of Miami
/// W.Zuo@miami.edu
///
/// \date 8/3/2013
///
///////////////////////////////////////////////////////////////////////////////
#ifndef _SOLVER_TDMA_H
#define _SOLVER_TDMA_H
#endif
#ifndef _DATA_STRUCTURE_H
#define _DATA_STRUCTURE_H
#include "data_structure.h"
#endif
#ifndef _BOUNDARY_H
#define _BOUNDARY_H
#include "boundary.h"
#endif
///////////////////////////////////////////////////////////////////////////////
/// TDMA solver for 3D
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param type Type of variable
///\param psi Pointer to variable
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int TDMA_3D(PARA_DATA *para, REAL **var, int type, REAL *psi);
///////////////////////////////////////////////////////////////////////////////
/// TDMA solver for XY-plane
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param psi Pointer to variable
///\param k K-index of the plane
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int TDMA_XY(PARA_DATA *para, REAL **var, REAL *psi, int k);
///////////////////////////////////////////////////////////////////////////////
/// TDMA solver for YZ-plane
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param psi Pointer to variable
///\param i I-index of the plane
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int TDMA_YZ(PARA_DATA *para, REAL **var, REAL *psi, int i);
///////////////////////////////////////////////////////////////////////////////
/// TDMA solver for ZX-plane
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param psi Pointer to variable
///\param j J-index of the plane
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int TDMA_ZX(PARA_DATA *para, REAL **var, REAL *psi, int j);
//////////////////////////////////////////////////////////////////////////////
/// TDMA solver for 1D array
///
///\param ap Pointer to coefficient for center
///\param ae Pointer to coefficient for east
///\param aw Pointer to coefficient for west
///\param b Pointer to b
///\param psi Pointer to variable
///\param LENGTH Length of the array
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int TDMA_1D(REAL *a, REAL *b, REAL *c, REAL *d, REAL *psi, int LENGTH);