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

FractionalVolume with surface_fraction=0 does not work for 3d Region #2810

Closed
rgourdine opened this issue Apr 1, 2024 · 2 comments · Fixed by #2887
Closed

FractionalVolume with surface_fraction=0 does not work for 3d Region #2810

rgourdine opened this issue Apr 1, 2024 · 2 comments · Fixed by #2887
Assignees
Labels
bug rxd reaction-diffusion

Comments

@rgourdine
Copy link
Collaborator

rgourdine commented Apr 1, 2024

Example:

dend1 = h.Section("dend1")
dend1.nseg = 4

cyt = rxd.Region(dend1.wholetree(), "i", geometry=rxd.FractionalVolume(volume_fraction=0.8), dx=0.25)
ca = rxd.Species(cyt, name="ca", charge=2, initial=1e-12)
dend1.L = 10
dend1.diam = 2

rxd.set_solve_type(domain=[dend1], dimension=3)
h.finitialize()
print(sum(ca.nodes(cyt).volume)

Expected behavior:
Not raising an exception

@rgourdine rgourdine added bug rxd reaction-diffusion labels Apr 1, 2024
@rgourdine rgourdine self-assigned this Apr 1, 2024
@adamjhn
Copy link
Member

adamjhn commented Apr 2, 2024

I think the reason we have not encountered this error before is in cyt the surface_fraction=0 but the nrn_region='i'. So at initialization we try to calculate how to scale the currents. The error in species.py occurs because surface_areas1d return 0 rather than a list.
@ramcdougal Should we throw an exception if surface_fraction=0 and nrn_region='i', or just add warning and avoid adding currents to that region?

@ramcdougal
Copy link
Member

The reason this wasn't an issue for the calcium wave experiments was because the FractionalVolume region with no surface area was not in the i region. Furthermore, when we did have it, there was an i region that did have surface area.

Physically this makes no sense... you can't be directly adjacent to the plasma membrane (the i region) and have a total area of zero.

Given that it is convenient to declare things to be in the i region as this allows their concentrations to interact with NMODL and be readable from HOC, I'm inclined to say let's do the warning case where we avoid adding currents... but if so, we should also raise a warning in 1D.

We should also go back and figure out why we made this test, and make sure that the resulting test has a physically meaningful i region and does not raise this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rxd reaction-diffusion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants