We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A DiffusionTerm cannot have a scalar diffusion coefficient if the solution variable is a vector. E.g.,
DiffusionTerm
import fipy as fp mesh = fp.Grid2D(nx=10, ny=10) vec = fp.CellVariable(mesh=mesh, name="vec", rank=1, hasOld=True) D = 1 eq = fp.TransientTerm(var=vec) == fp.DiffusionTerm(coeff=D, var=vec) eq.solve(dt=1)
raises
IndexError: boolean index did not match indexed array along dimension 0; dimension is 180 but corresponding boolean dimension is 720
This can be remedied by changing to
eq = fp.TransientTerm(var=vec) == fp.DiffusionTerm(coeff=[[[D, 0], [0, D]]], var=vec)
Note: Similarly, it's necessary to write
fp.ConvectionTerm(coeff=[[[1, 0], [0, 1]], [[2, 0], [0, 2]]], var=vec)
instead of
fp.ConvectionTerm(coeff=[[1], [2]], var=vec)
Note: While it is acceptable to write
fp.TransientTerm(coeff=[[1, 0], [0, 1]], var=vec)
it is not required. It should also be possible to pass scalar D.
D
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A
DiffusionTerm
cannot have a scalar diffusion coefficient if the solution variable is a vector. E.g.,raises
This can be remedied by changing to
Note: Similarly, it's necessary to write
instead of
Note: While it is acceptable to write
it is not required. It should also be possible to pass scalar
D
.The text was updated successfully, but these errors were encountered: