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

Open
rgourdine opened this issue Apr 1, 2024 · 1 comment
Open
Assignees
Labels
bug rxd reaction-diffusion

Comments

@rgourdine
Copy link
Collaborator

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?

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

No branches or pull requests

2 participants