mirror of
https://gitlab.com/scemama/eplf
synced 2025-01-03 10:05:58 +01:00
Merge branch 'master' of ssh://scemama@eplf.git.sourceforge.net/gitroot/eplf/eplf
This commit is contained in:
commit
f0689c031a
BIN
EZFIO.tar.gz
BIN
EZFIO.tar.gz
Binary file not shown.
3
Makefile
3
Makefile
@ -2,7 +2,7 @@
|
|||||||
all: bin/eplf
|
all: bin/eplf
|
||||||
|
|
||||||
EZFIO/config/eplf.config: EZFIO.tar.gz
|
EZFIO/config/eplf.config: EZFIO.tar.gz
|
||||||
tar -zxvf EZFIO.tar.gz
|
tar -zxf EZFIO.tar.gz
|
||||||
cd EZFIO ; ./configure
|
cd EZFIO ; ./configure
|
||||||
if [ -e $@ ] ; then rm $@ ; fi
|
if [ -e $@ ] ; then rm $@ ; fi
|
||||||
ln -s $$PWD/eplf.config $@
|
ln -s $$PWD/eplf.config $@
|
||||||
@ -16,7 +16,6 @@ bin/ezfio.py: EZFIO/lib/libezfio.so
|
|||||||
|
|
||||||
bin/eplf: EZFIO/lib/libezfio.so
|
bin/eplf: EZFIO/lib/libezfio.so
|
||||||
make -C src
|
make -C src
|
||||||
mv src/eplf bin
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
- rm -rf EZFIO
|
- rm -rf EZFIO
|
||||||
|
5
bin/common.py
Normal file
5
bin/common.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys, os
|
||||||
|
wd = os.path.dirname(__file__)
|
||||||
|
sys.path = [ wd+"/../EZFIO/Python" ]+sys.path
|
46
bin/to_cube.py
Executable file
46
bin/to_cube.py
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import common
|
||||||
|
|
||||||
|
# Check command line
|
||||||
|
|
||||||
|
try:
|
||||||
|
x, filename, grid_type = sys.argv
|
||||||
|
except ValueError:
|
||||||
|
print "usage: "+sys.argv[0]+" filename grid_type"
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
|
||||||
|
from ezfio import ezfio
|
||||||
|
|
||||||
|
def main():
|
||||||
|
ezfio.set_file(filename)
|
||||||
|
file = open("%s_%s.cube"%(filename,grid_type),"w")
|
||||||
|
print >>file, " Cube File"
|
||||||
|
print >>file, filename, grid_type
|
||||||
|
data = [ ezfio.nuclei_nucl_num ]+ezfio.grid_origin
|
||||||
|
print >>file, "%5d%12.6f%12.6f%12.6f" % tuple(data)
|
||||||
|
data = [ ezfio.grid_num_x, ezfio.grid_step_size[0],0.,0. ]
|
||||||
|
print >>file, "%5d%12.6f%12.6f%12.6f" % tuple(data)
|
||||||
|
data = [ ezfio.grid_num_y, 0., ezfio.grid_step_size[1],0. ]
|
||||||
|
print >>file, "%5d%12.6f%12.6f%12.6f" % tuple(data)
|
||||||
|
data = [ ezfio.grid_num_z, 0.,0., ezfio.grid_step_size[2] ]
|
||||||
|
print >>file, "%5d%12.6f%12.6f%12.6f" % tuple(data)
|
||||||
|
|
||||||
|
charge = ezfio.nuclei_nucl_charge
|
||||||
|
coord = ezfio.nuclei_nucl_coord
|
||||||
|
for i in range(ezfio.nuclei_nucl_num):
|
||||||
|
data = [ charge[i], charge[i], coord[0][i], coord[1][i], coord[2][i] ]
|
||||||
|
print >>file, "%5d%12.6f%12.6f%12.6f%12.6f" % tuple(data)
|
||||||
|
|
||||||
|
data = getattr(ezfio,"grid_data_%s"%grid_type)
|
||||||
|
for i in xrange(0,ezfio.grid_num_x):
|
||||||
|
for j in xrange(0,ezfio.grid_num_y):
|
||||||
|
for k in xrange(0,ezfio.grid_num_z,6):
|
||||||
|
for l in xrange(k,min(ezfio.grid_num_z,k+6)):
|
||||||
|
file.write (" %12.5E"%data[l][j][i])
|
||||||
|
file.write ("\n")
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
main()
|
@ -1,11 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import common
|
||||||
import sys,os,time
|
import sys,os,time
|
||||||
|
|
||||||
wd = os.path.dirname(__file__)
|
sys.path = [ "/home/scemama/resultsFile" ]+sys.path
|
||||||
sys.path += [ wd+"../EZFIO/Python" ]
|
|
||||||
sys.path += [ "/home/scemama/resultsFile" ]
|
|
||||||
|
|
||||||
from resultsFile import *
|
from resultsFile import *
|
||||||
|
|
||||||
# Check command line
|
# Check command line
|
||||||
@ -29,11 +27,11 @@ def write_ezfioFile(res,filename):
|
|||||||
ezfio.set_file(filename)
|
ezfio.set_file(filename)
|
||||||
|
|
||||||
# Electrons
|
# Electrons
|
||||||
ezfio.set_electrons_elec_alpha_num(res.num_alpha)
|
ezfio.electrons_elec_alpha_num = res.num_alpha
|
||||||
ezfio.set_electrons_elec_beta_num(res.num_beta)
|
ezfio.electrons_elec_beta_num = res.num_beta
|
||||||
|
|
||||||
# Nuclei
|
# Nuclei
|
||||||
ezfio.set_nuclei_nucl_num(len(res.geometry))
|
ezfio.nuclei_nucl_num = len(res.geometry)
|
||||||
charge = []
|
charge = []
|
||||||
coord = []
|
coord = []
|
||||||
coord_x = []
|
coord_x = []
|
||||||
@ -49,8 +47,8 @@ def write_ezfioFile(res,filename):
|
|||||||
coord_x.append(a.coord[0]/a0)
|
coord_x.append(a.coord[0]/a0)
|
||||||
coord_y.append(a.coord[1]/a0)
|
coord_y.append(a.coord[1]/a0)
|
||||||
coord_z.append(a.coord[2]/a0)
|
coord_z.append(a.coord[2]/a0)
|
||||||
ezfio.set_nuclei_nucl_charge(charge)
|
ezfio.nuclei_nucl_charge = charge
|
||||||
ezfio.set_nuclei_nucl_coord(coord_x+coord_y+coord_z)
|
ezfio.nuclei_nucl_coord = coord_x+coord_y+coord_z
|
||||||
|
|
||||||
# AO Basis
|
# AO Basis
|
||||||
import string
|
import string
|
||||||
@ -87,10 +85,10 @@ def write_ezfioFile(res,filename):
|
|||||||
if not is_cartesian:
|
if not is_cartesian:
|
||||||
print 'Only cartesian basis functions work...'
|
print 'Only cartesian basis functions work...'
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
ezfio.set_ao_basis_ao_num(len(res.basis))
|
ezfio.ao_basis_ao_num = len(res.basis)
|
||||||
ezfio.set_ao_basis_ao_nucl(at)
|
ezfio.ao_basis_ao_nucl = at
|
||||||
ezfio.set_ao_basis_ao_prim_num(num_prim)
|
ezfio.ao_basis_ao_prim_num = num_prim
|
||||||
ezfio.set_ao_basis_ao_power(power_x+power_y+power_z)
|
ezfio.ao_basis_ao_power = power_x+power_y+power_z
|
||||||
prim_num_max = ezfio.get_ao_basis_ao_prim_num_max()
|
prim_num_max = ezfio.get_ao_basis_ao_prim_num_max()
|
||||||
len_res_basis = len(res.basis)
|
len_res_basis = len(res.basis)
|
||||||
for i in range(len(res.basis)):
|
for i in range(len(res.basis)):
|
||||||
@ -104,17 +102,18 @@ def write_ezfioFile(res,filename):
|
|||||||
for j in range(i,len(coefficient),prim_num_max):
|
for j in range(i,len(coefficient),prim_num_max):
|
||||||
coef.append ( coefficient[j] )
|
coef.append ( coefficient[j] )
|
||||||
expo.append ( exponent[j] )
|
expo.append ( exponent[j] )
|
||||||
ezfio.set_ao_basis_ao_coef(coef)
|
ezfio.ao_basis_ao_coef = coef
|
||||||
ezfio.set_ao_basis_ao_expo(expo)
|
ezfio.ao_basis_ao_expo = expo
|
||||||
|
|
||||||
# MOs
|
# MOs
|
||||||
NumOrbSym = [ s[1] for s in res.symmetries ]
|
NumOrbSym = [ s[1] for s in res.symmetries ]
|
||||||
mo_tot_num = sum(NumOrbSym)
|
mo_tot_num = sum(NumOrbSym)
|
||||||
ezfio.set_mo_basis_mo_tot_num(mo_tot_num)
|
ezfio.mo_basis_mo_tot_num = mo_tot_num
|
||||||
if res.occ_num is not None:
|
|
||||||
ezfio.set_mo_basis_mo_occ(res.occ_num)
|
|
||||||
|
|
||||||
MoTag = res.mo_types[-1]
|
MoTag = res.mo_types[-1]
|
||||||
|
if res.occ_num.keys != []:
|
||||||
|
ezfio.mo_basis_mo_occ = res.occ_num[MoTag]
|
||||||
|
|
||||||
mo = res.mo_sets[MoTag]
|
mo = res.mo_sets[MoTag]
|
||||||
if len(mo) < mo_tot_num:
|
if len(mo) < mo_tot_num:
|
||||||
newmo = orbital()
|
newmo = orbital()
|
||||||
@ -123,20 +122,20 @@ def write_ezfioFile(res,filename):
|
|||||||
while len(mo) < mo_tot_num:
|
while len(mo) < mo_tot_num:
|
||||||
mo.append(newmo)
|
mo.append(newmo)
|
||||||
Energies = [ m.eigenvalue for m in mo ]
|
Energies = [ m.eigenvalue for m in mo ]
|
||||||
ezfio.set_mo_basis_mo_energy(Energies)
|
ezfio.mo_basis_mo_energy = Energies
|
||||||
|
|
||||||
if res.occ_num is not None:
|
if res.occ_num is not None:
|
||||||
OccNum = res.occ_num[MoTag]
|
OccNum = res.occ_num[MoTag]
|
||||||
while len(OccNum) < mo_tot_num:
|
while len(OccNum) < mo_tot_num:
|
||||||
OccNum.append(0.)
|
OccNum.append(0.)
|
||||||
ezfio.set_mo_basis_mo_occ(OccNum)
|
ezfio.mo_basis_mo_occ = OccNum
|
||||||
|
|
||||||
cls = [ "v" for i in mo ]
|
cls = [ "v" for i in mo ]
|
||||||
for i in res.closed_mos:
|
for i in res.closed_mos:
|
||||||
cls[i] = 'c'
|
cls[i] = 'c'
|
||||||
for i in res.active_mos:
|
for i in res.active_mos:
|
||||||
cls[i] = 'a'
|
cls[i] = 'a'
|
||||||
ezfio.set_mo_basis_mo_classif(cls)
|
ezfio.mo_basis_mo_classif = cls
|
||||||
|
|
||||||
MoMatrix = []
|
MoMatrix = []
|
||||||
for m in mo:
|
for m in mo:
|
||||||
@ -144,7 +143,7 @@ def write_ezfioFile(res,filename):
|
|||||||
MoMatrix.append(coef)
|
MoMatrix.append(coef)
|
||||||
while len(MoMatrix) < len(mo[0].vector)**2:
|
while len(MoMatrix) < len(mo[0].vector)**2:
|
||||||
MoMatrix.append(0.)
|
MoMatrix.append(0.)
|
||||||
ezfio.set_mo_basis_mo_coef(MoMatrix)
|
ezfio.mo_basis_mo_coef = MoMatrix
|
||||||
|
|
||||||
# Determinants
|
# Determinants
|
||||||
closed_mos = res.closed_mos
|
closed_mos = res.closed_mos
|
||||||
@ -168,13 +167,18 @@ def write_ezfioFile(res,filename):
|
|||||||
coef = reduce(lambda x, y: x+y,res.det_coefficients,[])
|
coef = reduce(lambda x, y: x+y,res.det_coefficients,[])
|
||||||
|
|
||||||
if len(dets_a[0]) > 0:
|
if len(dets_a[0]) > 0:
|
||||||
ezfio.set_determinants_det_num(len(dets_a))
|
ezfio.determinants_det_num = len(dets_a)
|
||||||
ezfio.set_determinants_det_coef(coef)
|
ezfio.determinants_det_coef = coef
|
||||||
ezfio.set_determinants_det_occ(dets_a+dets_b)
|
ezfio.determinants_det_occ = dets_a+dets_b
|
||||||
else:
|
else:
|
||||||
ezfio.set_determinants_det_num(1)
|
ezfio.determinants_det_num = 1
|
||||||
ezfio.set_determinants_det_coef([1.])
|
ezfio.determinants_det_coef = [1.]
|
||||||
ezfio.set_determinants_det_occ(dets_a+dets_b)
|
ezfio.determinants_det_occ = dets_a+dets_b
|
||||||
|
|
||||||
|
|
||||||
|
ezfio.compute_eplf = True
|
||||||
|
for i in "density density_lapl elf_grad eplf_lapl density_grad elf_grad elf_lapl eplf_grad".split():
|
||||||
|
exec "ezfio.compute_%s = False" % i
|
||||||
|
|
||||||
write_ezfioFile(file,firstArg+".ezfio")
|
write_ezfioFile(file,firstArg+".ezfio")
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ grid
|
|||||||
step_size real (3)
|
step_size real (3)
|
||||||
origin real (3)
|
origin real (3)
|
||||||
opposite real (3)
|
opposite real (3)
|
||||||
num_x integer = grid_point_num(1)
|
num_x integer = at(grid_point_num,1)
|
||||||
num_y integer = grid_point_num(2)
|
num_y integer = at(grid_point_num,2)
|
||||||
num_z integer = grid_point_num(3)
|
num_z integer = at(grid_point_num,3)
|
||||||
|
|
||||||
grid_data
|
grid_data
|
||||||
eplf real (grid_num_x,grid_num_y,grid_num_z)
|
eplf real (grid_num_x,grid_num_y,grid_num_z)
|
||||||
|
@ -4,7 +4,7 @@ SRC=
|
|||||||
OBJ=
|
OBJ=
|
||||||
|
|
||||||
eplf: main
|
eplf: main
|
||||||
mv main eplf
|
mv main ../bin/eplf
|
||||||
|
|
||||||
include irpf90.make
|
include irpf90.make
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
BEGIN_PROVIDER [ double precision, kinetic_energy_alpha_p ]
|
BEGIN_PROVIDER [ double precision, kinetic_energy_alpha_p ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Kinetic Energy
|
! Alpha Kinetic Energy
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
kinetic_energy_alpha_p = 0.d0
|
kinetic_energy_alpha_p = 0.d0
|
||||||
@ -18,7 +18,7 @@ END_PROVIDER
|
|||||||
BEGIN_PROVIDER [ double precision, kinetic_energy_beta_p ]
|
BEGIN_PROVIDER [ double precision, kinetic_energy_beta_p ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Kinetic Energy
|
! Beta Kinetic Energy
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
kinetic_energy_beta_p = 0.d0
|
kinetic_energy_beta_p = 0.d0
|
||||||
@ -35,6 +35,7 @@ END_PROVIDER
|
|||||||
BEGIN_PROVIDER [ double precision, kinetic_energy_p ]
|
BEGIN_PROVIDER [ double precision, kinetic_energy_p ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
|
! Kinetic energy
|
||||||
END_DOC
|
END_DOC
|
||||||
kinetic_energy_p = kinetic_energy_alpha_p + kinetic_energy_beta_p
|
kinetic_energy_p = kinetic_energy_alpha_p + kinetic_energy_beta_p
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
@ -92,6 +92,20 @@ subroutine get_$X(res)
|
|||||||
IRP_ENDIF
|
IRP_ENDIF
|
||||||
!$OMP END CRITICAL (ezfio_critical)
|
!$OMP END CRITICAL (ezfio_critical)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
subroutine set_$X(res)
|
||||||
|
$T :: res$D
|
||||||
|
implicit none
|
||||||
|
integer :: ierr
|
||||||
|
logical :: exists
|
||||||
|
!$OMP CRITICAL (ezfio_critical)
|
||||||
|
PROVIDE ezfio_filename
|
||||||
|
if (mpi_master) then
|
||||||
|
call ezfio_set_$X(res)
|
||||||
|
endif
|
||||||
|
!$OMP END CRITICAL (ezfio_critical)
|
||||||
|
|
||||||
end
|
end
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -60,10 +60,10 @@
|
|||||||
grid_y_num = Npoints(2)
|
grid_y_num = Npoints(2)
|
||||||
grid_z_num = Npoints(3)
|
grid_z_num = Npoints(3)
|
||||||
|
|
||||||
call get_grid_point_num(Npoints)
|
call set_grid_point_num(Npoints)
|
||||||
call get_grid_origin(origin)
|
call set_grid_origin(origin)
|
||||||
call get_grid_opposite(opposite)
|
call set_grid_opposite(opposite)
|
||||||
call get_grid_step_size(step_size)
|
call set_grid_step_size(step_size)
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user