Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field with dim 2 accessed with indices of dim 3 error in eulerian fluid demo #7

Open
turbo0628 opened this issue Mar 24, 2023 · 0 comments

Comments

@turbo0628
Copy link
Member

Reproduction:

Under eulerian_fluid, deflate the tarball under input and run demo.py, the compiler complains that a 2D field is accessed with a 3D index.

Traceback

[Taichi] version 1.3.0, llvm 15.0.4, commit 0f25b95e, linux, python 3.8.13
cmd args: Namespace(advect='mc', debug=False, demo_id=0, dim=2, dye_type=0, frames=10000, outdir=None, quant_all=False, quant_dye=False, quant_v=False, res=512, rk=3, visualize=False)
[Taichi] Starting on arch=cuda
Level 0
  coarsened_grid_size 1024
  coarsened_offset (-512, -512)

  sparse_grid_size 1040
  sparse_offset [-520, -520]
Level 1
  coarsened_grid_size 512
  coarsened_offset [-256, -256]

  sparse_grid_size 528
  sparse_offset [-264, -264]
Level 2
  coarsened_grid_size 256
  coarsened_offset [-128, -128]

  sparse_grid_size 272
  sparse_offset [-136, -136]
Level 3
  coarsened_grid_size 128
  coarsened_offset [-64, -64]

  sparse_grid_size 144
  sparse_offset [-72, -72]
Traceback (most recent call last):
  File "demo.py", line 99, in <module>
    solver = FluidSolver(
  File "/home/taichigraphics/work/taichi-repos/quantaichi/eulerian_fluid/solver.py", line 231, in __init__
    self.set_custom_source(res=640)
  File "/home/taichigraphics/work/taichi-repos/quantaichi/eulerian_fluid/solver.py", line 578, in set_custom_source
    self.set_custom_source_helper(self.dye[0].field, self.density_source[k],
  File "/home/taichigraphics/miniconda3/envs/taichi/lib/python3.8/site-packages/taichi/lang/kernel_impl.py", line 1008, in __call__
    raise type(e)('\n' + str(e)) from None
taichi.lang.exception.TaichiIndexError:
File "/home/taichigraphics/work/taichi-repos/quantaichi/eulerian_fluid/solver.py", line 573, in set_custom_source_helper:
                dyef[k - self.res // 2, i - self.res // 2,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     j - self.res // 2] = [0., 0.5, 1.0]
                     ^^^^^^^^^^^^^^^^^^
Field with dim 2 accessed with indices of dim 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant