Skip to content

Commit

Permalink
sh
Browse files Browse the repository at this point in the history
  • Loading branch information
suzanmanasreh committed Jul 27, 2024
1 parent ad88492 commit 1aa3bf2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 260 deletions.
68 changes: 4 additions & 64 deletions examples/cutout/cinit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -128,67 +128,6 @@ subroutine recenterWalls

end subroutine recenterWalls

recursive subroutine choose_point(pt)
real(WP) :: pt(3)

type(t_wall), pointer :: wall
real(WP) :: rad = 3., len, maxN, minN
real(WP) :: threshold
integer :: i

wall => walls(1)
len = RandomNumber(ranseed)*actlen
threshold = 0.2
maxN = -1E9
minN = 1E9

! figure out the radius based on the location in the tube
do i = 1, wall%nvert
if (abs(wall%x(i, 3) - len) .le. threshold) then
maxN = maxval((/maxN, wall%x(i, 1), wall%x(i, 2)/))
minN = minval((/minN, wall%x(i, 1), wall%x(i, 2)/))
end if
end do

rad = (maxN - minN)/2
! rad = 3

pt(2) = RandomNumber(ranseed)*2*PI
pt(3) = sqrt(RandomNumber(ranseed))*(rad)
pt(1) = pt(3)*cos(pt(2)) + rad + minN ! x
pt(2) = pt(3)*sin(pt(2)) + rad + minN ! y
pt(3) = len

end subroutine choose_point

! generate point inside sphere with center and radius
subroutine get_point(pt, center, rad)

real(WP) :: pt(3)
real(WP) :: center(3), rad
real(WP) :: d = 100., x, y, z, tmp_pt(3)
do while (d .gt. rad)
call random_number(x)
call random_number(y)
call random_number(z)
x = (x*rad*2) - rad
y = (y*rad*2) - rad
z = (z*rad*2) - rad
! if (rootWorld) print *, "tmp_pt: ", tmp_pt

d = sum(tmp_pt*tmp_pt)
! if (rootWorld) print *, "d: ", d, "tmp_pt: ", tmp_pt
end do
! if (rootWorld) print *, "tmp_pt after: ", x, y, z

pt = tmp_pt
! if (rootWorld) print *, "tmp_pt: ", tmp_pt
pt(1) = x + center(1)
pt(2) = y + center(2)
pt(3) = z + center(3)
! if (rootWorld) print *, "pt after: ", pt
end subroutine get_point

! find an open spot in the simulation to place a cell
subroutine place_cell(celltype, num)

Expand Down Expand Up @@ -235,7 +174,7 @@ subroutine place_cell(celltype, num)
call rotate_cell(newcell)

! randomly select a tmp_xc
! call choose_point(tmp_xc)
! place first 22 cells in sphere
if (num .le. 22) then
sphere_center = (/4.5, 5., 9./)
sphere_rad = 4.5
Expand All @@ -248,6 +187,7 @@ subroutine place_cell(celltype, num)
end do
d = 100.
tmp_xc = tmp_xc + sphere_center
! place rest of the cells in cylinder
else
tmp_xc(2) = RandomNumber(ranseed)*2*PI
tmp_xc(3) = sqrt(RandomNumber(ranseed))*(tuber)
Expand Down Expand Up @@ -318,12 +258,12 @@ subroutine rotate_cell(cell)
zv(3) = 1 - (2*vsq)

!generate rotation matrix
rotmat = RotateMatrix(zv) !(/ 0., 1., 0./))
rotmat = RotateMatrix(zv)

!rotate cell with rotmat
!each point: x = Rx
forall (i=1:cell%nlat, j=1:cell%nlon)
! reshpe is unnecessary?
! reshape is unnecessary
cell%x(i, j, :) = matmul(rotmat, cell%x(i, j, :))
end forall

Expand Down
179 changes: 0 additions & 179 deletions examples/cutout/cinit2.F90

This file was deleted.

17 changes: 0 additions & 17 deletions examples/cutout/ctube.F90
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,10 @@ subroutine InitSystem
rbc%ES = 12.4
rbc%ED = 200.
rbc%EB = 6.69D-2
! Mechanical properties of leukocytes
! Calculated according to section 6 of reference paper with WBC radius of 1.4 sim units
! and Es* scaled by 10^2
! Reference:
! Zhao, H., Isfahani, A. H., Olson, L. N., & Freund, J. B. (2010).
! A spectral boundary integral method for flowing blood cells.
! Journal of Computational Physics, 229(10), 3726-3744.
case (2)
rbc%ES = 887
rbc%ED = 200.
rbc%EB = 2.44D-2

! Mechanical properties for sickle cell roughly determined to be
! Es = (20 / 7.1) * Es for a healthy RBC (case(1) cell)
! Ed = (49.4 / 15.4) * Ed for healthy RBC (case(1) cell)
! Eb = (19.5 / 5.7) * Eb for a healthy RBC (case(1) cell)
! Reference:
! HeeSu Byun, Timothy R. Hillman, John M. Higgins, Monica Diez-Silva, Zhangli Peng, Ming Dao, Ramachandra R. Dasari, Subra Suresh, YongKeun Park
! Optical measurement of biomechanical properties of individual erythrocytes
! Acta Biomaterialia, Volume 8, Issue 11, 2012, Pages 4130-4138,
! https://doi.org/10.1016/j.actbio.2012.07.011
case (3)
rbc%ES = 10.*50
rbc%ED = 50.
Expand Down

0 comments on commit 1aa3bf2

Please sign in to comment.