10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-19 04:22:21 +01:00
QCaml/run_integrals.ml

57 lines
1.8 KiB
OCaml

let out_file : string option ref = ref None
let basis_file : string option ref = ref None
let nuclei_file : string option ref = ref None
let mu_erf : float option ref = ref None
let speclist = [
( "-b" , Arg.String (fun x -> basis_file := Some x),
"File containing the atomic basis set") ;
( "-x" , Arg.String (fun x -> nuclei_file := Some x),
"File containing the nuclear coordinates") ;
( "-m" , Arg.Float (fun x -> mu_erf := Some x),
"Value of mu, the range separation factor.") ;
]
let run () =
let basis_file =
match !basis_file with
| None -> raise (Invalid_argument "Basis set file should be specified with -b")
| Some x -> x
and nuclei_file =
match !nuclei_file with
| None -> raise (Invalid_argument "Coordinate file should be specified with -x")
| Some x -> x
and mu_erf = !mu_erf
in
let s =
Simulation.of_filenames ?mu_erf ~nuclei:nuclei_file basis_file
in
print_endline @@ Nuclei.to_string @@ Simulation.nuclei s;
print_endline "Nuclear repulsion : ";
print_float @@ Simulation.nuclear_repulsion s; print_newline ();
print_endline @@ Basis.to_string @@ Simulation.basis s;
let ao_basis = Simulation.ao_basis s in
let overlap = AOBasis.overlap ao_basis in
let eN_ints = AOBasis.eN_ints ao_basis in
let kin_ints = AOBasis.kin_ints ao_basis in
let ee_ints = AOBasis.ee_ints ao_basis in
Overlap.to_file ~filename:("Ov.dat") overlap;
NucInt.to_file ~filename:("Nuc.dat") eN_ints;
KinInt.to_file ~filename:("Kin.dat") kin_ints;
ERI.to_file ~filename:("ERI.dat") ee_ints;
match mu_erf with
| Some mu_erf ->
ERI_lr.to_file ~filename:("ERI_lr.dat") (AOBasis.ee_lr_ints ao_basis)
| None -> ()
let () =
let usage_msg = "Available options:" in
Arg.parse speclist (fun _ -> ()) usage_msg;
run ()