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

SoluteGrid/SpatialGrid in Domain #33

Open
roughhawkbit opened this issue Sep 13, 2013 · 1 comment
Open

SoluteGrid/SpatialGrid in Domain #33

roughhawkbit opened this issue Sep 13, 2013 · 1 comment

Comments

@roughhawkbit
Copy link
Collaborator

All of the grids in Domain (_domainGrid, _boundaryLayer, _diffusivityGrid, _biomassGrid) are cast as SoluteGrid rather than SpatialGrid, despite there being no obvious reason for this. SoluteGrid extends SpatialGrid with a soluteIndex, diffusivity, and _domain, plus a host of methods.

The crucial method in this case seems to be SoluteGrid.refreshBoundary(), called by Domain.refreshBiomassGrids() and which itself calls AllBC.refreshBoundary() on all of the boundary conditions attached to the domain. For some boundary conditions, there is no reason why refreshBoundary() needs to call a SoluteGrid rather than a SpatialGrid (e.g. in BoundaryZeroFlux).

In those that do need a SoluteGrid rather than a SpatialGrid, it is because they need to set the values of the grid along the boundary to the value given in some external object: for example, BoundaryBulk sets them to the value of the connected bulk for the solute with the same soluteIndex. But the grids in Domain don't have a corresponding solute... so for some reason their soluteIndex is simply set to 0 and so along these boundaries the grid values are set according to the external values of the solute which is defined first in the protocol file.

@roughhawkbit
Copy link
Collaborator Author

Following a discussion with Jan, it is probably best to simply remove the refreshBoundary() calls in Domain and cast the grids as SpatialGrid.

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

No branches or pull requests

1 participant