Dear all,
First of all, I am pretty new to Python/NGSolve/Netgen so please apologise any newbie-error I do.
I have a Mesh, let's say the points
(0,0),E1=(0.25,0), E2=(0.75,0), (1,0), (1,1), and (0,1), I ordered them counterclockwise
I wanted to solve the Laplace-Equation on it with the following Dirichlet-boundary conditions:
d=disctance to the section E1E2
With some linear algebra I could write the code down with two IfPos. But it took ages to solve, very often it didn't work at all. Since I never had similar problems with solving the Laplace Equation or others, I assume it was the IfPos(IfPos())
Code:
d=IfPos((e2-e1)*(y-e1), IfPos((e1-e2)*(y-e2), (x*(-(e2-e1))+y*0)/(e2**2+e1**2)**0.5, (x**2-(y-e2)**2)**0.5), (x**2-(y-e1)**2)**0.5)