ttricco / sarracen

A Python library for smoothed particle hydrodynamics (SPH) analysis and visualization.
https://sarracen.readthedocs.io
GNU General Public License v3.0
15 stars 18 forks source link

file format for GRADSPH files #79

Closed svaverbe closed 4 months ago

svaverbe commented 5 months ago

Our file format for dumping snapshot files looks like this in Fortran code:

ninactive=0

    do i=1,n
    if ( act(i) .eqv. .false. ) then
    ninactive=ninactive+1
    endif
    enddo

    open(12,FILE=OUTFN1)  

    write(12,fmt="(3I9)") n,ninactive,nsink
    write(12,fmt="(2ES25.15)") t,gam(1)

! header information

    if ( nsink .gt.  0 ) then

    do i=1,nsink

    write(12,fmt="(7ES25.15)") spx(i),spy(i),spz(i),vspx(i),vspy(i),vspz(i),ams(i)

! information on sink particles

    enddo

    endif 

    do i=1,n

! interpolate particle positions and velocities to the current system time

    if ( act(i) .eqv. .true. ) then

    write(12,fmt="(11ES25.15)") x(i,1),x(i,2),x(i,3),v(i,1), &
    v(i,2),v(i,3),am(i),h(i),cs(i),rho(i),temp(i)

    endif

! SPH particle dump

    enddo

    close(12)

We would like to modify read_csv.py in the readers directory make use of this format.

Siegfried Vanaverbeke