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

NeumannBC with temporal coordinates? #485

Closed
Saransh-cpp opened this issue Jan 16, 2022 · 4 comments
Closed

NeumannBC with temporal coordinates? #485

Saransh-cpp opened this issue Jan 16, 2022 · 4 comments

Comments

@Saransh-cpp
Copy link
Contributor

Greetings,

The wave_1D.py example says -

# do not use dde.NeumannBC here, since `normal_derivative` does not work with temporal coordinate

Is this still an issue or has this been fixed in DeepXDE?

Thank you!

@lululxvi
Copy link
Owner

It is not an issue. It is designed as this. NeumannBC is for boundary condition for space, not time.

@Saransh-cpp
Copy link
Contributor Author

Oh, I see. Thank you!

@Saransh-cpp
Copy link
Contributor Author

Saransh-cpp commented Jan 17, 2022

@lululxvi can I use NeumannBC when defining ICs with derivatives or should I use OperatorBC here too? For instance, how can I define an IC - At t = 0 -> du(x, t) / dt = 0?

After going through the FAQs, I wrote this code -

def boundary_initial(x, _):
    return np.isclose(x[-1], 0)


geom = dde.geometry.Interval(0, 1)
timedomain = dde.geometry.TimeDomain(0, 1)
geomtime = dde.geometry.GeometryXTime(geom, timedomain)

bc = dde.DirichletBC(geomtime, lambda x: 0, lambda _, on_boundary: on_boundary)
ic_1 = dde.IC(geomtime, lambda x: np.sin(
    n * np.pi * x[:, 0:1] / L), lambda _, on_initial: on_initial)
ic_2 = dde.NeumannBC(geomtime, lambda x: 0, boundary_initial,)

Is this correct?

@lululxvi
Copy link
Owner

Use OperatorBC. NeumannBC only computes the gradient with respect to space coordinate.

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