Skip to content

Commit

Permalink
Issue1000 examples.diffusion.mesh1D constrains a gradient but calls i…
Browse files Browse the repository at this point in the history
…t a flux (#1001)

* Change references from "flux" to "gradient"

  Bad porting from old `FixedFlux` boundary conditions

* Name the solution variable
  • Loading branch information
guyer committed Feb 5, 2024
1 parent e290e35 commit 3e38ff2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/diffusion/mesh1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,14 @@
>>> valueLeft = 0.
to the left and a fixed flux of
to the left and a fixed gradient of
>>> fluxRight = 1.
>>> gradRight = 1.
to the right:
>>> phi = CellVariable(mesh=mesh)
>>> phi.faceGrad.constrain([fluxRight], mesh.facesRight)
>>> phi = CellVariable(mesh=mesh, name="solution variable")
>>> phi.faceGrad.constrain([gradRight], mesh.facesRight)
>>> phi.constrain(valueLeft, mesh.facesLeft)
We re-initialize the solution variable
Expand Down Expand Up @@ -469,8 +469,8 @@
>>> phiT = CellVariable(name="correct", mesh=mesh)
>>> phiF = CellVariable(name="incorrect", mesh=mesh)
>>> phiT.faceGrad.constrain([fluxRight], mesh.facesRight)
>>> phiF.faceGrad.constrain([fluxRight], mesh.facesRight)
>>> phiT.faceGrad.constrain([gradRight], mesh.facesRight)
>>> phiF.faceGrad.constrain([gradRight], mesh.facesRight)
>>> phiT.constrain(valueLeft, mesh.facesLeft)
>>> phiF.constrain(valueLeft, mesh.facesLeft)
>>> phiT.setValue(0)
Expand Down

0 comments on commit 3e38ff2

Please sign in to comment.