tum-pbs / PhiFlow

A differentiable PDE solving framework for machine learning
MIT License
1.43k stars 193 forks source link

Check for obstacles instance in phi.physics.fluid.apply_boundary_conditions #103

Closed rcremese closed 1 year ago

rcremese commented 1 year ago

Hello, I'm kind of new using PhiFlow so I might do mistakes. But, while trying to implement a very simple 2D diffusion equation with obstacles, I faced some problems.

Nevertheless, thank you for your work on all of this, I'm very existed to use your package to implement PDE with JAX !

holl- commented 1 year ago

Thank you for your feedback!

  1. The @ operator is being phased out in 2.3. You can already replace it by arg1.at(arg2). I'll revisit the documentation of the geometry masks.
  2. Good idea, I've pushed this to 2.3-develop. It will now also accept single Geometry or Obstacle values.
  3. Obstacles specifically are only used by the fluid module. Other modules use Geometry. Obstacles extend Geometry by a velocity vector and rotation speed which only makes sense in fluid-like settings.

If you run into any other strange behavior or missing documentation, let me know!

holl- commented 1 year ago

By the way, you can install 2.3-develop by running

pip install --upgrade git+https://github.com/tum-pbs/PhiFlow@2.3-develop
rcremese commented 1 year ago

Thank you for your quick reply. Now, I better understand what the purpose of Geometry and Obstacle are. I'll see if i need to use the 2.3 version. Thanks again.