Esempio n. 1
0
def testdphidrc():
    LDCuts = [4., 5., 6.,]
    Delta = 1.2
    r = np.linspace(0,8., 100)
    
    for LDCut in LDCuts:
        coeff, dcoeff = alg.calcCoeff(LDCut = LDCut, Delta = Delta)
        dphidrc = dcoeff[0] + dcoeff[1]*r**2. + dcoeff[2]*r**4. + dcoeff[3]*r**6.
        plt.figure
        plt.plot(r, dphidrc, label = 'LDCUT = %g' % LDCut, linewidth = 3)

    plt.legend(); plt.xlabel(r'$r$'); plt.ylabel(r'$\frac{d\phi}{dr_c} (r)$')
Esempio n. 2
0
def testphi():
    LDCut = 6.5
    Delta = 1.2
    r = np.linspace(LDCut-Delta-0.5, LDCut+2.0, 100)
    coeff, dcoeff = alg.calcCoeff(LDCut = LDCut, Delta = Delta)
    phi = np.zeros(100)
    
    for n in range(100):
        if r[n] <= LDCut - Delta: phi[n] = 1.0
        elif r[n] >= LDCut: phi[n] = 0.0
        else:   phi[n] = coeff[0] + coeff[1]*r[n]**2. + coeff[2]*r[n]**4. + coeff[3]*r[n]**6.
    plt.figure
    plt.plot(r, phi, linewidth = 3)
    plt.xlabel(r'$r$'); plt.ylabel(r'$\phi(r)$')
Esempio n. 3
0
#various indexing schemes
TrjIter = {'AA': [0, -1, 10], 'CG': [0, -1, 10]}

# compile fortcode
fcompile()
from dSreldrc_fortlib import getdudrc
Trj_AA = pickleTraj(LammpsTraj)
BoxL = Trj_AA.FrameData['BoxL'][0]

#begin looping over different LD cutoffs
for i, LDCut in enumerate(LDCuts):
	
	print '\n\nLDCut = %g\n' % LDCut
	
	#calculate coefficients
	(coeff, dcoeff) = alg.calcCoeff(LDCut = LDCut, Delta = 1.2)

	#get AA and CG trj
	Trj_CG = pickleTraj(base_fmt['cg_trj'] % (fftype, i))
	
	#get Spline Coeffs for CG forcefield
	ffield_CG = base_fmt['cg_ff'] % (fftype, i)
	paramstring = parse_potential.parseParamString(ffield_CG)
	Sys = alg.makeSys(LDCut = LDCuts[i], Delta = Delta, BoxL = BoxL, fftype = fftype, Prefix = 'ldsplinecoeff',
                      paramstring = paramstring, sample_trajtype = 'CG', eval_trajtype = 'CG', SysData = SysData)

	(nknot, spdist, spc0, spc1, spc2, spc3) = alg.getLDSpline(Sys = Sys)

	for key in TrjIter.keys():
	   if TrjIter[key][1] == -1:
	       if key == 'AA': TrjIter[key][1] = len(Trj_AA)