GENERATESPIKES:=true; REFLECTSPIKES:=true; MAKEDIFFLIST:=true; COMPARESPIKETOONE:=false; REFSPIKE:=1; read "itall.txt"; lvl:=5; phatlvl:=8; spikelvl:=(phatlvl-lvl+2); T:=gasket(phatlvl); inpath:=cat("../data/level",lvl,"/"); outpath:=cat("../data/level",lvl,"/"); verts:=ourVertices(lvl): verts:=subsop(1=NULL, 2=NULL, 3=NULL, verts): verts:=subsop(seq(j=NULL,j=30..nops(verts)),verts): if (GENERATESPIKES) then fd:=fopen(cat(outpath,"numverts.txt"),WRITE); for k from 1 to nops(verts) do readFunc(T,12,cat(inpath,phatlvl,"phat",lvl,"psi.",k)); #clearFunc(T,phatlvl,13); co:=copyRotateScaleChunk(T,lvl,phatlvl,12,13,verts[k]); saveFunc(T,13,spikelvl,cat(outpath,phatlvl,"phat",lvl,"spike.",k)); #fprintf(fd,"Number of vertices in spike %d is %d\n",k,co); end do; fclose(fd); print("Done Generating Spikes"); end if; if (REFLECTSPIKES) then for k from 1 to nops(verts) do readFunc(T,12,cat(outpath,phatlvl,"phat",lvl,"spike.",k)); rotateFunc(T,spikelvl,[0,2,1],12,13); saveFunc(T,13,spikelvl,cat(outpath,phatlvl,"phat",lvl,"rspike.",k)); end do; print("Done Reflecting Spikes"); end if; if (MAKEDIFFLIST) then for k from 1 to nops(verts) do readFunc(T,2*k+12-2,cat(outpath,phatlvl,"phat",lvl,"spike.",k)); readFunc(T,2*k+12-1,cat(outpath,phatlvl,"phat",lvl,"rspike.",k)); end do; fd:=fopen(cat(outpath,phatlvl,"p",lvl,"l","rspikedifflist.txt"),WRITE); for l from 1 to nops(verts) do for m from l to nops(verts) do funcDifference(T,spikelvl,2*l+12-2,2*m+12-2,11); funcDifference(T,spikelvl,2*l+12-2,2*m+12-1,10); er1:=compareFuncList(T,spikelvl,11,[0]); er2:=compareFuncList(T,spikelvl,10,[0]); er:=min(abs(er1),abs(er2)); print(cat("er= ",er)); fprintf(fd,"Spike %a (%d) - %a (%d) err = %20.20g\n",verts[l],l,verts[m],m,er); end do; end do; fclose(fd); end if; if (COMPARESPIKETOONE) then readFunc(T,12,cat(outpath,phatlvl,"phat",lvl,"spike.",REFSPIKE)); for k from 1 to nops(verts) do readFunc(T,13,cat(outpath,phatlvl,"phat",lvl,"spike.",k)); clearFunc(T,spikelvl,14); funcDifference(T,spikelvl,12,13,14); saveFunc(T,14,spikelvl,cat(outpath,phatlvl,"phat",lvl,"spikediffwith",REFSPIKE,".",k)); end do; end if;