Example #1
0
def single_E_calc(gamma, scan, scan_dir, fwd_ic, bwd_ic):

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]
    savesuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega"]

    scan['\\gamma_s'] = str(gamma)

    ic_dict = {}

    if scan_dir == "scanforward":

        ic_dict = fwd_ic

    elif scan_dir == "scanbackward":

        ic_dict = bwd_ic

    scan['Rguess'] = str(ic_dict['Rguess0'])
    scan['Rupper'] = str(ic_dict['Rupper0'])
    scan['Rlower'] = str(ic_dict['Rlower0'])

    scan['etaguess'] = str(ic_dict['etaguess0'])
    scan['etaupper'] = str(ic_dict['etaupper0'])
    scan['etalower'] = str(ic_dict['etalower0'])

    scan['deltaguess'] = str(ic_dict['deltaguess0'])
    scan['deltaupper'] = str(ic_dict['deltaupper0'])
    scan['deltalower'] = str(ic_dict['deltalower0'])

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, scan_dir=scan_dir)

    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')

    # load the final values of E, R, eta, delta, and surface twist.
    Ei, Ri, etai, deltai, surftwisti = run.get_all_observables('observables',
                                                               str2float=True)

    run.concatenate_observables(["\\gamma_s"])

    return Ei, Ri, etai, deltai
Example #2
0
import numpy as np
import subprocess
import sys
sys.path.append('../../gammak24_singlepoint/')
from singlerun import SingleRun

if __name__ == "__main__":

    run = SingleRun("data/input.dat")

    run.run_exe()

    run.mv_file('psivsr')

    run.mv_file('observables')

    run.concatenate_observables()
Example #3
0
    scan['\\gamma_s'] = gamma
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s"]
    savesuf = ["K_{33}", "k_{24}", "d_0", "\\omega", "\\gamma_s"]
    scan_dir = "scanforward"

    # first, load the minimum for delta = 0 case, so you know the upper bound for
    # the energy minimum.

    scan['\\Lambda'] = '0'
    scan['\\omega'] = '0'

    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    run = SingleRun(rp)

    E0, R0, eta0, delta0, surftwist0 = run.get_all_observables(
        'observables_Emin', str2float=True)

    scan['\\omega'] = omega

    scan['Rguess'] = str(R0)
    scan['Rupper'] = str(1.5 * R0)
    scan['Rlower'] = str(0.75 * R0)

    i = 0
    while (i < len(Lambdas)):

        Lambda = Lambdas[i]
Example #4
0
    scan['\\gamma_s'] = gamma
    scan['\\omega'] = omega
    scan['\\Lambda'] = Lambda

    loadsuf = savesuf = [
        "K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"
    ]

    scan_dir = "scanforward"

    # first, load the minimum for delta = 0 case, so you know the upper bound for
    # the energy minimum.

    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    run = SingleRun(rp)

    strains = np.linspace(0, 0.05, num=501, endpoint=True)

    #if float(Lambda) > 25.0:

    #    scan['Rguess'] = str(np.log(float(Lambda)))
    #    scan['Rupper'] = str(float(scan['Rguess'])*1.3)
    #    scan['Rlower'] = str(float(scan['Rguess'])*0.75)
    #    scan['deltaguess'] = '0.815'
    #    scan['deltalower'] = '0.81'
    #    scan['etaguess'] = '6.4'
    #    scan['etaupper'] = '6.45'

    for i, u in enumerate(strains):
    if len(sys.argv) < 5:

        user_input = input("input string of a gamma,k24,Lambda,omega values, "
                           "using comma as delimiter: ")
        gamma, k24, Lambda, omega = user_input.split(',')

    else:
        gamma, k24, Lambda, omega = sys.argv[1], sys.argv[2], sys.argv[
            3], sys.argv[4]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, executable="../../../bin/full3var_psivsr")
    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')
    run.mv_file('psivsr')
Example #6
0
from scipy.integrate import simps, romb

if __name__ == "__main__":

    if len(sys.argv) < 5:

        user_input = input("input string of a gamma,k24,Lambda,omega values, "
                           "using comma as delimiter: ")
        gamma, k24, Lambda, omega = user_input.split(',')

    else:
        gamma, k24, Lambda, omega = sys.argv[1], sys.argv[2], sys.argv[
            3], sys.argv[4]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, executable="../../../bin/derivatives")
    # run C executable.
    run.run_exe()
Example #7
0
import numpy as np
import subprocess
import sys
sys.path.append('../../modules_gammak24/')
from singlerun import SingleRun
from readparams import ReadParams

if __name__ == "__main__":

    gamma, k24 = sys.argv[1], sys.argv[2]

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s"]
    savesuf = ["K_{33}", "k_{24}", "d_0", "\\omega", "\\gamma_s"]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\omega'] = '0'
    scan['\\Lambda'] = '0'

    # find minimum for delta = 0 case, so you know the upper bound for
    # the energy minimum.

    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    run = SingleRun(rp)

    run.run_exe()

    run.mv_file('observables', newname='observables_Emin')
Example #8
0
        
    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda']=Lambda
    scan['\\omega']= omega
    
    loadsuf=["K_{33}","k_{24}","\\Lambda","\\omega","\\gamma_s"]


    # read in file name info
    rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=loadsuf)
        
    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,executable="../../../bin/samplecalc_testEvspsip_s")
    # run C executable.
    run.run_exe()
    dataname = run.mv_file('Evspsip_s')

    data = np.loadtxt(dataname)


    psip_ss = data[:,0]
    Es = data[:,1]
    dEdpsip_ss = data[:,2]

    # determine where the min of Es occurs
    i_min = np.argmin(Es)

    # determine where the zero of dEdpsip_ss occur (should be at the same spot
Example #9
0

    gammas = np.array([0.025,0.05,0.075,0.1,0.125,0.15,0.175],float)

    scan = {}
    scan['k_{24}'] = k24
    scan['\Lambda']=Lambda
    scan['\omega']=omega



    for gamma in gammas:
        
        scan['\gamma_s'] = str(gamma)
        
        run = SingleRun("data/input.dat",scan)

        run.run_exe()

        run.mv_file('psivsr')

        run.mv_file('observables')

        
        Rguess,etaguess,deltaguess = run.get_xvals()

        scan['Rguess'] = Rguess
        scan['Rupper'] = str(1.5*float(Rguess))
        scan['Rlower'] = str(0.75*float(Rguess))

        if not np.isnan(float(etaguess)):
def single_E_calc(gamma,scan,loadsuf,savesuf,scan_dir):

    scan['\\gamma_s'] = str(gamma)

    k240 = 0.33

    k24 = float(scan['k_{24}'])

    t = (k24-k240)/k240

    if scan_dir == "scanforward":

        #Rguess0 = 0.045
        #Rupper0 = 0.6
        #Rlower0 = 0.4

        Rguess0 = lower_Rguess(t)
        Rupper0 = Rguess0*1.1
        Rlower0 = Rguess0*0.9

        etaguess0 = 6.295
        etalower0 = 6.29
        etaupper0 = 6.3

        deltaguess0 = 0.8
        deltalower0 = 0.799
        deltaupper0 = 0.805

    else:

        #Rguess0 = 0.7
        #Rupper0 = 0.9
        #Rlower0 = 0.6

        Rguess0 = upper_Rguess(t)
        Rupper0 = Rguess0*1.1
        Rlower0 = Rguess0*0.9

        etaguess0 = 6.34
        etalower0 = 6.32
        etaupper0 = 6.36

        deltaguess0 = 0.813
        deltalower0 = 0.808
        deltaupper0 = 0.816


    scan['Rguess'] = str(Rguess0)
    scan['Rupper'] = str(Rupper0)
    scan['Rlower'] = str(Rlower0)

    scan['etaguess'] = str(etaguess0)
    scan['etaupper'] = str(etaupper0)
    scan['etalower'] = str(etalower0)

    scan['deltaguess'] = str(deltaguess0)
    scan['deltaupper'] = str(deltaupper0)
    scan['deltalower'] = str(deltalower0)


    # read in file name info
    rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=savesuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,scan_dir=scan_dir)

    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')

    # load the final values of E, R, eta, delta, and surface twist.
    Ei,Ri,etai,deltai,surftwisti = run.get_all_observables('observables',str2float=True)

    run.concatenate_observables(["\\gamma_s"])

    return Ei,Ri
    start_time = time.time()

    if len(sys.argv) < 5:

        user_input = input("input string of a gamma,k24,Lambda,omega values, "
                           "using comma as delimiter: ")
        gamma, k24, Lambda, omega = user_input.split(',')

    else:
        gamma, k24, Lambda, omega = sys.argv[1], sys.argv[2], sys.argv[
            3], sys.argv[4]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, executable="../../../bin/full_onerun")
    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')
Example #12
0
        gamma, k24, Lambda, omega = sys.argv[1], sys.argv[2], sys.argv[
            3], sys.argv[4]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, executable="../../../bin/EvsR_s")
    # run C executable.
    run.run_exe()
    dataname = run.mv_file('EvsR_s')

    data = np.loadtxt(dataname)

    R_ss = data[:, 0]
    Es = data[:, 1]
    dEdR_ss = data[:, 2]

    # determine where the min of Es occurs
    i_min = np.argmin(Es)

    # determine where the zero of dEdR_ss occur (should be at the same spot
    # as where the min above occurs according to calculus).
from readparams import ReadParams

if __name__ == "__main__":

    gamma = str(0.04)
    k24 = str(0.5)
    Lambda = str(600.0)
    omega = str(20.0)

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,
                    executable="../../../bin/psi-with-hermite-fit",
                    valgrind=False)
    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('psivsr')
    run.mv_file('hermite-psivsr')
    if len(sys.argv) < 5:

        user_input = input("input string of a gamma,k24,Lambda,omega values, "
                           "using comma as delimiter: ")
        gamma, k24, Lambda, omega = user_input.split(',')

    else:
        gamma, k24, Lambda, omega = sys.argv[1], sys.argv[2], sys.argv[
            3], sys.argv[4]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = str(Lambda)
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, executable="../../../bin/psivsr_calculation")

    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')
    run.mv_file('psivsr')
    # see user_inputs.md for details on what typically goes in these inputs.
    #    o_L_input = input("input string of omega Lambda values, "
    #                  "using comma as delimiter: ")

    #omegas_Lambdas = np.array(o_L_input.split(','),float)

    omegas_Lambdas = np.linspace(0, 10, num=101, endpoint=True)

    scan = {}

    for o_L in omegas_Lambdas:

        scan['\omega'] = str(o_L)
        scan['\Lambda'] = str(o_L)

        run = SingleRun("data/input.dat", scan)

        run.run_exe()

        #run.mv_file('psivsr')

        run.mv_file('observables')

        Rguess, etaguess, deltaguess = run.get_xvals()

        scan['Rguess'] = Rguess
        scan['Rupper'] = str(1.5 * float(Rguess))
        scan['Rlower'] = str(0.75 * float(Rguess))

        if not np.isnan(float(etaguess)):
            scan['etaguess'] = etaguess
Example #16
0
    savesuf = ["K_{33}", "k_{24}", "\\omega", "\\gamma_s"]
    scan_dir = "scanforward"

    i = 0
    while (i < len(Lambdas)):

        Lambda = Lambdas[i]

        scan['\\Lambda'] = str(Lambda)

        # read in file name info
        rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

        # create a class to do calculations with current parameters in scan.
        run = SingleRun(rp,
                        scan_dir=scan_dir,
                        executable="../../../bin/full3var_with_modulus")

        # run C executable.
        run.run_exe()

        # move file written by C executable from temporary data path to true data path
        run.mv_file('observables')

        # load the final values of E, R, eta, delta, and surface twist.
        Ei, Ri, etai, deltai, surftwisti, modulusi = run.get_all_observables(
            'observables', str2float=True)

        if (Ei > 0.1 * FAILED_E):

            # if the energy calculation fails, this will be true.
Example #17
0
    scan = {}
    scan['k_{24}'] = k24
    scan['\Lambda'] = Lambda
    scan['\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s"]
    savesuf = ["K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega"]

    for gamma in gammas:

        scan['\gamma_s'] = str(gamma)

        rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

        run = SingleRun(rp)

        run.run_exe()

        #run.mv_file('psivsr')

        run.mv_file('observables')

        Rguess, etaguess, deltaguess = run.get_xvals()

        scan['Rguess'] = Rguess
        scan['Rupper'] = str(1.5 * float(Rguess))
        scan['Rlower'] = str(0.75 * float(Rguess))

        if not np.isnan(float(etaguess)):
            scan['etaguess'] = etaguess
Example #18
0
    scan_dir = "scantmp"

    i = len(gammas) - 1
    while (i >= 0):

        gamma = gammas[i]
        scan['\\gamma_s'] = str(gamma)

        # read in file name info
        rp = ReadParams(scan=scan,
                        loadsuf=loadsuf,
                        savesuf=savesuf,
                        datfile=datfile)

        # create a class to do calculations with current parameters in scan.
        run = SingleRun(rp, scan_dir=scan_dir, tmp_path=tmp_path)

        # run C executable.
        run.run_exe()

        # move file written by C executable from temporary data path to true data path
        run.mv_file('observables')

        # load the final values of E, R, eta, delta, and surface twist.
        Ei, Ri, etai, deltai, surftwisti = run.get_all_observables(
            'observables', str2float=True)

        if (Ei > 0.1 * FAILED_E and gamma > 0.15):

            # if the energy calculation fails, this will be true.
            print('hi')
Example #19
0
import numpy as np
import subprocess
import sys
sys.path.append('../../modules_gammak24/')
from singlerun import SingleRun

if __name__ == "__main__":

    datfile = "data/input.dat"
    executable = "../../../bin/gamma_k24_space"

    scan = {'\Lambda': sys.argv[1], '\omega': sys.argv[2]}
    run = SingleRun(datfile,
                    executable=executable,
                    scan=scan,
                    suffixlist=["K_{33}", "\\Lambda", "d_0", "\\omega"])

    run.run_exe()

    run.mv_file('energy')
    run.mv_file('surfacetwist')
    run.mv_file('radius')
    run.mv_file('eta')
    run.mv_file('delta')
Example #20
0
    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\omega'] = omega
    scan['\\Lambda'] = Lambda

    loadsuf = savesuf = [
        "K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"
    ]

    # first, load the minimum for delta = 0 case, so you know the upper bound for
    # the energy minimum.

    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    run = SingleRun(rp)

    #strains = np.linspace(0,0.05,num=501,endpoint=True)

    strains = np.array([0.0, 0.0020157, 0.0034803, 0.004315], float)

    #if float(Lambda) > 25.0:

    #    scan['Rguess'] = str(np.log(float(Lambda)))
    #    scan['Rupper'] = str(float(scan['Rguess'])*1.3)
    #    scan['Rlower'] = str(float(scan['Rguess'])*0.75)
    #    scan['deltaguess'] = '0.815'
    #    scan['deltalower'] = '0.81'
    #    scan['etaguess'] = '6.4'
    #    scan['etaupper'] = '6.45'
Example #21
0
        
    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda']=Lambda
    scan['\\omega']= omega
    
    loadsuf=["K_{33}","k_{24}","\\Lambda","\\omega","\\gamma_s"]


    # read in file name info
    rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=loadsuf)
        
    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,executable="../../../bin/f2_func")
    # run C executable.
    run.run_exe()
    dataname = run.mv_file('f2_func')

    data = np.loadtxt(dataname)


    zetas = data[:,0]
    f2s = data[:,1]
    df2dxis = data[:,2]
    df2dzetas = data[:,3]
        

    # plot Es vs psip_Rs and dEdpsip_Rs vs psip_Rs
Example #22
0
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = str(gamma)

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s"]
    savesuf = ["K_{33}", "k_{24}", "d_0", "\\gamma_s"]

    for i, Lambda in enumerate(Lambdas):

        omega = omegas[i]

        scan['\\Lambda'] = str(Lambda)
        scan['\\omega'] = str(omega)

        rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

        run = SingleRun(rp)

        run.run_exe()

        #run.mv_file('psivsr')

        run.mv_file('observables')

        Rguess, etaguess, deltaguess = run.get_xvals()

        scan['Rguess'] = Rguess
        scan['Rupper'] = str(1.5 * float(Rguess))
        scan['Rlower'] = str(0.75 * float(Rguess))

        if not np.isnan(float(etaguess)):
            scan['etaguess'] = etaguess
Example #23
0
        scan['Rguess'] = str(Rguess0)
        scan['Rupper'] = str(Rupper0)
        scan['Rlower'] = str(Rlower0)

        for j,gnew in enumerate(gnews):

            scan['\\gamma_s'] = str(gnew)

            print(gnew,k24)

            # read in file name info
            rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=savesuf)

            # create a class to do calculations with current parameters in scan.
            run = SingleRun(rp,scan_dir=scan_dir)

            # run C executable.
            run.run_exe()

            # move file written by C executable from temporary data path to true data path
            run.mv_file('observables')

            # load the final values of E, R, eta, delta, and surface twist.
            Ei,Ri,etai,deltai,surftwisti = run.get_all_observables('observables',str2float=True)




            if (np.isnan(Ri) or Ri <= 0) and gnew > 0.15:
Example #24
0
def single_E_calc(gamma, scan, loadsuf, savesuf, scan_dir):

    scan['\\gamma_s'] = str(gamma)

    if scan_dir == "scanforward":

        Rguess0 = 0.044
        Rlower0 = 0.04
        Rupper0 = 0.05

        etaguess0 = 6.29
        etalower0 = 6.3
        etaupper0 = 6.287

        deltaguess0 = 0.74
        deltalower0 = 0.72
        deltaupper0 = 0.8

    else:

        Rguess0 = 1.5
        Rlower0 = 1.0
        Rupper0 = 2.0

        etaguess0 = 6.4
        etalower0 = 6.38
        etaupper0 = 6.42

        deltaguess0 = 0.815
        deltalower0 = 0.813
        deltaupper0 = 0.816

    scan['Rguess'] = str(Rguess0)
    scan['Rupper'] = str(Rupper0)
    scan['Rlower'] = str(Rlower0)

    scan['etaguess'] = str(etaguess0)
    scan['etaupper'] = str(etaupper0)
    scan['etalower'] = str(etalower0)

    scan['deltaguess'] = str(deltaguess0)
    scan['deltaupper'] = str(deltaupper0)
    scan['deltalower'] = str(deltalower0)

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, scan_dir=scan_dir)

    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')

    # load the final values of E, R, eta, delta, and surface twist.
    Ei, Ri, etai, deltai, surftwisti = run.get_all_observables('observables',
                                                               str2float=True)

    run.concatenate_observables(["\\gamma_s"])

    return Ei, Ri
Example #25
0
    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda']=Lambda
    scan['\\omega']= omega
    scan['mpt'] = str(2**power2)
    
    loadsuf=["K_{33}","k_{24}","\\Lambda","\\omega","\\gamma_s"]


    # read in file name info
    rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=loadsuf)
        
    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,executable="../../../bin/EvsR_c-different-grid-sizes",valgrind=False)
    # run C executable.

    start = time.time()
    
    run.run_exe()

    totaltime = time.time()-start



    with open("data/timings.txt","a") as myfile:
        myfile.write(f"{scan['mpt']}\t{totaltime:e}\n")

    # move file written by C executable from temporary data path to true data path
    run.mv_file(f"EvsR_c-{scan['mpt']}")
Example #26
0
    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\omega']= omega
    scan['\\Lambda']= Lambda
    
    loadsuf=savesuf=["K_{33}","k_{24}","\\Lambda","\\omega","\\gamma_s"]

    scan_dir = "scanforward"

    # first, load the minimum for delta = 0 case, so you know the upper bound for
    # the energy minimum.

    rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=savesuf)

    run = SingleRun(rp)


    strains = np.linspace(0,0.05,num=501,endpoint=True)


    for i,u in enumerate(strains):

        if i == 0:
            
            # for the zero strain case, I need to determine what eta_eq is,
            # so I run the full 3 variable (R,eta,delta) minimization.
            
            executable = "../../../bin/full3var_onerun"
            
        else:
Example #27
0
        
    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda']=Lambda
    scan['\\omega']= omega
    
    loadsuf=["K_{33}","k_{24}","\\Lambda","\\omega","\\gamma_s"]


    # read in file name info
    rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=loadsuf)
        
    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,executable="../../../bin/samplecalc_testenergy")
    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('psivsr_discrete')



    c_data = np.loadtxt("data/_psivsr_3.0000e+01_1.0000e-01_1.0000e+03_5.0000e+00_4.0000e-02.txt")
    d_data = np.loadtxt("data/_psivsr_discrete_3.0000e+01_1.0000e-01_1.0000e+03_5.0000e+00_4.0000e-02.txt")



    c_rs = c_data[:,0]
    c_psis = c_data[:,1]
        user_input = input("input string of a gamma,k24,Lambda,omega values, "
                           "using comma as delimiter: ")
        gamma, k24, Lambda, omega = user_input.split(',')

    else:
        gamma, k24, Lambda, omega = sys.argv[1], sys.argv[2], sys.argv[
            3], sys.argv[4]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,
                    executable="../../../bin/full4var_psivsr",
                    valgrind=True)
    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')
    run.mv_file('psivsr')
Example #29
0
import time
sys.path.append('../../scripts/')
from singlerun import SingleRun
from readparams import ReadParams

if __name__ == "__main__":

    gamma = str(0.04)
    k24 = str(0.5)
    Lambda = str(600.0)
    omega = str(20.0)

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, executable="../../../bin/EvsR_c", valgrind=False)
    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')