heltonmc / LightPropagation.jl

Modeling light transport in turbid media
MIT License
9 stars 3 forks source link

Implement solutions for time-domain DCS (gated, single time) #12

Closed heltonmc closed 2 years ago

codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@63179f9). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #12   +/-   ##
=======================================
  Coverage        ?   45.83%           
=======================================
  Files           ?       16           
  Lines           ?     1152           
  Branches        ?        0           
=======================================
  Hits            ?      528           
  Misses          ?      624           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 63179f9...6d4fcd7. Read the comment docs.

heltonmc commented 2 years ago

Implements time-domain solutions in the semi-infinite and layered geometries for g1 and g2.

Time-domain solutions have two separate routines depending on the time added. If a single time point is entered t isa AbstractFloat this will simply calculate g(tau, t) for that time point. If t isa AbstractVector it will integrate over all the pathlengths in the range of t[1] and t[end] using Gauss-legendre integration.

The solutions are very accurate however I have not paid any attention to optimizing these yets and they allocate too much memory. One of the reasons is that I am directly calling the external interface for the fluence functions inside for loops. I believe Julia right now struggles with escape analysis, thus on each loop it is reallocating that memory. I will definitely optimize this further. In general, the strategy will be to preallocate as much as possible before entering the loops over each tau value and accessing the kernel functions in the fluence calculations. This will get rid of the majority of the allocations....

These functions are also not documented as of yet... I will add some to these next.