mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
Changed dummy into ghost
This commit is contained in:
parent
3319d78816
commit
9927328138
@ -26,8 +26,7 @@ let of_string = function
|
|||||||
| "J" | "j" -> J
|
| "J" | "j" -> J
|
||||||
| "K" | "k" -> K
|
| "K" | "k" -> K
|
||||||
| "L" | "l" -> L
|
| "L" | "l" -> L
|
||||||
| x -> raise (Failure ("Angmom should be S|P|D|F|G|H|I|J|K|L,
|
| x -> raise (Failure ("Angmom should be S|P|D|F|G|H|I|J|K|L, not "^x^"."))
|
||||||
not "^x^"."))
|
|
||||||
|
|
||||||
let of_char = function
|
let of_char = function
|
||||||
| 'S' | 's' -> S
|
| 'S' | 's' -> S
|
||||||
|
@ -17,7 +17,7 @@ let read in_channel at_number =
|
|||||||
(** Find an element in the basis set file *)
|
(** Find an element in the basis set file *)
|
||||||
let find in_channel element =
|
let find in_channel element =
|
||||||
seek_in in_channel 0;
|
seek_in in_channel 0;
|
||||||
let element_read = ref Element.X in
|
let element_read = ref Element.Og in
|
||||||
while !element_read <> element
|
while !element_read <> element
|
||||||
do
|
do
|
||||||
let buffer = input_line in_channel in
|
let buffer = input_line in_channel in
|
||||||
|
@ -20,7 +20,7 @@ type t = X
|
|||||||
|
|
||||||
let of_string x =
|
let of_string x =
|
||||||
match (String.capitalize_ascii (String.lowercase_ascii x)) with
|
match (String.capitalize_ascii (String.lowercase_ascii x)) with
|
||||||
| "X" | "Dummy" -> X
|
| "X" | "Ghost" -> X
|
||||||
| "H" | "Hydrogen" -> H
|
| "H" | "Hydrogen" -> H
|
||||||
| "He" | "Helium" -> He
|
| "He" | "Helium" -> He
|
||||||
| "Li" | "Lithium" -> Li
|
| "Li" | "Lithium" -> Li
|
||||||
@ -265,7 +265,7 @@ let to_string = function
|
|||||||
|
|
||||||
|
|
||||||
let to_long_string = function
|
let to_long_string = function
|
||||||
| X -> "Dummy"
|
| X -> "Ghost"
|
||||||
| H -> "Hydrogen"
|
| H -> "Hydrogen"
|
||||||
| He -> "Helium"
|
| He -> "Helium"
|
||||||
| Li -> "Lithium"
|
| Li -> "Lithium"
|
||||||
|
@ -6,8 +6,8 @@ type element =
|
|||||||
| Element of Element.t
|
| Element of Element.t
|
||||||
| Int_elem of (Nucl_number.t * Element.t)
|
| Int_elem of (Nucl_number.t * Element.t)
|
||||||
|
|
||||||
(** Handle dummy atoms placed on bonds *)
|
(** Handle ghost atoms placed on bonds *)
|
||||||
let dummy_centers ~threshold ~molecule ~nuclei =
|
let ghost_centers ~threshold ~molecule ~nuclei =
|
||||||
let d =
|
let d =
|
||||||
Molecule.distance_matrix molecule
|
Molecule.distance_matrix molecule
|
||||||
in
|
in
|
||||||
@ -68,11 +68,11 @@ let run ?o b au c d m p cart xyz_file =
|
|||||||
(Molecule.of_file xyz_file ~charge:(Charge.of_int c)
|
(Molecule.of_file xyz_file ~charge:(Charge.of_int c)
|
||||||
~multiplicity:(Multiplicity.of_int m) )
|
~multiplicity:(Multiplicity.of_int m) )
|
||||||
in
|
in
|
||||||
let dummy =
|
let ghost =
|
||||||
dummy_centers ~threshold:d ~molecule ~nuclei:molecule.Molecule.nuclei
|
ghost_centers ~threshold:d ~molecule ~nuclei:molecule.Molecule.nuclei
|
||||||
in
|
in
|
||||||
let nuclei =
|
let nuclei =
|
||||||
molecule.Molecule.nuclei @ dummy
|
molecule.Molecule.nuclei @ ghost
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
@ -145,8 +145,6 @@ let run ?o b au c d m p cart xyz_file =
|
|||||||
| i :: k :: [] -> (Nucl_number.of_int @@ int_of_string i, Element.of_string k)
|
| i :: k :: [] -> (Nucl_number.of_int @@ int_of_string i, Element.of_string k)
|
||||||
| _ -> failwith "Expected format is int,Element:basis"
|
| _ -> failwith "Expected format is int,Element:basis"
|
||||||
in Int_elem result
|
in Int_elem result
|
||||||
and basis =
|
|
||||||
String.lowercase_ascii basis
|
|
||||||
in
|
in
|
||||||
let key =
|
let key =
|
||||||
match elem with
|
match elem with
|
||||||
@ -313,7 +311,7 @@ let run ?o b au c d m p cart xyz_file =
|
|||||||
}
|
}
|
||||||
in
|
in
|
||||||
let nuclei =
|
let nuclei =
|
||||||
molecule.Molecule.nuclei @ dummy
|
molecule.Molecule.nuclei @ ghost
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
@ -491,11 +489,7 @@ let run ?o b au c d m p cart xyz_file =
|
|||||||
|> List.rev
|
|> List.rev
|
||||||
|> list_map (fun (x,i) ->
|
|> list_map (fun (x,i) ->
|
||||||
try
|
try
|
||||||
let e =
|
let e = x.Atom.element in
|
||||||
match x.Atom.element with
|
|
||||||
| Element.X -> Element.H
|
|
||||||
| e -> e
|
|
||||||
in
|
|
||||||
let key =
|
let key =
|
||||||
Int_elem (i,x.Atom.element)
|
Int_elem (i,x.Atom.element)
|
||||||
in
|
in
|
||||||
@ -507,9 +501,15 @@ let run ?o b au c d m p cart xyz_file =
|
|||||||
in
|
in
|
||||||
try
|
try
|
||||||
Basis.read_element (basis_channel key) i e
|
Basis.read_element (basis_channel key) i e
|
||||||
with Not_found ->
|
with _ ->
|
||||||
failwith (Printf.sprintf "Basis not found for atom %d (%s)" (Nucl_number.to_int i)
|
try
|
||||||
(Element.to_string x.Atom.element) )
|
if e = Element.X then
|
||||||
|
Basis.read_element (basis_channel key) i (Element.H)
|
||||||
|
else
|
||||||
|
raise Not_found
|
||||||
|
with Not_found ->
|
||||||
|
failwith (Printf.sprintf "Basis not found for atom %d (%s)" (Nucl_number.to_int i)
|
||||||
|
(Element.to_string x.Atom.element) )
|
||||||
with
|
with
|
||||||
| End_of_file -> failwith
|
| End_of_file -> failwith
|
||||||
("Element "^(Element.to_string x.Atom.element)^" not found in basis set.")
|
("Element "^(Element.to_string x.Atom.element)^" not found in basis set.")
|
||||||
@ -710,9 +710,9 @@ If a file with the same name as the basis set exists, this file will be read. O
|
|||||||
arg=With_arg "<int>";
|
arg=With_arg "<int>";
|
||||||
doc="Total charge of the molecule. Default is 0. For negative values, use m instead of -, for ex m1"} ;
|
doc="Total charge of the molecule. Default is 0. For negative values, use m instead of -, for ex m1"} ;
|
||||||
|
|
||||||
{ opt=Optional ; short='d'; long="dummy";
|
{ opt=Optional ; short='g'; long="ghost";
|
||||||
arg=With_arg "<float>";
|
arg=With_arg "<float>";
|
||||||
doc="Add dummy atoms. x * (covalent radii of the atoms)."} ;
|
doc="Add ghost atoms. x * (covalent radii of the atoms)."} ;
|
||||||
|
|
||||||
{ opt=Optional ; short='m'; long="multiplicity";
|
{ opt=Optional ; short='m'; long="multiplicity";
|
||||||
arg=With_arg "<int>";
|
arg=With_arg "<int>";
|
||||||
@ -756,8 +756,8 @@ If a file with the same name as the basis set exists, this file will be read. O
|
|||||||
int_of_string x )
|
int_of_string x )
|
||||||
in
|
in
|
||||||
|
|
||||||
let dummy =
|
let ghost =
|
||||||
match Command_line.get "dummy" with
|
match Command_line.get "ghost" with
|
||||||
| None -> 0.
|
| None -> 0.
|
||||||
| Some x -> float_of_string x
|
| Some x -> float_of_string x
|
||||||
in
|
in
|
||||||
@ -782,7 +782,7 @@ If a file with the same name as the basis set exists, this file will be read. O
|
|||||||
| x::_ -> x
|
| x::_ -> x
|
||||||
in
|
in
|
||||||
|
|
||||||
run ?o:output basis au charge dummy multiplicity pseudo cart xyz_filename
|
run ?o:output basis au charge ghost multiplicity pseudo cart xyz_filename
|
||||||
)
|
)
|
||||||
with
|
with
|
||||||
(* | Failure txt -> Printf.eprintf "Fatal error: %s\n%!" txt *)
|
(* | Failure txt -> Printf.eprintf "Fatal error: %s\n%!" txt *)
|
||||||
|
Loading…
Reference in New Issue
Block a user