no milesatone reached...

This commit is contained in:
tth 2022-02-17 14:10:15 +01:00
parent bc54e20011
commit cfc8ea6b63
7 changed files with 37 additions and 20 deletions

View File

@ -88,10 +88,10 @@ module bloubspace
blb%py = 0.0 blb%py = 0.0
blb%age = blb%age + 1 blb%age = blb%age + 1
endif endif
if (5.0 .lt. blb%py) then if (4.99 .lt. blb%py) then !!
blb%vy = -1.0 * blb%vy blb%vy = -1.0 * blb%vy
blb%age = blb%age + 1 blb%age = blb%age + 1
blb%py = 5.0 blb%py = 4.99 !!
endif endif
if (5.0 .lt. blb%pz) then if (5.0 .lt. blb%pz) then

View File

@ -5,12 +5,15 @@ program essai
integer :: foo integer :: foo
real :: quux real :: quux
double precision :: somme
call init_random_seed() call init_random_seed()
somme = 0.0
do foo=1, 200000 do foo=1, 200000
quux = rand() quux = rand()
print *, foo, quux somme = somme + quux
print *, foo, quux, somme/foo
enddo enddo
end program end program

View File

@ -32,7 +32,7 @@ program genbloubs
if (0 .ne. errcode) then if (0 .ne. errcode) then
exit exit
endif endif
print *, bloub%px, bloub%py, bloub%pz, bloub%radius print *, bloub%px, bloub%py, bloub%pz, bloub%radius, bloub%age
compte = compte + 1 compte = compte + 1
enddo enddo

View File

@ -70,6 +70,11 @@ program mergebloubs
do ! infinite loop do ! infinite loop
print *, "============ PASS ", idx print *, "============ PASS ", idx
if (idx .EQ. NB_MAX_BLOUBS) then
write(0, '(I8, A)') idx, " max number of bloubs reached"
exit
endif
! read the next bloub from input file ! read the next bloub from input file
read (unit=inu, iostat=errcode) bloub read (unit=inu, iostat=errcode) bloub
if (0 .ne. errcode) then if (0 .ne. errcode) then
@ -89,9 +94,7 @@ program mergebloubs
! call display_bloub(les_bloubs(i), "DEAD ? WTF ?") ! call display_bloub(les_bloubs(i), "DEAD ? WTF ?")
cycle cycle
endif endif
rval = distance_of_bloubs(les_bloubs(i), bloub) rval = distance_of_bloubs(les_bloubs(i), bloub)
if (rval .LT. (les_bloubs(i)%radius + bloub%radius)) then if (rval .LT. (les_bloubs(i)%radius + bloub%radius)) then
print *, "contact : ", i, idx, rval print *, "contact : ", i, idx, rval
call merge_two_bloubs(les_bloubs(i), bloub, newbloub) call merge_two_bloubs(les_bloubs(i), bloub, newbloub)
@ -99,16 +102,21 @@ program mergebloubs
nbr_merge = nbr_merge + 1 nbr_merge = nbr_merge + 1
merged = .TRUE. merged = .TRUE.
endif endif
enddo enddo
if (merged) then if (merged) then
! put new bloub in the list
les_bloubs(idx) = newbloub les_bloubs(idx) = newbloub
bloub = newbloub
else else
! put old bloub in the list ! put old bloub in the list
les_bloubs(idx) = bloub les_bloubs(idx) = bloub
endif endif
write(outu, iostat=errcode) bloub ! no error control ?
if (0 .ne. errcode) then
STOP " : WRITE ERROR TO " // trim(outfile)
endif
idx = idx + 1 idx = idx + 1
! print *, "idx = ", idx ! print *, "idx = ", idx

View File

@ -54,7 +54,7 @@ program movebloubs
endif endif
! moving and boundingboxing ! moving and boundingboxing
call move_bloub (bloub, 0.15) call move_bloub (bloub, 0.14)
call bound_a_blob (bloub) call bound_a_blob (bloub)
call green_soylent (bloub) call green_soylent (bloub)
if (.NOT. bloub%alive) then if (.NOT. bloub%alive) then
@ -78,10 +78,10 @@ program movebloubs
! ok, we have read all the bloubs in the input file ! ok, we have read all the bloubs in the input file
! insert some fancy conditional here ! insert some fancy conditional here
if (compteur .LT. 1500) then if (compteur .LT. 1600) then
if (rand() .LT. 0.05) then
call add_more_bloubs(outu, 8, 0.075) call add_more_bloubs(outu, 8, 0.052)
endif
endif endif
close(inu) ; close(outu) close(inu) ; close(outu)
@ -104,13 +104,15 @@ contains
type(t_bloubs) :: bloub type(t_bloubs) :: bloub
integer :: foo integer :: foo
write(0, '(A,I4,1X,A)') "adding", nbre, "bloubs"
do foo=1, nbre do foo=1, nbre
bloub%nick = 'newbie ' bloub%nick = 'newbie '
bloub%alive = .TRUE.
call random_pv(bloub) call random_pv(bloub)
bloub%radius = wtf bloub%radius = wtf
bloub%age = foo bloub%age = 1
bloub%alive = .TRUE.
! call display_bloub (bloub, "new bloub") ! call display_bloub (bloub, "new bloub")
write(un) bloub ! no error control ? write(un) bloub ! no error control ?

View File

@ -7,7 +7,7 @@
INCFILE="bloubs.inc" INCFILE="bloubs.inc"
TMPPNG="/dev/shm/bloubs7.png" TMPPNG="/dev/shm/bloubs7.png"
POVOPT="+Q5 -a -v -d -W920 -H600 -WT2" POVOPT="+Q9 +a -v -d -W960 -H640 -WT2"
DDIR="frames" DDIR="frames"
LOGERR="log.error" LOGERR="log.error"
@ -15,7 +15,7 @@ LOGERR="log.error"
BLBS_IN="/dev/shm/in.blbs" BLBS_IN="/dev/shm/in.blbs"
BLBS_OUT="/dev/shm/out.blbs" BLBS_OUT="/dev/shm/out.blbs"
NBIMG=600 NBIMG=1200
make all make all
err=$? err=$?
@ -67,7 +67,7 @@ do
mv ${BLBS_OUT} ${BLBS_IN} mv ${BLBS_OUT} ${BLBS_IN}
echo echo
sleep 33 sleep 9
done done

View File

@ -11,8 +11,12 @@ BEGIN {
} }
{ {
printf "\t\tsphere { <%f, %f, %f>, %f }\n", \ if ($5 > 4) color = "Magenta"
$1, $2, $3, $4 else color = "Cyan"
pigment = "pigment { color " color " }"
printf "\t\tsphere { <%f, %f, %f>, %f %s }\n", \
$1, $2, $3, $4, pigment
count++ count++
} }