lululxvi / deepxde

A library for scientific machine learning and physics-informed learning
https://deepxde.readthedocs.io
GNU Lesser General Public License v2.1
2.56k stars 730 forks source link

Potential geometry bug? #802

Open ethanshoemaker opened 2 years ago

ethanshoemaker commented 2 years ago

Hi Lu Lu, I am attempting to use the inside(x) function. My code is... (it should be noted that airfoil is a polygon geometry)

def airfoil_fill(x, inside):
    return airfoil.inside(x)

I get the error : too many indices for array: array is 1-dimensional, but 2 were indexed.

I tried your fix seen in https://github.com/lululxvi/deepxde/issues/634 but then my code doesn't do anything. No error is returned and the program doesn't terminate, but nothing happens and no output is generated. Any help would be appreciated.

riccardotomada commented 2 years ago

I noticed that the algorithm of the "inside" method is quite slow, especially if the points to be checked are a lot and the sampling method is latin hypercube. For this reason, I would try to avoid using it