biodynamo
biodynamo copied to clipboard
Closed diffusion fix + Depletion
This PR will contain 3 major contributions. The tasks are sorted by contributions
- Resolution
- [x] resturcture functions to avoide repetitive code
- [x] add
assert - [x] change missleading discription in comment
- Depletion
- [x] Don't change
DiffusionGrid - [x] Don't change
EulerGrid - [x] Add
DepletedEulerGridsubclass (should hanlde multiple substances depleting it) - [x] Use
OpenMPandSIMDinstructions to optimize update - [x] Add unit test to compare against analytic solution
- Boundary Conditions
- [x] Introduce NeumandBoundary
- [x] Introduce DirichletBoundary
- [x] Deprecate previous boundaries
- [x] Document boundaries
- [x] ~Ideally find analytic solutions to Neuman and Dirichlet Problem and come up with tests~
ToDo
Benchmark to see if BoundaryCondition::Evaluate(size_t,size_t,size_t,size_t) introduces a big overhead compared to simply using a constant.
Benchmark setup
- Simulation with one cell without behaviors
- DiffusionGrid with resolution 100 and 2000 sim steps
- Simulate 50 times for each BC, measure each time, compute the average and standard deviation
Results
| BC | "as is" | const |
|---|---|---|
| Dirichlet | 3.72 +/- 0.11 [s] | 3.69 +/- 0.24 [s] |
| Neumann | 3.95 +/- 0.12 [s] | 5.74 +/- 0.16 [s] |
| open | 3.12 +/- 0.09 [s] | - |
| closed | 3.16 +/- 0.17 [s] | - |
While this is a bit of a miracle to me, replacing class with a real_t data member rather increases the runtime.
Thanks @nicogno , that's a great (and absolutely necessary) feature! Great Job!
@TobiasDuswald thank you for your huge help!









