Stop copying Dirichlet csv rows and fix the warning's expected count - #73
Merged
drbergman merged 1 commit intoAug 21, 2026
Merged
Conversation
get_row_from_dirichlet_condition_csv took line and substrate_indices by value, copying a string and a vector for every row of the file. Take both by const reference, matching the substrate reader. The "wrong number of density data" warning printed number_of_voxels() where it means number_of_densities(); Found is a count of substrate columns, and the matlab loader's equivalent message already uses the density count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The my-physicell counterpart of #72. Note up front that the two defects #72 fixes have no direct counterpart here:
sync_substrate_dirichlet_activation, thefix_/unfix_substrate_at_voxel(s)family andfind_existing_density_indexare all new ondc-reworkand don't exist on this branch, so there is no mesh-copying loop and no split error policy to unify. What does correspond is in the Dirichlet-from-file reader.get_row_from_dirichlet_condition_csvtooklineandsubstrate_indicesby value, copying a string and heap-allocating a vector for every row of the file; both are nowconst&. This is the same change #69 makes to the substrate reader's twin signature, and it touches a different function, so the two shouldn't collide.The "wrong number of density data" warning in that function printed
number_of_voxels()where it meansnumber_of_densities()—Foundis a count of substrate columns, andload_dirichlet_conditions_from_matlab's equivalent message already uses the density count. Worth knowing: that warning is unreachable today. In the header-less branch ofload_dirichlet_conditions_from_csv,iis never incremented past thecontinue, sosubstrate_indicesends up empty, and the re-openedstd::ifstream fileshadows the outer one and dies at the end of the block, leaving the outer stream closed. A header-less DC csv therefore sets nothing at all, silently. That is the Dirichlet twin of the header-less path #69 revives for substrates, and it is still missing — happy to do it as a follow-up if you want it in this round.