-
Notifications
You must be signed in to change notification settings - Fork 4
Make all non-intrinsic procedures pure functions #46
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
895aa92
fix(t_cell_collection: associate test data object
rouson 51827e3
doc(UML): start Matcha class diagram
rouson 4ed1a4f
feat(distribution): add assertions
rouson ec76a1d
doc(UML): add distribution_t class & postcondition
rouson f01bf58
refac(main):nonintrinsic procedures are pure funcs
rouson c4ab73f
doc(t_cell_collection): fix typo in comment
rouson e335cc5
refactor(distribution): rm unused vel function
rouson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| program matcha | ||
| !! Motility Analysis of T-Cell Histories in Activation (Matcha) | ||
| use matcha_m, only : t_cell_collection_t, distribution_t | ||
| implicit none | ||
|
|
||
| integer, parameter :: ncells = 100, npositions = 25, ndim = 3, nintervals = 10 | ||
| double precision, parameter :: scale = 100.D0, dt = 0.1D0 | ||
| double precision, allocatable :: random_positions(:,:) | ||
| type(t_cell_collection_t), allocatable :: history(:) | ||
|
|
||
| allocate(random_positions(ncells,ndim)) | ||
| call random_number(random_positions) | ||
| history = [t_cell_collection_t(scale*random_positions, time=0.D0)] | ||
|
|
||
| block | ||
| integer, parameter :: nveldim = 4, nsteps = npositions - 1 | ||
| double precision, allocatable :: random_4vectors(:,:,:), sample_distribution(:), velocities(:,:,:) | ||
| type(distribution_t) distribution | ||
| integer step | ||
|
|
||
| allocate(random_4vectors(ncells,nsteps,nveldim)) | ||
| call random_number(random_4vectors) | ||
| allocate(sample_distribution(nintervals)) | ||
| call random_number(sample_distribution) | ||
| sample_distribution = sample_distribution/sum(sample_distribution) | ||
| distribution = distribution_t(sample_distribution) | ||
|
|
||
| associate(random_speeds => random_4vectors(:,:,1), random_directions => random_4vectors(:,:,2:4)) | ||
| associate(v => distribution%velocities(random_speeds, random_directions)) | ||
| do step = 1, nsteps | ||
| associate(x => history(step)%positions(), t => history(step)%time()) | ||
| history = [history, t_cell_collection_t(x + v(:,step,:)*dt, t + dt)] | ||
| end associate | ||
| end do | ||
| end associate | ||
| end associate | ||
| end block | ||
|
|
||
| print * | ||
| print *,"----> Matcha done. <----" | ||
|
|
||
| end program |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| @startuml | ||
|
|
||
| Title "Matcha Classes" | ||
|
|
||
| class t_cell_collection_t{ | ||
| - positions_ : double precision[:,:] | ||
| - time : double precision | ||
| + positions() : real[:,:] | ||
| + t_cell_collection_t(positions : double precision[:,:], time : double precision) : t_cell_collection_t | ||
| } | ||
|
|
||
| class distribution_t{ | ||
| - vel_ : double precision[:] | ||
| - cumulative_distribution_ : double precision[:] | ||
| + distribution_t(sample_distribution : double precision[:]) : distribution_t | ||
| } | ||
| note right of distribution_t::distribution_t | ||
| context distribution_t::distribution_t() post: all([(cumulative_distribution_(i+1) >= cumulative_distribution_(i), i=1,size(cumulative_distribution_,1)-1)] | ||
| end note | ||
|
|
||
| @enduml |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| module matcha_m | ||
| use t_cell_m, only : initialize_positions | ||
| use t_cell_collection_m, only : t_cell_collection_t | ||
| use distribution_m, only : distribution_t | ||
| use move_m, only : move_tcells | ||
| implicit none | ||
|
|
||
| end module |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.