Changes between Version 1 and Version 2 of u/bliu/processing


Ignore:
Timestamp:
06/28/18 12:35:57 (7 years ago)
Author:
Baowei Liu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/bliu/processing

    v1 v2  
     1== Compare SplinePotential(r,r_soft) with RelativePotential_1(mass,pos,r_soft) ==
     2
     31. When r/r_soft > 0.5 SplinePotential
     4
     5{{{
     6(-16/5+(y^2*(32/3+y*(48/5-32/15*y)))+1/15*y)/r_soft
     7}}}
     8Or
     9
     10{{{
     11(-16/5+32/3*y^2 + 48/5*y^3 -32/15*y^4 +1/15*y)/r_soft
     12}}}
     13
     14{{{
     15FUNCTION SplinePotential(r,r_soft)
     16      REAL(KIND=qPREC) :: r, r_soft,y
     17      REAL(KIND=qPREC) :: SplinePotential
     18      REAL(KIND=qPREC), PARAMETER :: &
     19           GSC0=-14d0/5d0, &
     20           GSC1=16d0/3d0, &
     21           GSC2=-48d0/5d0, &
     22           GSC3=32d0/5d0, &
     23           GSC4=32d0/3d0, &
     24           GSC5=-16d0, &
     25           GSC6=48d0/5d0, &
     26           GSC7=-32d0/15d0, &
     27           GSC8=1d0/15d0, &
     28           GSC9=-16d0/5d0
     29      y=r/r_soft
     30      IF (GravityDim == 3) THEN
     31         IF (r >= r_soft) THEN
     32            SplinePotential=-1d0/r
     33         ELSE
     34            y=r/r_soft
     35            IF (r >= half*r_soft) THEN
     36               SplinePotential=(GSC9+(y**2*(GSC4+y*(GSC5+y*(GSC6+y*GSC7)))+GSC8/y )) / r_soft
     37            ELSE
     38               SplinePotential=(GSC0 + (y**2*(GSC1+y**2*(GSC2+y*GSC3)))) / r_soft
     39            END IF
     40         END IF
     41      ELSE
     42         SplinePotential=PlummerPotential2D(r,r_soft)
     43      END IF
     44   END FUNCTION SplinePotential
     45
     46}}}
     47
     482. When r/r_soft > 0.5 RelativePotential_1(mass,pos,r_soft) See below for the script from Luke
     49
     50{{{
     51-1/15 - 32/3*y^3 + 16*y^4 - 48/5*y^5 + 32/15 *y^6 + 48/15*y)
     52}}}
     53
     54
     55{{{
     56   FUNCTION RelativePotential_1(mass,pos,r_soft)
     57      REAL(KIND=qPREC), DIMENSION(3) :: pos
     58      REAL(KIND=qPREC) :: RelativePotential_1
     59      REAL(KIND=qPREC) :: mass, r_soft, r, r2
     60      REAL(KIND=qPREC) :: u_1, phi0_rel_1, spline_A_1, spline_B_1
     61      REAL(KIND=qPREC) :: phi_rel_1_A, phi_rel_1_B, phi_rel_1_C
     62
     63      r2=sum(pos(1:nDim)**2)
     64      r=sqrt(r2)
     65
     66      u_1=r/r_soft
     67
     68      phi0_rel_1=-1d0*mass*ScaleGrav/r
     69      spline_A_1=-16d0/3d0*u_1**3 + 48d0/5d0*u_1**3 - 32d0/5d0*u_1**6 + 14d0/5d0*u_1
     70      spline_B_1=-1d0/15d0 - 32d0/3d0*u_1**3 + 16d0*u_1**4 - 48d0/5d0*u_1**5 + 32d0/15d0*u_1**6 + 48d0/15d0*u_1
     71
     72      phi_rel_1_A=0d0
     73      phi_rel_1_B=0d0
     74      phi_rel_1_C=0d0
     75      if(u_1<0.5) then
     76         phi_rel_1_A=phi0_rel_1*spline_A_1
     77      else if(u_1>1.0) then
     78         phi_rel_1_C=phi0_rel_1
     79      else
     80         phi_rel_1_B=phi0_rel_1*spline_B_1
     81      end if
     82
     83      RelativePotential_1=(phi_rel_1_A+phi_rel_1_B+phi_rel_1_C)
     84
     85   END FUNCTION RelativePotential_1
     86
     87}}}
     88
     89
     90
     91
     92========
    1931. Tests: with data Visit/2.13.0 failed opening data under /public/lchamand/Yisheng_chombo/out_143
    294  small memory test with Visit/2.12.3: succeeded with pseuducolor plot  rho, failed with px/rho