sys.exit("ERROR!!! Please, specify the input file with the '-i' option \n\n"+HELP_MSG)

print " >> OVEWRITING SETTINGS by params.ini  "
PPU.loadParams( 'params.ini' )

print " ========= get electrostatic forcefiled from hartree "

# TODO with time implement reading a hartree potential generated by different software
print " loading Hartree potential from disk "

if(options.input.lower().endswith(".xsf") ):
    print "Use loadXSF"
    V, lvec, nDim, head = GU.loadXSF(options.input)
elif(options.input.lower().endswith(".cube") ):
    print "Use loadCUBE"
    V, lvec, nDim, head = GU.loadCUBE(options.input)
    V*=27.211396132
else:
    sys.exit("ERROR!!! Unknown format of the input file\n\n"+HELP_MSG)
rho = None
multipole = None
if options.tip in {'s','px','py','pz','dx2','dy2','dz2','dxy','dxz','dyz'}:
    rho = None
    multipole={options.tip:1.0}
elif options.tip.endswith(".xsf"):
    rho, lvec_tip, nDim_tip, tiphead = GU.loadXSF(options.tip)
    if any(nDim_tip != nDim):
        sys.exit("Error: Input file for tip charge density has been specified, but the dimensions are incompatible with the Hartree potential file!")    

print " computing convolution with tip by FFT "
Fel_x,Fel_y,Fel_z = fFFT.potential2forces(V, lvec, nDim, rho=rho, sigma = options.sigma, multipole = multipole)
Esempio n. 2
0
if options.input==None:
    sys.exit("ERROR!!! Please, specify the input file with the '-i' option \n\n"+HELP_MSG)

print " >> OVEWRITING SETTINGS by params.ini  "
PPU.loadParams( 'params.ini' )

print " ========= get electrostatic forcefiled from hartree "

# TODO with time implement reading a hartree potential generated by different software
print " loading Hartree potential from disk "
if(options.input.lower().endswith(".xsf") ):
    print "Use loadXSF"
    V, lvec, nDim, head = GU.loadXSF(options.input)
elif(options.input.lower().endswith(".cube") ):
    print "Use loadCUBE"
    V, lvec, nDim, head = GU.loadCUBE(options.input)
    V*=27.211396132
else:
    sys.exit("ERROR!!! Unknown format of the input file\n\n"+HELP_MSG)
rho = None
sigma = options.sigma if ( options.sigma > 0.0) else PPU.params['sigma']
multipole = None

if (options.tip.endswith(".xsf") or options.tip.endswith(".cube") ) :
    rho, lvec_tip, nDim_tip, tiphead = GU.loadXSF(options.tip) if (options.tip.endswith(".xsf")) else GU.loadCUBE(options.tip)
    if (nDim_tip != nDim):
        sys.exit("Error: Input file for tip charge density has been specified, but the dimensions are incompatible with the Hartree potential file!")    
else:
    multipole = {options.tip:1.0} if ( options.tip in {'s','px','py','pz','dx2','dy2','dz2','dxy','dxz','dyz'} ) else {PPU.params['tip']:1.0}

print " computing convolution with tip by FFT "
Esempio n. 3
0
        "ERROR!!! Please, specify the input file with the '-i' option \n\n" +
        HELP_MSG)

print(" >> OVEWRITING SETTINGS by params.ini  ")
PPU.loadParams('params.ini')

print(" ========= get electrostatic forcefiled from hartree ")

# TODO with time implement reading a hartree potential generated by different software
print(" loading Hartree potential from disk ")
if (options.input.lower().endswith(".xsf")):
    print("Use loadXSF")
    V, lvec, nDim, head = GU.loadXSF(options.input)
elif (options.input.lower().endswith(".cube")):
    print("Use loadCUBE")
    V, lvec, nDim, head = GU.loadCUBE(options.input)
    V *= 27.211396132
else:
    sys.exit("ERROR!!! Unknown format of the input file\n\n" + HELP_MSG)

if options.prolongez[0] > 0.0:
    V = np.array(V)
    assert options.prolongez[0] < lvec[
        3, 2], "prolongez is higher than height of the cell"
    print("prolonging_z at height %f by appr. %f" %
          (options.prolongez[0], options.prolongez[1]))
    #print "Debug: nDim", nDim
    nz = int(nDim[0] * options.prolongez[0] / lvec[3, 2])
    nn = int(nDim[0] * options.prolongez[1] / lvec[3, 2])
    print("this means adding %i new z-voxels in between above z-voxel %i" %
          (nn, nz))