LBM模拟

self.e = ti.Vector.field(3, ti.i32, shape=(19))
self.S_dig = ti.Vector.field(19, ti.f32, shape=())
self.e_f = ti.Vector.field(3, ti.f32, shape=(19))
self.w = ti.field(ti.f32, shape=(19))
self.solid = ti.field(ti.i8, shape=(nx, ny, nz))
self.ext_f = ti.Vector.field(3, ti.f32, shape=())

    self.M = ti.Matrix.field(19, 19, ti.f32, shape=())
    self.inv_M = ti.Matrix.field(19, 19, ti.f32, shape=())

    M_np = np.array([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
                     [-1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
                     [1, -2, -2, -2, -2, -2, -2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
                     [0, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0],
                     [0, -2, 2, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0],
                     [0, 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1],
                     [0, 0, 0, -2, 2, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1],
                     [0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1],
                     [0, 0, 0, 0, 0, -2, 2, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1],
                     [0, 2, 2, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -2, -2, -2, -2],
                     [0, -2, -2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -2, -2, -2, -2],
                     [0, 0, 0, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 0, 0, 0, 0],
                     [0, 0, 0, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1],
                     [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 1, -1, 1, -1, -1, 1, -1, 1, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, -1, 1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1],
                     [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, 1, -1, 1, 1, -1]])
    inv_M_np = np.linalg.inv(M_np)

    self.LR = [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15, 18, 17]

    self.M[None] = ti.Matrix([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
                              [-1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
                              [1, -2, -2, -2, -2, -2, -2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
                              [0, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0],
                              [0, -2, 2, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0],
                              [0, 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1],
                              [0, 0, 0, -2, 2, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1],
                              [0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1],
                              [0, 0, 0, 0, 0, -2, 2, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1],
                              [0, 2, 2, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -2, -2, -2, -2],
                              [0, -2, -2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -2, -2, -2, -2],
                              [0, 0, 0, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 0, 0, 0, 0],
                              [0, 0, 0, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 0, 0, 0, 0],
                              [0, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0],
                              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1],
                              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 0, 0, 0, 0],
                              [0, 0, 0, 0, 0, 0, 0, 1, -1, 1, -1, -1, 1, -1, 1, 0, 0, 0, 0],
                              [0, 0, 0, 0, 0, 0, 0, -1, 1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1],
                              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, 1, -1, 1, 1, -1]])

    self.inv_M[None] = ti.Matrix(inv_M_np)

    self.x = np.linspace(0, nx, nx)
    self.y = np.linspace(0, ny, ny)
    self.z = np.linspace(0, nz, nz)

这是运行的代码

UserWarning: Taichi matrices/vectors with 19x19 > 32 entries are not suggested. Matrices/vectors will be automatically unrolled at compile-time for performance. So the compilation time could be extremely long if the matrix size is too big. You may use a field to store a large matrix like this, e.g.:
x = ti.field(ti.f32, (19, 19)).
See Fields | Taichi Docs for more details.
File “D:\LBM\LBM2\Single_phase\LBM_3D_SinglePhase_Solver.py”, line 575, in
lb3d = LB3D_Solver_Single_Phase(80,80,80)
File “D:\LBM\LBM2\Single_phase\LBM_3D_SinglePhase_Solver.py”, line 91, in init
self.M[None] = ti.Matrix([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],

warnings.warn(Fore.YELLOW + Style.BRIGHT + msg + Style.RESET_ALL, warning_type)
C:\Users\QQh\anaconda3\envs\python_wt\lib\site-packages\taichi\lang\util.py:340: UserWarning: Taichi matrices/vectors with 19x19 > 32 entries are not suggested. Matrices/vectors will be automatically unrolled at compile-time for performance. So the compilation time could be extremely long if the matrix size is too big. You may use a field to store a large matrix like this, e.g.:
x = ti.field(ti.f32, (19, 19)).
See Fields | Taichi Docs for more details.
File “D:\LBM\LBM2\Single_phase\LBM_3D_SinglePhase_Solver.py”, line 575, in
lb3d = LB3D_Solver_Single_Phase(80,80,80)
File “D:\LBM\LBM2\Single_phase\LBM_3D_SinglePhase_Solver.py”, line 91, in init
self.M[None] = ti.Matrix([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
File “C:\Users\QQh\anaconda3\envs\python_wt\lib\site-packages\taichi\lang\util.py”, line 321, in wrapped
return func(*args, **kwargs)
File “C:\Users\QQh\anaconda3\envs\python_wt\lib\site-packages\taichi\lang\matrix.py”, line 1344, in setitem
self[key]._set_entries(value)
File “C:\Users\QQh\anaconda3\envs\python_wt\lib\site-packages\taichi\lang\util.py”, line 321, in wrapped
return func(*args, **kwargs)
File “C:\Users\QQh\anaconda3\envs\python_wt\lib\site-packages\taichi\lang\matrix.py”, line 1353, in getitem
return Matrix([[_host_access[i * self.m + j] for j in range(self.m)] for i in range(self.n)])

warnings.warn(Fore.YELLOW + Style.BRIGHT + msg + Style.RESET_ALL, warning_type)
C:\Users\QQh\anaconda3\envs\python_wt\lib\site-packages\taichi\lang\util.py:340: UserWarning: Taichi matrices/vectors with 19x19 > 32 entries are not suggested. Matrices/vectors will be automatically unrolled at compile-time for performance. So the compilation time could be extremely long if the matrix size is too big. You may use a field to store a large matrix like this, e.g.:
x = ti.field(ti.f32, (19, 19)).
See Fields | Taichi Docs for more details.
File “D:\LBM\LBM2\Single_phase\LBM_3D_SinglePhase_Solver.py”, line 575, in
lb3d = LB3D_Solver_Single_Phase(80,80,80)
File “D:\LBM\LBM2\Single_phase\LBM_3D_SinglePhase_Solver.py”, line 111, in init
self.inv_M[None] = ti.Matrix(inv_M_np)

warnings.warn(Fore.YELLOW + Style.BRIGHT + msg + Style.RESET_ALL, warning_type)
C:\Users\QQh\anaconda3\envs\python_wt\lib\site-packages\taichi\lang\util.py:340: UserWarning: Taichi matrices/vectors with 19x19 > 32 entries are not suggested. Matrices/vectors will be automatically unrolled at compile-time for performance. So the compilation time could be extremely long if the matrix size is too big. You may use a field to store a large matrix like this, e.g.:
x = ti.field(ti.f32, (19, 19)).
这是运行出的问题,请教一下各位大神如何修改,可以让这个警告消失。