def getBlockForce(filename,
                  option=1,
                  units='metal',
                  dimensions=3,
                  energyindex=2,
                  subdir='Log_Files/'):
    xvec, energyvec, npoints = energySub(filename, energyindex, units,
                                         dimensions, subdir)
    if option == 1:  # get force curve
        return np.column_stack((xvec, Mmath.getDiffVec(xvec, -energyvec)))
def parseCrackData(crackdata, cR, option, timeincrement=0.002):
    time = crackdata[:, 0] * timeincrement
    xposition = crackdata[:, 3] - crackdata[0, 3]
    velocity = Mmath.getDiffVec(time, xposition)
    velocitynorm = velocity / cR
    if option == 1:  # position vs. time
        return [time, xposition]
    elif option == 2:  # normalized velocity vs. time
        return [time, velocitynorm]
    elif option == 3:  # normalized velocity vs. position
        return [xposition, velocitynorm]
def parseCrackData(crackdata,cR,option,timeincrement=0.002):
    time = crackdata[:,0]*timeincrement
    xposition = crackdata[:,3] - crackdata[0,3]
    velocity = Mmath.getDiffVec(time,xposition)
    velocitynorm = velocity/cR
    if option == 1: # position vs. time
        return [time,xposition]
    elif option == 2: # normalized velocity vs. time
        return [time,velocitynorm]
    elif option == 3: # normalized velocity vs. position
        return [xposition,velocitynorm]
def genPotential(dimensions,ep,rvec=rvecmaster,style='New',extend=False,**kwargs):
    if style == 'Old':
        paramsfun, energyfun = solveEqnsOld, getEnergyOld
    elif style == 'New':
        paramsfun, energyfun = solveEqnsNew, getEnergyNew
    paramsdict = paramsfun(dimensions,ep,**kwargs) # pass kwargs to change defaults of solveEqns (e.g. offset, alphabar, etc.)
    energyvec = np.array([energyfun(rbar,**paramsdict) for rbar in rvec/r0])
    forcevec = Mmath.getDiffVec(rvec,-energyvec)
    if extend:
        rvec, energyvec, forcevec = extendToZero(rvec,energyvec,forcevec)
    numvec = np.arange(np.shape(forcevec)[0])+1
    return np.column_stack((numvec,rvec,energyvec,forcevec)), paramsdict
def getAll(rvec=rvecmaster,style='New',extend=False,**kwargs): # pass ep for New Potential; pass r3bar for Warner
    if style == 'Warner': # old
        paramsfun, energyfun = solveEqnsWarner, getEnergyWarner
    elif style == 'New':
        paramsfun, energyfun = solveEqnsNew, getEnergyNew
    paramsdict = paramsfun(**kwargs)
    energyvec = np.array(getEnergyLoop(rvec/r0,paramsdict,energyfun))
    forcevec = Mmath.getDiffVec(rvec,-energyvec)
    if extend:
        rvec, energyvec, forcevec = extendToZero(rvec,energyvec,forcevec)
    numvec = np.arange(np.shape(forcevec)[0])+1
    return np.column_stack((numvec,rvec,energyvec,forcevec)), paramsdict
def getAll(rvec=rvecmaster,
           style='New',
           extend=False,
           **kwargs):  # pass ep for New Potential; pass r3bar for Warner
    if style == 'Warner':  # old
        paramsfun, energyfun = solveEqnsWarner, getEnergyWarner
    elif style == 'New':
        paramsfun, energyfun = solveEqnsNew, getEnergyNew
    paramsdict = paramsfun(**kwargs)
    energyvec = np.array(getEnergyLoop(rvec / r0, paramsdict, energyfun))
    forcevec = Mmath.getDiffVec(rvec, -energyvec)
    if extend:
        rvec, energyvec, forcevec = extendToZero(rvec, energyvec, forcevec)
    numvec = np.arange(np.shape(forcevec)[0]) + 1
    return np.column_stack((numvec, rvec, energyvec, forcevec)), paramsdict
def parseCrackData(crackdata,cR,option,r0=2**(1/6),timeincrement=0.002,cL=1.0):
    time = crackdata[:,0]*timeincrement
    xposition = crackdata[:,3] - crackdata[0,3]
    velocity = Mmath.getDiffVec(time,xposition)
    timenorm = time/(r0/cL)
    velocitynorm = velocity/cR
    xpositionnorm = xposition/r0
    if option == 1: # position vs. time
        return [time,xposition]
    elif option == 2: # normalized velocity vs. time
        return [time,velocitynorm]
    elif option == 3: # normalized velocity vs. position
        return [xposition,velocitynorm]
    elif option == 4:
        return [timenorm,velocitynorm]
    elif option == 5:
        return [xpositionnorm,velocitynorm]
def genPotential(dimensions,
                 ep,
                 rvec=rvecmaster,
                 style='New',
                 extend=False,
                 **kwargs):
    if style == 'Old':
        paramsfun, energyfun = solveEqnsOld, getEnergyOld
    elif style == 'New':
        paramsfun, energyfun = solveEqnsNew, getEnergyNew
    paramsdict = paramsfun(
        dimensions, ep, **kwargs
    )  # pass kwargs to change defaults of solveEqns (e.g. offset, alphabar, etc.)
    energyvec = np.array([energyfun(rbar, **paramsdict) for rbar in rvec / r0])
    forcevec = Mmath.getDiffVec(rvec, -energyvec)
    if extend:
        rvec, energyvec, forcevec = extendToZero(rvec, energyvec, forcevec)
    numvec = np.arange(np.shape(forcevec)[0]) + 1
    return np.column_stack((numvec, rvec, energyvec, forcevec)), paramsdict
Example #9
0
def parseCrackData(crackdata,
                   cR,
                   option,
                   r0=2**(1 / 6),
                   timeincrement=0.002,
                   cL=1.0):
    time = crackdata[:, 0] * timeincrement
    xposition = crackdata[:, 3] - crackdata[0, 3]
    velocity = Mmath.getDiffVec(time, xposition)
    timenorm = time / (r0 / cL)
    velocitynorm = velocity / cR
    xpositionnorm = xposition / r0
    if option == 1:  # position vs. time
        return [time, xposition]
    elif option == 2:  # normalized velocity vs. time
        return [time, velocitynorm]
    elif option == 3:  # normalized velocity vs. position
        return [xposition, velocitynorm]
    elif option == 4:
        return [timenorm, velocitynorm]
    elif option == 5:
        return [xpositionnorm, velocitynorm]
def getBlockForce(filename,option=1,units='metal',dimensions=3,energyindex=2,subdir='Log_Files/'):
    xvec, energyvec, npoints = energySub(filename,energyindex,units,dimensions,subdir)
    if option == 1: # get force curve
        return np.column_stack((xvec,Mmath.getDiffVec(xvec,-energyvec)))