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

[Example] Fix the ti example problems of sparse matrix demos #3215

Merged
merged 5 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/simulation/implicit_mass_spring.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def displayGGUI(self, canvas, radius=0.01, color=(1.0, 1.0, 1.0)):
'--use-ggui',
action='store_true',
help='Display with GGUI')
args = parser.parse_args()
args, unknowns = parser.parse_known_args()
use_ggui = False
use_ggui = args.use_ggui

Expand Down
6 changes: 3 additions & 3 deletions examples/simulation/stable_fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

# How to run:
# `python stable_fluid.py`: use the jacobi iteration to solve the linear system.
# `python stable_fluid.py -s`: use a sparse matrix to do so.
# `python stable_fluid.py -S`: use a sparse matrix to do so.
parser = argparse.ArgumentParser()
parser.add_argument('-s',
parser.add_argument('-S',
'--use-sp-mat',
action='store_true',
help='Solve Poisson\'s equation by using a sparse matrix')
args = parser.parse_args()
args, unknowns = parser.parse_known_args()

res = 512
dt = 0.03
Expand Down
2 changes: 2 additions & 0 deletions python/taichi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ def example(self, arguments: list = sys.argv[2:]):
dest='save',
action='store_true',
help="Save source code to current directory instead of running it")

# TODO: Pass the arguments to downstream correctly(#3216).
args = parser.parse_args(arguments)

examples_dir = TaichiMain._get_examples_dir()
Expand Down