Skip to content

Solving the laplace equation in only one direction while in a 2 or 3D domain #199

Answered by david-zwicker
Tobias-Dwyer asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, this is possible, although it is currently not very well exposed in the general framework. Here is an example that should get you started:

from pde.grids.operators.cartesian import _make_derivative, _make_derivative2

make_derivative_x = functools.partial(_make_derivative, axis=0)
pde.CartesianGrid.register_operator('derivative_x', make_derivative_x)
make_laplace_x = functools.partial(_make_derivative2, axis=0)
pde.CartesianGrid.register_operator('laplace_x', make_laplace_x)

eq = pde.PDE({'u': 'derivative_x(g/D*derivative_x(u))'})

The example defines two new operators, derivative_x and laplace_x, that can be used in the expressions of the PDE class. They evaluate the first and secon…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tobias-Dwyer
Comment options

Answer selected by Tobias-Dwyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants