whale coordinate transformation

Here is a snippet from Sussman’s AMR code (sci_clsvof.f90) that explain how to read data from the whale input file and transform the coordinates. It is these transformed coordinates that are used when creating boxes within which AMR adaption does or does not occur.

else if (probtype.eq.562) then ! Whale

! open mouth
if (axis_dir.eq.3) then ! open mouth whale
xblob(1)=0.0
xblob(2)=0.0
xblob(3)=0.0
newxblob(1)=0.5
newxblob(2)=0.5
newxblob(3)=1.0
radblob=12.5

! try this ?

xblob(1)=0.0 ! will become y
xblob(2)=-1.0 ! will become -x
invertfactor(2)=-1.0
xblob(3)=0.0 ! will become z
newxblob(1)=0.5
newxblob(2)=1.0
newxblob(3)=0.5
radblob=12.5
———————————————————————-
else if (probtype.eq.562) then
do dir=1,3
xtemp(dir)=xval(dir)
enddo
! open mouth whale
if (axis_dir.eq.3) then
xval(1)=xtemp(3)
xval(2)=xtemp(1)
xval(3)=xtemp(2)

! try this?
xval(1)=xtemp(2)
xval(2)=xtemp(1)
xval(3)=xtemp(3)

———————————————————————-
do dir=1,3
xval(dir)=invertfactor(dir)* & ! GE (first thing done):
(xvalbefore(dir)-xblob(dir))/radblob + newxblob(dir)
enddo ! xvalbefore is read from file (GE 562)