Skip to content

Commit

Permalink
fix poission 1d (PaddlePaddle#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
xingfeng01 authored Sep 5, 2022
1 parent cb2b574 commit 633f20c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion paddlescience/pde/pde_poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ class Poisson(PDE):

def __init__(self, dim=2, rhs=0.0, weight=1.0):

if dim == 2:
if dim == 1:
# independent and dependent variable
x = sympy.Symbol('x')
u = sympy.Function('u')(x)
super(Poisson, self).__init__([x], [u], weight)
self.add_equation(u.diff(x).diff(x), rhs)

elif dim == 2:
# independent and dependent variable
x = sympy.Symbol('x')
y = sympy.Symbol('y')
Expand Down

0 comments on commit 633f20c

Please sign in to comment.