mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-03 20:54:00 +01:00
Add Read / Write for Nuclear Repulsion (usefull for PBC)
This commit is contained in:
parent
cd4ea7dd54
commit
414aa32463
@ -7,5 +7,5 @@ include Input_bitmasks;;
|
||||
include Input_determinants_by_hand;;
|
||||
include Input_electrons;;
|
||||
include Input_mo_basis;;
|
||||
include Input_nuclei;;
|
||||
include Input_nuclei_by_hand;;
|
||||
include Input_auto_generated;;
|
||||
|
@ -2,7 +2,7 @@ open Qptypes;;
|
||||
open Qputils;;
|
||||
open Core.Std;;
|
||||
|
||||
module Nuclei : sig
|
||||
module Nuclei_by_hand : sig
|
||||
type t =
|
||||
{ nucl_num : Nucl_number.t ;
|
||||
nucl_label : Element.t array;
|
@ -20,7 +20,7 @@ type keyword =
|
||||
| Determinants_by_hand
|
||||
| Electrons
|
||||
| Mo_basis
|
||||
| Nuclei
|
||||
| Nuclei_by_hand
|
||||
{keywords}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ let keyword_to_string = function
|
||||
| Determinants_by_hand -> "Determinants_by_hand"
|
||||
| Electrons -> "Electrons"
|
||||
| Mo_basis -> "MO basis"
|
||||
| Nuclei -> "Molecule"
|
||||
| Nuclei_by_hand -> "Molecule"
|
||||
{keywords_to_string}
|
||||
|
||||
|
||||
@ -74,8 +74,8 @@ let get s =
|
||||
f Mo_basis.(read, to_rst)
|
||||
| Electrons ->
|
||||
f Electrons.(read, to_rst)
|
||||
| Nuclei ->
|
||||
f Nuclei.(read, to_rst)
|
||||
| Nuclei_by_hand ->
|
||||
f Nuclei_by_hand.(read, to_rst)
|
||||
| Ao_basis ->
|
||||
f Ao_basis.(read, to_rst)
|
||||
| Determinants_by_hand ->
|
||||
@ -121,7 +121,7 @@ let set str s =
|
||||
{write}
|
||||
| Electrons -> write Electrons.(of_rst, write) s
|
||||
| Determinants_by_hand -> write Determinants_by_hand.(of_rst, write) s
|
||||
| Nuclei -> write Nuclei.(of_rst, write) s
|
||||
| Nuclei_by_hand -> write Nuclei_by_hand.(of_rst, write) s
|
||||
| Ao_basis -> () (* TODO *)
|
||||
| Mo_basis -> () (* TODO *)
|
||||
end
|
||||
@ -184,7 +184,7 @@ let run check_only ?ndet ?state ezfio_filename =
|
||||
*)
|
||||
|
||||
let tasks = [
|
||||
Nuclei ;
|
||||
Nuclei_by_hand ;
|
||||
Ao_basis;
|
||||
Electrons ;
|
||||
{tasks}
|
||||
|
@ -20,3 +20,14 @@ doc: Nuclear coordinates in the format (:, {x,y,z})
|
||||
type: double precision
|
||||
size: (nuclei.nucl_num,3)
|
||||
interface: ezfio
|
||||
|
||||
[disk_access_nuclear_repulsion]
|
||||
doc: Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ]
|
||||
type: Disk_access
|
||||
interface: ezfio,provider,ocaml
|
||||
default: None
|
||||
|
||||
[nuclear_repulsion]
|
||||
doc: Nuclear repulsion (Computed automaticaly or Read in the EZFIO)
|
||||
type:double precision
|
||||
interface: ezfio
|
||||
|
@ -146,6 +146,20 @@ END_PROVIDER
|
||||
BEGIN_DOC
|
||||
! Nuclear repulsion energy
|
||||
END_DOC
|
||||
|
||||
IF (disk_access_nuclear_repulsion.EQ.'Read') THEN
|
||||
print*, 'nuclear_repulsion read from disk'
|
||||
LOGICAL :: has
|
||||
call ezfio_has_nuclei_nuclear_repulsion(has)
|
||||
if (has) then
|
||||
call ezfio_get_nuclei_nuclear_repulsion(nuclear_repulsion)
|
||||
else
|
||||
print *, 'nuclei/nuclear_repulsion not found in EZFIO file'
|
||||
stop 1
|
||||
endif
|
||||
|
||||
ELSE
|
||||
|
||||
integer :: k,l
|
||||
double precision :: Z12, r2, x(3)
|
||||
nuclear_repulsion = 0.d0
|
||||
@ -163,10 +177,15 @@ END_PROVIDER
|
||||
enddo
|
||||
enddo
|
||||
nuclear_repulsion *= 0.5d0
|
||||
END IF
|
||||
|
||||
call write_time(output_Nuclei)
|
||||
call write_double(output_Nuclei,nuclear_repulsion, &
|
||||
'Nuclear repulsion energy')
|
||||
|
||||
IF (disk_access_nuclear_repulsion.EQ.'Write') THEN
|
||||
call ezfio_set_nuclei_nuclear_repulsion(nuclear_repulsion)
|
||||
END IF
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ character*(128), element_name, (78)]
|
||||
|
Loading…
Reference in New Issue
Block a user