Skip to content

Commit

Permalink
try to fix example160 by regularization
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Jan 25, 2024
1 parent 7c45fa7 commit b79ebda
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions examples/Example160_UnipolarDriftDiffusion1D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ function reaction!(f, u, node, data)
f[iphi] = data.z * (1 - 2 * u[ic])
f[ic] = 0
end

const eps_reg=1.0e-10
function sedanflux!(f, u, edge, data)
ic = data.ic
iphi = data.iphi
f[iphi] = data.eps * (u[iphi, 1] - u[iphi, 2])
mu1 = -log1p(-u[ic, 1])
mu2 = -log1p(-u[ic, 2])
mu1 = -log1p(-u[ic, 1]+eps_reg)
mu2 = -log1p(-u[ic, 2]+eps_reg)
bp, bm = fbernoulli_pm(data.z * 2 * (u[iphi, 1] - u[iphi, 2]) + (mu1 - mu2))
f[ic] = bm * u[ic, 1] - bp * u[ic, 2]
end
Expand Down Expand Up @@ -235,11 +235,6 @@ end
using Test
function runtests()

if Sys.isapple()
@test true
return
end


evolval = 18.721369939565655
dlcapval = 0.025657355479449806
Expand Down

2 comments on commit b79ebda

@j-fu
Copy link
Member Author

@j-fu j-fu commented on b79ebda Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/99524

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.17.0 -m "<description of version>" b79ebdaf30f73485f5d68471ecad5f5f7abd3663
git push origin v1.17.0

Please sign in to comment.