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

Model dimensions should be part of the parameters #45

Open
jpsluka opened this issue Jun 18, 2020 · 1 comment
Open

Model dimensions should be part of the parameters #45

jpsluka opened this issue Jun 18, 2020 · 1 comment
Assignees

Comments

@jpsluka
Copy link
Collaborator

jpsluka commented Jun 18, 2020

The CC3D model dimensions (90x90 currently) should be part of the parameters list. It looks like the rest of the code uses the self.dim.x and self.sim.y so the 90's only occur in the XML. Therefore the only change is to add the parameters, and unfortunately you can't use a python parameter in the XML, so the lattice would need to be resized in python.

As an enhancement, link the model's dimensions to the models desired width in cell width units and the cell_diameter via a "pixel_to_micron" parameter. Already have a time to mcs conversion factor (s_to_mcs). Now scale the other quantities relative to those parameters (such as the diffusion constants). The model size can then be defined in cell widths (e.g., you can say the model is 30 cell widths wide). This has several advantages. (1) units for things like cell widths and diffusion coefficients etc. are in physical units like micron and micron^2/second (instead of pixels/mcs). (2) For debugging, you can make the cells width smaller (in pixels, the scaling would treat them as being the same width in microns) and you can reduce the width of the model in terms of the number of cells that fit. This makes the simulation run much faster, which is great for debugging. Even using the current code, changing the model dimensions to 30x30 gives a speedup of nearly 10 fold. Very handy for debugging, getting the plot correct, writing data to files, etc. And (3) this is the easiest way to check for scaling errors and model behaviors that depend on the resolution and size of the model.

@tjsego
Copy link
Collaborator

tjsego commented Feb 19, 2021

We'll do this with the next CC3D release, once python specification of core components is available.

@tjsego tjsego self-assigned this Feb 19, 2021
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

2 participants