VCLOD Test for Coefficient 2

This script performs the main VCLOD test for this thesis with a specific diffusion coefficient. We investigate the energy error of the VCLOD dependent on the updated correctors. For this purpose, we update every corrector individually and compare it to the reference solution. This enables a good comparison between percentages. We desire to yield a fast decrease of the energy error of the VCLOD method since, due to the error indicator, we sort and update the element correctors in terms of the effect that comes with the perturbation.


In [1]:
import os
import sys
import numpy as np
import scipy.sparse as sparse
import random
import csv

%matplotlib notebook
import matplotlib.pyplot as plt
from visualize import drawCoefficient
from data import * 

from gridlod import interp, coef, util, fem, world, linalg, femsolver
import pg_rand, femsolverCoarse, buildcoef2d
from gridlod.world import World

Result function

The 'result' function investigates the VCLOD for each percentage. The reference solution is computed by a standard FEM on the fine mesh. We compute the 'worst solution' that represents zero percentage updating and clearly has no computational cost at all. Afterwards, we compute the error indicator for the given patch size $k=4$ and use every value gradually. Furthermore we store the resulting energy error for the VCLOD as well as the optimal energy error that results from 100 percentage updating. Once again, we take advantage of the 'gridlod' module in order to compute the required matrices.


In [2]:
def result(pglod, world, A, R, f, k, String):
    print "-------------- " + String + " ---------------" 
    NWorldFine = world.NWorldFine
    NWorldCoarse = world.NWorldCoarse
    NCoarseElement = world.NCoarseElement
    
    boundaryConditions = world.boundaryConditions
    NpFine = np.prod(NWorldFine+1)
    NpCoarse = np.prod(NWorldCoarse+1)
        
    # new Coefficient
    ANew = R.flatten()
    Anew = coef.coefficientFine(NWorldCoarse, NCoarseElement, ANew)
    
    # reference solution
    f_fine = np.ones(NpFine)
    uFineFem, AFine, MFine = femsolver.solveFine(world, ANew, f_fine, None, boundaryConditions)
    
    # worst solution
    KFull = pglod.assembleMsStiffnessMatrix()
    MFull = fem.assemblePatchMatrix(NWorldCoarse, world.MLocCoarse)
    free  = util.interiorpIndexMap(NWorldCoarse)                                 
    
    bFull = MFull*f
    KFree = KFull[free][:,free]
    bFree = bFull[free]

    xFree = sparse.linalg.spsolve(KFree, bFree)
    
    basis = fem.assembleProlongationMatrix(NWorldCoarse, NCoarseElement)
    
    basisCorrectors = pglod.assembleBasisCorrectors()
    modifiedBasis = basis - basisCorrectors
    
    xFull = np.zeros(NpCoarse)
    xFull[free] = xFree
    uCoarse = xFull
    uLodFine = modifiedBasis*xFull
    
    uLodFineWorst = uLodFine
    
    # energy error
    errorworst = np.sqrt(np.dot(uFineFem - uLodFineWorst, AFine*(uFineFem - uLodFineWorst)))
    
    # tolerance = 0 
    vis, eps = pglod.updateCorrectors(Anew, 0, f, 1, clearFineQuantities=False, Computing=False)
    
    PotentialCorrectors = np.sum(vis)
    elemente = np.arange(np.prod(NWorldCoarse))
            
    # identify tolerances
    epsnozero = filter(lambda x: x!=0, eps)
    
    assert(np.size(epsnozero) != 0)
    
    mini = np.min(epsnozero)
    minilog = int(round(np.log10(mini)-0.49))
    epsnozero.append(10**(minilog))
    ToleranceListcomplete = []
    for i in range(0,int(np.size(epsnozero))):
        ToleranceListcomplete.append(epsnozero[i])

    ToleranceListcomplete.sort()
    ToleranceListcomplete = np.unique(ToleranceListcomplete)

    # with tolerance
    errorplotinfo = []
    tolerancesafe = []
    errorBest = []
    errorWorst = []
    recomputefractionsafe = []
    recomputefraction = 0
    Correctors = 0
    leng = np.size(ToleranceListcomplete)
    for k in range(leng-1,-1,-1):
        tol = ToleranceListcomplete[k]
        print " --- "+ str(-k+leng) + "/" + str(leng)+ " --- Tolerance: " + str(round(tol,5)) + " in "+ String +" ---- ", 
        vistol = pglod.updateCorrectors(Anew, tol, f, clearFineQuantities=False, Testing=True)
        
        Correctors += np.sum(vistol)
        
        recomputefraction += float(np.sum(vistol))/PotentialCorrectors * 100
        recomputefractionsafe.append(recomputefraction)
        
        KFull = pglod.assembleMsStiffnessMatrix()
        MFull = fem.assemblePatchMatrix(NWorldCoarse, world.MLocCoarse)
        free  = util.interiorpIndexMap(NWorldCoarse)                                 

        bFull = MFull*f
        KFree = KFull[free][:,free]
        bFree = bFull[free]

        xFree = sparse.linalg.spsolve(KFree, bFree)
        basis = fem.assembleProlongationMatrix(NWorldCoarse, NCoarseElement)

        basisCorrectors = pglod.assembleBasisCorrectors()

        modifiedBasis = basis - basisCorrectors

        xFull = np.zeros(NpCoarse)
        xFull[free] = xFree
        uCoarse = xFull
        uLodFine = modifiedBasis*xFull
        
        #energy error
        errortol = np.sqrt(np.dot(uFineFem - uLodFine, AFine*(uFineFem - uLodFine)))
        
        errorplotinfo.append(errortol)
        tolerancesafe.append(tol)
    
    # 100% updating
    uLodFinebest = uLodFine
    errorbest = np.sqrt(np.dot(uFineFem - uLodFinebest, AFine*(uFineFem - uLodFinebest)))
    
    for k in range(leng-1,-1,-1):
        errorBest.append(errorbest)
        errorWorst.append(errorworst)

    return vis, eps, PotentialCorrectors, recomputefractionsafe, errorplotinfo, errorWorst, errorBest

Preparations

We use the same setting as we have already used before containing the 'buildcoef2d' class in order to construct the coefficient. We visualize the coefficient and store the information in an extern folder.


In [3]:
bg = 0.05       #background
val = 1         #values

#fine World
NWorldFine = np.array([256, 256])
NpFine = np.prod(NWorldFine+1)                                                                               

#coarse World
NWorldCoarse = np.array([16,16])
NpCoarse = np.prod(NWorldCoarse+1)

#ratio between Fine and Coarse
NCoarseElement = NWorldFine/NWorldCoarse

boundaryConditions = np.array([[0, 0],
                               [0, 0]])

world = World(NWorldCoarse, NCoarseElement, boundaryConditions)

#righthandside
f = np.ones(NpCoarse)

#Coefficient 2
CoefClass = buildcoef2d.Coefficient2d(NWorldFine, 
                        bg                  = bg,
                        val                 = val,
                        length              = 1,
                        thick               = 1,
                        space               = 2,
                        probfactor          = 1,
                        right               = 0,
                        down                = 0,
                        diagr1              = 0,
                        diagr2              = 0,
                        diagl1              = 0,
                        diagl2              = 0,
                        LenSwitch           = None,
                        thickSwitch         = None,
                        equidistant         = True,
                        ChannelHorizontal   = None,
                        ChannelVertical     = True,
                        BoundarySpace       = True)

A = CoefClass.BuildCoefficient()
ABase = A.flatten()

ROOT = '../test_data/Coef2'

#safe NworldFine
with open("%s/NWorldFine.txt" % ROOT, 'wb') as csvfile:
    writer = csv.writer(csvfile)
    for val in NWorldFine:
        writer.writerow([val])

#safe NworldCoarse
with open("%s/NWorldCoarse.txt" % ROOT, 'wb') as csvfile:
    writer = csv.writer(csvfile)
    for val in NWorldCoarse:
        writer.writerow([val])

#ABase
with open("%s/OriginalCoeff.txt" % ROOT, 'wb') as csvfile:
    writer = csv.writer(csvfile)
    for val in ABase:
        writer.writerow([val])

#fine-fem
f_fine = np.ones(NpFine)
uFineFem, AFine, MFine = femsolver.solveFine(world, ABase, f_fine, None, boundaryConditions)

#fine solution
with open("%s/finescale.txt" % ROOT, 'wb') as csvfile:
    writer = csv.writer(csvfile)
    for val in uFineFem:
        writer.writerow([val])
        
plt.figure("Original")
drawCoefficient(NWorldFine, ABase,greys=True)
plt.title("Original coefficient")
plt.show()


Perturbations of the same entries

To keep comparability, we use the 'specific' perturbation function and use a random seed.


In [4]:
# random seed
random.seed(20)

# decision
valc = np.shape(CoefClass.ShapeRemember)[0]
numbers = []
decision = np.zeros(100)
decision[0] = 1


for i in range(0,valc):
    a = random.sample(decision,1)[0]
    if a == 1:
        numbers.append(i)

value1 = 3
C1 = CoefClass.SpecificValueChange(ratio=value1,
                                    Number = numbers,
                                    probfactor=1,
                                    randomvalue=None,
                                    negative=None,
                                    ShapeRestriction=True,
                                    ShapeWave=None,
                                    ChangeRight=1,
                                    ChangeDown=1,
                                    ChangeDiagr1=1,
                                    ChangeDiagr2=1,
                                    ChangeDiagl1=1,
                                    ChangeDiagl2=1,
                                    Original = True,
                                    NewShapeChange = True)

V = CoefClass.SpecificVanish(Number = numbers,
                                probfactor=1,
                                PartlyVanish=None,
                                ChangeRight=1,
                                ChangeDown=1,
                                ChangeDiagr1=1,
                                ChangeDiagr2=1,
                                ChangeDiagl1=1,
                                ChangeDiagl2=1,
                                Original = True)

M1 = CoefClass.SpecificMove(probfactor=1,
                            Number = numbers,
                            steps=1,
                            randomstep=None,
                            randomDirection=None,
                            ChangeRight=1,
                            ChangeDown=1,
                            ChangeDiagr1=1,
                            ChangeDiagr2=1,
                            ChangeDiagl1=1,
                            ChangeDiagl2=1,
                            Right=1,
                            BottomRight=0,
                            Bottom=0,
                            BottomLeft=0,
                            Left=0,
                            TopLeft=0,
                            Top=0,
                            TopRight=0,
                            Original = True)

Precomputations


In [5]:
k = 4

NWorldFine = world.NWorldFine
NWorldCoarse = world.NWorldCoarse
NCoarseElement = world.NCoarseElement

boundaryConditions = world.boundaryConditions
NpFine = np.prod(NWorldFine+1)
NpCoarse = np.prod(NWorldCoarse+1)

#interpolant
IPatchGenerator = lambda i, N: interp.L2ProjectionPatchMatrix(i, N, NWorldCoarse, NCoarseElement, boundaryConditions)

#old Coefficient
ABase = A.flatten()
Aold = coef.coefficientFine(NWorldCoarse, NCoarseElement, ABase)

pglod = pg_rand.VcPetrovGalerkinLOD(Aold, world, k, IPatchGenerator, 0)
pglod.originCorrectors(clearFineQuantities=False)

Change in value


In [ ]:
vis, eps, PotentialUpdated, recomputefractionsafe, errorplotinfo, errorworst, errorbest = result(pglod ,world, A, C1, f, k, 'Specific value change' + str(value1))

safeChange(ROOT, C1, vis, eps, PotentialUpdated, recomputefractionsafe, errorplotinfo, errorworst, errorbest)


-------------- Specific value change3 ---------------
Not Recomputed!
 --- 1/89 --- Tolerance: 0.4922 in Specific value change3 ----  To be recomputed:  0.0 %
 --- 2/89 --- Tolerance: 0.4922 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 3/89 --- Tolerance: 0.47463 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 4/89 --- Tolerance: 0.47463 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 5/89 --- Tolerance: 0.47463 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 6/89 --- Tolerance: 0.47463 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 7/89 --- Tolerance: 0.47463 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 8/89 --- Tolerance: 0.47463 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 9/89 --- Tolerance: 0.47463 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 10/89 --- Tolerance: 0.47462 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 11/89 --- Tolerance: 0.47462 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 12/89 --- Tolerance: 0.16204 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 13/89 --- Tolerance: 0.16204 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 14/89 --- Tolerance: 0.16039 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 15/89 --- Tolerance: 0.16039 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 16/89 --- Tolerance: 0.16019 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 17/89 --- Tolerance: 0.16019 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 18/89 --- Tolerance: 0.16017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 19/89 --- Tolerance: 0.16017 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 20/89 --- Tolerance: 0.16017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 21/89 --- Tolerance: 0.10689 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 22/89 --- Tolerance: 0.10689 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 23/89 --- Tolerance: 0.05092 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 24/89 --- Tolerance: 0.05092 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 25/89 --- Tolerance: 0.05088 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 26/89 --- Tolerance: 0.05088 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 27/89 --- Tolerance: 0.05071 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 28/89 --- Tolerance: 0.05071 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 29/89 --- Tolerance: 0.05069 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 30/89 --- Tolerance: 0.05069 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 31/89 --- Tolerance: 0.05069 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 32/89 --- Tolerance: 0.03913 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 33/89 --- Tolerance: 0.03913 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 34/89 --- Tolerance: 0.01686 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 35/89 --- Tolerance: 0.01686 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 36/89 --- Tolerance: 0.01685 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 37/89 --- Tolerance: 0.01685 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 38/89 --- Tolerance: 0.01685 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 39/89 --- Tolerance: 0.01684 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 40/89 --- Tolerance: 0.01684 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 41/89 --- Tolerance: 0.01642 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 42/89 --- Tolerance: 0.01642 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 43/89 --- Tolerance: 0.00798 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 44/89 --- Tolerance: 0.00798 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 45/89 --- Tolerance: 0.00392 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 46/89 --- Tolerance: 0.00392 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 47/89 --- Tolerance: 0.00392 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 48/89 --- Tolerance: 0.00392 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 49/89 --- Tolerance: 0.00392 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 50/89 --- Tolerance: 0.0039 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 51/89 --- Tolerance: 0.0039 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 52/89 --- Tolerance: 0.00388 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 53/89 --- Tolerance: 0.00388 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 54/89 --- Tolerance: 0.00199 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 55/89 --- Tolerance: 0.00199 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 56/89 --- Tolerance: 0.0017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 57/89 --- Tolerance: 0.0017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 58/89 --- Tolerance: 0.0017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 59/89 --- Tolerance: 0.0017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 60/89 --- Tolerance: 0.0017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 61/89 --- Tolerance: 0.0017 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 62/89 --- Tolerance: 0.0017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 63/89 --- Tolerance: 0.00146 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 64/89 --- Tolerance: 0.00146 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 65/89 --- Tolerance: 0.00062 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 66/89 --- Tolerance: 0.00062 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 67/89 --- Tolerance: 0.00043 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 68/89 --- Tolerance: 0.00043 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 69/89 --- Tolerance: 0.00043 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 70/89 --- Tolerance: 0.00043 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 71/89 --- Tolerance: 0.00043 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 72/89 --- Tolerance: 0.00043 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 73/89 --- Tolerance: 0.00043 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 74/89 --- Tolerance: 0.00038 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 75/89 --- Tolerance: 0.00038 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 76/89 --- Tolerance: 0.00017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 77/89 --- Tolerance: 0.00017 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 78/89 --- Tolerance: 9e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 79/89 --- Tolerance: 9e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 80/89 --- Tolerance: 9e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 81/89 --- Tolerance: 9e-05 in Specific value change3 ----  To be recomputed:  2.34375 %
 --- 82/89 --- Tolerance: 9e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 83/89 --- Tolerance: 8e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 84/89 --- Tolerance: 8e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 85/89 --- Tolerance: 7e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 86/89 --- Tolerance: 7e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 87/89 --- Tolerance: 5e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 88/89 --- Tolerance: 5e-05 in Specific value change3 ----  To be recomputed:  0.390625 %
 --- 89/89 --- Tolerance: 1e-05 in Specific value change3 ----  To be recomputed:  0.390625 %

Disappearance


In [ ]:
vis, eps, PotentialUpdated, recomputefractionsafe, errorplotinfo, errorworst, errorbest = result(pglod ,world, A, V, f, k, 'Vanish')

safeVanish(ROOT, V, vis, eps, PotentialUpdated, recomputefractionsafe, errorplotinfo, errorworst, errorbest)


-------------- Vanish ---------------
Not Recomputed!
 --- 1/89 --- Tolerance: 2.08968 in Vanish ----  To be recomputed:  0.0 %
 --- 2/89 --- Tolerance: 2.08968 in Vanish ----  To be recomputed:  0.390625 %
 --- 3/89 --- Tolerance: 1.96335 in Vanish ----  To be recomputed:  0.390625 %
 --- 4/89 --- Tolerance: 1.96335 in Vanish ----  To be recomputed:  0.390625 %
 --- 5/89 --- Tolerance: 1.95425 in Vanish ----  To be recomputed:  0.390625 %
 --- 6/89 --- Tolerance: 1.95425 in Vanish ----  To be recomputed:  0.390625 %
 --- 7/89 --- Tolerance: 1.95364 in Vanish ----  To be recomputed:  0.390625 %
 --- 8/89 --- Tolerance: 1.95364 in Vanish ----  To be recomputed:  0.390625 %
 --- 9/89 --- Tolerance: 1.9536 in Vanish ----  To be recomputed:  0.390625 %
 --- 10/89 --- Tolerance: 1.9536 in Vanish ----  To be recomputed:  2.34375 %
 --- 11/89 --- Tolerance: 1.9536 in Vanish ----  To be recomputed:  0.390625 %
 --- 12/89 --- Tolerance: 0.45894 in Vanish ----  To be recomputed:  0.390625 %
 --- 13/89 --- Tolerance: 0.45894 in Vanish ----  To be recomputed:  0.390625 %
 --- 14/89 --- Tolerance: 0.45429 in Vanish ----  To be recomputed:  0.390625 %
 --- 15/89 --- Tolerance: 0.45429 in Vanish ----  To be recomputed:  0.390625 %
 --- 16/89 --- Tolerance: 0.45371 in Vanish ----  To be recomputed:  0.390625 %
 --- 17/89 --- Tolerance: 0.45371 in Vanish ----  To be recomputed:  0.390625 %
 --- 18/89 --- Tolerance: 0.45367 in Vanish ----  To be recomputed:  0.390625 %
 --- 19/89 --- Tolerance: 0.45367 in Vanish ----  To be recomputed:  2.34375 %
 --- 20/89 --- Tolerance: 0.45367 in Vanish ----  To be recomputed:  0.390625 %
 --- 21/89 --- Tolerance: 0.30276 in Vanish ----  To be recomputed:  0.390625 %
 --- 22/89 --- Tolerance: 0.30276 in Vanish ----  To be recomputed:  0.390625 %
 --- 23/89 --- Tolerance: 0.14423 in Vanish ----  To be recomputed:  0.390625 %
 --- 24/89 --- Tolerance: 0.14423 in Vanish ----  To be recomputed:  0.390625 %
 --- 25/89 --- Tolerance: 0.14412 in Vanish ----  To be recomputed:  0.390625 %
 --- 26/89 --- Tolerance: 0.14412 in Vanish ----  To be recomputed:  0.390625 %
 --- 27/89 --- Tolerance: 0.14363 in Vanish ----  To be recomputed:  0.390625 %
 --- 28/89 --- Tolerance: 0.14363 in Vanish ----  To be recomputed:  0.390625 %
 --- 29/89 --- Tolerance: 0.14357 in Vanish ----  To be recomputed:  0.390625 %
 --- 30/89 --- Tolerance: 0.14357 in Vanish ----  To be recomputed:  2.34375 %
 --- 31/89 --- Tolerance: 0.14357 in Vanish ----  To be recomputed:  0.390625 %
 --- 32/89 --- Tolerance: 0.11084 in Vanish ----  To be recomputed:  0.390625 %
 --- 33/89 --- Tolerance: 0.11084 in Vanish ----  To be recomputed:  0.390625 %
 --- 34/89 --- Tolerance: 0.04774 in Vanish ----  To be recomputed:  0.390625 %
 --- 35/89 --- Tolerance: 0.04774 in Vanish ----  To be recomputed:  0.390625 %
 --- 36/89 --- Tolerance: 0.04772 in Vanish ----  To be recomputed:  0.390625 %
 --- 38/89 --- Tolerance: 0.04772 in Vanish ----  To be recomputed:  0.390625 %
 --- 39/89 --- Tolerance: 0.04769 in Vanish ----  To be recomputed:  2.34375 %
 --- 40/89 --- Tolerance: 0.04769 in Vanish ----  To be recomputed:  0.390625 %
 --- 41/89 --- Tolerance: 0.0465 in Vanish ----  To be recomputed:  0.390625 %
 --- 42/89 --- Tolerance: 0.0465 in Vanish ----  To be recomputed:  0.390625 %
 --- 43/89 --- Tolerance: 0.0226 in Vanish ----  To be recomputed:  0.390625 %
 --- 44/89 --- Tolerance: 0.0226 in Vanish ----  To be recomputed:  0.390625 %
 --- 45/89 --- Tolerance: 0.01111 in Vanish ----  To be recomputed:  0.390625 %
 --- 46/89 --- Tolerance: 0.01111 in Vanish ----  To be recomputed:  0.390625 %
 --- 47/89 --- Tolerance: 0.01109 in Vanish ----  To be recomputed:  0.390625 %
 --- 48/89 --- Tolerance: 0.01109 in Vanish ----  To be recomputed:  2.34375 %
 --- 49/89 --- Tolerance: 0.01109 in Vanish ----  To be recomputed:  0.390625 %
 --- 50/89 --- Tolerance: 0.01104 in Vanish ----  To be recomputed:  0.390625 %
 --- 51/89 --- Tolerance: 0.01104 in Vanish ----  To be recomputed:  0.390625 %
 --- 52/89 --- Tolerance: 0.01098 in Vanish ----  To be recomputed:  0.390625 %
 --- 53/89 --- Tolerance: 0.01098 in Vanish ----  To be recomputed:  0.390625 %
 --- 54/89 --- Tolerance: 0.00564 in Vanish ----  To be recomputed:  0.390625 %
 --- 55/89 --- Tolerance: 0.00564 in Vanish ----  To be recomputed:  0.390625 %
 --- 56/89 --- Tolerance: 0.00483 in Vanish ----  To be recomputed:  0.390625 %
 --- 57/89 --- Tolerance: 0.00483 in Vanish ----  To be recomputed:  0.390625 %
 --- 58/89 --- Tolerance: 0.00482 in Vanish ----  To be recomputed:  0.390625 %
 --- 59/89 --- Tolerance: 0.00482 in Vanish ----  To be recomputed:  0.390625 %
 --- 60/89 --- Tolerance: 0.00482 in Vanish ----  To be recomputed:  0.390625 %
 --- 61/89 --- Tolerance: 0.00481 in Vanish ----  To be recomputed:  2.34375 %
 --- 62/89 --- Tolerance: 0.00481 in Vanish ----  To be recomputed:  0.390625 %
 --- 63/89 --- Tolerance: 0.00412 in Vanish ----  To be recomputed:  0.390625 %
 --- 64/89 --- Tolerance: 0.00412 in Vanish ----  To be recomputed:  0.390625 %
 --- 65/89 --- Tolerance: 0.00176 in Vanish ----  To be recomputed:  0.390625 %
 --- 66/89 --- Tolerance: 0.00176 in Vanish ----  To be recomputed:  0.390625 %
 --- 67/89 --- Tolerance: 0.00123 in Vanish ----  To be recomputed:  0.390625 %
 --- 68/89 --- Tolerance: 0.00123 in Vanish ----  To be recomputed:  0.390625 %
 --- 69/89 --- Tolerance: 0.00122 in Vanish ----  To be recomputed:  0.390625 %
 --- 70/89 --- Tolerance: 0.00122 in Vanish ----  To be recomputed:  2.34375 %
 --- 71/89 --- Tolerance: 0.00122 in Vanish ----  To be recomputed:  0.390625 %
 --- 72/89 --- Tolerance: 0.00121 in Vanish ----  To be recomputed:  0.390625 %
 --- 73/89 --- Tolerance: 0.00121 in Vanish ----  To be recomputed:  0.390625 %
 --- 74/89 --- Tolerance: 0.00108 in Vanish ----  To be recomputed:  0.390625 %
 --- 75/89 --- Tolerance: 0.00108 in Vanish ----  To be recomputed:  0.390625 %
 --- 76/89 --- Tolerance: 0.00049 in Vanish ----  To be recomputed:  0.390625 %
 --- 77/89 --- Tolerance: 0.00049 in Vanish ----  To be recomputed:  0.390625 %
 --- 78/89 --- Tolerance: 0.00026 in Vanish ----  To be recomputed:  0.390625 %
 --- 79/89 --- Tolerance: 0.00026 in Vanish ----  To be recomputed:  0.390625 %
 --- 80/89 --- Tolerance: 0.00026 in Vanish ----  To be recomputed:  0.390625 %
 --- 81/89 --- Tolerance: 0.00026 in Vanish ----  To be recomputed:  2.34375 %
 --- 82/89 --- Tolerance: 0.00026 in Vanish ----  To be recomputed:  0.390625 %
 --- 83/89 --- Tolerance: 0.00024 in Vanish ----  To be recomputed:  0.390625 %
 --- 84/89 --- Tolerance: 0.00024 in Vanish ----  To be recomputed:  0.390625 %
 --- 85/89 --- Tolerance: 0.0002 in Vanish ----  To be recomputed:  0.390625 %
 --- 86/89 --- Tolerance: 0.0002 in Vanish ----  To be recomputed:  0.390625 %
 --- 87/89 --- Tolerance: 0.00014 in Vanish ----  To be recomputed:  0.390625 %
 --- 88/89 --- Tolerance: 0.00014 in Vanish ----  To be recomputed:  0.390625 %
 --- 89/89 --- Tolerance: 0.0001 in Vanish ----  To be recomputed:  0.390625 %

Shift


In [ ]:
vis, eps, PotentialUpdated, recomputefractionsafe, errorplotinfo, errorworst, errorbest = result(pglod ,world, A, M1, f, k, 'One Step Move')

safeShift(ROOT, M1, vis, eps, PotentialUpdated, recomputefractionsafe, errorplotinfo, errorworst, errorbest)


-------------- One Step Move ---------------
Not Recomputed!
 --- 1/88 --- Tolerance: 1.9145 in One Step Move ----  To be recomputed:  0.0 %
 --- 2/88 --- Tolerance: 1.9145 in One Step Move ----  To be recomputed:  0.390625 %
 --- 3/88 --- Tolerance: 1.79657 in One Step Move ----  To be recomputed:  0.390625 %
 --- 4/88 --- Tolerance: 1.78866 in One Step Move ----  To be recomputed:  0.78125 %
 --- 5/88 --- Tolerance: 1.78866 in One Step Move ----  To be recomputed:  0.390625 %
 --- 6/88 --- Tolerance: 1.78814 in One Step Move ----  To be recomputed:  0.390625 %
 --- 7/88 --- Tolerance: 1.78814 in One Step Move ----  To be recomputed:  0.390625 %
 --- 8/88 --- Tolerance: 1.78811 in One Step Move ----  To be recomputed:  0.390625 %
 --- 9/88 --- Tolerance: 1.78811 in One Step Move ----  To be recomputed:  2.34375 %
 --- 10/88 --- Tolerance: 1.78811 in One Step Move ----  To be recomputed:  0.390625 %
 --- 11/88 --- Tolerance: 0.47637 in One Step Move ----  To be recomputed:  0.390625 %
 --- 12/88 --- Tolerance: 0.47637 in One Step Move ----  To be recomputed:  0.390625 %
 --- 13/88 --- Tolerance: 0.47209 in One Step Move ----  To be recomputed:  0.390625 %
 --- 14/88 --- Tolerance: 0.47209 in One Step Move ----  To be recomputed:  0.390625 %
 --- 15/88 --- Tolerance: 0.47151 in One Step Move ----  To be recomputed:  0.390625 %
 --- 16/88 --- Tolerance: 0.47151 in One Step Move ----  To be recomputed:  0.390625 %
 --- 17/88 --- Tolerance: 0.47146 in One Step Move ----  To be recomputed:  0.390625 %
 --- 18/88 --- Tolerance: 0.47146 in One Step Move ----  To be recomputed:  2.34375 %
 --- 19/88 --- Tolerance: 0.47146 in One Step Move ----  To be recomputed:  0.390625 %
 --- 20/88 --- Tolerance: 0.31969 in One Step Move ----  To be recomputed:  0.390625 %
 --- 21/88 --- Tolerance: 0.31969 in One Step Move ----  To be recomputed:  0.390625 %
 --- 22/88 --- Tolerance: 0.25066 in One Step Move ----  To be recomputed:  0.390625 %
 --- 23/88 --- Tolerance: 0.25066 in One Step Move ----  To be recomputed:  0.390625 %
 --- 24/88 --- Tolerance: 0.25065 in One Step Move ----  To be recomputed:  0.390625 %
 --- 25/88 --- Tolerance: 0.25065 in One Step Move ----  To be recomputed:  0.390625 %
 --- 26/88 --- Tolerance: 0.25063 in One Step Move ----  To be recomputed:  0.390625 %
 --- 27/88 --- Tolerance: 0.25063 in One Step Move ----  To be recomputed:  2.34375 %
 --- 28/88 --- Tolerance: 0.25063 in One Step Move ----  To be recomputed:  0.390625 %
 --- 29/88 --- Tolerance: 0.24619 in One Step Move ----  To be recomputed:  0.390625 %
 --- 30/88 --- Tolerance: 0.24619 in One Step Move ----  To be recomputed:  0.390625 %
 --- 31/88 --- Tolerance: 0.21264 in One Step Move ----  To be recomputed:  0.390625 %
 --- 32/88 --- Tolerance: 0.21264 in One Step Move ----  To be recomputed:  0.390625 %
 --- 33/88 --- Tolerance: 0.04925 in One Step Move ----  To be recomputed:  0.390625 %
 --- 34/88 --- Tolerance: 0.04925 in One Step Move ----  To be recomputed:  0.390625 %
 --- 35/88 --- Tolerance: 0.04923 in One Step Move ----  To be recomputed:  0.390625 %
 --- 36/88 --- Tolerance: 0.04923 in One Step Move ----  To be recomputed:  0.390625 %
 --- 37/88 --- Tolerance: 0.04923 in One Step Move ----  To be recomputed:  0.390625 %
 --- 38/88 --- Tolerance: 0.04917 in One Step Move ----  To be recomputed:  2.34375 %
 --- 39/88 --- Tolerance: 0.04917 in One Step Move ----  To be recomputed:  0.390625 %
 --- 40/88 --- Tolerance: 0.04807 in One Step Move ----  To be recomputed:  0.390625 %
 --- 41/88 --- Tolerance: 0.04807 in One Step Move ----  To be recomputed:  0.390625 %
 --- 42/88 --- Tolerance: 0.02358 in One Step Move ----  To be recomputed:  0.390625 %
 --- 43/88 --- Tolerance: 0.02358 in One Step Move ----  To be recomputed:  0.390625 %
 --- 44/88 --- Tolerance: 0.02133 in One Step Move ----  To be recomputed:  0.390625 %
 --- 45/88 --- Tolerance: 0.02133 in One Step Move ----  To be recomputed:  0.390625 %
 --- 46/88 --- Tolerance: 0.021 in One Step Move ----  To be recomputed:  0.390625 %
 --- 47/88 --- Tolerance: 0.021 in One Step Move ----  To be recomputed:  2.34375 %
 --- 48/88 --- Tolerance: 0.021 in One Step Move ----  To be recomputed:  0.390625 %
 --- 49/88 --- Tolerance: 0.02099 in One Step Move ----  To be recomputed:  0.390625 %
 --- 50/88 --- Tolerance: 0.02099 in One Step Move ----  To be recomputed:  0.390625 %
 --- 51/88 --- Tolerance: 0.02083 in One Step Move ----  To be recomputed:  0.390625 %
 --- 52/88 --- Tolerance: 0.02083 in One Step Move ----  To be recomputed:  0.390625 %
 --- 53/88 --- Tolerance: 0.01155 in One Step Move ----  To be recomputed:  0.390625 %
 --- 54/88 --- Tolerance: 0.01155 in One Step Move ----  To be recomputed:  0.390625 %
 --- 55/88 --- Tolerance: 0.00497 in One Step Move ----  To be recomputed:  0.390625 %
 --- 56/88 --- Tolerance: 0.00497 in One Step Move ----  To be recomputed:  0.390625 %
 --- 57/88 --- Tolerance: 0.00496 in One Step Move ----  To be recomputed:  0.390625 %
 --- 58/88 --- Tolerance: 0.00496 in One Step Move ----  To be recomputed:  0.390625 %
 --- 59/88 --- Tolerance: 0.00496 in One Step Move ----  To be recomputed:  0.390625 %
 --- 60/88 --- Tolerance: 0.00495 in One Step Move ----  To be recomputed:  2.34375 %
 --- 61/88 --- Tolerance: 0.00495 in One Step Move ----  To be recomputed:  0.390625 %
 --- 62/88 --- Tolerance: 0.00424 in One Step Move ----  To be recomputed:  0.390625 %
 --- 63/88 --- Tolerance: 0.00424 in One Step Move ----  To be recomputed:  0.390625 %
 --- 64/88 --- Tolerance: 0.00228 in One Step Move ----  To be recomputed:  0.390625 %
 --- 65/88 --- Tolerance: 0.00228 in One Step Move ----  To be recomputed:  0.390625 %
 --- 66/88 --- Tolerance: 0.00226 in One Step Move ----  To be recomputed:  0.390625 %
 --- 67/88 --- Tolerance: 0.00226 in One Step Move ----  To be recomputed:  2.34375 %
 --- 68/88 --- Tolerance: 0.00226 in One Step Move ----  To be recomputed:  0.390625 %
 --- 69/88 --- Tolerance: 0.00225 in One Step Move ----  To be recomputed:  0.390625 %
 --- 70/88 --- Tolerance: 0.00225 in One Step Move ----  To be recomputed:  0.390625 %
 --- 71/88 --- Tolerance: 0.00209 in One Step Move ----  To be recomputed:  0.390625 %
 --- 72/88 --- Tolerance: 0.00209 in One Step Move ----  To be recomputed:  0.390625 %
 --- 73/88 --- Tolerance: 0.00184 in One Step Move ----  To be recomputed:  0.390625 %
 --- 74/88 --- Tolerance: 0.00184 in One Step Move ----  To be recomputed:  0.390625 %
 --- 75/88 --- Tolerance: 0.00095 in One Step Move ----  To be recomputed:  0.390625 %
 --- 76/88 --- Tolerance: 0.00095 in One Step Move ----  To be recomputed:  0.390625 %
 --- 77/88 --- Tolerance: 0.00027 in One Step Move ----  To be recomputed:  0.390625 %
 --- 78/88 --- Tolerance: 0.00027 in One Step Move ----  To be recomputed:  0.390625 %
 --- 79/88 --- Tolerance: 0.00027 in One Step Move ----  To be recomputed:  0.390625 %
 --- 80/88 --- Tolerance: 0.00027 in One Step Move ----  To be recomputed:  2.34375 %
 --- 81/88 --- Tolerance: 0.00027 in One Step Move ----  To be recomputed:  0.390625 %
 --- 82/88 --- Tolerance: 0.00025 in One Step Move ----  To be recomputed:  0.390625 %
 --- 83/88 --- Tolerance: 0.00025 in One Step Move ----  To be recomputed:  0.390625 %
 --- 84/88 --- Tolerance: 0.00021 in One Step Move ----  To be recomputed:  0.390625 %
 --- 85/88 --- Tolerance: 0.00021 in One Step Move ----  To be recomputed:  0.390625 %
 --- 86/88 --- Tolerance: 0.00015 in One Step Move ----  To be recomputed:  0.390625 %
 --- 87/88 --- Tolerance: 0.00015 in One Step Move ----  To be recomputed:  0.390625 %
 --- 88/88 --- Tolerance: 0.0001 in One Step Move ----  To be recomputed:  0.390625 %