From 8e55dc9f3386c2e2ee9601d58821118fb74bd23a Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 12 Nov 2014 10:34:54 +0100 Subject: [PATCH] Added Hartree_fock to qp_edit --- ocaml/Input_hartree_fock.ml | 27 ++++++++++++++++++++++++--- ocaml/qp_edit.ml | 8 +++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ocaml/Input_hartree_fock.ml b/ocaml/Input_hartree_fock.ml index bd92e69b..56b18b31 100644 --- a/ocaml/Input_hartree_fock.ml +++ b/ocaml/Input_hartree_fock.ml @@ -8,7 +8,8 @@ module Hartree_fock : sig thresh_scf : Threshold.t; } with sexp ;; - val read : unit -> t + val read : unit -> t + val write : t -> unit val to_string : t -> string val to_rst : t -> Rst_string.t val of_rst : Rst_string.t -> t @@ -31,14 +32,25 @@ end = struct |> Strictly_positive_int.of_int ;; - let read_thresh_scf() = + let write_n_it_scf_max n_it_scf_max = + Strictly_positive_int.to_int n_it_scf_max + |> Ezfio.set_hartree_fock_n_it_scf_max + ;; + + let read_thresh_scf () = if not (Ezfio.has_hartree_fock_thresh_scf()) then get_default "thresh_scf" |> Float.of_string |> Ezfio.set_hartree_fock_thresh_scf ; Ezfio.get_hartree_fock_thresh_scf () - |> Threshold.of_float ;; + |> Threshold.of_float + ;; + + let write_thresh_scf thresh_scf = + Threshold.to_float thresh_scf + |> Ezfio.set_hartree_fock_thresh_scf + ;; let read () = @@ -47,6 +59,15 @@ end = struct } ;; + + let write { n_it_scf_max ; + thresh_scf ; + } = + write_n_it_scf_max n_it_scf_max; + write_thresh_scf thresh_scf + ;; + + let to_string b = Printf.sprintf " n_it_scf_max = %s diff --git a/ocaml/qp_edit.ml b/ocaml/qp_edit.ml index c922b83b..9d151a1c 100644 --- a/ocaml/qp_edit.ml +++ b/ocaml/qp_edit.ml @@ -83,9 +83,11 @@ let set str s = in match s with (* - | Hartree_fock -> | Mo_basis -> *) + | Hartree_fock -> + Input.Hartree_fock.of_rst str + |> Input.Hartree_fock.write | Full_ci -> Input.Full_ci.of_rst str |> Input.Full_ci.write @@ -134,7 +136,6 @@ let run ezfio_filename = List.map ~f:get [ Ao_basis ; Mo_basis ; - Hartree_fock ; ]) in String.concat output @@ -145,8 +146,9 @@ let run ezfio_filename = Nuclei ; Electrons ; Bielec_integrals ; - Full_ci ; + Hartree_fock ; Cisd_sc2 ; + Full_ci ; Determinants ; ] in