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

Error in Flow past sphere example #106

Closed
sambaPython24 opened this issue Jan 28, 2025 · 1 comment
Closed

Error in Flow past sphere example #106

sambaPython24 opened this issue Jan 28, 2025 · 1 comment

Comments

@sambaPython24
Copy link

When trying to run the example provided here,
I get the error

registered bc RegularizedBC_8426067066698 with id 1
registered bc FullwayBounceBackBC_8426066680812 with id 2
registered bc ExtrapolationOutflowBC_8426066609487 with id 3
registered bc HalfwayBounceBackBC_8426067283648 with id 4
Traceback (most recent call last):
  File "/path/xlb_test.py", line 173, in <module>
    simulation = FlowOverSphere(omega, grid_shape, velocity_set, backend, precision_policy)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/xlb_test.py", line 42, in __init__
    self._setup()
  File "/path/xlb_test.py", line 46, in _setup
    self.setup_stepper()
  File "/path/xlb_test.py", line 78, in setup_stepper
    self.stepper = IncompressibleNavierStokesStepper(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: IncompressibleNavierStokesStepper.__init__() missing 1 required positional argument: 'omega'

and when I provide the the argument with ```omega = self.omega``, the stepper function

registered bc RegularizedBC_8324411173899 with id 1
registered bc FullwayBounceBackBC_8324410480050 with id 2
registered bc ExtrapolationOutflowBC_8324410318114 with id 3
registered bc HalfwayBounceBackBC_8324411092951 with id 4
Module xlb.operator.equilibrium.quadratic_equilibrium 44485d9 load on device 'cpu' took 1.44 ms  (cached)
Module xlb.operator.boundary_masker.indices_boundary_masker 884a947 load on device 'cpu' took 0.25 ms  (cached)
Module xlb.operator.boundary_condition.boundary_condition 6174482 load on device 'cpu' took 0.36 ms  (cached)
Traceback (most recent call last):
  File "/path/xlb_test.py", line 175, in <module>
    simulation.run(num_steps=10000, post_process_interval=1000)
  File "/path/xlb_test.py", line 131, in run
    self.f_0, self.f_1 = self.stepper(self.f_0, self.f_1, self.bc_mask, self.missing_mask, self.omega, i)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/xlb/operator/operator.py", line 74, in __call__
    raise Exception(f"Error captured for backend with key {key} for operator {self.__class__.__name__}: {error}\n {traceback_str}")
Exception: Error captured for backend with key ('IncompressibleNavierStokesStepper', <ComputeBackend.WARP: 2>, '(self, f_0, f_1, bc_mask, missing_mask, timestep)') for operator IncompressibleNavierStokesStepper: too many positional arguments
 Traceback (most recent call last):
  File "/lib/python3.12/site-packages/xlb/operator/operator.py", line 62, in __call__
    bound_arguments = inspect.signature(backend_method).bind(self, *args, **kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/inspect.py", line 3277, in bind
    return self._bind(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/inspect.py", line 3196, in _bind
    raise TypeError('too many positional arguments') from None
TypeError: too many positional arguments

It is difficult to debug for me as the simulater.stepper function does not have any docstring that would reveal, what arguments it takes.

@hsalehipour
Copy link
Collaborator

@sambaPython24 thanks for trying XLB. It looks like you have pip installed XLB but are using the latest examples from the repo. If you want to keep your installation please go back to this version https://github.com/Autodesk/XLB/tree/v0.2.1

Otherwise you can clone the latest repo and this example should run without errors.

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

2 participants