From ee9ee5ceb5bb373b24a620e2d60caeb2b5bd91a5 Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Sun, 22 Sep 2024 07:43:30 +0100 Subject: [PATCH 01/11] Add host energy modification --- src/fortran/lib/mod_evolver.f90 | 207 +++++++++++++++++++++++++++- src/fortran/lib/mod_generator.f90 | 1 + src/raffle/raffle.py | 7 +- src/wrapper/f90wrap_mod_evolver.f90 | 13 +- test/test_evolver.f90 | 3 + 5 files changed, 217 insertions(+), 14 deletions(-) diff --git a/src/fortran/lib/mod_evolver.f90 b/src/fortran/lib/mod_evolver.f90 index 2dd33c3c..306c3ba5 100644 --- a/src/fortran/lib/mod_evolver.f90 +++ b/src/fortran/lib/mod_evolver.f90 @@ -47,6 +47,8 @@ module evolver !! Number of atoms in the structure. real(real12) :: energy = 0.0_real12 !! Energy of the structure. + logical :: from_host = .false. + !! Boolean whether the structure is derived from the host. integer, dimension(:), allocatable :: stoichiometry !! Stoichiometry of the structure. character(len=3), dimension(:), allocatable :: element_symbols @@ -55,10 +57,25 @@ module evolver procedure, pass(this) :: calculate end type gvector_type + type, extends(gvector_type) :: gvector_host_type + !! Type for host information. + !! + !! This type contains the information regarding the host structure that + !! will be used in the grandparent generator type. + logical :: defined = .false. + !! Boolean whether the host structure has been set. + real(real12) :: interface_energy = 0.0_real12 + !! Energy associated with the formation of the interface in the host. + type(basis_type) :: basis + !! Host structure. + integer, dimension(:,:), allocatable :: pair_index + contains + procedure, pass(this) :: calculate_interface_energy + !! Calculate the interface formation energy of the host. + procedure, pass(this) :: set => set_host + !! Set the host structure for the distribution functions. + end type gvector_host_type - !! should gvector be for the entire prediction, or one for each system? - !! if one for each system, do not contain nbins, width, as this would ... - !! ... result in lots of duplicated data type :: gvector_container_type !! Container for distribution functions. !! @@ -111,6 +128,8 @@ module evolver !! Total distribution functions for all systems. !! Generated from combining the energy-weighted distribution functions !! of all systems + type(gvector_host_type) :: host_system + !! Host structure for the distribution functions. type(gvector_type), dimension(:), allocatable :: system !! Distribution functions for each system. type(element_type), dimension(:), allocatable :: element_info @@ -369,6 +388,74 @@ end subroutine set_radius_distance_tol !############################################################################### +!############################################################################### +! set the host stoichiometry, energy, and the final stoichiometry of the + subroutine set_host(this, host) + !! Set the host structure for the distribution functions. + !! + !! distribution function not needed for host + implicit none + + ! Arguments + class(gvector_host_type), intent(inout) :: this + !! Parent. Instance of distribution functions container. + type(basis_type), intent(in) :: host + !! Host structure for the distribution functions. + + ! Local variables + integer :: i, is, js + !! Loop indices. + + call this%basis%copy(host) + this%defined = .true. + allocate(this%pair_index(this%basis%nspec, this%basis%nspec)) + i = 0 + do is = 1, this%basis%nspec + do js = is, this%basis%nspec, 1 + i = i + 1 + this%pair_index(js,is) = i + this%pair_index(is,js) = i + end do + end do + if(allocated(this%df_2body)) deallocate(this%df_2body) + if(allocated(this%df_3body)) deallocate(this%df_3body) + if(allocated(this%df_4body)) deallocate(this%df_4body) + + end subroutine set_host +!############################################################################### + + +!############################################################################### + subroutine calculate_interface_energy(this, element_info) + !! Calculate the interface formation energy of the host. + implicit none + + ! Arguments + class(gvector_host_type), intent(inout) :: this + !! Parent. Instance of host type. + type(element_type), dimension(:), intent(in) :: element_info + !! List of elements and properties. + + ! Local variables + integer :: is, idx1 + !! Loop indices. + + this%interface_energy = this%energy + do is = 1, size(this%element_symbols) + idx1 = findloc( [ element_info(:)%name ], & + this%element_symbols(is), dim=1) + if(idx1.lt.1)then + call stop_program( "Species not found in species list" ) + return + end if + this%interface_energy = this%interface_energy - & + this%stoichiometry(is) * element_info(idx1)%energy + end do + + end subroutine calculate_interface_energy +!############################################################################### + + !############################################################################### subroutine create(this, basis_list, deallocate_systems) !! create the distribution functions from the input file @@ -423,7 +510,7 @@ end subroutine create !############################################################################### - subroutine update(this, basis_list, deallocate_systems) + subroutine update(this, basis_list, from_host, deallocate_systems) !! update the distribution functions from the input file implicit none ! Arguments @@ -431,25 +518,75 @@ subroutine update(this, basis_list, deallocate_systems) !! Parent. Instance of distribution functions container. type(basis_type), dimension(:), intent(in) :: basis_list !! List of basis structures. + logical, intent(in), optional :: from_host + !! Optional. Boolean whether structures are derived from the host. logical, intent(in), optional :: deallocate_systems !! Optional. Boolean whether to deallocate the systems after the !! distribution functions are created. ! Local variables + integer :: i + !! Loop index. logical :: deallocate_systems_ + !! Boolean whether to deallocate the systems after the distribution + logical :: from_host_ + !! Boolean whether structures are derived from the host. + character(256) :: stop_msg + !! Error message. + if(present(from_host))then + from_host_ = from_host + else + from_host_ = .true. + end if deallocate_systems_ = .true. if(present(deallocate_systems)) deallocate_systems_ = deallocate_systems call this%add(basis_list) call this%update_bond_info() + + ! If the structures are derived from the host, subtract the interface energy + if(from_host_)then + if(.not.this%host_system%defined)then + write(stop_msg,*) "host not set" // & + achar(13) // achar(10) // & + "Run the set_host() procedure of parent of" // & + "gvector_container_type before calling create()" + call stop_program( stop_msg ) + return + else + if(.not.allocated(this%host_system%df_2body))then + call this%host_system%calculate(this%host_system%basis, width = this%width, & + sigma = this%sigma, & + cutoff_min = this%cutoff_min, & + cutoff_max = this%cutoff_max, & + radius_distance_tol = this%radius_distance_tol & + ) + end if + call this%host_system%calculate_interface_energy(this%element_info) + write(*,*) "host interface energy: ", this%host_system%interface_energy + write(*,*) "Stoichiometry of host: ", this%host_system%stoichiometry + write(*,*) this%element_info(1)%energy + do i = this%num_evaluated_allocated + 1, size(this%system), 1 + this%system(i)%from_host = .true. + write(*,*) "unmodified energy: ", this%system(i)%energy + this%system(i)%energy = this%system(i)%energy - & + this%host_system%interface_energy + this%system(i)%num_atoms = this%system(i)%num_atoms - & + this%host_system%num_atoms + write(*,*) "modified energy: ", this%system(i)%energy + end do + end if + end if + call this%evolve() if(deallocate_systems_) call this%deallocate_systems() end subroutine update !############################################################################### + !############################################################################### subroutine deallocate_systems(this) !! Deallocate the systems in the container. @@ -1630,6 +1767,8 @@ subroutine evolve(this, system) !! Temporary array for the g-vectors. logical, dimension(:), allocatable :: tmp_in_dataset + integer, dimension(:), allocatable :: host_idx_list + !--------------------------------------------------------------------------- ! if present, add the system to the container @@ -1725,6 +1864,20 @@ subroutine evolve(this, system) deallocate(this%norm_4body) end if + if(any(this%system(this%num_evaluated_allocated+1:)%from_host).and.this%host_system%defined)then + ! set host_idx_list + allocate(host_idx_list(size(this%element_info))) + host_idx_list = 0 + do is = 1, size(this%host_system%element_symbols) + idx1 = findloc( [ this%element_info(:)%name ], & + this%host_system%element_symbols(is), dim=1) + if(idx1.lt.1)then + call stop_program( "Host species not found in species list" ) + return + end if + host_idx_list(idx1) = is + end do + end if !--------------------------------------------------------------------------- ! loop over all systems to calculate the total gvectors @@ -1764,7 +1917,50 @@ subroutine evolve(this, system) energy = energy / this%system(i)%num_atoms weight = exp( ( this%best_energy - energy ) / this%kbt ) j = 0 - + ! if(weight.lt.1.E-6.and.this%system(i)%from_host)then + + ! do is = 1, size(this%system(i)%element_symbols) + ! idx1 = findloc( [ this%element_info(:)%name ], & + ! this%system(i)%element_symbols(is), dim=1) + ! if(host_idx_list(idx1).eq.0)then + ! this%total%df_3body(:,idx1) = this%total%df_3body(:,idx1) - & + ! 0.1_real12 * this%system(i)%df_3body(:,is) + ! this%total%df_4body(:,idx1) = this%total%df_4body(:,idx1) - & + ! 0.1_real12 * this%system(i)%df_4body(:,is) + ! else + ! this%total%df_3body(:,idx1) = this%total%df_3body(:,idx1) - & + ! set_difference( 0.1_real12 * this%system(i)%df_3body(:,is), & + ! this%host_system%df_3body(:,host_idx_list(idx1)), & + ! set_min_zero = .false. & + ! ) + ! this%total%df_4body(:,idx1) = this%total%df_4body(:,idx1) - & + ! set_difference( 0.1_real12 * this%system(i)%df_4body(:,is), & + ! this%host_system%df_4body(:,host_idx_list(idx1)), & + ! set_min_zero = .false. & + ! ) + ! do js = is, size(this%system(i)%element_symbols), 1 + ! idx2 = findloc( [ this%element_info(:)%name ], & + ! this%system(i)%element_symbols(js), dim=1) + ! j = nint( ( size(this%element_info) - & + ! min( idx1, idx2 ) / 2._real12 ) * & + ! ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) + ! if(host_idx_list(idx2).eq.0)then + ! this%total%df_2body(:,j) = this%total%df_2body(:,j) - & + ! 0.1_real12 * this%system(i)%df_2body(:,idx_list(is,js)) + ! else + ! this%total%df_2body(:,j) = this%total%df_2body(:,j) - & + ! set_difference( 0.1_real12 * this%system(i)%df_2body(:,idx_list(is,js)), & + ! this%host_system%df_2body(:,this%host_system%pair_index(host_idx_list(idx1),host_idx_list(idx2))), & + ! set_min_zero = .false. & + ! ) + ! end if + ! end do + ! end if + ! end do + ! if(weight.lt.1.E-6)then + ! deallocate(idx_list) + ! cycle + ! else !------------------------------------------------------------------------ ! loop over all species in the system to add the gvectors !------------------------------------------------------------------------ @@ -1818,6 +2014,7 @@ subroutine evolve(this, system) end do end do + ! end if deallocate(idx_list) end do diff --git a/src/fortran/lib/mod_generator.f90 b/src/fortran/lib/mod_generator.f90 index 933db6f6..e75ed134 100644 --- a/src/fortran/lib/mod_generator.f90 +++ b/src/fortran/lib/mod_generator.f90 @@ -160,6 +160,7 @@ subroutine set_host(this, host) do i = 1, this%host%nspec this%host%spec(i)%name = strip_null(this%host%spec(i)%name) end do + call this%distributions%host_system%set(this%host) call this%set_grid() end subroutine set_host diff --git a/src/raffle/raffle.py b/src/raffle/raffle.py index 625db1a8..fa9b7379 100644 --- a/src/raffle/raffle.py +++ b/src/raffle/raffle.py @@ -1202,7 +1202,7 @@ def create(self, basis_list, deallocate_systems=True): _raffle.f90wrap_evolver__create__binding__gvector_container_type(this=self._handle, \ basis_list=basis_list._handle, deallocate_systems=deallocate_systems) - def update(self, basis_list, deallocate_systems=True): + def update(self, basis_list, from_host=True, deallocate_systems=True): """ update__binding__gvector_container_type(self, basis_list) @@ -1225,7 +1225,10 @@ def update(self, basis_list, deallocate_systems=True): _raffle.f90wrap_evolver__update__binding__gvector_container_type(this=self._handle, \ - basis_list=basis_list._handle, deallocate_systems=deallocate_systems) + basis_list=basis_list._handle, \ + from_host=from_host, \ + deallocate_systems=deallocate_systems \ + ) def deallocate_systems(self): """ diff --git a/src/wrapper/f90wrap_mod_evolver.f90 b/src/wrapper/f90wrap_mod_evolver.f90 index 9d2ae51c..438c6406 100644 --- a/src/wrapper/f90wrap_mod_evolver.f90 +++ b/src/wrapper/f90wrap_mod_evolver.f90 @@ -755,7 +755,7 @@ subroutine f90wrap_evolver__create__binding__gvector_container_type(this, basis_ end if end subroutine f90wrap_evolver__create__binding__gvector_container_type -subroutine f90wrap_evolver__update__binding__gvector_container_type(this, basis_list, deallocate_systems) +subroutine f90wrap_evolver__update__binding__gvector_container_type(this, basis_list, from_host, deallocate_systems) use rw_geom, only: basis_type use evolver, only: gvector_container_type implicit none @@ -775,15 +775,14 @@ subroutine f90wrap_evolver__update__binding__gvector_container_type(this, basis_ integer, intent(in), dimension(2) :: this type(basis_type_xnum_array_ptr_type) :: basis_list_ptr integer, intent(in), dimension(2) :: basis_list - logical, intent(in), optional :: deallocate_systems + logical, intent(in) :: from_host + logical, intent(in) :: deallocate_systems this_ptr = transfer(this, this_ptr) basis_list_ptr = transfer(basis_list, basis_list_ptr) - if(present(deallocate_systems)) then - call this_ptr%p%update(basis_list=basis_list_ptr%p%items, deallocate_systems=deallocate_systems) - else - call this_ptr%p%update(basis_list=basis_list_ptr%p%items) - end if + call this_ptr%p%update(basis_list=basis_list_ptr%p%items, & + from_host=from_host, & + deallocate_systems=deallocate_systems) end subroutine f90wrap_evolver__update__binding__gvector_container_type subroutine f90wrap_evolver__deallocate_systems__binding__gvector_conta8f02(this) diff --git a/test/test_evolver.f90 b/test/test_evolver.f90 index 40948407..c7e251dc 100644 --- a/test/test_evolver.f90 +++ b/test/test_evolver.f90 @@ -520,6 +520,9 @@ subroutine test_update(basis, success) call basis_list(i)%copy(basis(i)) end do + ! Set host system + call gvector_container%host_system%set(basis(1)) + ! Set element energies allocate(elements(0)) do i = 1, size(basis_list) From 063915f631508badb32fba826a75bd4a533f1927 Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Sun, 22 Sep 2024 07:45:04 +0100 Subject: [PATCH 02/11] Fix host order --- example/wrapper/run_BaTiO3.py | 10 +++++----- example/wrapper/run_diamond.py | 6 +++--- example/wrapper/run_graphite.py | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/example/wrapper/run_BaTiO3.py b/example/wrapper/run_BaTiO3.py index dc30c22f..f7fad416 100644 --- a/example/wrapper/run_BaTiO3.py +++ b/example/wrapper/run_BaTiO3.py @@ -27,13 +27,13 @@ # read the host structure from a POSCAR file print("Reading host") -host = read("../example_files/POSCAR_host_BaTiO3") -generator.set_host(host) -print("Host read") - +host = read("../example_files/POSCAR_host_diamond") host.calc = calculator print("host energy: ", host.get_potential_energy()) +generator.set_host(host) +print("Host read") + # generate bulk BaTiO3 and get its energy reference_bulk = Atoms("BaTiO3", positions=[[0.0, 0.0, 0.0], [2.005, 2.005, 2.005], @@ -137,7 +137,7 @@ # generate structures num_structures_old = 0 optimise_structure = False -for iter in range(1): +for iter in range(3): print(f"Iteration {iter}") print("Generating...") # this is the main function to generate structures diff --git a/example/wrapper/run_diamond.py b/example/wrapper/run_diamond.py index 2d010f1a..d10e90e6 100644 --- a/example/wrapper/run_diamond.py +++ b/example/wrapper/run_diamond.py @@ -28,12 +28,12 @@ # read the host structure from a POSCAR file print("Reading host") host = read("../example_files/POSCAR_host_diamond") -generator.set_host(host) -print("Host read") - host.calc = calculator print("host energy: ", host.get_potential_energy()) +generator.set_host(host) +print("Host read") + # generate bulk diamond and get its energy diamond_bulk = Atoms("C8", positions=[ diff --git a/example/wrapper/run_graphite.py b/example/wrapper/run_graphite.py index acb34226..c4e56b32 100644 --- a/example/wrapper/run_graphite.py +++ b/example/wrapper/run_graphite.py @@ -28,11 +28,12 @@ # read the host structure from a POSCAR file print("Reading host") host = read("../example_files/POSCAR_graphite_missing_layer") +host.calc = calculator +print("host energy: ", host.get_potential_energy()) + generator.set_host(host) print("Host read") -host.calc = calculator -print("host energy: ", host.get_potential_energy()) # generate bulk diamond and get its energy diamond_bulk = Atoms("C8", From ddf912e6718b4240c55fa4a33ac8f4a931e87c31 Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Sun, 22 Sep 2024 07:46:26 +0100 Subject: [PATCH 03/11] Use better setting of kbT --- example/wrapper/run_BaTiO3.py | 2 +- example/wrapper/run_diamond.py | 2 +- example/wrapper/run_graphite.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/wrapper/run_BaTiO3.py b/example/wrapper/run_BaTiO3.py index f7fad416..7d71504d 100644 --- a/example/wrapper/run_BaTiO3.py +++ b/example/wrapper/run_BaTiO3.py @@ -82,7 +82,7 @@ ) # set energy scale -generator.distributions.kbT = 0.2 +generator.distributions.set_kbT(0.2) # set the distribution function widths (2-body, 3-body, 4-body) generator.distributions.set_width([0.025, np.pi/200.0, np.pi/200.0]) diff --git a/example/wrapper/run_diamond.py b/example/wrapper/run_diamond.py index d10e90e6..53a1ca7a 100644 --- a/example/wrapper/run_diamond.py +++ b/example/wrapper/run_diamond.py @@ -93,7 +93,7 @@ ) # set energy scale -generator.distributions.kbT = 0.2 +generator.distributions.set_kbT(0.2) # set the distribution function widths (2-body, 3-body, 4-body) generator.distributions.set_width([0.025, np.pi/200.0, np.pi/200.0]) diff --git a/example/wrapper/run_graphite.py b/example/wrapper/run_graphite.py index c4e56b32..ccac00f3 100644 --- a/example/wrapper/run_graphite.py +++ b/example/wrapper/run_graphite.py @@ -94,7 +94,7 @@ ) # set energy scale -generator.distributions.kbT = 0.2 +generator.distributions.set_kbT(0.2) # set the distribution function widths (2-body, 3-body, 4-body) generator.distributions.set_width([0.025, np.pi/200.0, np.pi/200.0]) From 28f5208571c862d3eba62d2ebcb9571456123a03 Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Sun, 22 Sep 2024 07:47:16 +0100 Subject: [PATCH 04/11] Update example script --- example/wrapper/run.py | 140 ++++++++++++++++++++++++++++++----------- 1 file changed, 102 insertions(+), 38 deletions(-) diff --git a/example/wrapper/run.py b/example/wrapper/run.py index 6bb3cd40..ca260d76 100644 --- a/example/wrapper/run.py +++ b/example/wrapper/run.py @@ -1,42 +1,70 @@ -# caution: path[0] is reserved for script path (or '' in REPL) -# sys.path.insert(1, '../../build/') +# This script demonstrates how to use the raffle generator to generate graphite structures +# The script reads a host structure from a POSCAR file, and sets it as the host structure for the generator. + +# import standard libraries +import os +import numpy as np + +# import raffle library from raffle.generator import raffle_generator + +# import ASE (Atomic Simulation Environment) modules from ase import Atoms from ase.io import read, write +from ase.optimize import BFGS -# atoms = Atoms('CC', positions=[[0, 0, 0], [1.2, 0, 0]], pbc=True, cell=[2.4, 2.4, 2.4]) +# import CHGNet calculator (for MLP energy evaluation) +from chgnet.model.dynamics import CHGNetCalculator + +# load CHGNet calculator +print("Initialising CHGNet calculator") +calculator = CHGNetCalculator(model=None) print("Initialising raffle generator") generator = raffle_generator() - print("Reading host") -host = read("../example_files/POSCAR_host") +host = read("../example_files/DC_MgO_hosts/POSCAR_1x5_orthorhombic_11.0A_separation") +host.calc = calculator +print("host energy: ", host.get_potential_energy()) + generator.set_host(host) print("Host read") print("Setting element energies") generator.distributions.set_element_energies( { - 'C': -9.0266865, - 'Mg': -1.5478236, - 'O': -4.3707458 - } -) - -## BOND SETTER -generator.distributions.set_bond_radii( - { - ('C', 'C'): 1.5, - ('C', 'Mg'): 2.0, - ('C', 'O'): 1.5, - ('Mg', 'Mg'): 2.0, - ('Mg', 'O'): 2.0, - ('O', 'O'): 1.5 + 'C': -9.0266865, # -1.263, + 'Mg': -1.5478236, # -0.008, + 'O': -4.3707458, #-1.888 } ) +# ## BOND SETTER +# generator.distributions.set_bond_radii( +# { +# ('C', 'C'): 1.5, +# ('C', 'Mg'): 2.0, +# ('C', 'O'): 1.5, +# ('Mg', 'Mg'): 2.0, +# ('Mg', 'O'): 2.0, +# ('O', 'O'): 1.5 +# } +# ) + +# set energy scale +generator.distributions.set_kbT(0.5) +# set the distribution function widths (2-body, 3-body, 4-body) +generator.distributions.set_width([0.025, np.pi/200.0, np.pi/200.0]) + +# set the radii tolerances for the 3-body and 4-body distributions +# these are the lower and upper bounds for the bond radii +# the first two values are the lower and upper tolerance on covalent bond radii for 3-body distributions +# the last two values are the lower and upper tolerance on covalent bond radii for 4-body distributions +# the max bondlength cutoff is an upper limit, so you can turn off 3-body and 4-body distributions by +# setting all the values above 100.0 (just to be safe) +generator.distributions.set_radius_distance_tol([1.5, 2.5, 3.0, 6.0]) print("Reading database") database = read("../example_files/database/database.xyz", index=":") @@ -62,23 +90,59 @@ print(generator.distributions.get_bond_radii()) print("Setting bins (discretisation of host cell)") -generator.bins = [12,12,30] +generator.set_grid(grid_spacing=0.2, grid_offset=[0.0, 0.0, 0.0]) +print(generator.grid) print("Setting stoichiometry to insert") -stoich_dict = { 'C': 8, 'Mg': 8 } - -print("Generating...") -generator.generate(num_structures=10, stoichiometry=stoich_dict, seed=0, verbose=1, method_probab={"void":1.0, "walk":1.0, "min":1.0}) -print("Generated") - -print("Getting structures") -# generated_structures = generator.get_structures() -print("number of structures supposed to be generated: ", generator.num_structures) -generated_structures = generator.get_structures() -print("actual number allocated: ",len(generated_structures)) -print("Got structures") - -print("Converting to ASE") -for i, atoms in enumerate(generated_structures): - print(f"Converting structure {i}") - write(f"POSCAR_{i}", atoms) +stoich_dict = { 'Mg': 20, 'O': 20 } +generator.distributions.best_energy = 0.0 + +# generate structures +num_structures_old = 0 +optimise_structure = False +for iter in range(10): + print(f"Iteration {iter}") + print("Generating...") + # this is the main function to generate structures + generator.generate(num_structures=10, stoichiometry=stoich_dict, seed=0+iter, verbose=0, method_probab={"void":1.0, "walk":1.0, "min":1.0}) + print("Generated") + + print("Getting structures") + print("number of structures supposed to be generated: ", generator.num_structures) + generated_structures = generator.get_structures() + print("actual number allocated: ",len(generated_structures)) + print("Got structures") + + # check if directory iteration[iter] exists, if not create it + iterdir = f"iteration{iter}/" + if not os.path.exists(iterdir): + os.makedirs(iterdir) + + # get energies using MLPs and optimise the structures + num_structures_new = len(generated_structures) + for i, atoms in enumerate(generated_structures): + if(i < num_structures_old): + continue + inew = i - num_structures_old + atoms.calc = calculator + if optimise_structure: + optimizer = BFGS(atoms, trajectory = "traje.traj") + optimizer.run(fmax=0.05) + print(f"Structure {inew} optimised") + atoms.get_potential_energy() + print(f"Structure {inew} energy: {atoms.get_potential_energy()}") + write(iterdir+f"POSCAR_{inew}", atoms) + + # update the distribution functions + print("Updating distributions") + generator.distributions.update(generated_structures[num_structures_old:], deallocate_systems=False) + + # print the new distribution functions to a file + print("Printing distributions") + generator.distributions.write(iterdir+"distributions.txt") + generator.distributions.write_2body(iterdir+"df2.txt") + generator.distributions.write_3body(iterdir+"df3.txt") + generator.distributions.write_4body(iterdir+"df4.txt") + + # update the number of structures generated + num_structures_old = num_structures_new From 9a51b35968ab69529f4e586cbcb2ae7717c2a6fe Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Sun, 22 Sep 2024 07:48:05 +0100 Subject: [PATCH 05/11] Add example hosts --- .../DC_MgO_hosts/POSCAR_10x10_5.4_separation | 408 ++++++++++++++++++ .../DC_MgO_hosts/POSCAR_10x10_6.0A_separation | 408 ++++++++++++++++++ .../DC_MgO_hosts/POSCAR_1x1_5.4A_separation | 17 + .../POSCAR_1x5_orthorhombic_11.0A_separation | 48 +++ .../DC_MgO_hosts/POSCAR_2x2_5.4A_separation | 24 ++ .../POSCAR_2x5_orthorhombic_11.0A_separation | 88 ++++ .../DC_MgO_hosts/POSCAR_3x3_11.0A_separation | 44 ++ .../DC_MgO_hosts/POSCAR_3x3_5.4A_separation | 44 ++ .../DC_MgO_hosts/POSCAR_4x4_11.0A_separation | 72 ++++ .../DC_MgO_hosts/POSCAR_4x4_14.7A_separation | 72 ++++ .../DC_MgO_hosts/POSCAR_5x1_5.4A_separation | 28 ++ .../DC_MgO_hosts/POSCAR_5x1_6.0A_separation | 108 +++++ .../DC_MgO_hosts/POSCAR_6x6_5.4A_separation | 152 +++++++ .../DC_MgO_hosts/POSCAR_7x7_8.4A_separation | 204 +++++++++ .../example_files/DC_MgO_hosts/POSCAR_MgO_HEX | 204 +++++++++ ...AR_orthorhombic_11.1A_separation_Mg_seeded | 50 +++ 16 files changed, 1971 insertions(+) create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_10x10_5.4_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_10x10_6.0A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_1x1_5.4A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_1x5_orthorhombic_11.0A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_2x2_5.4A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_2x5_orthorhombic_11.0A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_3x3_11.0A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_3x3_5.4A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_4x4_11.0A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_4x4_14.7A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_5x1_5.4A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_5x1_6.0A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_6x6_5.4A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_7x7_8.4A_separation create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_MgO_HEX create mode 100644 example/example_files/DC_MgO_hosts/POSCAR_orthorhombic_11.1A_separation_Mg_seeded diff --git a/example/example_files/DC_MgO_hosts/POSCAR_10x10_5.4_separation b/example/example_files/DC_MgO_hosts/POSCAR_10x10_5.4_separation new file mode 100644 index 00000000..3ca82577 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_10x10_5.4_separation @@ -0,0 +1,408 @@ +c1 + 1.000000000 + 24.639999866 0.000000000 0.000000000 + -12.319999933 21.338865834 0.000000000 + 0.000000000 0.000000000 10.710999966 +C +400 +Direct + 0.000000000 0.000000000 0.250000000 + 0.100000000 0.000000000 0.250000000 + 0.200000000 0.000000000 0.250000000 + 0.300000000 0.000000000 0.250000000 + 0.400000000 0.000000000 0.250000000 + 0.500000000 0.000000000 0.250000000 + 0.600000000 0.000000000 0.250000000 + 0.700000000 0.000000000 0.250000000 + 0.800000000 0.000000000 0.250000000 + 0.900000000 0.000000000 0.250000000 + 0.000000000 0.100000000 0.250000000 + 0.100000000 0.100000000 0.250000000 + 0.200000000 0.100000000 0.250000000 + 0.300000000 0.100000000 0.250000000 + 0.400000000 0.100000000 0.250000000 + 0.500000000 0.100000000 0.250000000 + 0.600000000 0.100000000 0.250000000 + 0.700000000 0.100000000 0.250000000 + 0.800000000 0.100000000 0.250000000 + 0.900000000 0.100000000 0.250000000 + 0.000000000 0.200000000 0.250000000 + 0.100000000 0.200000000 0.250000000 + 0.200000000 0.200000000 0.250000000 + 0.300000000 0.200000000 0.250000000 + 0.400000000 0.200000000 0.250000000 + 0.500000000 0.200000000 0.250000000 + 0.600000000 0.200000000 0.250000000 + 0.700000000 0.200000000 0.250000000 + 0.800000000 0.200000000 0.250000000 + 0.900000000 0.200000000 0.250000000 + 0.000000000 0.300000000 0.250000000 + 0.100000000 0.300000000 0.250000000 + 0.200000000 0.300000000 0.250000000 + 0.300000000 0.300000000 0.250000000 + 0.400000000 0.300000000 0.250000000 + 0.500000000 0.300000000 0.250000000 + 0.600000000 0.300000000 0.250000000 + 0.700000000 0.300000000 0.250000000 + 0.800000000 0.300000000 0.250000000 + 0.900000000 0.300000000 0.250000000 + 0.000000000 0.400000000 0.250000000 + 0.100000000 0.400000000 0.250000000 + 0.200000000 0.400000000 0.250000000 + 0.300000000 0.400000000 0.250000000 + 0.400000000 0.400000000 0.250000000 + 0.500000000 0.400000000 0.250000000 + 0.600000000 0.400000000 0.250000000 + 0.700000000 0.400000000 0.250000000 + 0.800000000 0.400000000 0.250000000 + 0.900000000 0.400000000 0.250000000 + 0.000000000 0.500000000 0.250000000 + 0.100000000 0.500000000 0.250000000 + 0.200000000 0.500000000 0.250000000 + 0.300000000 0.500000000 0.250000000 + 0.400000000 0.500000000 0.250000000 + 0.500000000 0.500000000 0.250000000 + 0.600000000 0.500000000 0.250000000 + 0.700000000 0.500000000 0.250000000 + 0.800000000 0.500000000 0.250000000 + 0.900000000 0.500000000 0.250000000 + 0.000000000 0.600000000 0.250000000 + 0.100000000 0.600000000 0.250000000 + 0.200000000 0.600000000 0.250000000 + 0.300000000 0.600000000 0.250000000 + 0.400000000 0.600000000 0.250000000 + 0.500000000 0.600000000 0.250000000 + 0.600000000 0.600000000 0.250000000 + 0.700000000 0.600000000 0.250000000 + 0.800000000 0.600000000 0.250000000 + 0.900000000 0.600000000 0.250000000 + 0.000000000 0.700000000 0.250000000 + 0.100000000 0.700000000 0.250000000 + 0.200000000 0.700000000 0.250000000 + 0.300000000 0.700000000 0.250000000 + 0.400000000 0.700000000 0.250000000 + 0.500000000 0.700000000 0.250000000 + 0.600000000 0.700000000 0.250000000 + 0.700000000 0.700000000 0.250000000 + 0.800000000 0.700000000 0.250000000 + 0.900000000 0.700000000 0.250000000 + 0.000000000 0.800000000 0.250000000 + 0.100000000 0.800000000 0.250000000 + 0.200000000 0.800000000 0.250000000 + 0.300000000 0.800000000 0.250000000 + 0.400000000 0.800000000 0.250000000 + 0.500000000 0.800000000 0.250000000 + 0.600000000 0.800000000 0.250000000 + 0.700000000 0.800000000 0.250000000 + 0.800000000 0.800000000 0.250000000 + 0.900000000 0.800000000 0.250000000 + 0.000000000 0.900000000 0.250000000 + 0.100000000 0.900000000 0.250000000 + 0.200000000 0.900000000 0.250000000 + 0.300000000 0.900000000 0.250000000 + 0.400000000 0.900000000 0.250000000 + 0.500000000 0.900000000 0.250000000 + 0.600000000 0.900000000 0.250000000 + 0.700000000 0.900000000 0.250000000 + 0.800000000 0.900000000 0.250000000 + 0.900000000 0.900000000 0.250000000 + 0.000000000 0.000000000 0.749999982 + 0.100000000 0.000000000 0.749999982 + 0.200000000 0.000000000 0.749999982 + 0.300000000 0.000000000 0.749999982 + 0.400000000 0.000000000 0.749999982 + 0.500000000 0.000000000 0.749999982 + 0.600000000 0.000000000 0.749999982 + 0.700000000 0.000000000 0.749999982 + 0.800000000 0.000000000 0.749999982 + 0.900000000 0.000000000 0.749999982 + 0.000000000 0.100000000 0.749999982 + 0.100000000 0.100000000 0.749999982 + 0.200000000 0.100000000 0.749999982 + 0.300000000 0.100000000 0.749999982 + 0.400000000 0.100000000 0.749999982 + 0.500000000 0.100000000 0.749999982 + 0.600000000 0.100000000 0.749999982 + 0.700000000 0.100000000 0.749999982 + 0.800000000 0.100000000 0.749999982 + 0.900000000 0.100000000 0.749999982 + 0.000000000 0.200000000 0.749999982 + 0.100000000 0.200000000 0.749999982 + 0.200000000 0.200000000 0.749999982 + 0.300000000 0.200000000 0.749999982 + 0.400000000 0.200000000 0.749999982 + 0.500000000 0.200000000 0.749999982 + 0.600000000 0.200000000 0.749999982 + 0.700000000 0.200000000 0.749999982 + 0.800000000 0.200000000 0.749999982 + 0.900000000 0.200000000 0.749999982 + 0.000000000 0.300000000 0.749999982 + 0.100000000 0.300000000 0.749999982 + 0.200000000 0.300000000 0.749999982 + 0.300000000 0.300000000 0.749999982 + 0.400000000 0.300000000 0.749999982 + 0.500000000 0.300000000 0.749999982 + 0.600000000 0.300000000 0.749999982 + 0.700000000 0.300000000 0.749999982 + 0.800000000 0.300000000 0.749999982 + 0.900000000 0.300000000 0.749999982 + 0.000000000 0.400000000 0.749999982 + 0.100000000 0.400000000 0.749999982 + 0.200000000 0.400000000 0.749999982 + 0.300000000 0.400000000 0.749999982 + 0.400000000 0.400000000 0.749999982 + 0.500000000 0.400000000 0.749999982 + 0.600000000 0.400000000 0.749999982 + 0.700000000 0.400000000 0.749999982 + 0.800000000 0.400000000 0.749999982 + 0.900000000 0.400000000 0.749999982 + 0.000000000 0.500000000 0.749999982 + 0.100000000 0.500000000 0.749999982 + 0.200000000 0.500000000 0.749999982 + 0.300000000 0.500000000 0.749999982 + 0.400000000 0.500000000 0.749999982 + 0.500000000 0.500000000 0.749999982 + 0.600000000 0.500000000 0.749999982 + 0.700000000 0.500000000 0.749999982 + 0.800000000 0.500000000 0.749999982 + 0.900000000 0.500000000 0.749999982 + 0.000000000 0.600000000 0.749999982 + 0.100000000 0.600000000 0.749999982 + 0.200000000 0.600000000 0.749999982 + 0.300000000 0.600000000 0.749999982 + 0.400000000 0.600000000 0.749999982 + 0.500000000 0.600000000 0.749999982 + 0.600000000 0.600000000 0.749999982 + 0.700000000 0.600000000 0.749999982 + 0.800000000 0.600000000 0.749999982 + 0.900000000 0.600000000 0.749999982 + 0.000000000 0.700000000 0.749999982 + 0.100000000 0.700000000 0.749999982 + 0.200000000 0.700000000 0.749999982 + 0.300000000 0.700000000 0.749999982 + 0.400000000 0.700000000 0.749999982 + 0.500000000 0.700000000 0.749999982 + 0.600000000 0.700000000 0.749999982 + 0.700000000 0.700000000 0.749999982 + 0.800000000 0.700000000 0.749999982 + 0.900000000 0.700000000 0.749999982 + 0.000000000 0.800000000 0.749999982 + 0.100000000 0.800000000 0.749999982 + 0.200000000 0.800000000 0.749999982 + 0.300000000 0.800000000 0.749999982 + 0.400000000 0.800000000 0.749999982 + 0.500000000 0.800000000 0.749999982 + 0.600000000 0.800000000 0.749999982 + 0.700000000 0.800000000 0.749999982 + 0.800000000 0.800000000 0.749999982 + 0.900000000 0.800000000 0.749999982 + 0.000000000 0.900000000 0.749999982 + 0.100000000 0.900000000 0.749999982 + 0.200000000 0.900000000 0.749999982 + 0.300000000 0.900000000 0.749999982 + 0.400000000 0.900000000 0.749999982 + 0.500000000 0.900000000 0.749999982 + 0.600000000 0.900000000 0.749999982 + 0.700000000 0.900000000 0.749999982 + 0.800000000 0.900000000 0.749999982 + 0.900000000 0.900000000 0.749999982 + 0.033333334 0.066666668 0.250000000 + 0.133333334 0.066666668 0.250000000 + 0.233333334 0.066666668 0.250000000 + 0.333333334 0.066666668 0.250000000 + 0.433333334 0.066666668 0.250000000 + 0.533333334 0.066666668 0.250000000 + 0.633333334 0.066666668 0.250000000 + 0.733333334 0.066666668 0.250000000 + 0.833333334 0.066666668 0.250000000 + 0.933333334 0.066666668 0.250000000 + 0.033333334 0.166666668 0.250000000 + 0.133333334 0.166666668 0.250000000 + 0.233333334 0.166666668 0.250000000 + 0.333333334 0.166666668 0.250000000 + 0.433333334 0.166666668 0.250000000 + 0.533333334 0.166666668 0.250000000 + 0.633333334 0.166666668 0.250000000 + 0.733333334 0.166666668 0.250000000 + 0.833333334 0.166666668 0.250000000 + 0.933333334 0.166666668 0.250000000 + 0.033333334 0.266666668 0.250000000 + 0.133333334 0.266666668 0.250000000 + 0.233333334 0.266666668 0.250000000 + 0.333333334 0.266666668 0.250000000 + 0.433333334 0.266666668 0.250000000 + 0.533333334 0.266666668 0.250000000 + 0.633333334 0.266666668 0.250000000 + 0.733333334 0.266666668 0.250000000 + 0.833333334 0.266666668 0.250000000 + 0.933333334 0.266666668 0.250000000 + 0.033333334 0.366666668 0.250000000 + 0.133333334 0.366666668 0.250000000 + 0.233333334 0.366666668 0.250000000 + 0.333333334 0.366666668 0.250000000 + 0.433333334 0.366666668 0.250000000 + 0.533333334 0.366666668 0.250000000 + 0.633333334 0.366666668 0.250000000 + 0.733333334 0.366666668 0.250000000 + 0.833333334 0.366666668 0.250000000 + 0.933333334 0.366666668 0.250000000 + 0.033333334 0.466666668 0.250000000 + 0.133333334 0.466666668 0.250000000 + 0.233333334 0.466666668 0.250000000 + 0.333333334 0.466666668 0.250000000 + 0.433333334 0.466666668 0.250000000 + 0.533333334 0.466666668 0.250000000 + 0.633333334 0.466666668 0.250000000 + 0.733333334 0.466666668 0.250000000 + 0.833333334 0.466666668 0.250000000 + 0.933333334 0.466666668 0.250000000 + 0.033333334 0.566666668 0.250000000 + 0.133333334 0.566666668 0.250000000 + 0.233333334 0.566666668 0.250000000 + 0.333333334 0.566666668 0.250000000 + 0.433333334 0.566666668 0.250000000 + 0.533333334 0.566666668 0.250000000 + 0.633333334 0.566666668 0.250000000 + 0.733333334 0.566666668 0.250000000 + 0.833333334 0.566666668 0.250000000 + 0.933333334 0.566666668 0.250000000 + 0.033333334 0.666666668 0.250000000 + 0.133333334 0.666666668 0.250000000 + 0.233333334 0.666666668 0.250000000 + 0.333333334 0.666666668 0.250000000 + 0.433333334 0.666666668 0.250000000 + 0.533333334 0.666666668 0.250000000 + 0.633333334 0.666666668 0.250000000 + 0.733333334 0.666666668 0.250000000 + 0.833333334 0.666666668 0.250000000 + 0.933333334 0.666666668 0.250000000 + 0.033333334 0.766666668 0.250000000 + 0.133333334 0.766666668 0.250000000 + 0.233333334 0.766666668 0.250000000 + 0.333333334 0.766666668 0.250000000 + 0.433333334 0.766666668 0.250000000 + 0.533333334 0.766666668 0.250000000 + 0.633333334 0.766666668 0.250000000 + 0.733333334 0.766666668 0.250000000 + 0.833333334 0.766666668 0.250000000 + 0.933333334 0.766666668 0.250000000 + 0.033333334 0.866666668 0.250000000 + 0.133333334 0.866666668 0.250000000 + 0.233333334 0.866666668 0.250000000 + 0.333333334 0.866666668 0.250000000 + 0.433333334 0.866666668 0.250000000 + 0.533333334 0.866666668 0.250000000 + 0.633333334 0.866666668 0.250000000 + 0.733333334 0.866666668 0.250000000 + 0.833333334 0.866666668 0.250000000 + 0.933333334 0.866666668 0.250000000 + 0.033333334 0.966666668 0.250000000 + 0.133333334 0.966666668 0.250000000 + 0.233333334 0.966666668 0.250000000 + 0.333333334 0.966666668 0.250000000 + 0.433333334 0.966666668 0.250000000 + 0.533333334 0.966666668 0.250000000 + 0.633333334 0.966666668 0.250000000 + 0.733333334 0.966666668 0.250000000 + 0.833333334 0.966666668 0.250000000 + 0.933333334 0.966666668 0.250000000 + 0.066666666 0.033333331 0.749999982 + 0.166666666 0.033333331 0.749999982 + 0.266666666 0.033333331 0.749999982 + 0.366666666 0.033333331 0.749999982 + 0.466666666 0.033333331 0.749999982 + 0.566666666 0.033333331 0.749999982 + 0.666666666 0.033333331 0.749999982 + 0.766666666 0.033333331 0.749999982 + 0.866666666 0.033333331 0.749999982 + 0.966666666 0.033333331 0.749999982 + 0.066666666 0.133333331 0.749999982 + 0.166666666 0.133333331 0.749999982 + 0.266666666 0.133333331 0.749999982 + 0.366666666 0.133333331 0.749999982 + 0.466666666 0.133333331 0.749999982 + 0.566666666 0.133333331 0.749999982 + 0.666666666 0.133333331 0.749999982 + 0.766666666 0.133333331 0.749999982 + 0.866666666 0.133333331 0.749999982 + 0.966666666 0.133333331 0.749999982 + 0.066666666 0.233333331 0.749999982 + 0.166666666 0.233333331 0.749999982 + 0.266666666 0.233333331 0.749999982 + 0.366666666 0.233333331 0.749999982 + 0.466666666 0.233333331 0.749999982 + 0.566666666 0.233333331 0.749999982 + 0.666666666 0.233333331 0.749999982 + 0.766666666 0.233333331 0.749999982 + 0.866666666 0.233333331 0.749999982 + 0.966666666 0.233333331 0.749999982 + 0.066666666 0.333333331 0.749999982 + 0.166666666 0.333333331 0.749999982 + 0.266666666 0.333333331 0.749999982 + 0.366666666 0.333333331 0.749999982 + 0.466666666 0.333333331 0.749999982 + 0.566666666 0.333333331 0.749999982 + 0.666666666 0.333333331 0.749999982 + 0.766666666 0.333333331 0.749999982 + 0.866666666 0.333333331 0.749999982 + 0.966666666 0.333333331 0.749999982 + 0.066666666 0.433333331 0.749999982 + 0.166666666 0.433333331 0.749999982 + 0.266666666 0.433333331 0.749999982 + 0.366666666 0.433333331 0.749999982 + 0.466666666 0.433333331 0.749999982 + 0.566666666 0.433333331 0.749999982 + 0.666666666 0.433333331 0.749999982 + 0.766666666 0.433333331 0.749999982 + 0.866666666 0.433333331 0.749999982 + 0.966666666 0.433333331 0.749999982 + 0.066666666 0.533333331 0.749999982 + 0.166666666 0.533333331 0.749999982 + 0.266666666 0.533333331 0.749999982 + 0.366666666 0.533333331 0.749999982 + 0.466666666 0.533333331 0.749999982 + 0.566666666 0.533333331 0.749999982 + 0.666666666 0.533333331 0.749999982 + 0.766666666 0.533333331 0.749999982 + 0.866666666 0.533333331 0.749999982 + 0.966666666 0.533333331 0.749999982 + 0.066666666 0.633333331 0.749999982 + 0.166666666 0.633333331 0.749999982 + 0.266666666 0.633333331 0.749999982 + 0.366666666 0.633333331 0.749999982 + 0.466666666 0.633333331 0.749999982 + 0.566666666 0.633333331 0.749999982 + 0.666666666 0.633333331 0.749999982 + 0.766666666 0.633333331 0.749999982 + 0.866666666 0.633333331 0.749999982 + 0.966666666 0.633333331 0.749999982 + 0.066666666 0.733333331 0.749999982 + 0.166666666 0.733333331 0.749999982 + 0.266666666 0.733333331 0.749999982 + 0.366666666 0.733333331 0.749999982 + 0.466666666 0.733333331 0.749999982 + 0.566666666 0.733333331 0.749999982 + 0.666666666 0.733333331 0.749999982 + 0.766666666 0.733333331 0.749999982 + 0.866666666 0.733333331 0.749999982 + 0.966666666 0.733333331 0.749999982 + 0.066666666 0.833333331 0.749999982 + 0.166666666 0.833333331 0.749999982 + 0.266666666 0.833333331 0.749999982 + 0.366666666 0.833333331 0.749999982 + 0.466666666 0.833333331 0.749999982 + 0.566666666 0.833333331 0.749999982 + 0.666666666 0.833333331 0.749999982 + 0.766666666 0.833333331 0.749999982 + 0.866666666 0.833333331 0.749999982 + 0.966666666 0.833333331 0.749999982 + 0.066666666 0.933333331 0.749999982 + 0.166666666 0.933333331 0.749999982 + 0.266666666 0.933333331 0.749999982 + 0.366666666 0.933333331 0.749999982 + 0.466666666 0.933333331 0.749999982 + 0.566666666 0.933333331 0.749999982 + 0.666666666 0.933333331 0.749999982 + 0.766666666 0.933333331 0.749999982 + 0.866666666 0.933333331 0.749999982 + 0.966666666 0.933333331 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_10x10_6.0A_separation b/example/example_files/DC_MgO_hosts/POSCAR_10x10_6.0A_separation new file mode 100644 index 00000000..f28bfc5b --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_10x10_6.0A_separation @@ -0,0 +1,408 @@ +c1 + 1.000000000 + 24.639999866 0.000000000 0.000000000 + -12.319999933 21.338865834 0.000000000 + 0.000000000 0.000000000 12.029835 +C +400 +Direct + 0.000000000 0.000000000 0.250000000 + 0.100000000 0.000000000 0.250000000 + 0.200000000 0.000000000 0.250000000 + 0.300000000 0.000000000 0.250000000 + 0.400000000 0.000000000 0.250000000 + 0.500000000 0.000000000 0.250000000 + 0.600000000 0.000000000 0.250000000 + 0.700000000 0.000000000 0.250000000 + 0.800000000 0.000000000 0.250000000 + 0.900000000 0.000000000 0.250000000 + 0.000000000 0.100000000 0.250000000 + 0.100000000 0.100000000 0.250000000 + 0.200000000 0.100000000 0.250000000 + 0.300000000 0.100000000 0.250000000 + 0.400000000 0.100000000 0.250000000 + 0.500000000 0.100000000 0.250000000 + 0.600000000 0.100000000 0.250000000 + 0.700000000 0.100000000 0.250000000 + 0.800000000 0.100000000 0.250000000 + 0.900000000 0.100000000 0.250000000 + 0.000000000 0.200000000 0.250000000 + 0.100000000 0.200000000 0.250000000 + 0.200000000 0.200000000 0.250000000 + 0.300000000 0.200000000 0.250000000 + 0.400000000 0.200000000 0.250000000 + 0.500000000 0.200000000 0.250000000 + 0.600000000 0.200000000 0.250000000 + 0.700000000 0.200000000 0.250000000 + 0.800000000 0.200000000 0.250000000 + 0.900000000 0.200000000 0.250000000 + 0.000000000 0.300000000 0.250000000 + 0.100000000 0.300000000 0.250000000 + 0.200000000 0.300000000 0.250000000 + 0.300000000 0.300000000 0.250000000 + 0.400000000 0.300000000 0.250000000 + 0.500000000 0.300000000 0.250000000 + 0.600000000 0.300000000 0.250000000 + 0.700000000 0.300000000 0.250000000 + 0.800000000 0.300000000 0.250000000 + 0.900000000 0.300000000 0.250000000 + 0.000000000 0.400000000 0.250000000 + 0.100000000 0.400000000 0.250000000 + 0.200000000 0.400000000 0.250000000 + 0.300000000 0.400000000 0.250000000 + 0.400000000 0.400000000 0.250000000 + 0.500000000 0.400000000 0.250000000 + 0.600000000 0.400000000 0.250000000 + 0.700000000 0.400000000 0.250000000 + 0.800000000 0.400000000 0.250000000 + 0.900000000 0.400000000 0.250000000 + 0.000000000 0.500000000 0.250000000 + 0.100000000 0.500000000 0.250000000 + 0.200000000 0.500000000 0.250000000 + 0.300000000 0.500000000 0.250000000 + 0.400000000 0.500000000 0.250000000 + 0.500000000 0.500000000 0.250000000 + 0.600000000 0.500000000 0.250000000 + 0.700000000 0.500000000 0.250000000 + 0.800000000 0.500000000 0.250000000 + 0.900000000 0.500000000 0.250000000 + 0.000000000 0.600000000 0.250000000 + 0.100000000 0.600000000 0.250000000 + 0.200000000 0.600000000 0.250000000 + 0.300000000 0.600000000 0.250000000 + 0.400000000 0.600000000 0.250000000 + 0.500000000 0.600000000 0.250000000 + 0.600000000 0.600000000 0.250000000 + 0.700000000 0.600000000 0.250000000 + 0.800000000 0.600000000 0.250000000 + 0.900000000 0.600000000 0.250000000 + 0.000000000 0.700000000 0.250000000 + 0.100000000 0.700000000 0.250000000 + 0.200000000 0.700000000 0.250000000 + 0.300000000 0.700000000 0.250000000 + 0.400000000 0.700000000 0.250000000 + 0.500000000 0.700000000 0.250000000 + 0.600000000 0.700000000 0.250000000 + 0.700000000 0.700000000 0.250000000 + 0.800000000 0.700000000 0.250000000 + 0.900000000 0.700000000 0.250000000 + 0.000000000 0.800000000 0.250000000 + 0.100000000 0.800000000 0.250000000 + 0.200000000 0.800000000 0.250000000 + 0.300000000 0.800000000 0.250000000 + 0.400000000 0.800000000 0.250000000 + 0.500000000 0.800000000 0.250000000 + 0.600000000 0.800000000 0.250000000 + 0.700000000 0.800000000 0.250000000 + 0.800000000 0.800000000 0.250000000 + 0.900000000 0.800000000 0.250000000 + 0.000000000 0.900000000 0.250000000 + 0.100000000 0.900000000 0.250000000 + 0.200000000 0.900000000 0.250000000 + 0.300000000 0.900000000 0.250000000 + 0.400000000 0.900000000 0.250000000 + 0.500000000 0.900000000 0.250000000 + 0.600000000 0.900000000 0.250000000 + 0.700000000 0.900000000 0.250000000 + 0.800000000 0.900000000 0.250000000 + 0.900000000 0.900000000 0.250000000 + 0.000000000 0.000000000 0.749999982 + 0.100000000 0.000000000 0.749999982 + 0.200000000 0.000000000 0.749999982 + 0.300000000 0.000000000 0.749999982 + 0.400000000 0.000000000 0.749999982 + 0.500000000 0.000000000 0.749999982 + 0.600000000 0.000000000 0.749999982 + 0.700000000 0.000000000 0.749999982 + 0.800000000 0.000000000 0.749999982 + 0.900000000 0.000000000 0.749999982 + 0.000000000 0.100000000 0.749999982 + 0.100000000 0.100000000 0.749999982 + 0.200000000 0.100000000 0.749999982 + 0.300000000 0.100000000 0.749999982 + 0.400000000 0.100000000 0.749999982 + 0.500000000 0.100000000 0.749999982 + 0.600000000 0.100000000 0.749999982 + 0.700000000 0.100000000 0.749999982 + 0.800000000 0.100000000 0.749999982 + 0.900000000 0.100000000 0.749999982 + 0.000000000 0.200000000 0.749999982 + 0.100000000 0.200000000 0.749999982 + 0.200000000 0.200000000 0.749999982 + 0.300000000 0.200000000 0.749999982 + 0.400000000 0.200000000 0.749999982 + 0.500000000 0.200000000 0.749999982 + 0.600000000 0.200000000 0.749999982 + 0.700000000 0.200000000 0.749999982 + 0.800000000 0.200000000 0.749999982 + 0.900000000 0.200000000 0.749999982 + 0.000000000 0.300000000 0.749999982 + 0.100000000 0.300000000 0.749999982 + 0.200000000 0.300000000 0.749999982 + 0.300000000 0.300000000 0.749999982 + 0.400000000 0.300000000 0.749999982 + 0.500000000 0.300000000 0.749999982 + 0.600000000 0.300000000 0.749999982 + 0.700000000 0.300000000 0.749999982 + 0.800000000 0.300000000 0.749999982 + 0.900000000 0.300000000 0.749999982 + 0.000000000 0.400000000 0.749999982 + 0.100000000 0.400000000 0.749999982 + 0.200000000 0.400000000 0.749999982 + 0.300000000 0.400000000 0.749999982 + 0.400000000 0.400000000 0.749999982 + 0.500000000 0.400000000 0.749999982 + 0.600000000 0.400000000 0.749999982 + 0.700000000 0.400000000 0.749999982 + 0.800000000 0.400000000 0.749999982 + 0.900000000 0.400000000 0.749999982 + 0.000000000 0.500000000 0.749999982 + 0.100000000 0.500000000 0.749999982 + 0.200000000 0.500000000 0.749999982 + 0.300000000 0.500000000 0.749999982 + 0.400000000 0.500000000 0.749999982 + 0.500000000 0.500000000 0.749999982 + 0.600000000 0.500000000 0.749999982 + 0.700000000 0.500000000 0.749999982 + 0.800000000 0.500000000 0.749999982 + 0.900000000 0.500000000 0.749999982 + 0.000000000 0.600000000 0.749999982 + 0.100000000 0.600000000 0.749999982 + 0.200000000 0.600000000 0.749999982 + 0.300000000 0.600000000 0.749999982 + 0.400000000 0.600000000 0.749999982 + 0.500000000 0.600000000 0.749999982 + 0.600000000 0.600000000 0.749999982 + 0.700000000 0.600000000 0.749999982 + 0.800000000 0.600000000 0.749999982 + 0.900000000 0.600000000 0.749999982 + 0.000000000 0.700000000 0.749999982 + 0.100000000 0.700000000 0.749999982 + 0.200000000 0.700000000 0.749999982 + 0.300000000 0.700000000 0.749999982 + 0.400000000 0.700000000 0.749999982 + 0.500000000 0.700000000 0.749999982 + 0.600000000 0.700000000 0.749999982 + 0.700000000 0.700000000 0.749999982 + 0.800000000 0.700000000 0.749999982 + 0.900000000 0.700000000 0.749999982 + 0.000000000 0.800000000 0.749999982 + 0.100000000 0.800000000 0.749999982 + 0.200000000 0.800000000 0.749999982 + 0.300000000 0.800000000 0.749999982 + 0.400000000 0.800000000 0.749999982 + 0.500000000 0.800000000 0.749999982 + 0.600000000 0.800000000 0.749999982 + 0.700000000 0.800000000 0.749999982 + 0.800000000 0.800000000 0.749999982 + 0.900000000 0.800000000 0.749999982 + 0.000000000 0.900000000 0.749999982 + 0.100000000 0.900000000 0.749999982 + 0.200000000 0.900000000 0.749999982 + 0.300000000 0.900000000 0.749999982 + 0.400000000 0.900000000 0.749999982 + 0.500000000 0.900000000 0.749999982 + 0.600000000 0.900000000 0.749999982 + 0.700000000 0.900000000 0.749999982 + 0.800000000 0.900000000 0.749999982 + 0.900000000 0.900000000 0.749999982 + 0.033333334 0.066666668 0.250000000 + 0.133333334 0.066666668 0.250000000 + 0.233333334 0.066666668 0.250000000 + 0.333333334 0.066666668 0.250000000 + 0.433333334 0.066666668 0.250000000 + 0.533333334 0.066666668 0.250000000 + 0.633333334 0.066666668 0.250000000 + 0.733333334 0.066666668 0.250000000 + 0.833333334 0.066666668 0.250000000 + 0.933333334 0.066666668 0.250000000 + 0.033333334 0.166666668 0.250000000 + 0.133333334 0.166666668 0.250000000 + 0.233333334 0.166666668 0.250000000 + 0.333333334 0.166666668 0.250000000 + 0.433333334 0.166666668 0.250000000 + 0.533333334 0.166666668 0.250000000 + 0.633333334 0.166666668 0.250000000 + 0.733333334 0.166666668 0.250000000 + 0.833333334 0.166666668 0.250000000 + 0.933333334 0.166666668 0.250000000 + 0.033333334 0.266666668 0.250000000 + 0.133333334 0.266666668 0.250000000 + 0.233333334 0.266666668 0.250000000 + 0.333333334 0.266666668 0.250000000 + 0.433333334 0.266666668 0.250000000 + 0.533333334 0.266666668 0.250000000 + 0.633333334 0.266666668 0.250000000 + 0.733333334 0.266666668 0.250000000 + 0.833333334 0.266666668 0.250000000 + 0.933333334 0.266666668 0.250000000 + 0.033333334 0.366666668 0.250000000 + 0.133333334 0.366666668 0.250000000 + 0.233333334 0.366666668 0.250000000 + 0.333333334 0.366666668 0.250000000 + 0.433333334 0.366666668 0.250000000 + 0.533333334 0.366666668 0.250000000 + 0.633333334 0.366666668 0.250000000 + 0.733333334 0.366666668 0.250000000 + 0.833333334 0.366666668 0.250000000 + 0.933333334 0.366666668 0.250000000 + 0.033333334 0.466666668 0.250000000 + 0.133333334 0.466666668 0.250000000 + 0.233333334 0.466666668 0.250000000 + 0.333333334 0.466666668 0.250000000 + 0.433333334 0.466666668 0.250000000 + 0.533333334 0.466666668 0.250000000 + 0.633333334 0.466666668 0.250000000 + 0.733333334 0.466666668 0.250000000 + 0.833333334 0.466666668 0.250000000 + 0.933333334 0.466666668 0.250000000 + 0.033333334 0.566666668 0.250000000 + 0.133333334 0.566666668 0.250000000 + 0.233333334 0.566666668 0.250000000 + 0.333333334 0.566666668 0.250000000 + 0.433333334 0.566666668 0.250000000 + 0.533333334 0.566666668 0.250000000 + 0.633333334 0.566666668 0.250000000 + 0.733333334 0.566666668 0.250000000 + 0.833333334 0.566666668 0.250000000 + 0.933333334 0.566666668 0.250000000 + 0.033333334 0.666666668 0.250000000 + 0.133333334 0.666666668 0.250000000 + 0.233333334 0.666666668 0.250000000 + 0.333333334 0.666666668 0.250000000 + 0.433333334 0.666666668 0.250000000 + 0.533333334 0.666666668 0.250000000 + 0.633333334 0.666666668 0.250000000 + 0.733333334 0.666666668 0.250000000 + 0.833333334 0.666666668 0.250000000 + 0.933333334 0.666666668 0.250000000 + 0.033333334 0.766666668 0.250000000 + 0.133333334 0.766666668 0.250000000 + 0.233333334 0.766666668 0.250000000 + 0.333333334 0.766666668 0.250000000 + 0.433333334 0.766666668 0.250000000 + 0.533333334 0.766666668 0.250000000 + 0.633333334 0.766666668 0.250000000 + 0.733333334 0.766666668 0.250000000 + 0.833333334 0.766666668 0.250000000 + 0.933333334 0.766666668 0.250000000 + 0.033333334 0.866666668 0.250000000 + 0.133333334 0.866666668 0.250000000 + 0.233333334 0.866666668 0.250000000 + 0.333333334 0.866666668 0.250000000 + 0.433333334 0.866666668 0.250000000 + 0.533333334 0.866666668 0.250000000 + 0.633333334 0.866666668 0.250000000 + 0.733333334 0.866666668 0.250000000 + 0.833333334 0.866666668 0.250000000 + 0.933333334 0.866666668 0.250000000 + 0.033333334 0.966666668 0.250000000 + 0.133333334 0.966666668 0.250000000 + 0.233333334 0.966666668 0.250000000 + 0.333333334 0.966666668 0.250000000 + 0.433333334 0.966666668 0.250000000 + 0.533333334 0.966666668 0.250000000 + 0.633333334 0.966666668 0.250000000 + 0.733333334 0.966666668 0.250000000 + 0.833333334 0.966666668 0.250000000 + 0.933333334 0.966666668 0.250000000 + 0.066666666 0.033333331 0.749999982 + 0.166666666 0.033333331 0.749999982 + 0.266666666 0.033333331 0.749999982 + 0.366666666 0.033333331 0.749999982 + 0.466666666 0.033333331 0.749999982 + 0.566666666 0.033333331 0.749999982 + 0.666666666 0.033333331 0.749999982 + 0.766666666 0.033333331 0.749999982 + 0.866666666 0.033333331 0.749999982 + 0.966666666 0.033333331 0.749999982 + 0.066666666 0.133333331 0.749999982 + 0.166666666 0.133333331 0.749999982 + 0.266666666 0.133333331 0.749999982 + 0.366666666 0.133333331 0.749999982 + 0.466666666 0.133333331 0.749999982 + 0.566666666 0.133333331 0.749999982 + 0.666666666 0.133333331 0.749999982 + 0.766666666 0.133333331 0.749999982 + 0.866666666 0.133333331 0.749999982 + 0.966666666 0.133333331 0.749999982 + 0.066666666 0.233333331 0.749999982 + 0.166666666 0.233333331 0.749999982 + 0.266666666 0.233333331 0.749999982 + 0.366666666 0.233333331 0.749999982 + 0.466666666 0.233333331 0.749999982 + 0.566666666 0.233333331 0.749999982 + 0.666666666 0.233333331 0.749999982 + 0.766666666 0.233333331 0.749999982 + 0.866666666 0.233333331 0.749999982 + 0.966666666 0.233333331 0.749999982 + 0.066666666 0.333333331 0.749999982 + 0.166666666 0.333333331 0.749999982 + 0.266666666 0.333333331 0.749999982 + 0.366666666 0.333333331 0.749999982 + 0.466666666 0.333333331 0.749999982 + 0.566666666 0.333333331 0.749999982 + 0.666666666 0.333333331 0.749999982 + 0.766666666 0.333333331 0.749999982 + 0.866666666 0.333333331 0.749999982 + 0.966666666 0.333333331 0.749999982 + 0.066666666 0.433333331 0.749999982 + 0.166666666 0.433333331 0.749999982 + 0.266666666 0.433333331 0.749999982 + 0.366666666 0.433333331 0.749999982 + 0.466666666 0.433333331 0.749999982 + 0.566666666 0.433333331 0.749999982 + 0.666666666 0.433333331 0.749999982 + 0.766666666 0.433333331 0.749999982 + 0.866666666 0.433333331 0.749999982 + 0.966666666 0.433333331 0.749999982 + 0.066666666 0.533333331 0.749999982 + 0.166666666 0.533333331 0.749999982 + 0.266666666 0.533333331 0.749999982 + 0.366666666 0.533333331 0.749999982 + 0.466666666 0.533333331 0.749999982 + 0.566666666 0.533333331 0.749999982 + 0.666666666 0.533333331 0.749999982 + 0.766666666 0.533333331 0.749999982 + 0.866666666 0.533333331 0.749999982 + 0.966666666 0.533333331 0.749999982 + 0.066666666 0.633333331 0.749999982 + 0.166666666 0.633333331 0.749999982 + 0.266666666 0.633333331 0.749999982 + 0.366666666 0.633333331 0.749999982 + 0.466666666 0.633333331 0.749999982 + 0.566666666 0.633333331 0.749999982 + 0.666666666 0.633333331 0.749999982 + 0.766666666 0.633333331 0.749999982 + 0.866666666 0.633333331 0.749999982 + 0.966666666 0.633333331 0.749999982 + 0.066666666 0.733333331 0.749999982 + 0.166666666 0.733333331 0.749999982 + 0.266666666 0.733333331 0.749999982 + 0.366666666 0.733333331 0.749999982 + 0.466666666 0.733333331 0.749999982 + 0.566666666 0.733333331 0.749999982 + 0.666666666 0.733333331 0.749999982 + 0.766666666 0.733333331 0.749999982 + 0.866666666 0.733333331 0.749999982 + 0.966666666 0.733333331 0.749999982 + 0.066666666 0.833333331 0.749999982 + 0.166666666 0.833333331 0.749999982 + 0.266666666 0.833333331 0.749999982 + 0.366666666 0.833333331 0.749999982 + 0.466666666 0.833333331 0.749999982 + 0.566666666 0.833333331 0.749999982 + 0.666666666 0.833333331 0.749999982 + 0.766666666 0.833333331 0.749999982 + 0.866666666 0.833333331 0.749999982 + 0.966666666 0.833333331 0.749999982 + 0.066666666 0.933333331 0.749999982 + 0.166666666 0.933333331 0.749999982 + 0.266666666 0.933333331 0.749999982 + 0.366666666 0.933333331 0.749999982 + 0.466666666 0.933333331 0.749999982 + 0.566666666 0.933333331 0.749999982 + 0.666666666 0.933333331 0.749999982 + 0.766666666 0.933333331 0.749999982 + 0.866666666 0.933333331 0.749999982 + 0.966666666 0.933333331 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_1x1_5.4A_separation b/example/example_files/DC_MgO_hosts/POSCAR_1x1_5.4A_separation new file mode 100644 index 00000000..a18f5abf --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_1x1_5.4A_separation @@ -0,0 +1,17 @@ +c1 + 1.00000000000000 + 2.4639999866000002 0.0000000000000000 0.0000000000000000 + -1.2319999933000001 2.1338865833999998 0.0000000000000000 + 0.0000000000000000 0.0000000000000000 10.7109999657000001 + C + 4 +Direct + 0.0000000000000000 0.0000000000000000 0.2500000000000000 + 0.0000000000000000 0.0000000000000000 0.7499999819999985 + 0.3333333400000029 0.6666666830000025 0.2500000000000000 + 0.6666666570000004 0.3333333140000008 0.7499999819999985 + + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_1x5_orthorhombic_11.0A_separation b/example/example_files/DC_MgO_hosts/POSCAR_1x5_orthorhombic_11.0A_separation new file mode 100644 index 00000000..c55082f1 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_1x5_orthorhombic_11.0A_separation @@ -0,0 +1,48 @@ +c1+mg1 o1 + 1.000000000 + 4.267773167 0.000000000 0.000000000 + -0.000000000 12.319999933 0.000000000 + 0.000000000 0.000000000 14.398580001 +C +40 +Direct + 0.000000000 0.000000000 0.000000000 + 0.000000000 0.200000000 0.000000000 + 0.000000000 0.400000000 0.000000000 + 0.000000000 0.600000000 0.000000000 + 0.000000000 0.800000000 0.000000000 + 0.500000000 0.100000000 0.000000000 + 0.500000000 0.300000000 0.000000000 + 0.500000000 0.500000000 0.000000000 + 0.500000000 0.700000000 0.000000000 + 0.500000000 0.900000000 0.000000000 + 0.000000000 0.000000000 0.766956196 + 0.000000000 0.200000000 0.766956196 + 0.000000000 0.400000000 0.766956196 + 0.000000000 0.600000000 0.766956196 + 0.000000000 0.800000000 0.766956196 + 0.500000000 0.100000000 0.766956196 + 0.500000000 0.300000000 0.766956196 + 0.500000000 0.500000000 0.766956196 + 0.500000000 0.700000000 0.766956196 + 0.500000000 0.900000000 0.766956196 + 0.333333342 1.000000000 0.000000000 + 0.333333342 0.200000000 0.000000000 + 0.333333342 0.400000000 0.000000000 + 0.333333342 0.600000000 0.000000000 + 0.333333342 0.800000000 0.000000000 + 0.833333342 0.100000000 0.000000000 + 0.833333342 0.300000000 0.000000000 + 0.833333342 0.500000000 0.000000000 + 0.833333342 0.700000000 0.000000000 + 0.833333342 0.900000000 0.000000000 + 0.166666657 0.100000000 0.766956196 + 0.166666657 0.300000000 0.766956196 + 0.166666657 0.500000000 0.766956196 + 0.166666657 0.700000000 0.766956196 + 0.166666657 0.900000000 0.766956196 + 0.666666657 0.000000000 0.766956196 + 0.666666657 0.200000000 0.766956196 + 0.666666657 0.400000000 0.766956196 + 0.666666657 0.600000000 0.766956196 + 0.666666657 0.800000000 0.766956196 \ No newline at end of file diff --git a/example/example_files/DC_MgO_hosts/POSCAR_2x2_5.4A_separation b/example/example_files/DC_MgO_hosts/POSCAR_2x2_5.4A_separation new file mode 100644 index 00000000..20995265 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_2x2_5.4A_separation @@ -0,0 +1,24 @@ +c1 + 1.000000000 + 4.927999973 0.000000000 0.000000000 + -2.463999987 4.267773167 0.000000000 + 0.000000000 0.000000000 10.710999966 +C +16 +Direct + 0.000000000 0.000000000 0.250000000 + 0.500000000 0.000000000 0.250000000 + 0.000000000 0.500000000 0.250000000 + 0.500000000 0.500000000 0.250000000 + 0.000000000 0.000000000 0.749999982 + 0.500000000 0.000000000 0.749999982 + 0.000000000 0.500000000 0.749999982 + 0.500000000 0.500000000 0.749999982 + 0.166666670 0.333333342 0.250000000 + 0.666666670 0.333333342 0.250000000 + 0.166666670 0.833333342 0.250000000 + 0.666666670 0.833333342 0.250000000 + 0.333333329 0.166666657 0.749999982 + 0.833333329 0.166666657 0.749999982 + 0.333333329 0.666666657 0.749999982 + 0.833333329 0.666666657 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_2x5_orthorhombic_11.0A_separation b/example/example_files/DC_MgO_hosts/POSCAR_2x5_orthorhombic_11.0A_separation new file mode 100644 index 00000000..3e7dd7df --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_2x5_orthorhombic_11.0A_separation @@ -0,0 +1,88 @@ +c1+mg1 o1 +1.0 + 8.5355463028 0.0000000000 0.0000000000 + 0.0000000000 12.3199996948 0.0000000000 + 0.0000000000 0.0000000000 14.3985795975 + C + 80 +Direct + 0.000000000 0.000000000 0.000000000 + 0.500000000 0.000000000 0.000000000 + 0.000000000 0.200000004 0.000000000 + 0.500000000 0.200000004 0.000000000 + 0.000000000 0.400000008 0.000000000 + 0.500000000 0.400000008 0.000000000 + 0.000000000 0.600000031 0.000000000 + 0.500000000 0.600000031 0.000000000 + 0.000000000 0.800000015 0.000000000 + 0.500000000 0.800000015 0.000000000 + 0.250000000 0.100000002 0.000000000 + 0.750000028 0.100000002 0.000000000 + 0.250000000 0.300000015 0.000000000 + 0.750000028 0.300000015 0.000000000 + 0.250000000 0.500000000 0.000000000 + 0.750000028 0.500000000 0.000000000 + 0.250000000 0.699999985 0.000000000 + 0.750000028 0.699999985 0.000000000 + 0.250000000 0.899999969 0.000000000 + 0.750000028 0.899999969 0.000000000 + -0.000000000 -0.000000000 0.766956230 + 0.500000000 -0.000000000 0.766956230 + -0.000000000 0.200000004 0.766956230 + 0.500000000 0.200000004 0.766956230 + -0.000000000 0.400000008 0.766956230 + 0.500000000 0.400000008 0.766956230 + 0.000000000 0.600000031 0.766956230 + 0.500000000 0.600000031 0.766956230 + 0.000000000 0.800000015 0.766956230 + 0.500000000 0.800000015 0.766956230 + 0.250000000 0.100000002 0.766956230 + 0.750000028 0.100000002 0.766956230 + 0.250000000 0.300000015 0.766956230 + 0.750000028 0.300000015 0.766956230 + 0.250000000 0.500000000 0.766956230 + 0.750000028 0.500000000 0.766956230 + 0.250000000 0.699999985 0.766956230 + 0.750000028 0.699999985 0.766956230 + 0.250000000 0.899999969 0.766956230 + 0.750000028 0.899999969 0.766956230 + 0.166666671 0.000000000 0.000000000 + 0.666666685 0.000000000 0.000000000 + 0.166666671 0.200000004 0.000000000 + 0.666666685 0.200000004 0.000000000 + 0.166666671 0.400000008 0.000000000 + 0.666666685 0.400000008 0.000000000 + 0.166666671 0.600000031 0.000000000 + 0.666666685 0.600000031 0.000000000 + 0.166666671 0.800000015 0.000000000 + 0.666666685 0.800000015 0.000000000 + 0.416666657 0.100000002 0.000000000 + 0.916666601 0.100000002 0.000000000 + 0.416666657 0.300000015 0.000000000 + 0.916666601 0.300000015 0.000000000 + 0.416666657 0.500000000 0.000000000 + 0.916666601 0.500000000 0.000000000 + 0.416666657 0.699999985 0.000000000 + 0.916666601 0.699999985 0.000000000 + 0.416666657 0.899999969 0.000000000 + 0.916666601 0.899999969 0.000000000 + 0.083333329 0.100000002 0.766956230 + 0.583333287 0.100000002 0.766956230 + 0.083333329 0.300000015 0.766956230 + 0.583333287 0.300000015 0.766956230 + 0.083333329 0.500000000 0.766956230 + 0.583333287 0.500000000 0.766956230 + 0.083333329 0.699999985 0.766956230 + 0.583333287 0.699999985 0.766956230 + 0.083333329 0.899999969 0.766956230 + 0.583333287 0.899999969 0.766956230 + 0.333333343 -0.000000000 0.766956230 + 0.833333371 -0.000000000 0.766956230 + 0.333333343 0.200000004 0.766956230 + 0.833333371 0.200000004 0.766956230 + 0.333333343 0.400000008 0.766956230 + 0.833333371 0.400000008 0.766956230 + 0.333333343 0.600000031 0.766956230 + 0.833333371 0.600000031 0.766956230 + 0.333333343 0.800000015 0.766956230 + 0.833333371 0.800000015 0.766956230 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_3x3_11.0A_separation b/example/example_files/DC_MgO_hosts/POSCAR_3x3_11.0A_separation new file mode 100644 index 00000000..29baf2d8 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_3x3_11.0A_separation @@ -0,0 +1,44 @@ +c1 + 1.000000000 + 7.391999960 0.000000000 0.000000000 + -3.695999980 6.401659750 0.000000000 + 0.000000000 0.000000000 14.710999966 +C +36 +Direct + 0.000000000 0.000000000 0.000000000 + 0.333333333 0.000000000 0.000000000 + 0.666666667 0.000000000 0.000000000 + 0.000000000 0.333333333 0.000000000 + 0.333333333 0.333333333 0.000000000 + 0.666666667 0.333333333 0.000000000 + 0.000000000 0.666666667 0.000000000 + 0.333333333 0.666666667 0.000000000 + 0.666666667 0.666666667 0.000000000 + 0.000000000 0.000000000 0.749999982 + 0.333333333 0.000000000 0.749999982 + 0.666666667 0.000000000 0.749999982 + 0.000000000 0.333333333 0.749999982 + 0.333333333 0.333333333 0.749999982 + 0.666666667 0.333333333 0.749999982 + 0.000000000 0.666666667 0.749999982 + 0.333333333 0.666666667 0.749999982 + 0.666666667 0.666666667 0.749999982 + 0.111111113 0.222222228 0.000000000 + 0.444444447 0.222222228 0.000000000 + 0.777777780 0.222222228 0.000000000 + 0.111111113 0.555555561 0.000000000 + 0.444444447 0.555555561 0.000000000 + 0.777777780 0.555555561 0.000000000 + 0.111111113 0.888888894 0.000000000 + 0.444444447 0.888888894 0.000000000 + 0.777777780 0.888888894 0.000000000 + 0.222222219 0.111111105 0.749999982 + 0.555555552 0.111111105 0.749999982 + 0.888888886 0.111111105 0.749999982 + 0.222222219 0.444444438 0.749999982 + 0.555555552 0.444444438 0.749999982 + 0.888888886 0.444444438 0.749999982 + 0.222222219 0.777777771 0.749999982 + 0.555555552 0.777777771 0.749999982 + 0.888888886 0.777777771 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_3x3_5.4A_separation b/example/example_files/DC_MgO_hosts/POSCAR_3x3_5.4A_separation new file mode 100644 index 00000000..cd93a31f --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_3x3_5.4A_separation @@ -0,0 +1,44 @@ +c1 + 1.000000000 + 7.391999960 0.000000000 0.000000000 + -3.695999980 6.401659750 0.000000000 + 0.000000000 0.000000000 10.710999966 +C +36 +Direct + 0.000000000 0.000000000 0.250000000 + 0.333333333 0.000000000 0.250000000 + 0.666666667 0.000000000 0.250000000 + 0.000000000 0.333333333 0.250000000 + 0.333333333 0.333333333 0.250000000 + 0.666666667 0.333333333 0.250000000 + 0.000000000 0.666666667 0.250000000 + 0.333333333 0.666666667 0.250000000 + 0.666666667 0.666666667 0.250000000 + 0.000000000 0.000000000 0.749999982 + 0.333333333 0.000000000 0.749999982 + 0.666666667 0.000000000 0.749999982 + 0.000000000 0.333333333 0.749999982 + 0.333333333 0.333333333 0.749999982 + 0.666666667 0.333333333 0.749999982 + 0.000000000 0.666666667 0.749999982 + 0.333333333 0.666666667 0.749999982 + 0.666666667 0.666666667 0.749999982 + 0.111111113 0.222222228 0.250000000 + 0.444444447 0.222222228 0.250000000 + 0.777777780 0.222222228 0.250000000 + 0.111111113 0.555555561 0.250000000 + 0.444444447 0.555555561 0.250000000 + 0.777777780 0.555555561 0.250000000 + 0.111111113 0.888888894 0.250000000 + 0.444444447 0.888888894 0.250000000 + 0.777777780 0.888888894 0.250000000 + 0.222222219 0.111111105 0.749999982 + 0.555555552 0.111111105 0.749999982 + 0.888888886 0.111111105 0.749999982 + 0.222222219 0.444444438 0.749999982 + 0.555555552 0.444444438 0.749999982 + 0.888888886 0.444444438 0.749999982 + 0.222222219 0.777777771 0.749999982 + 0.555555552 0.777777771 0.749999982 + 0.888888886 0.777777771 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_4x4_11.0A_separation b/example/example_files/DC_MgO_hosts/POSCAR_4x4_11.0A_separation new file mode 100644 index 00000000..30f64a6f --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_4x4_11.0A_separation @@ -0,0 +1,72 @@ +c1 + 1.000000000 + 9.855999947 0.000000000 0.000000000 + -4.927999973 8.535546333 0.000000000 + 0.000000000 0.000000000 14.710999966 +C +64 +Direct + 0.000000000 0.000000000 0.000000000 + 0.750000000 0.000000000 0.000000000 + 0.000000000 0.750000000 0.000000000 + 0.750000000 0.750000000 0.000000000 + 0.250000000 0.000000000 0.000000000 + 0.250000000 0.750000000 0.000000000 + 0.500000000 0.000000000 0.000000000 + 0.500000000 0.750000000 0.000000000 + 0.000000000 0.250000000 0.000000000 + 0.750000000 0.250000000 0.000000000 + 0.250000000 0.250000000 0.000000000 + 0.500000000 0.250000000 0.000000000 + 0.000000000 0.500000000 0.000000000 + 0.750000000 0.500000000 0.000000000 + 0.250000000 0.500000000 0.000000000 + 0.500000000 0.500000000 0.000000000 + 0.000000000 0.000000000 0.749999982 + 0.750000000 0.000000000 0.749999982 + 0.000000000 0.750000000 0.749999982 + 0.750000000 0.750000000 0.749999982 + 0.250000000 0.000000000 0.749999982 + 0.250000000 0.750000000 0.749999982 + 0.500000000 0.000000000 0.749999982 + 0.500000000 0.750000000 0.749999982 + 0.000000000 0.250000000 0.749999982 + 0.750000000 0.250000000 0.749999982 + 0.250000000 0.250000000 0.749999982 + 0.500000000 0.250000000 0.749999982 + 0.000000000 0.500000000 0.749999982 + 0.750000000 0.500000000 0.749999982 + 0.250000000 0.500000000 0.749999982 + 0.500000000 0.500000000 0.749999982 + 0.083333335 0.166666671 0.000000000 + 0.833333335 0.166666671 0.000000000 + 0.083333335 0.916666671 0.000000000 + 0.833333335 0.916666671 0.000000000 + 0.333333335 0.166666671 0.000000000 + 0.333333335 0.916666671 0.000000000 + 0.583333335 0.166666671 0.000000000 + 0.583333335 0.916666671 0.000000000 + 0.083333335 0.416666671 0.000000000 + 0.833333335 0.416666671 0.000000000 + 0.333333335 0.416666671 0.000000000 + 0.583333335 0.416666671 0.000000000 + 0.083333335 0.666666671 0.000000000 + 0.833333335 0.666666671 0.000000000 + 0.333333335 0.666666671 0.000000000 + 0.583333335 0.666666671 0.000000000 + 0.166666664 0.083333329 0.749999982 + 0.916666664 0.083333329 0.749999982 + 0.166666664 0.833333329 0.749999982 + 0.916666664 0.833333329 0.749999982 + 0.416666664 0.083333329 0.749999982 + 0.416666664 0.833333329 0.749999982 + 0.666666665 0.083333329 0.749999982 + 0.666666665 0.833333329 0.749999982 + 0.166666664 0.333333329 0.749999982 + 0.916666664 0.333333329 0.749999982 + 0.416666664 0.333333329 0.749999982 + 0.666666665 0.333333329 0.749999982 + 0.166666664 0.583333328 0.749999982 + 0.916666664 0.583333328 0.749999982 + 0.416666664 0.583333328 0.749999982 + 0.666666665 0.583333328 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_4x4_14.7A_separation b/example/example_files/DC_MgO_hosts/POSCAR_4x4_14.7A_separation new file mode 100644 index 00000000..1113bb09 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_4x4_14.7A_separation @@ -0,0 +1,72 @@ +c1 + 1.000000000 + 9.855999947 0.000000000 0.000000000 + -4.927999973 8.535546333 0.000000000 + 0.000000000 0.000000000 18.388833288 +C +64 +Direct + 0.000000000 0.000000000 0.000000000 + 0.750000000 0.000000000 0.000000000 + 0.000000000 0.750000000 0.000000000 + 0.750000000 0.750000000 0.000000000 + 0.250000000 0.000000000 0.000000000 + 0.250000000 0.750000000 0.000000000 + 0.500000000 0.000000000 0.000000000 + 0.500000000 0.750000000 0.000000000 + 0.000000000 0.250000000 0.000000000 + 0.750000000 0.250000000 0.000000000 + 0.250000000 0.250000000 0.000000000 + 0.500000000 0.250000000 0.000000000 + 0.000000000 0.500000000 0.000000000 + 0.750000000 0.500000000 0.000000000 + 0.250000000 0.500000000 0.000000000 + 0.500000000 0.500000000 0.000000000 + 0.000000000 0.000000000 0.800000892 + 0.750000000 0.000000000 0.800000892 + 0.000000000 0.750000000 0.800000892 + 0.750000000 0.750000000 0.800000892 + 0.250000000 0.000000000 0.800000892 + 0.250000000 0.750000000 0.800000892 + 0.500000000 0.000000000 0.800000892 + 0.500000000 0.750000000 0.800000892 + 0.000000000 0.250000000 0.800000892 + 0.750000000 0.250000000 0.800000892 + 0.250000000 0.250000000 0.800000892 + 0.500000000 0.250000000 0.800000892 + 0.000000000 0.500000000 0.800000892 + 0.750000000 0.500000000 0.800000892 + 0.250000000 0.500000000 0.800000892 + 0.500000000 0.500000000 0.800000892 + 0.083333335 0.166666671 0.000000000 + 0.833333335 0.166666671 0.000000000 + 0.083333335 0.916666671 0.000000000 + 0.833333335 0.916666671 0.000000000 + 0.333333335 0.166666671 0.000000000 + 0.333333335 0.916666671 0.000000000 + 0.583333335 0.166666671 0.000000000 + 0.583333335 0.916666671 0.000000000 + 0.083333335 0.416666671 0.000000000 + 0.833333335 0.416666671 0.000000000 + 0.333333335 0.416666671 0.000000000 + 0.583333335 0.416666671 0.000000000 + 0.083333335 0.666666671 0.000000000 + 0.833333335 0.666666671 0.000000000 + 0.333333335 0.666666671 0.000000000 + 0.583333335 0.666666671 0.000000000 + 0.166666664 0.083333329 0.800000892 + 0.916666664 0.083333329 0.800000892 + 0.166666664 0.833333329 0.800000892 + 0.916666664 0.833333329 0.800000892 + 0.416666664 0.083333329 0.800000892 + 0.416666664 0.833333329 0.800000892 + 0.666666665 0.083333329 0.800000892 + 0.666666665 0.833333329 0.800000892 + 0.166666664 0.333333329 0.800000892 + 0.916666664 0.333333329 0.800000892 + 0.416666664 0.333333329 0.800000892 + 0.666666665 0.333333329 0.800000892 + 0.166666664 0.583333328 0.800000892 + 0.916666664 0.583333328 0.800000892 + 0.416666664 0.583333328 0.800000892 + 0.666666665 0.583333328 0.800000892 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_5x1_5.4A_separation b/example/example_files/DC_MgO_hosts/POSCAR_5x1_5.4A_separation new file mode 100644 index 00000000..cbcc836d --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_5x1_5.4A_separation @@ -0,0 +1,28 @@ +c1 + 1.000000000 + 12.319999933 0.000000000 0.000000000 + -1.231999993 2.133886583 0.000000000 + 0.000000000 0.000000000 10.710999966 +C +20 +Direct + 0.000000000 0.000000000 0.250000000 + 0.200000000 0.000000000 0.250000000 + 0.400000000 0.000000000 0.250000000 + 0.600000000 0.000000000 0.250000000 + 0.800000000 0.000000000 0.250000000 + 0.000000000 0.000000000 0.749999982 + 0.200000000 0.000000000 0.749999982 + 0.400000000 0.000000000 0.749999982 + 0.600000000 0.000000000 0.749999982 + 0.800000000 0.000000000 0.749999982 + 0.066666668 0.666666683 0.250000000 + 0.266666668 0.666666683 0.250000000 + 0.466666668 0.666666683 0.250000000 + 0.666666668 0.666666683 0.250000000 + 0.866666668 0.666666683 0.250000000 + 0.133333331 0.333333314 0.749999982 + 0.333333331 0.333333314 0.749999982 + 0.533333331 0.333333314 0.749999982 + 0.733333331 0.333333314 0.749999982 + 0.933333331 0.333333314 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_5x1_6.0A_separation b/example/example_files/DC_MgO_hosts/POSCAR_5x1_6.0A_separation new file mode 100644 index 00000000..d335f3a7 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_5x1_6.0A_separation @@ -0,0 +1,108 @@ +c1 + 1.000000000 + 12.319999933 0.000000000 0.000000000 + -6.159999967 10.669432917 0.000000000 + 0.000000000 0.000000000 12.029835 +C +100 +Direct + 0.000000000 0.000000000 0.250000000 + 0.200000000 0.000000000 0.250000000 + 0.400000000 0.000000000 0.250000000 + 0.600000000 0.000000000 0.250000000 + 0.800000000 0.000000000 0.250000000 + 0.000000000 0.200000000 0.250000000 + 0.200000000 0.200000000 0.250000000 + 0.400000000 0.200000000 0.250000000 + 0.600000000 0.200000000 0.250000000 + 0.800000000 0.200000000 0.250000000 + 0.000000000 0.400000000 0.250000000 + 0.200000000 0.400000000 0.250000000 + 0.400000000 0.400000000 0.250000000 + 0.600000000 0.400000000 0.250000000 + 0.800000000 0.400000000 0.250000000 + 0.000000000 0.600000000 0.250000000 + 0.200000000 0.600000000 0.250000000 + 0.400000000 0.600000000 0.250000000 + 0.600000000 0.600000000 0.250000000 + 0.800000000 0.600000000 0.250000000 + 0.000000000 0.800000000 0.250000000 + 0.200000000 0.800000000 0.250000000 + 0.400000000 0.800000000 0.250000000 + 0.600000000 0.800000000 0.250000000 + 0.800000000 0.800000000 0.250000000 + 0.000000000 0.000000000 0.749999982 + 0.200000000 0.000000000 0.749999982 + 0.400000000 0.000000000 0.749999982 + 0.600000000 0.000000000 0.749999982 + 0.800000000 0.000000000 0.749999982 + 0.000000000 0.200000000 0.749999982 + 0.200000000 0.200000000 0.749999982 + 0.400000000 0.200000000 0.749999982 + 0.600000000 0.200000000 0.749999982 + 0.800000000 0.200000000 0.749999982 + 0.000000000 0.400000000 0.749999982 + 0.200000000 0.400000000 0.749999982 + 0.400000000 0.400000000 0.749999982 + 0.600000000 0.400000000 0.749999982 + 0.800000000 0.400000000 0.749999982 + 0.000000000 0.600000000 0.749999982 + 0.200000000 0.600000000 0.749999982 + 0.400000000 0.600000000 0.749999982 + 0.600000000 0.600000000 0.749999982 + 0.800000000 0.600000000 0.749999982 + 0.000000000 0.800000000 0.749999982 + 0.200000000 0.800000000 0.749999982 + 0.400000000 0.800000000 0.749999982 + 0.600000000 0.800000000 0.749999982 + 0.800000000 0.800000000 0.749999982 + 0.066666668 0.133333337 0.250000000 + 0.266666668 0.133333337 0.250000000 + 0.466666668 0.133333337 0.250000000 + 0.666666668 0.133333337 0.250000000 + 0.866666668 0.133333337 0.250000000 + 0.066666668 0.333333337 0.250000000 + 0.266666668 0.333333337 0.250000000 + 0.466666668 0.333333337 0.250000000 + 0.666666668 0.333333337 0.250000000 + 0.866666668 0.333333337 0.250000000 + 0.066666668 0.533333337 0.250000000 + 0.266666668 0.533333337 0.250000000 + 0.466666668 0.533333337 0.250000000 + 0.666666668 0.533333337 0.250000000 + 0.866666668 0.533333337 0.250000000 + 0.066666668 0.733333337 0.250000000 + 0.266666668 0.733333337 0.250000000 + 0.466666668 0.733333337 0.250000000 + 0.666666668 0.733333337 0.250000000 + 0.866666668 0.733333337 0.250000000 + 0.066666668 0.933333337 0.250000000 + 0.266666668 0.933333337 0.250000000 + 0.466666668 0.933333337 0.250000000 + 0.666666668 0.933333337 0.250000000 + 0.866666668 0.933333337 0.250000000 + 0.133333331 0.066666663 0.749999982 + 0.333333331 0.066666663 0.749999982 + 0.533333331 0.066666663 0.749999982 + 0.733333331 0.066666663 0.749999982 + 0.933333331 0.066666663 0.749999982 + 0.133333331 0.266666663 0.749999982 + 0.333333331 0.266666663 0.749999982 + 0.533333331 0.266666663 0.749999982 + 0.733333331 0.266666663 0.749999982 + 0.933333331 0.266666663 0.749999982 + 0.133333331 0.466666663 0.749999982 + 0.333333331 0.466666663 0.749999982 + 0.533333331 0.466666663 0.749999982 + 0.733333331 0.466666663 0.749999982 + 0.933333331 0.466666663 0.749999982 + 0.133333331 0.666666663 0.749999982 + 0.333333331 0.666666663 0.749999982 + 0.533333331 0.666666663 0.749999982 + 0.733333331 0.666666663 0.749999982 + 0.933333331 0.666666663 0.749999982 + 0.133333331 0.866666663 0.749999982 + 0.333333331 0.866666663 0.749999982 + 0.533333331 0.866666663 0.749999982 + 0.733333331 0.866666663 0.749999982 + 0.933333331 0.866666663 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_6x6_5.4A_separation b/example/example_files/DC_MgO_hosts/POSCAR_6x6_5.4A_separation new file mode 100644 index 00000000..a98f071f --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_6x6_5.4A_separation @@ -0,0 +1,152 @@ +c1 + 1.000000000 + 14.783999920 0.000000000 0.000000000 + -7.391999960 12.803319500 0.000000000 + 0.000000000 0.000000000 10.710999966 +C +144 +Direct + 0.000000000 0.000000000 0.250000000 + 0.500000000 0.000000000 0.250000000 + 0.000000000 0.500000000 0.250000000 + 0.500000000 0.500000000 0.250000000 + 0.166666667 0.000000000 0.250000000 + 0.666666667 0.000000000 0.250000000 + 0.166666667 0.500000000 0.250000000 + 0.666666667 0.500000000 0.250000000 + 0.333333333 0.000000000 0.250000000 + 0.833333333 0.000000000 0.250000000 + 0.333333333 0.500000000 0.250000000 + 0.833333333 0.500000000 0.250000000 + 0.000000000 0.166666667 0.250000000 + 0.500000000 0.166666667 0.250000000 + 0.000000000 0.666666667 0.250000000 + 0.500000000 0.666666667 0.250000000 + 0.166666667 0.166666667 0.250000000 + 0.666666667 0.166666667 0.250000000 + 0.166666667 0.666666667 0.250000000 + 0.666666667 0.666666667 0.250000000 + 0.333333333 0.166666667 0.250000000 + 0.833333333 0.166666667 0.250000000 + 0.333333333 0.666666667 0.250000000 + 0.833333333 0.666666667 0.250000000 + 0.000000000 0.333333333 0.250000000 + 0.500000000 0.333333333 0.250000000 + 0.000000000 0.833333333 0.250000000 + 0.500000000 0.833333333 0.250000000 + 0.166666667 0.333333333 0.250000000 + 0.666666667 0.333333333 0.250000000 + 0.166666667 0.833333333 0.250000000 + 0.666666667 0.833333333 0.250000000 + 0.333333333 0.333333333 0.250000000 + 0.833333333 0.333333333 0.250000000 + 0.333333333 0.833333333 0.250000000 + 0.833333333 0.833333333 0.250000000 + 0.000000000 0.000000000 0.749999982 + 0.500000000 0.000000000 0.749999982 + 0.000000000 0.500000000 0.749999982 + 0.500000000 0.500000000 0.749999982 + 0.166666667 0.000000000 0.749999982 + 0.666666667 0.000000000 0.749999982 + 0.166666667 0.500000000 0.749999982 + 0.666666667 0.500000000 0.749999982 + 0.333333333 0.000000000 0.749999982 + 0.833333333 0.000000000 0.749999982 + 0.333333333 0.500000000 0.749999982 + 0.833333333 0.500000000 0.749999982 + 0.000000000 0.166666667 0.749999982 + 0.500000000 0.166666667 0.749999982 + 0.000000000 0.666666667 0.749999982 + 0.500000000 0.666666667 0.749999982 + 0.166666667 0.166666667 0.749999982 + 0.666666667 0.166666667 0.749999982 + 0.166666667 0.666666667 0.749999982 + 0.666666667 0.666666667 0.749999982 + 0.333333333 0.166666667 0.749999982 + 0.833333333 0.166666667 0.749999982 + 0.333333333 0.666666667 0.749999982 + 0.833333333 0.666666667 0.749999982 + 0.000000000 0.333333333 0.749999982 + 0.500000000 0.333333333 0.749999982 + 0.000000000 0.833333333 0.749999982 + 0.500000000 0.833333333 0.749999982 + 0.166666667 0.333333333 0.749999982 + 0.666666667 0.333333333 0.749999982 + 0.166666667 0.833333333 0.749999982 + 0.666666667 0.833333333 0.749999982 + 0.333333333 0.333333333 0.749999982 + 0.833333333 0.333333333 0.749999982 + 0.333333333 0.833333333 0.749999982 + 0.833333333 0.833333333 0.749999982 + 0.055555556 0.111111114 0.250000000 + 0.555555556 0.111111114 0.250000000 + 0.055555556 0.611111114 0.250000000 + 0.555555556 0.611111114 0.250000000 + 0.222222224 0.111111114 0.250000000 + 0.722222223 0.111111114 0.250000000 + 0.222222224 0.611111114 0.250000000 + 0.722222223 0.611111114 0.250000000 + 0.388888890 0.111111114 0.250000000 + 0.888888890 0.111111114 0.250000000 + 0.388888890 0.611111114 0.250000000 + 0.888888890 0.611111114 0.250000000 + 0.055555556 0.277777781 0.250000000 + 0.555555556 0.277777781 0.250000000 + 0.055555556 0.777777781 0.250000000 + 0.555555556 0.777777781 0.250000000 + 0.222222224 0.277777781 0.250000000 + 0.722222223 0.277777781 0.250000000 + 0.222222224 0.777777781 0.250000000 + 0.722222223 0.777777781 0.250000000 + 0.388888890 0.277777781 0.250000000 + 0.888888890 0.277777781 0.250000000 + 0.388888890 0.777777781 0.250000000 + 0.888888890 0.777777781 0.250000000 + 0.055555556 0.444444447 0.250000000 + 0.555555556 0.444444447 0.250000000 + 0.055555556 0.944444447 0.250000000 + 0.555555556 0.944444447 0.250000000 + 0.222222224 0.444444447 0.250000000 + 0.722222223 0.444444447 0.250000000 + 0.222222224 0.944444447 0.250000000 + 0.722222223 0.944444447 0.250000000 + 0.388888890 0.444444447 0.250000000 + 0.888888890 0.444444447 0.250000000 + 0.388888890 0.944444447 0.250000000 + 0.888888890 0.944444447 0.250000000 + 0.111111109 0.055555553 0.749999982 + 0.611111110 0.055555553 0.749999982 + 0.111111109 0.555555552 0.749999982 + 0.611111110 0.555555552 0.749999982 + 0.277777776 0.055555553 0.749999982 + 0.777777776 0.055555553 0.749999982 + 0.277777776 0.555555552 0.749999982 + 0.777777776 0.555555552 0.749999982 + 0.444444443 0.055555553 0.749999982 + 0.944444443 0.055555553 0.749999982 + 0.444444443 0.555555552 0.749999982 + 0.944444443 0.555555552 0.749999982 + 0.111111109 0.222222219 0.749999982 + 0.611111110 0.222222219 0.749999982 + 0.111111109 0.722222219 0.749999982 + 0.611111110 0.722222219 0.749999982 + 0.277777776 0.222222219 0.749999982 + 0.777777776 0.222222219 0.749999982 + 0.277777776 0.722222219 0.749999982 + 0.777777776 0.722222219 0.749999982 + 0.444444443 0.222222219 0.749999982 + 0.944444443 0.222222219 0.749999982 + 0.444444443 0.722222219 0.749999982 + 0.944444443 0.722222219 0.749999982 + 0.111111109 0.388888886 0.749999982 + 0.611111110 0.388888886 0.749999982 + 0.111111109 0.888888886 0.749999982 + 0.611111110 0.888888886 0.749999982 + 0.277777776 0.388888886 0.749999982 + 0.777777776 0.388888886 0.749999982 + 0.277777776 0.888888886 0.749999982 + 0.777777776 0.888888886 0.749999982 + 0.444444443 0.388888886 0.749999982 + 0.944444443 0.388888886 0.749999982 + 0.444444443 0.888888886 0.749999982 + 0.944444443 0.888888886 0.749999982 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_7x7_8.4A_separation b/example/example_files/DC_MgO_hosts/POSCAR_7x7_8.4A_separation new file mode 100644 index 00000000..701c643a --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_7x7_8.4A_separation @@ -0,0 +1,204 @@ +c1 + 1.000000000 + 17.247999906 0.000000000 0.000000000 + -8.623999953 14.937206084 0.000000000 + 0.000000000 0.000000000 12.02983500 +C +196 +Direct + 0.000000000 0.000000000 0.000000000 + 0.142857143 0.000000000 0.000000000 + 0.285714286 0.000000000 0.000000000 + 0.428571429 0.000000000 0.000000000 + 0.571428571 0.000000000 0.000000000 + 0.714285714 0.000000000 0.000000000 + 0.857142857 0.000000000 0.000000000 + 0.000000000 0.142857143 0.000000000 + 0.142857143 0.142857143 0.000000000 + 0.285714286 0.142857143 0.000000000 + 0.428571429 0.142857143 0.000000000 + 0.571428571 0.142857143 0.000000000 + 0.714285714 0.142857143 0.000000000 + 0.857142857 0.142857143 0.000000000 + 0.000000000 0.285714286 0.000000000 + 0.142857143 0.285714286 0.000000000 + 0.285714286 0.285714286 0.000000000 + 0.428571429 0.285714286 0.000000000 + 0.571428571 0.285714286 0.000000000 + 0.714285714 0.285714286 0.000000000 + 0.857142857 0.285714286 0.000000000 + 0.000000000 0.428571429 0.000000000 + 0.142857143 0.428571429 0.000000000 + 0.285714286 0.428571429 0.000000000 + 0.428571429 0.428571429 0.000000000 + 0.571428571 0.428571429 0.000000000 + 0.714285714 0.428571429 0.000000000 + 0.857142857 0.428571429 0.000000000 + 0.000000000 0.571428571 0.000000000 + 0.142857143 0.571428571 0.000000000 + 0.285714286 0.571428571 0.000000000 + 0.428571429 0.571428571 0.000000000 + 0.571428571 0.571428571 0.000000000 + 0.714285714 0.571428571 0.000000000 + 0.857142857 0.571428571 0.000000000 + 0.000000000 0.714285714 0.000000000 + 0.142857143 0.714285714 0.000000000 + 0.285714286 0.714285714 0.000000000 + 0.428571429 0.714285714 0.000000000 + 0.571428571 0.714285714 0.000000000 + 0.714285714 0.714285714 0.000000000 + 0.857142857 0.714285714 0.000000000 + 0.000000000 0.857142857 0.000000000 + 0.142857143 0.857142857 0.000000000 + 0.285714286 0.857142857 0.000000000 + 0.428571429 0.857142857 0.000000000 + 0.571428571 0.857142857 0.000000000 + 0.714285714 0.857142857 0.000000000 + 0.857142857 0.857142857 0.000000000 + 0.000000000 0.000000000 0.69428092808 + 0.142857143 0.000000000 0.69428092808 + 0.285714286 0.000000000 0.69428092808 + 0.428571429 0.000000000 0.69428092808 + 0.571428571 0.000000000 0.69428092808 + 0.714285714 0.000000000 0.69428092808 + 0.857142857 0.000000000 0.69428092808 + 0.000000000 0.142857143 0.69428092808 + 0.142857143 0.142857143 0.69428092808 + 0.285714286 0.142857143 0.69428092808 + 0.428571429 0.142857143 0.69428092808 + 0.571428571 0.142857143 0.69428092808 + 0.714285714 0.142857143 0.69428092808 + 0.857142857 0.142857143 0.69428092808 + 0.000000000 0.285714286 0.69428092808 + 0.142857143 0.285714286 0.69428092808 + 0.285714286 0.285714286 0.69428092808 + 0.428571429 0.285714286 0.69428092808 + 0.571428571 0.285714286 0.69428092808 + 0.714285714 0.285714286 0.69428092808 + 0.857142857 0.285714286 0.69428092808 + 0.000000000 0.428571429 0.69428092808 + 0.142857143 0.428571429 0.69428092808 + 0.285714286 0.428571429 0.69428092808 + 0.428571429 0.428571429 0.69428092808 + 0.571428571 0.428571429 0.69428092808 + 0.714285714 0.428571429 0.69428092808 + 0.857142857 0.428571429 0.69428092808 + 0.000000000 0.571428571 0.69428092808 + 0.142857143 0.571428571 0.69428092808 + 0.285714286 0.571428571 0.69428092808 + 0.428571429 0.571428571 0.69428092808 + 0.571428571 0.571428571 0.69428092808 + 0.714285714 0.571428571 0.69428092808 + 0.857142857 0.571428571 0.69428092808 + 0.000000000 0.714285714 0.69428092808 + 0.142857143 0.714285714 0.69428092808 + 0.285714286 0.714285714 0.69428092808 + 0.428571429 0.714285714 0.69428092808 + 0.571428571 0.714285714 0.69428092808 + 0.714285714 0.714285714 0.69428092808 + 0.857142857 0.714285714 0.69428092808 + 0.000000000 0.857142857 0.69428092808 + 0.142857143 0.857142857 0.69428092808 + 0.285714286 0.857142857 0.69428092808 + 0.428571429 0.857142857 0.69428092808 + 0.571428571 0.857142857 0.69428092808 + 0.714285714 0.857142857 0.69428092808 + 0.857142857 0.857142857 0.69428092808 + 0.047619049 0.095238098 0.000000000 + 0.190476191 0.095238098 0.000000000 + 0.333333334 0.095238098 0.000000000 + 0.476190477 0.095238098 0.000000000 + 0.619047620 0.095238098 0.000000000 + 0.761904763 0.095238098 0.000000000 + 0.904761906 0.095238098 0.000000000 + 0.047619049 0.238095240 0.000000000 + 0.190476191 0.238095240 0.000000000 + 0.333333334 0.238095240 0.000000000 + 0.476190477 0.238095240 0.000000000 + 0.619047620 0.238095240 0.000000000 + 0.761904763 0.238095240 0.000000000 + 0.904761906 0.238095240 0.000000000 + 0.047619049 0.380952383 0.000000000 + 0.190476191 0.380952383 0.000000000 + 0.333333334 0.380952383 0.000000000 + 0.476190477 0.380952383 0.000000000 + 0.619047620 0.380952383 0.000000000 + 0.761904763 0.380952383 0.000000000 + 0.904761906 0.380952383 0.000000000 + 0.047619049 0.523809526 0.000000000 + 0.190476191 0.523809526 0.000000000 + 0.333333334 0.523809526 0.000000000 + 0.476190477 0.523809526 0.000000000 + 0.619047620 0.523809526 0.000000000 + 0.761904763 0.523809526 0.000000000 + 0.904761906 0.523809526 0.000000000 + 0.047619049 0.666666669 0.000000000 + 0.190476191 0.666666669 0.000000000 + 0.333333334 0.666666669 0.000000000 + 0.476190477 0.666666669 0.000000000 + 0.619047620 0.666666669 0.000000000 + 0.761904763 0.666666669 0.000000000 + 0.904761906 0.666666669 0.000000000 + 0.047619049 0.809523812 0.000000000 + 0.190476191 0.809523812 0.000000000 + 0.333333334 0.809523812 0.000000000 + 0.476190477 0.809523812 0.000000000 + 0.619047620 0.809523812 0.000000000 + 0.761904763 0.809523812 0.000000000 + 0.904761906 0.809523812 0.000000000 + 0.047619049 0.952380955 0.000000000 + 0.190476191 0.952380955 0.000000000 + 0.333333334 0.952380955 0.000000000 + 0.476190477 0.952380955 0.000000000 + 0.619047620 0.952380955 0.000000000 + 0.761904763 0.952380955 0.000000000 + 0.904761906 0.952380955 0.000000000 + 0.095238094 0.047619045 0.69428092808 + 0.238095237 0.047619045 0.69428092808 + 0.380952380 0.047619045 0.69428092808 + 0.523809522 0.047619045 0.69428092808 + 0.666666665 0.047619045 0.69428092808 + 0.809523808 0.047619045 0.69428092808 + 0.952380951 0.047619045 0.69428092808 + 0.095238094 0.190476188 0.69428092808 + 0.238095237 0.190476188 0.69428092808 + 0.380952380 0.190476188 0.69428092808 + 0.523809522 0.190476188 0.69428092808 + 0.666666665 0.190476188 0.69428092808 + 0.809523808 0.190476188 0.69428092808 + 0.952380951 0.190476188 0.69428092808 + 0.095238094 0.333333331 0.69428092808 + 0.238095237 0.333333331 0.69428092808 + 0.380952380 0.333333331 0.69428092808 + 0.523809522 0.333333331 0.69428092808 + 0.666666665 0.333333331 0.69428092808 + 0.809523808 0.333333331 0.69428092808 + 0.952380951 0.333333331 0.69428092808 + 0.095238094 0.476190473 0.69428092808 + 0.238095237 0.476190473 0.69428092808 + 0.380952380 0.476190473 0.69428092808 + 0.523809522 0.476190473 0.69428092808 + 0.666666665 0.476190473 0.69428092808 + 0.809523808 0.476190473 0.69428092808 + 0.952380951 0.476190473 0.69428092808 + 0.095238094 0.619047616 0.69428092808 + 0.238095237 0.619047616 0.69428092808 + 0.380952380 0.619047616 0.69428092808 + 0.523809522 0.619047616 0.69428092808 + 0.666666665 0.619047616 0.69428092808 + 0.809523808 0.619047616 0.69428092808 + 0.952380951 0.619047616 0.69428092808 + 0.095238094 0.761904759 0.69428092808 + 0.238095237 0.761904759 0.69428092808 + 0.380952380 0.761904759 0.69428092808 + 0.523809522 0.761904759 0.69428092808 + 0.666666665 0.761904759 0.69428092808 + 0.809523808 0.761904759 0.69428092808 + 0.952380951 0.761904759 0.69428092808 + 0.095238094 0.904761902 0.69428092808 + 0.238095237 0.904761902 0.69428092808 + 0.380952380 0.904761902 0.69428092808 + 0.523809522 0.904761902 0.69428092808 + 0.666666665 0.904761902 0.69428092808 + 0.809523808 0.904761902 0.69428092808 + 0.952380951 0.904761902 0.69428092808 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_MgO_HEX b/example/example_files/DC_MgO_hosts/POSCAR_MgO_HEX new file mode 100644 index 00000000..cd191e18 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_MgO_HEX @@ -0,0 +1,204 @@ +Mg2 O2 +1.0 + 24.639999866 0.0000000000 0.0000000000 + -12.319999933 21.338865834 0.0000000000 + 0.0000000000 0.0000000000 4.2310647964 + Mg O + 98 98 +Direct + 0.095238142 0.047618996 0.750000000 + 0.095238142 0.190476134 0.750000000 + 0.095238142 0.333333284 0.750000000 + 0.095238142 0.476190418 0.750000000 + 0.095238142 0.619047582 0.750000000 + 0.095238142 0.761904716 0.750000000 + 0.095238142 0.904761851 0.750000000 + 0.238095284 0.047618996 0.750000000 + 0.238095284 0.190476134 0.750000000 + 0.238095284 0.333333284 0.750000000 + 0.238095284 0.476190418 0.750000000 + 0.238095284 0.619047582 0.750000000 + 0.238095284 0.761904716 0.750000000 + 0.238095284 0.904761851 0.750000000 + 0.380952418 0.047618996 0.750000000 + 0.380952418 0.190476134 0.750000000 + 0.380952418 0.333333284 0.750000000 + 0.380952418 0.476190418 0.750000000 + 0.380952418 0.619047582 0.750000000 + 0.380952418 0.761904716 0.750000000 + 0.380952418 0.904761851 0.750000000 + 0.523809552 0.047618996 0.750000000 + 0.523809552 0.190476134 0.750000000 + 0.523809552 0.333333284 0.750000000 + 0.523809552 0.476190418 0.750000000 + 0.523809552 0.619047582 0.750000000 + 0.523809552 0.761904716 0.750000000 + 0.523809552 0.904761851 0.750000000 + 0.666666687 0.047618996 0.750000000 + 0.666666687 0.190476134 0.750000000 + 0.666666687 0.333333284 0.750000000 + 0.666666687 0.476190418 0.750000000 + 0.666666687 0.619047582 0.750000000 + 0.666666687 0.761904716 0.750000000 + 0.666666687 0.904761851 0.750000000 + 0.809523880 0.047618996 0.750000000 + 0.809523880 0.190476134 0.750000000 + 0.809523880 0.333333284 0.750000000 + 0.809523880 0.476190418 0.750000000 + 0.809523880 0.619047582 0.750000000 + 0.809523880 0.761904716 0.750000000 + 0.809523880 0.904761851 0.750000000 + 0.952381015 0.047618996 0.750000000 + 0.952381015 0.190476134 0.750000000 + 0.952381015 0.333333284 0.750000000 + 0.952381015 0.476190418 0.750000000 + 0.952381015 0.619047582 0.750000000 + 0.952381015 0.761904716 0.750000000 + 0.952381015 0.904761851 0.750000000 + 0.047618996 0.095238142 0.250000000 + 0.047618996 0.238095284 0.250000000 + 0.047618996 0.380952418 0.250000000 + 0.047618996 0.523809552 0.250000000 + 0.047618996 0.666666687 0.250000000 + 0.047618996 0.809523880 0.250000000 + 0.047618996 0.952381015 0.250000000 + 0.190476134 0.095238142 0.250000000 + 0.190476134 0.238095284 0.250000000 + 0.190476134 0.380952418 0.250000000 + 0.190476134 0.523809552 0.250000000 + 0.190476134 0.666666687 0.250000000 + 0.190476134 0.809523880 0.250000000 + 0.190476134 0.952381015 0.250000000 + 0.333333284 0.095238142 0.250000000 + 0.333333284 0.238095284 0.250000000 + 0.333333284 0.380952418 0.250000000 + 0.333333284 0.523809552 0.250000000 + 0.333333284 0.666666687 0.250000000 + 0.333333284 0.809523880 0.250000000 + 0.333333284 0.952381015 0.250000000 + 0.476190418 0.095238142 0.250000000 + 0.476190418 0.238095284 0.250000000 + 0.476190418 0.380952418 0.250000000 + 0.476190418 0.523809552 0.250000000 + 0.476190418 0.666666687 0.250000000 + 0.476190418 0.809523880 0.250000000 + 0.476190418 0.952381015 0.250000000 + 0.619047582 0.095238142 0.250000000 + 0.619047582 0.238095284 0.250000000 + 0.619047582 0.380952418 0.250000000 + 0.619047582 0.523809552 0.250000000 + 0.619047582 0.666666687 0.250000000 + 0.619047582 0.809523880 0.250000000 + 0.619047582 0.952381015 0.250000000 + 0.761904716 0.095238142 0.250000000 + 0.761904716 0.238095284 0.250000000 + 0.761904716 0.380952418 0.250000000 + 0.761904716 0.523809552 0.250000000 + 0.761904716 0.666666687 0.250000000 + 0.761904716 0.809523880 0.250000000 + 0.761904716 0.952381015 0.250000000 + 0.904761851 0.095238142 0.250000000 + 0.904761851 0.238095284 0.250000000 + 0.904761851 0.380952418 0.250000000 + 0.904761851 0.523809552 0.250000000 + 0.904761851 0.666666687 0.250000000 + 0.904761851 0.809523880 0.250000000 + 0.904761851 0.952381015 0.250000000 + 0.095238142 0.047618996 0.250000000 + 0.095238142 0.190476134 0.250000000 + 0.095238142 0.333333284 0.250000000 + 0.095238142 0.476190418 0.250000000 + 0.095238142 0.619047582 0.250000000 + 0.095238142 0.761904716 0.250000000 + 0.095238142 0.904761851 0.250000000 + 0.238095284 0.047618996 0.250000000 + 0.238095284 0.190476134 0.250000000 + 0.238095284 0.333333284 0.250000000 + 0.238095284 0.476190418 0.250000000 + 0.238095284 0.619047582 0.250000000 + 0.238095284 0.761904716 0.250000000 + 0.238095284 0.904761851 0.250000000 + 0.380952418 0.047618996 0.250000000 + 0.380952418 0.190476134 0.250000000 + 0.380952418 0.333333284 0.250000000 + 0.380952418 0.476190418 0.250000000 + 0.380952418 0.619047582 0.250000000 + 0.380952418 0.761904716 0.250000000 + 0.380952418 0.904761851 0.250000000 + 0.523809552 0.047618996 0.250000000 + 0.523809552 0.190476134 0.250000000 + 0.523809552 0.333333284 0.250000000 + 0.523809552 0.476190418 0.250000000 + 0.523809552 0.619047582 0.250000000 + 0.523809552 0.761904716 0.250000000 + 0.523809552 0.904761851 0.250000000 + 0.666666687 0.047618996 0.250000000 + 0.666666687 0.190476134 0.250000000 + 0.666666687 0.333333284 0.250000000 + 0.666666687 0.476190418 0.250000000 + 0.666666687 0.619047582 0.250000000 + 0.666666687 0.761904716 0.250000000 + 0.666666687 0.904761851 0.250000000 + 0.809523880 0.047618996 0.250000000 + 0.809523880 0.190476134 0.250000000 + 0.809523880 0.333333284 0.250000000 + 0.809523880 0.476190418 0.250000000 + 0.809523880 0.619047582 0.250000000 + 0.809523880 0.761904716 0.250000000 + 0.809523880 0.904761851 0.250000000 + 0.952381015 0.047618996 0.250000000 + 0.952381015 0.190476134 0.250000000 + 0.952381015 0.333333284 0.250000000 + 0.952381015 0.476190418 0.250000000 + 0.952381015 0.619047582 0.250000000 + 0.952381015 0.761904716 0.250000000 + 0.952381015 0.904761851 0.250000000 + 0.047618996 0.095238142 0.750000000 + 0.047618996 0.238095284 0.750000000 + 0.047618996 0.380952418 0.750000000 + 0.047618996 0.523809552 0.750000000 + 0.047618996 0.666666687 0.750000000 + 0.047618996 0.809523880 0.750000000 + 0.047618996 0.952381015 0.750000000 + 0.190476134 0.095238142 0.750000000 + 0.190476134 0.238095284 0.750000000 + 0.190476134 0.380952418 0.750000000 + 0.190476134 0.523809552 0.750000000 + 0.190476134 0.666666687 0.750000000 + 0.190476134 0.809523880 0.750000000 + 0.190476134 0.952381015 0.750000000 + 0.333333284 0.095238142 0.750000000 + 0.333333284 0.238095284 0.750000000 + 0.333333284 0.380952418 0.750000000 + 0.333333284 0.523809552 0.750000000 + 0.333333284 0.666666687 0.750000000 + 0.333333284 0.809523880 0.750000000 + 0.333333284 0.952381015 0.750000000 + 0.476190418 0.095238142 0.750000000 + 0.476190418 0.238095284 0.750000000 + 0.476190418 0.380952418 0.750000000 + 0.476190418 0.523809552 0.750000000 + 0.476190418 0.666666687 0.750000000 + 0.476190418 0.809523880 0.750000000 + 0.476190418 0.952381015 0.750000000 + 0.619047582 0.095238142 0.750000000 + 0.619047582 0.238095284 0.750000000 + 0.619047582 0.380952418 0.750000000 + 0.619047582 0.523809552 0.750000000 + 0.619047582 0.666666687 0.750000000 + 0.619047582 0.809523880 0.750000000 + 0.619047582 0.952381015 0.750000000 + 0.761904716 0.095238142 0.750000000 + 0.761904716 0.238095284 0.750000000 + 0.761904716 0.380952418 0.750000000 + 0.761904716 0.523809552 0.750000000 + 0.761904716 0.666666687 0.750000000 + 0.761904716 0.809523880 0.750000000 + 0.761904716 0.952381015 0.750000000 + 0.904761851 0.095238142 0.750000000 + 0.904761851 0.238095284 0.750000000 + 0.904761851 0.380952418 0.750000000 + 0.904761851 0.523809552 0.750000000 + 0.904761851 0.666666687 0.750000000 + 0.904761851 0.809523880 0.750000000 + 0.904761851 0.952381015 0.750000000 diff --git a/example/example_files/DC_MgO_hosts/POSCAR_orthorhombic_11.1A_separation_Mg_seeded b/example/example_files/DC_MgO_hosts/POSCAR_orthorhombic_11.1A_separation_Mg_seeded new file mode 100644 index 00000000..5d2659c3 --- /dev/null +++ b/example/example_files/DC_MgO_hosts/POSCAR_orthorhombic_11.1A_separation_Mg_seeded @@ -0,0 +1,50 @@ +c1+mg1 o1 + 1.000000000 + 4.267773167 0.000000000 0.000000000 + -0.000000000 12.319999933 0.000000000 + 0.000000000 0.000000000 14.398580001 +C Mg +40 2 +Direct + 0.000000000 0.000000000 0.000000000 + 0.000000000 0.200000000 0.000000000 + 0.000000000 0.400000000 0.000000000 + 0.000000000 0.600000000 0.000000000 + 0.000000000 0.800000000 0.000000000 + 0.500000000 0.100000000 0.000000000 + 0.500000000 0.300000000 0.000000000 + 0.500000000 0.500000000 0.000000000 + 0.500000000 0.700000000 0.000000000 + 0.500000000 0.900000000 0.000000000 + 0.000000000 0.000000000 0.766956196 + 0.000000000 0.200000000 0.766956196 + 0.000000000 0.400000000 0.766956196 + 0.000000000 0.600000000 0.766956196 + 0.000000000 0.800000000 0.766956196 + 0.500000000 0.100000000 0.766956196 + 0.500000000 0.300000000 0.766956196 + 0.500000000 0.500000000 0.766956196 + 0.500000000 0.700000000 0.766956196 + 0.500000000 0.900000000 0.766956196 + 0.333333342 1.000000000 0.000000000 + 0.333333342 0.200000000 0.000000000 + 0.333333342 0.400000000 0.000000000 + 0.333333342 0.600000000 0.000000000 + 0.333333342 0.800000000 0.000000000 + 0.833333342 0.100000000 0.000000000 + 0.833333342 0.300000000 0.000000000 + 0.833333342 0.500000000 0.000000000 + 0.833333342 0.700000000 0.000000000 + 0.833333342 0.900000000 0.000000000 + 0.166666657 0.100000000 0.766956196 + 0.166666657 0.300000000 0.766956196 + 0.166666657 0.500000000 0.766956196 + 0.166666657 0.700000000 0.766956196 + 0.166666657 0.900000000 0.766956196 + 0.666666657 0.000000000 0.766956196 + 0.666666657 0.200000000 0.766956196 + 0.666666657 0.400000000 0.766956196 + 0.666666657 0.600000000 0.766956196 + 0.666666657 0.800000000 0.766956196 + 0.500000000 0.500000000 0.384000000 + 0.500000000 0.250000000 0.192000000 \ No newline at end of file From c6bd0ce3f520e9af2a152f0a8ed775cd88118f28 Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Sun, 22 Sep 2024 07:59:13 +0100 Subject: [PATCH 06/11] Change formation energy weighting to pair-dependent --- src/fortran/lib/mod_evolver.f90 | 328 ++++++++++++++++++++-------- src/raffle/raffle.py | 72 +++--- src/wrapper/f90wrap_mod_evolver.f90 | 134 ++++++------ 3 files changed, 334 insertions(+), 200 deletions(-) diff --git a/src/fortran/lib/mod_evolver.f90 b/src/fortran/lib/mod_evolver.f90 index 306c3ba5..aa65e9b1 100644 --- a/src/fortran/lib/mod_evolver.f90 +++ b/src/fortran/lib/mod_evolver.f90 @@ -53,6 +53,10 @@ module evolver !! Stoichiometry of the structure. character(len=3), dimension(:), allocatable :: element_symbols !! Elements contained within the structure. + integer, dimension(:), allocatable :: num_pairs, num_per_species + !! Number of pairs and number of pairs per species. + real(real12), dimension(:), allocatable :: weight_pair, weight_per_species + !! Weights for the 2-body and species distribution functions. contains procedure, pass(this) :: calculate end type gvector_type @@ -85,10 +89,6 @@ module evolver !! Number of evaluated systems. integer :: num_evaluated_allocated = 0 !! Number of evaluated systems still allocated. - integer :: best_system = 0 - !! Index of the best system. - real(real12) :: best_energy = 0.0_real12 - !! Energy of the best system. real(real12) :: kbt = 0.2_real12 !! Boltzmann constant times temperature. real(real12) :: & @@ -99,6 +99,10 @@ module evolver in_dataset_2body, in_dataset_3body, in_dataset_4body !! Whether the 2-, 3-, and 4-body distribution functions are in !! the dataset. + real(real12), dimension(:), allocatable :: & + best_energy_pair, & + best_energy_per_species + !! Best energy for the 2-body and species distribution functions. integer, dimension(3) :: nbins = -1 !! Number of bins for the 2-, 3-, and 4-body distribution functions. real(real12), dimension(3) :: & @@ -499,6 +503,9 @@ subroutine create(this, basis_list, deallocate_systems) if(allocated(this%in_dataset_2body)) deallocate(this%in_dataset_2body) if(allocated(this%in_dataset_3body)) deallocate(this%in_dataset_3body) if(allocated(this%in_dataset_4body)) deallocate(this%in_dataset_4body) + if(allocated(this%best_energy_pair)) deallocate(this%best_energy_pair) + if(allocated(this%best_energy_per_species)) & + deallocate(this%best_energy_per_species) allocate(this%system(0)) call this%add(basis_list) call this%set_bond_info() @@ -597,7 +604,8 @@ subroutine deallocate_systems(this) !! Parent. Instance of distribution functions container. deallocate(this%system) - this%best_system = 0 + ! this%best_system = 0 + deallocate(this%best_energy_pair, this%best_energy_per_species) this%num_evaluated_allocated = 0 end subroutine deallocate_systems @@ -1580,28 +1588,87 @@ subroutine set_best_energy(this) !! Parent of the procedure. Instance of distribution functions container. ! Local variables - integer :: i, is, idx + integer :: i, j, is, js, idx1, idx2 !! Loop index. - real(real12) :: energy + real(real12) :: energy, energy_per_species, energy_pair !! Energy of the system. + integer, dimension(:,:), allocatable :: idx_list + !! Index list for pairs of elements. + + if(.not.allocated(this%best_energy_pair))then + allocate(this%best_energy_pair(size(this%bond_info,1)), source = 0._real12) + elseif(size(this%best_energy_pair).ne.size(this%bond_info))then + deallocate(this%best_energy_pair) + allocate(this%best_energy_pair(size(this%bond_info,1)), source = 0._real12) + end if + + if(.not.allocated(this%best_energy_per_species))then + allocate(this%best_energy_per_species(size(this%element_info,1)), source = 0._real12) + elseif(size(this%best_energy_per_species).ne.size(this%element_info))then + deallocate(this%best_energy_per_species) + allocate(this%best_energy_per_species(size(this%element_info,1)), source = 0._real12) + end if do i = 1, size(this%system) + j = 0 + allocate(idx_list(size(this%system(i)%element_symbols),& + size(this%system(i)%element_symbols))) + do is = 1, size(this%system(i)%element_symbols) + do js = is, size(this%system(i)%element_symbols), 1 + j = j + 1 + idx_list(is,js) = j + idx_list(js,is) = j + end do + end do + energy = this%system(i)%energy do is = 1, size(this%system(i)%element_symbols) - idx = findloc( [ this%element_info(:)%name ], & + idx1 = findloc( [ this%element_info(:)%name ], & this%system(i)%element_symbols(is), dim=1 ) - if(idx.lt.1)then + if(idx1.lt.1)then call stop_program( "Species not found in element_info" ) return end if energy = energy - this%system(i)%stoichiometry(is) * & - this%element_info(idx)%energy + this%element_info(idx1)%energy end do energy = energy / this%system(i)%num_atoms - if( energy .lt. this%best_energy ) then - this%best_energy = energy - this%best_system = i - end if + + do is = 1, size(this%system(i)%element_symbols) + idx1 = findloc( [ this%element_info(:)%name ], & + this%system(i)%element_symbols(is), dim=1 ) + energy_per_species = energy * this%system(i)%weight_per_species(is) / & + real( this%system(i)%num_per_species(is), real12) + + if( energy_per_species .lt. this%best_energy_per_species(idx1) )then + this%best_energy_per_species(idx1) = energy_per_species + end if + do js = 1, size(this%system(i)%element_symbols) + idx2 = findloc( [ this%element_info(:)%name ], & + this%system(i)%element_symbols(js), dim=1) + j = nint( ( size(this%element_info) - & + min( idx1, idx2 ) / 2._real12 ) * & + ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) + + energy_pair = energy * this%system(i)%weight_pair(idx_list(is,js)) / & + real( this%system(i)%num_pairs(idx_list(is,js)), real12) + + if( energy_pair .lt. this%best_energy_pair(j) )then + this%best_energy_pair(j) = energy_pair + end if + + end do + if(this%system(i)%num_per_species(is).eq.0)then + write(0,*) "system ", i + write(0,*) this%system(i)%element_symbols(is), is + write(*,*) this%system(i)%num_per_species(is), this%system(i)%num_pairs + call stop_program( "Species not found in system" ) + stop + return + end if + end do + deallocate(idx_list) + end do end subroutine set_best_energy @@ -1757,8 +1824,12 @@ subroutine evolve(this, system) !! Index of the element in the element_info array. integer :: num_evaluated !! Number of systems evaluated this iteration. - real(real12) :: weight, energy, best_energy_old + real(real12) :: weight, energy !! Energy and weight variables for a system. + real(real12), dimension(:), allocatable :: & + best_energy_pair_old, & + best_energy_per_species_old + !! Old best energies. real(real12), dimension(:), allocatable :: height !! Height of the g-vectors. integer, dimension(:,:), allocatable :: idx_list @@ -1783,85 +1854,87 @@ subroutine evolve(this, system) !--------------------------------------------------------------------------- - ! get the energy from the lowest formation energy system - !--------------------------------------------------------------------------- - best_energy_old = this%best_energy - call this%set_best_energy() - - - !--------------------------------------------------------------------------- - ! initialise the total gvectors + ! initialise the total gvectors and get best energies from lowest + ! formation energy system !--------------------------------------------------------------------------- if(.not.allocated(this%total%df_2body))then + call this%set_best_energy() call this%initialise_gvectors() else - this%total%df_2body = this%total%df_2body * & - exp( this%best_energy / this%kbt ) / & - exp( best_energy_old / this%kbt ) - this%total%df_3body = this%total%df_3body * & - exp( this%best_energy / this%kbt ) / & - exp( best_energy_old / this%kbt ) - this%total%df_4body = this%total%df_4body * & - exp( this%best_energy / this%kbt ) / & - exp( best_energy_old / this%kbt ) - if(size(this%total%df_2body,2).ne.size(this%bond_info))then - allocate(tmp_df(this%nbins(1),size(this%bond_info)), & - source = 0._real12 ) - tmp_df(:,1:size(this%total%df_2body,2)) = this%total%df_2body - deallocate(this%total%df_2body) - call move_alloc( tmp_df, this%total%df_2body ) - allocate(tmp_in_dataset(size(this%bond_info)), source = .false. ) - tmp_in_dataset(1:size(this%in_dataset_2body)) = this%in_dataset_2body - deallocate(this%in_dataset_2body) - call move_alloc( tmp_in_dataset, this%in_dataset_2body ) - end if - if(size(this%total%df_3body,2).ne.size(this%element_info))then - allocate(tmp_df(this%nbins(2),size(this%element_info)), & - source = 0._real12 ) - tmp_df(:,1:size(this%total%df_3body,2)) = this%total%df_3body - deallocate(this%total%df_3body) - call move_alloc( tmp_df, this%total%df_3body ) - allocate(tmp_in_dataset(size(this%element_info)), source = .false. ) - tmp_in_dataset(1:size(this%in_dataset_3body)) = this%in_dataset_3body - deallocate(this%in_dataset_3body) - call move_alloc( tmp_in_dataset, this%in_dataset_3body ) - end if - if(size(this%total%df_4body,2).ne.size(this%element_info))then - allocate(tmp_df(this%nbins(3),size(this%element_info)), & - source = 0._real12 ) - tmp_df(:,1:size(this%total%df_4body,2)) = this%total%df_4body - deallocate(this%total%df_4body) - call move_alloc( tmp_df, this%total%df_4body ) - allocate(tmp_in_dataset(size(this%element_info)), source = .false. ) - tmp_in_dataset(1:size(this%in_dataset_4body)) = this%in_dataset_4body - deallocate(this%in_dataset_4body) - call move_alloc( tmp_in_dataset, this%in_dataset_4body ) - end if - do j = 1, size(this%total%df_2body,2) - if(.not.this%in_dataset_2body(j))then - this%total%df_2body(:,j) = 0._real12 - else - this%total%df_2body(:,j) = & - this%total%df_2body(:,j) * this%norm_2body(j) - end if - end do - do is = 1, size(this%element_info) - if(.not.this%in_dataset_3body(is))then - this%total%df_3body(:,is) = 0._real12 - else - this%total%df_3body(:,is) = & - this%total%df_3body(:,is) * this%norm_3body(is) - end if - if(.not.this%in_dataset_4body(is))then - this%total%df_4body(:,is) = 0._real12 - else - this%total%df_4body(:,is) = & - this%total%df_4body(:,is) * this%norm_4body(is) - end if - end do - deallocate(this%norm_2body) - deallocate(this%norm_3body) - deallocate(this%norm_4body) + best_energy_pair_old = this%best_energy_pair + best_energy_per_species_old = this%best_energy_per_species + call this%set_best_energy() + do i = 1, size(this%total%df_2body,2) + this%total%df_2body(:,i) = this%total%df_2body(:,i) * & + exp( this%best_energy_pair(i) / this%kbt ) / & + exp( best_energy_pair_old(i) / this%kbt ) + end do + do i = 1, size(this%total%df_3body,2) + this%total%df_3body(:,i) = this%total%df_3body(:,i) * & + exp( this%best_energy_per_species(i) / this%kbt ) / & + exp( best_energy_per_species_old(i) / this%kbt ) + this%total%df_4body(:,i) = this%total%df_4body(:,i) * & + exp( this%best_energy_per_species(i) / this%kbt ) / & + exp( best_energy_per_species_old(i) / this%kbt ) + end do + if(size(this%total%df_2body,2).ne.size(this%bond_info))then + allocate(tmp_df(this%nbins(1),size(this%bond_info)), & + source = 0._real12 ) + tmp_df(:,1:size(this%total%df_2body,2)) = this%total%df_2body + deallocate(this%total%df_2body) + call move_alloc( tmp_df, this%total%df_2body ) + allocate(tmp_in_dataset(size(this%bond_info)), source = .false. ) + tmp_in_dataset(1:size(this%in_dataset_2body)) = this%in_dataset_2body + deallocate(this%in_dataset_2body) + call move_alloc( tmp_in_dataset, this%in_dataset_2body ) + end if + if(size(this%total%df_3body,2).ne.size(this%element_info))then + allocate(tmp_df(this%nbins(2),size(this%element_info)), & + source = 0._real12 ) + tmp_df(:,1:size(this%total%df_3body,2)) = this%total%df_3body + deallocate(this%total%df_3body) + call move_alloc( tmp_df, this%total%df_3body ) + allocate(tmp_in_dataset(size(this%element_info)), source = .false. ) + tmp_in_dataset(1:size(this%in_dataset_3body)) = this%in_dataset_3body + deallocate(this%in_dataset_3body) + call move_alloc( tmp_in_dataset, this%in_dataset_3body ) + end if + if(size(this%total%df_4body,2).ne.size(this%element_info))then + allocate(tmp_df(this%nbins(3),size(this%element_info)), & + source = 0._real12 ) + tmp_df(:,1:size(this%total%df_4body,2)) = this%total%df_4body + deallocate(this%total%df_4body) + call move_alloc( tmp_df, this%total%df_4body ) + allocate(tmp_in_dataset(size(this%element_info)), source = .false. ) + tmp_in_dataset(1:size(this%in_dataset_4body)) = this%in_dataset_4body + deallocate(this%in_dataset_4body) + call move_alloc( tmp_in_dataset, this%in_dataset_4body ) + end if + do j = 1, size(this%total%df_2body,2) + if(.not.this%in_dataset_2body(j))then + this%total%df_2body(:,j) = 0._real12 + else + this%total%df_2body(:,j) = & + this%total%df_2body(:,j) * this%norm_2body(j) + end if + end do + do is = 1, size(this%element_info) + if(.not.this%in_dataset_3body(is))then + this%total%df_3body(:,is) = 0._real12 + else + this%total%df_3body(:,is) = & + this%total%df_3body(:,is) * this%norm_3body(is) + end if + if(.not.this%in_dataset_4body(is))then + this%total%df_4body(:,is) = 0._real12 + else + this%total%df_4body(:,is) = & + this%total%df_4body(:,is) * this%norm_4body(is) + end if + end do + deallocate(this%norm_2body) + deallocate(this%norm_3body) + deallocate(this%norm_4body) end if if(any(this%system(this%num_evaluated_allocated+1:)%from_host).and.this%host_system%defined)then @@ -1915,7 +1988,8 @@ subroutine evolve(this, system) this%element_info(idx1)%energy end do energy = energy / this%system(i)%num_atoms - weight = exp( ( this%best_energy - energy ) / this%kbt ) + ! write(*,*) "Energy of system ",i,": ", energy + ! weight = exp( ( this%best_energy - energy ) / this%kbt ) j = 0 ! if(weight.lt.1.E-6.and.this%system(i)%from_host)then @@ -1969,6 +2043,17 @@ subroutine evolve(this, system) idx1 = findloc( [ this%element_info(:)%name ], & this%system(i)%element_symbols(is), dim=1) + weight = exp( & + ( & + this%best_energy_per_species(is) - & + energy * ( & + this%system(i)%weight_per_species(is) / & + real( this%system(i)%num_per_species(is), real12 ) & + ) & + ) / this%kbt & + ) + if(weight.lt.1.E-6) cycle + ! height = 1._real12 / ( 1._real12 + this%total%df_3body(:,idx1) ) this%total%df_3body(:,idx1) = this%total%df_3body(:,idx1) + & ! weight * & @@ -2001,6 +2086,18 @@ subroutine evolve(this, system) ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) ! height = 1._real12 / & ! ( 1._real12 + this%total%df_2body(:,j) ) ** 2._real12 + + weight = exp( & + ( & + this%best_energy_pair(j) - & + energy * ( & + this%system(i)%weight_pair(idx_list(is,js)) / & + real( this%system(i)%num_pairs(idx_list(is,js)), real12 ) & + ) & + ) / this%kbt & + ) + if(weight.lt.1.E-6) cycle + this%total%df_2body(:,j) = this%total%df_2body(:,j) + & ! weight * & set_difference( weight * this%system(i)%df_2body(:,idx_list(is,js)), & @@ -2046,8 +2143,14 @@ subroutine evolve(this, system) this%norm_2body(j) = maxval(this%total%df_2body(:,j)) ! this%norm_2body(j) = sum(this%total%df_2body(:,j))/size(this%total%df_2body,1) if(abs(this%norm_2body(j)).lt.1.E-6)then - call stop_program( "Zero norm for 2-body g-vector" ) - return + ! if(any(this%system(this%num_evaluated_allocated+1:)%from_host))then + ! this%norm_2body(j) = 1.E-2_real12 + ! this%total%df_2body(:,j) = 1.E-2_real12 + ! cycle + ! else + call stop_program( "Zero norm for 2-body g-vector" ) + return + ! end if end if this%total%df_2body(:,j) = & this%total%df_2body(:,j) / this%norm_2body(j) @@ -2058,14 +2161,25 @@ subroutine evolve(this, system) this%norm_3body(is) = maxval(this%total%df_3body(:,is)) ! this%norm_3body(is) = sum(this%total%df_3body(:,is))/size(this%total%df_3body,1) if(abs(this%norm_3body(is)).lt.1.E-6)then - call stop_program( "Zero norm for 3-body g-vector" ) - return + ! if(any(this%system(this%num_evaluated_allocated+1:)%from_host))then + ! this%norm_3body(is) = 1.E-2_real12 + ! this%total%df_3body(:,is) = 1.E-2_real12 + ! cycle + ! else + call stop_program( "Zero norm for 3-body g-vector" ) + return + ! end if end if this%norm_4body(is) = maxval(this%total%df_4body(:,is)) ! this%norm_4body(is) = sum(this%total%df_4body(:,is))/size(this%total%df_4body,1) if(abs(this%norm_4body(is)).lt.1.E-6)then - call stop_program( "Zero norm for 4-body g-vector" ) - return + ! if(any(this%system(this%num_evaluated_allocated+1:)%from_host))then + ! this%norm_4body(is) = 1.E-2_real12 + ! this%total%df_4body(:,is) = 1.E-2_real12 + ! else + call stop_program( "Zero norm for 4-body g-vector" ) + return + ! end if end if this%total%df_3body(:,is) = & this%total%df_3body(:,is) / this%norm_3body(is) @@ -2237,6 +2351,10 @@ subroutine calculate(this, basis, & ! calculate the gaussian width and allocate the distribution functions !--------------------------------------------------------------------------- eta = 1._real12 / ( 2._real12 * sigma_**2._real12 ) + allocate(this%num_pairs(num_pairs), source = 0) + allocate(this%num_per_species(basis%nspec), source = 0) + allocate(this%weight_pair(num_pairs), source = 0._real12) + allocate(this%weight_per_species(basis%nspec), source = 0._real12) allocate(this%df_2body(nbins_(1), num_pairs), source = 0._real12) allocate(this%df_3body(nbins_(2), basis%nspec), source = 0._real12) allocate(this%df_4body(nbins_(3), basis%nspec), source = 0._real12) @@ -2397,6 +2515,22 @@ subroutine calculate(this, basis, & cutoff_min_(1), & limit(1), scale = distance(:itmp1) & ) + this%weight_pair(pair_index(is, js)) = & + this%weight_pair(pair_index(is, js)) +& + 4._real12 * sum( & + ( & + bond_info(pair_index(is, js))%radius_covalent / & + bondlength_list(:itmp1) ) ** 2 & + ) + this%num_pairs(pair_index(is, js)) = this%num_pairs(pair_index(is, js)) + itmp1 + this%weight_per_species(is) = & + this%weight_per_species(is) + & + 4._real12 * sum( & + ( & + bond_info(pair_index(is, js))%radius_covalent / & + bondlength_list(:itmp1) ) ** 2 & + ) + this%num_per_species(is) = this%num_per_species(is) + itmp1 end if end do diff --git a/src/raffle/raffle.py b/src/raffle/raffle.py index fa9b7379..8eaccc03 100644 --- a/src/raffle/raffle.py +++ b/src/raffle/raffle.py @@ -1452,20 +1452,20 @@ def get_bond_radii(self): return bond_radii - def _set_best_energy(self): - """ - set_best_energy__binding__gvector_container_type(self) + # def _set_best_energy(self): + # """ + # set_best_energy__binding__gvector_container_type(self) - Defined at ../src/lib/mod_evolver.f90 lines \ - 532-554 + # Defined at ../src/lib/mod_evolver.f90 lines \ + # 532-554 - Parameters - ---------- - this : unknown + # Parameters + # ---------- + # this : unknown - """ - _raffle.f90wrap_evolver__set_best_energy__binding__gvector_containe4680(this=self._handle) + # """ + # _raffle.f90wrap_evolver__set_best_energy__binding__gvector_containe4680(this=self._handle) def initialise_gvectors(self): """ @@ -1672,37 +1672,37 @@ def num_evaluated_allocated(self, num_evaluated_allocated): _raffle.f90wrap_gvector_container_type__set__num_evaluated_allocated(self._handle, \ num_evaluated_allocated) - @property - def best_system(self): - """ - Element best_system ftype=integer pytype=int + # @property + # def best_system(self): + # """ + # Element best_system ftype=integer pytype=int - Defined at ../src/lib/mod_evolver.f90 line 31 + # Defined at ../src/lib/mod_evolver.f90 line 31 - """ - return _raffle.f90wrap_gvector_container_type__get__best_system(self._handle) + # """ + # return _raffle.f90wrap_gvector_container_type__get__best_system(self._handle) - @best_system.setter - def best_system(self, best_system): - _raffle.f90wrap_gvector_container_type__set__best_system(self._handle, \ - best_system) + # @best_system.setter + # def best_system(self, best_system): + # _raffle.f90wrap_gvector_container_type__set__best_system(self._handle, \ + # best_system) - @property - def best_energy(self): - """ - Element best_energy ftype=real(real12) pytype=float + # @property + # def best_energy(self): + # """ + # Element best_energy ftype=real(real12) pytype=float - Defined at ../src/lib/mod_evolver.f90 line 32 + # Defined at ../src/lib/mod_evolver.f90 line 32 - """ - return _raffle.f90wrap_gvector_container_type__get__best_energy(self._handle) + # """ + # return _raffle.f90wrap_gvector_container_type__get__best_energy(self._handle) - @best_energy.setter - def best_energy(self, best_energy): - _raffle.f90wrap_gvector_container_type__set__best_energy(self._handle, \ - best_energy) + # @best_energy.setter + # def best_energy(self, best_energy): + # _raffle.f90wrap_gvector_container_type__set__best_energy(self._handle, \ + # best_energy) @property def kbT(self): @@ -1904,10 +1904,10 @@ def _init_array_system(self): def __str__(self): ret = ['{\n'] - ret.append(' best_system : ') - ret.append(repr(self.best_system)) - ret.append(',\n best_energy : ') - ret.append(repr(self.best_energy)) + # ret.append(' best_system : ') + # ret.append(repr(self.best_system)) + # ret.append(',\n best_energy : ') + # ret.append(repr(self.best_energy)) ret.append(',\n kbT : ') ret.append(repr(self.kbT)) ret.append(',\n nbins : ') diff --git a/src/wrapper/f90wrap_mod_evolver.f90 b/src/wrapper/f90wrap_mod_evolver.f90 index 438c6406..3a2c989b 100644 --- a/src/wrapper/f90wrap_mod_evolver.f90 +++ b/src/wrapper/f90wrap_mod_evolver.f90 @@ -318,61 +318,61 @@ subroutine f90wrap_gvector_container_type__set__num_evaluated_allocated(this, f9 this_ptr%p%num_evaluated_allocated = f90wrap_num_evaluated_allocated end subroutine f90wrap_gvector_container_type__set__num_evaluated_allocated -subroutine f90wrap_gvector_container_type__get__best_system(this, f90wrap_best_system) - use evolver, only: gvector_container_type - implicit none - type gvector_container_type_ptr_type - type(gvector_container_type), pointer :: p => NULL() - end type gvector_container_type_ptr_type - integer, intent(in) :: this(2) - type(gvector_container_type_ptr_type) :: this_ptr - integer, intent(out) :: f90wrap_best_system - - this_ptr = transfer(this, this_ptr) - f90wrap_best_system = this_ptr%p%best_system -end subroutine f90wrap_gvector_container_type__get__best_system - -subroutine f90wrap_gvector_container_type__set__best_system(this, f90wrap_best_system) - use evolver, only: gvector_container_type - implicit none - type gvector_container_type_ptr_type - type(gvector_container_type), pointer :: p => NULL() - end type gvector_container_type_ptr_type - integer, intent(in) :: this(2) - type(gvector_container_type_ptr_type) :: this_ptr - integer, intent(in) :: f90wrap_best_system - - this_ptr = transfer(this, this_ptr) - this_ptr%p%best_system = f90wrap_best_system -end subroutine f90wrap_gvector_container_type__set__best_system - -subroutine f90wrap_gvector_container_type__get__best_energy(this, f90wrap_best_energy) - use evolver, only: gvector_container_type - implicit none - type gvector_container_type_ptr_type - type(gvector_container_type), pointer :: p => NULL() - end type gvector_container_type_ptr_type - integer, intent(in) :: this(2) - type(gvector_container_type_ptr_type) :: this_ptr - real(4), intent(out) :: f90wrap_best_energy - - this_ptr = transfer(this, this_ptr) - f90wrap_best_energy = this_ptr%p%best_energy -end subroutine f90wrap_gvector_container_type__get__best_energy - -subroutine f90wrap_gvector_container_type__set__best_energy(this, f90wrap_best_energy) - use evolver, only: gvector_container_type - implicit none - type gvector_container_type_ptr_type - type(gvector_container_type), pointer :: p => NULL() - end type gvector_container_type_ptr_type - integer, intent(in) :: this(2) - type(gvector_container_type_ptr_type) :: this_ptr - real(4), intent(in) :: f90wrap_best_energy - - this_ptr = transfer(this, this_ptr) - this_ptr%p%best_energy = f90wrap_best_energy -end subroutine f90wrap_gvector_container_type__set__best_energy +! subroutine f90wrap_gvector_container_type__get__best_system(this, f90wrap_best_system) +! use evolver, only: gvector_container_type +! implicit none +! type gvector_container_type_ptr_type +! type(gvector_container_type), pointer :: p => NULL() +! end type gvector_container_type_ptr_type +! integer, intent(in) :: this(2) +! type(gvector_container_type_ptr_type) :: this_ptr +! integer, intent(out) :: f90wrap_best_system + +! this_ptr = transfer(this, this_ptr) +! f90wrap_best_system = this_ptr%p%best_system +! end subroutine f90wrap_gvector_container_type__get__best_system + +! subroutine f90wrap_gvector_container_type__set__best_system(this, f90wrap_best_system) +! use evolver, only: gvector_container_type +! implicit none +! type gvector_container_type_ptr_type +! type(gvector_container_type), pointer :: p => NULL() +! end type gvector_container_type_ptr_type +! integer, intent(in) :: this(2) +! type(gvector_container_type_ptr_type) :: this_ptr +! integer, intent(in) :: f90wrap_best_system + +! this_ptr = transfer(this, this_ptr) +! this_ptr%p%best_system = f90wrap_best_system +! end subroutine f90wrap_gvector_container_type__set__best_system + +! subroutine f90wrap_gvector_container_type__get__best_energy(this, f90wrap_best_energy) +! use evolver, only: gvector_container_type +! implicit none +! type gvector_container_type_ptr_type +! type(gvector_container_type), pointer :: p => NULL() +! end type gvector_container_type_ptr_type +! integer, intent(in) :: this(2) +! type(gvector_container_type_ptr_type) :: this_ptr +! real(4), intent(out) :: f90wrap_best_energy + +! this_ptr = transfer(this, this_ptr) +! f90wrap_best_energy = this_ptr%p%best_energy +! end subroutine f90wrap_gvector_container_type__get__best_energy + +! subroutine f90wrap_gvector_container_type__set__best_energy(this, f90wrap_best_energy) +! use evolver, only: gvector_container_type +! implicit none +! type gvector_container_type_ptr_type +! type(gvector_container_type), pointer :: p => NULL() +! end type gvector_container_type_ptr_type +! integer, intent(in) :: this(2) +! type(gvector_container_type_ptr_type) :: this_ptr +! real(4), intent(in) :: f90wrap_best_energy + +! this_ptr = transfer(this, this_ptr) +! this_ptr%p%best_energy = f90wrap_best_energy +! end subroutine f90wrap_gvector_container_type__set__best_energy subroutine f90wrap_gvector_container_type__get__kbt(this, f90wrap_kbt) use evolver, only: gvector_container_type @@ -923,18 +923,18 @@ subroutine f90wrap_evolver__get_bond_radii_staticmem__binding__gvectord2e1(this, call this_ptr%p%get_bond_radii_staticmem(elements=elements, radii=radii) end subroutine f90wrap_evolver__get_bond_radii_staticmem__binding__gvectord2e1 -subroutine f90wrap_evolver__set_best_energy__binding__gvector_containe4680(this) - use evolver, only: gvector_container_type - implicit none - - type gvector_container_type_ptr_type - type(gvector_container_type), pointer :: p => NULL() - end type gvector_container_type_ptr_type - type(gvector_container_type_ptr_type) :: this_ptr - integer, intent(in), dimension(2) :: this - this_ptr = transfer(this, this_ptr) - call this_ptr%p%set_best_energy() -end subroutine f90wrap_evolver__set_best_energy__binding__gvector_containe4680 +! subroutine f90wrap_evolver__set_best_energy__binding__gvector_containe4680(this) +! use evolver, only: gvector_container_type +! implicit none + +! type gvector_container_type_ptr_type +! type(gvector_container_type), pointer :: p => NULL() +! end type gvector_container_type_ptr_type +! type(gvector_container_type_ptr_type) :: this_ptr +! integer, intent(in), dimension(2) :: this +! this_ptr = transfer(this, this_ptr) +! call this_ptr%p%set_best_energy() +! end subroutine f90wrap_evolver__set_best_energy__binding__gvector_containe4680 subroutine f90wrap_evolver__initialise_gvectors__binding__gvector_contc1f2(this) use evolver, only: gvector_container_type From f7bf1283232e05723b20d1bf7b82b40995e10e0b Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Thu, 26 Sep 2024 17:43:04 +0100 Subject: [PATCH 07/11] Fix weight renormalisation --- src/fortran/lib/mod_evolver.f90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fortran/lib/mod_evolver.f90 b/src/fortran/lib/mod_evolver.f90 index aa65e9b1..ae318223 100644 --- a/src/fortran/lib/mod_evolver.f90 +++ b/src/fortran/lib/mod_evolver.f90 @@ -1638,7 +1638,7 @@ subroutine set_best_energy(this) idx1 = findloc( [ this%element_info(:)%name ], & this%system(i)%element_symbols(is), dim=1 ) energy_per_species = energy * this%system(i)%weight_per_species(is) / & - real( this%system(i)%num_per_species(is), real12) + real( sum( this%system(i)%num_per_species(:) ), real12) if( energy_per_species .lt. this%best_energy_per_species(idx1) )then this%best_energy_per_species(idx1) = energy_per_species @@ -1651,7 +1651,7 @@ subroutine set_best_energy(this) ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) energy_pair = energy * this%system(i)%weight_pair(idx_list(is,js)) / & - real( this%system(i)%num_pairs(idx_list(is,js)), real12) + real( sum( this%system(i)%num_per_species(:) ), real12) if( energy_pair .lt. this%best_energy_pair(j) )then this%best_energy_pair(j) = energy_pair @@ -2048,7 +2048,7 @@ subroutine evolve(this, system) this%best_energy_per_species(is) - & energy * ( & this%system(i)%weight_per_species(is) / & - real( this%system(i)%num_per_species(is), real12 ) & + real( sum( this%system(i)%num_per_species(:) ), real12 ) & ) & ) / this%kbt & ) @@ -2092,7 +2092,7 @@ subroutine evolve(this, system) this%best_energy_pair(j) - & energy * ( & this%system(i)%weight_pair(idx_list(is,js)) / & - real( this%system(i)%num_pairs(idx_list(is,js)), real12 ) & + real( sum( this%system(i)%num_per_species(:) ), real12 ) & ) & ) / this%kbt & ) @@ -2516,7 +2516,7 @@ subroutine calculate(this, basis, & limit(1), scale = distance(:itmp1) & ) this%weight_pair(pair_index(is, js)) = & - this%weight_pair(pair_index(is, js)) +& + this%weight_pair(pair_index(is, js)) + & 4._real12 * sum( & ( & bond_info(pair_index(is, js))%radius_covalent / & From 417934f0567c55c6da79f965ff427efe16c7b84a Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Fri, 27 Sep 2024 07:56:03 +0100 Subject: [PATCH 08/11] Fix formatting --- src/fortran/lib/mod_evolver.f90 | 191 +++++++++++--------------------- 1 file changed, 62 insertions(+), 129 deletions(-) diff --git a/src/fortran/lib/mod_evolver.f90 b/src/fortran/lib/mod_evolver.f90 index ae318223..30ba1f17 100644 --- a/src/fortran/lib/mod_evolver.f90 +++ b/src/fortran/lib/mod_evolver.f90 @@ -479,6 +479,7 @@ subroutine create(this, basis_list, deallocate_systems) character(256) :: stop_msg !! Error message. + ! Check if element_database is allocated if(.not.allocated(element_database))then write(stop_msg,*) "element_database not allocated" // & achar(13) // achar(10) // & @@ -547,9 +548,11 @@ subroutine update(this, basis_list, from_host, deallocate_systems) from_host_ = .true. end if + ! Check if deallocate_systems is present deallocate_systems_ = .true. if(present(deallocate_systems)) deallocate_systems_ = deallocate_systems + ! Add the new basis structures call this%add(basis_list) call this%update_bond_info() @@ -564,25 +567,22 @@ subroutine update(this, basis_list, from_host, deallocate_systems) return else if(.not.allocated(this%host_system%df_2body))then - call this%host_system%calculate(this%host_system%basis, width = this%width, & - sigma = this%sigma, & - cutoff_min = this%cutoff_min, & - cutoff_max = this%cutoff_max, & - radius_distance_tol = this%radius_distance_tol & + call this%host_system%calculate( & + this%host_system%basis, & + width = this%width, & + sigma = this%sigma, & + cutoff_min = this%cutoff_min, & + cutoff_max = this%cutoff_max, & + radius_distance_tol = this%radius_distance_tol & ) end if call this%host_system%calculate_interface_energy(this%element_info) - write(*,*) "host interface energy: ", this%host_system%interface_energy - write(*,*) "Stoichiometry of host: ", this%host_system%stoichiometry - write(*,*) this%element_info(1)%energy do i = this%num_evaluated_allocated + 1, size(this%system), 1 this%system(i)%from_host = .true. - write(*,*) "unmodified energy: ", this%system(i)%energy this%system(i)%energy = this%system(i)%energy - & this%host_system%interface_energy this%system(i)%num_atoms = this%system(i)%num_atoms - & this%host_system%num_atoms - write(*,*) "modified energy: ", this%system(i)%energy end do end if end if @@ -1596,17 +1596,29 @@ subroutine set_best_energy(this) !! Index list for pairs of elements. if(.not.allocated(this%best_energy_pair))then - allocate(this%best_energy_pair(size(this%bond_info,1)), source = 0._real12) + allocate( & + this%best_energy_pair(size(this%bond_info,1)), & + source = 0._real12 & + ) elseif(size(this%best_energy_pair).ne.size(this%bond_info))then deallocate(this%best_energy_pair) - allocate(this%best_energy_pair(size(this%bond_info,1)), source = 0._real12) + allocate( & + this%best_energy_pair(size(this%bond_info,1)), & + source = 0._real12 & + ) end if if(.not.allocated(this%best_energy_per_species))then - allocate(this%best_energy_per_species(size(this%element_info,1)), source = 0._real12) + allocate( & + this%best_energy_per_species(size(this%element_info,1)), & + source = 0._real12 & + ) elseif(size(this%best_energy_per_species).ne.size(this%element_info))then deallocate(this%best_energy_per_species) - allocate(this%best_energy_per_species(size(this%element_info,1)), source = 0._real12) + allocate( & + this%best_energy_per_species(size(this%element_info,1)), & + source = 0._real12 & + ) end if do i = 1, size(this%system) @@ -1637,8 +1649,9 @@ subroutine set_best_energy(this) do is = 1, size(this%system(i)%element_symbols) idx1 = findloc( [ this%element_info(:)%name ], & this%system(i)%element_symbols(is), dim=1 ) - energy_per_species = energy * this%system(i)%weight_per_species(is) / & - real( sum( this%system(i)%num_per_species(:) ), real12) + energy_per_species = & + energy * this%system(i)%weight_per_species(is) / & + real( sum( this%system(i)%num_per_species(:) ), real12 ) if( energy_per_species .lt. this%best_energy_per_species(idx1) )then this%best_energy_per_species(idx1) = energy_per_species @@ -1650,8 +1663,9 @@ subroutine set_best_energy(this) min( idx1, idx2 ) / 2._real12 ) * & ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) - energy_pair = energy * this%system(i)%weight_pair(idx_list(is,js)) / & - real( sum( this%system(i)%num_per_species(:) ), real12) + energy_pair = & + energy * this%system(i)%weight_pair(idx_list(is,js)) / & + real( sum( this%system(i)%num_per_species(:) ), real12 ) if( energy_pair .lt. this%best_energy_pair(j) )then this%best_energy_pair(j) = energy_pair @@ -1659,11 +1673,7 @@ subroutine set_best_energy(this) end do if(this%system(i)%num_per_species(is).eq.0)then - write(0,*) "system ", i - write(0,*) this%system(i)%element_symbols(is), is - write(*,*) this%system(i)%num_per_species(is), this%system(i)%num_pairs call stop_program( "Species not found in system" ) - stop return end if end do @@ -1870,12 +1880,14 @@ subroutine evolve(this, system) exp( best_energy_pair_old(i) / this%kbt ) end do do i = 1, size(this%total%df_3body,2) - this%total%df_3body(:,i) = this%total%df_3body(:,i) * & - exp( this%best_energy_per_species(i) / this%kbt ) / & - exp( best_energy_per_species_old(i) / this%kbt ) - this%total%df_4body(:,i) = this%total%df_4body(:,i) * & - exp( this%best_energy_per_species(i) / this%kbt ) / & - exp( best_energy_per_species_old(i) / this%kbt ) + this%total%df_3body(:,i) = & + this%total%df_3body(:,i) * exp( & + this%best_energy_per_species(i) / this%kbt & + ) / exp( best_energy_per_species_old(i) / this%kbt ) + this%total%df_4body(:,i) = & + this%total%df_4body(:,i) * exp( & + this%best_energy_per_species(i) / this%kbt & + ) / exp( best_energy_per_species_old(i) / this%kbt ) end do if(size(this%total%df_2body,2).ne.size(this%bond_info))then allocate(tmp_df(this%nbins(1),size(this%bond_info)), & @@ -1937,7 +1949,10 @@ subroutine evolve(this, system) deallocate(this%norm_4body) end if - if(any(this%system(this%num_evaluated_allocated+1:)%from_host).and.this%host_system%defined)then + if( & + any(this%system(this%num_evaluated_allocated+1:)%from_host) .and. & + this%host_system%defined & + )then ! set host_idx_list allocate(host_idx_list(size(this%element_info))) host_idx_list = 0 @@ -1988,53 +2003,7 @@ subroutine evolve(this, system) this%element_info(idx1)%energy end do energy = energy / this%system(i)%num_atoms - ! write(*,*) "Energy of system ",i,": ", energy - ! weight = exp( ( this%best_energy - energy ) / this%kbt ) j = 0 - ! if(weight.lt.1.E-6.and.this%system(i)%from_host)then - - ! do is = 1, size(this%system(i)%element_symbols) - ! idx1 = findloc( [ this%element_info(:)%name ], & - ! this%system(i)%element_symbols(is), dim=1) - ! if(host_idx_list(idx1).eq.0)then - ! this%total%df_3body(:,idx1) = this%total%df_3body(:,idx1) - & - ! 0.1_real12 * this%system(i)%df_3body(:,is) - ! this%total%df_4body(:,idx1) = this%total%df_4body(:,idx1) - & - ! 0.1_real12 * this%system(i)%df_4body(:,is) - ! else - ! this%total%df_3body(:,idx1) = this%total%df_3body(:,idx1) - & - ! set_difference( 0.1_real12 * this%system(i)%df_3body(:,is), & - ! this%host_system%df_3body(:,host_idx_list(idx1)), & - ! set_min_zero = .false. & - ! ) - ! this%total%df_4body(:,idx1) = this%total%df_4body(:,idx1) - & - ! set_difference( 0.1_real12 * this%system(i)%df_4body(:,is), & - ! this%host_system%df_4body(:,host_idx_list(idx1)), & - ! set_min_zero = .false. & - ! ) - ! do js = is, size(this%system(i)%element_symbols), 1 - ! idx2 = findloc( [ this%element_info(:)%name ], & - ! this%system(i)%element_symbols(js), dim=1) - ! j = nint( ( size(this%element_info) - & - ! min( idx1, idx2 ) / 2._real12 ) * & - ! ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) - ! if(host_idx_list(idx2).eq.0)then - ! this%total%df_2body(:,j) = this%total%df_2body(:,j) - & - ! 0.1_real12 * this%system(i)%df_2body(:,idx_list(is,js)) - ! else - ! this%total%df_2body(:,j) = this%total%df_2body(:,j) - & - ! set_difference( 0.1_real12 * this%system(i)%df_2body(:,idx_list(is,js)), & - ! this%host_system%df_2body(:,this%host_system%pair_index(host_idx_list(idx1),host_idx_list(idx2))), & - ! set_min_zero = .false. & - ! ) - ! end if - ! end do - ! end if - ! end do - ! if(weight.lt.1.E-6)then - ! deallocate(idx_list) - ! cycle - ! else !------------------------------------------------------------------------ ! loop over all species in the system to add the gvectors !------------------------------------------------------------------------ @@ -2054,29 +2023,17 @@ subroutine evolve(this, system) ) if(weight.lt.1.E-6) cycle - ! height = 1._real12 / ( 1._real12 + this%total%df_3body(:,idx1) ) this%total%df_3body(:,idx1) = this%total%df_3body(:,idx1) + & - ! weight * & set_difference( weight * this%system(i)%df_3body(:,is), & - this%total%df_3body(:,idx1), & !/ max( & - ! 1._real12, & - ! maxval(this%total%df_3body(:,idx1)) & - ! ), & + this%total%df_3body(:,idx1), & set_min_zero = .true. & ) - ! height * this%system(i)%df_4body(:,is) - ! height = 1._real12 / ( 1._real12 + this%total%df_4body(:,idx1) ) this%total%df_4body(:,idx1) = this%total%df_4body(:,idx1) + & - ! weight * & set_difference( weight * this%system(i)%df_4body(:,is), & - this%total%df_4body(:,idx1), &! !/ max( & - ! 1._real12, & - ! maxval(this%total%df_4body(:,idx1)) & - ! ), & + this%total%df_4body(:,idx1), & set_min_zero = .true. & ) - ! height * this%system(i)%df_4body(:,is) do js = is, size(this%system(i)%element_symbols), 1 idx2 = findloc( [ this%element_info(:)%name ], & @@ -2084,8 +2041,6 @@ subroutine evolve(this, system) j = nint( ( size(this%element_info) - & min( idx1, idx2 ) / 2._real12 ) * & ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) - ! height = 1._real12 / & - ! ( 1._real12 + this%total%df_2body(:,j) ) ** 2._real12 weight = exp( & ( & @@ -2099,19 +2054,14 @@ subroutine evolve(this, system) if(weight.lt.1.E-6) cycle this%total%df_2body(:,j) = this%total%df_2body(:,j) + & - ! weight * & - set_difference( weight * this%system(i)%df_2body(:,idx_list(is,js)), & - this%total%df_2body(:,j), & !/ max( & - ! 1._real12, & - ! maxval(this%total%df_2body(:,j)) & - ! ), & - set_min_zero = .true. & + set_difference( & + weight * this%system(i)%df_2body(:,idx_list(is,js)), & + this%total%df_2body(:,j), & + set_min_zero = .true. & ) - ! height * this%system(i)%df_2body(:,idx_list(is,js)) end do end do - ! end if deallocate(idx_list) end do @@ -2141,16 +2091,9 @@ subroutine evolve(this, system) allocate(this%norm_2body(size(this%total%df_2body,2))) do j = 1, size(this%total%df_2body,2) this%norm_2body(j) = maxval(this%total%df_2body(:,j)) - ! this%norm_2body(j) = sum(this%total%df_2body(:,j))/size(this%total%df_2body,1) if(abs(this%norm_2body(j)).lt.1.E-6)then - ! if(any(this%system(this%num_evaluated_allocated+1:)%from_host))then - ! this%norm_2body(j) = 1.E-2_real12 - ! this%total%df_2body(:,j) = 1.E-2_real12 - ! cycle - ! else - call stop_program( "Zero norm for 2-body g-vector" ) - return - ! end if + call stop_program( "Zero norm for 2-body g-vector" ) + return end if this%total%df_2body(:,j) = & this%total%df_2body(:,j) / this%norm_2body(j) @@ -2159,27 +2102,14 @@ subroutine evolve(this, system) allocate(this%norm_4body(size(this%element_info))) do is = 1, size(this%element_info) this%norm_3body(is) = maxval(this%total%df_3body(:,is)) - ! this%norm_3body(is) = sum(this%total%df_3body(:,is))/size(this%total%df_3body,1) if(abs(this%norm_3body(is)).lt.1.E-6)then - ! if(any(this%system(this%num_evaluated_allocated+1:)%from_host))then - ! this%norm_3body(is) = 1.E-2_real12 - ! this%total%df_3body(:,is) = 1.E-2_real12 - ! cycle - ! else - call stop_program( "Zero norm for 3-body g-vector" ) - return - ! end if + call stop_program( "Zero norm for 3-body g-vector" ) + return end if this%norm_4body(is) = maxval(this%total%df_4body(:,is)) - ! this%norm_4body(is) = sum(this%total%df_4body(:,is))/size(this%total%df_4body,1) if(abs(this%norm_4body(is)).lt.1.E-6)then - ! if(any(this%system(this%num_evaluated_allocated+1:)%from_host))then - ! this%norm_4body(is) = 1.E-2_real12 - ! this%total%df_4body(:,is) = 1.E-2_real12 - ! else - call stop_program( "Zero norm for 4-body g-vector" ) - return - ! end if + call stop_program( "Zero norm for 4-body g-vector" ) + return end if this%total%df_3body(:,is) = & this%total%df_3body(:,is) / this%norm_3body(is) @@ -2190,8 +2120,10 @@ subroutine evolve(this, system) this%num_evaluated_allocated = size(this%system) this%num_evaluated = this%num_evaluated + num_evaluated - this%viability_3body_default = sum(this%total%df_3body)/size(this%total%df_3body) - this%viability_4body_default = sum(this%total%df_4body)/size(this%total%df_4body) + this%viability_3body_default = sum( this%total%df_3body ) / & + size( this%total%df_3body ) + this%viability_4body_default = sum( this%total%df_4body ) / & + size( this%total%df_4body ) end subroutine evolve !############################################################################### @@ -2522,7 +2454,8 @@ subroutine calculate(this, basis, & bond_info(pair_index(is, js))%radius_covalent / & bondlength_list(:itmp1) ) ** 2 & ) - this%num_pairs(pair_index(is, js)) = this%num_pairs(pair_index(is, js)) + itmp1 + this%num_pairs(pair_index(is, js)) = & + this%num_pairs(pair_index(is, js)) + itmp1 this%weight_per_species(is) = & this%weight_per_species(is) + & 4._real12 * sum( & From fbfa7fdd5a24a8e809985e1d91f3679d0b822a0e Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Fri, 27 Sep 2024 07:57:17 +0100 Subject: [PATCH 09/11] Add hull weighting option --- src/fortran/lib/mod_evolver.f90 | 145 +++++++++++++++++++++++++++----- 1 file changed, 122 insertions(+), 23 deletions(-) diff --git a/src/fortran/lib/mod_evolver.f90 b/src/fortran/lib/mod_evolver.f90 index 30ba1f17..a5cbd426 100644 --- a/src/fortran/lib/mod_evolver.f90 +++ b/src/fortran/lib/mod_evolver.f90 @@ -47,6 +47,8 @@ module evolver !! Number of atoms in the structure. real(real12) :: energy = 0.0_real12 !! Energy of the structure. + real(real12) :: energy_above_hull = 0.0_real12 + !! Energy above the hull of the structure. logical :: from_host = .false. !! Boolean whether the structure is derived from the host. integer, dimension(:), allocatable :: stoichiometry @@ -91,6 +93,10 @@ module evolver !! Number of evaluated systems still allocated. real(real12) :: kbt = 0.2_real12 !! Boltzmann constant times temperature. + logical :: weight_by_hull = .false. + !! Boolean whether to weight the distribution functions by the energy + !! above the hull. If false, the formation energy from the element + !! reference energies is used. real(real12) :: & viability_3body_default = 0.1_real12, & viability_4body_default = 0.1_real12 @@ -461,7 +467,9 @@ end subroutine calculate_interface_energy !############################################################################### - subroutine create(this, basis_list, deallocate_systems) + subroutine create( & + this, basis_list, energy_above_hull_list, deallocate_systems & + ) !! create the distribution functions from the input file implicit none ! Arguments @@ -469,6 +477,8 @@ subroutine create(this, basis_list, deallocate_systems) !! Parent. Instance of distribution functions container. type(basis_type), dimension(:), intent(in) :: basis_list !! List of basis structures. + real(real12), dimension(:), intent(in), optional :: energy_above_hull_list + !! List of energies above the hull for the structures. logical, intent(in), optional :: deallocate_systems !! Optional. Boolean whether to deallocate the systems after the !! distribution functions are created. @@ -489,6 +499,32 @@ subroutine create(this, basis_list, deallocate_systems) return end if + ! Check if energy_above_hull_list and basis_list are the same size + if(present(energy_above_hull_list))then + if(size(energy_above_hull_list).eq.0)then + this%weight_by_hull = .false. + elseif(size(energy_above_hull_list) .ne. size(basis_list))then + this%weight_by_hull = .true. + write(stop_msg,*) "energy_above_hull_list and basis_list " // & + "not the same size" // & + achar(13) // achar(10) // & + "energy_above_hull_list: ", size(energy_above_hull_list), & + achar(13) // achar(10) // & + "basis_list: ", size(basis_list) + call stop_program( stop_msg ) + return + end if + end if + if(this%weight_by_hull.and..not.present(energy_above_hull_list))then + write(stop_msg,*) "energy_above_hull_list not present" // & + achar(13) // achar(10) // & + "energy_above_hull_list must be present when using hull weighting" + call stop_program( stop_msg ) + return + end if + + + ! Check if deallocate_systems is present deallocate_systems_ = .true. if(present(deallocate_systems)) deallocate_systems_ = deallocate_systems @@ -509,6 +545,9 @@ subroutine create(this, basis_list, deallocate_systems) deallocate(this%best_energy_per_species) allocate(this%system(0)) call this%add(basis_list) + if(present(energy_above_hull_list).and.this%weight_by_hull)then + this%system(:)%energy_above_hull = energy_above_hull_list(:) + end if call this%set_bond_info() call this%evolve() if(deallocate_systems_) call this%deallocate_systems() @@ -518,7 +557,9 @@ end subroutine create !############################################################################### - subroutine update(this, basis_list, from_host, deallocate_systems) + subroutine update( & + this, basis_list, energy_above_hull_list, from_host, deallocate_systems & + ) !! update the distribution functions from the input file implicit none ! Arguments @@ -526,6 +567,8 @@ subroutine update(this, basis_list, from_host, deallocate_systems) !! Parent. Instance of distribution functions container. type(basis_type), dimension(:), intent(in) :: basis_list !! List of basis structures. + real(real12), dimension(:), intent(in), optional :: energy_above_hull_list + !! List of energies above the hull for the structures. logical, intent(in), optional :: from_host !! Optional. Boolean whether structures are derived from the host. logical, intent(in), optional :: deallocate_systems @@ -542,10 +585,48 @@ subroutine update(this, basis_list, from_host, deallocate_systems) character(256) :: stop_msg !! Error message. + + ! Check if energy_above_hull_list and basis_list are the same size + if(present(energy_above_hull_list))then + if(size(energy_above_hull_list).eq.0 .and. .not. this%weight_by_hull)then + exit + if(size(energy_above_hull_list) .ne. size(basis_list) .and. & + this%weight_by_hull & + )then + write(stop_msg,*) "energy_above_hull_list and basis_list " // & + "not the same size whilst using hull weighting" // & + achar(13) // achar(10) // & + "energy_above_hull_list: ", size(energy_above_hull_list), & + achar(13) // achar(10) // & + "basis_list: ", size(basis_list) + call stop_program( stop_msg ) + return + end if + end if + if(this%weight_by_hull.and..not.present(energy_above_hull_list))then + write(stop_msg,*) "energy_above_hull_list not present" // & + achar(13) // achar(10) // & + "energy_above_hull_list must be present when using hull weighting" + call stop_program( stop_msg ) + return + end if + + ! Check if from_host is present if(present(from_host))then from_host_ = from_host + if(this%weight_by_hull.and.from_host_)then + write(stop_msg,*) "Hull weighting and from_host are incompatible" // & + achar(13) // achar(10) // & + "Set from_host = .false. to use hull weighting" + call stop_program( stop_msg ) + return + end if else - from_host_ = .true. + if(this%weight_by_hull)then + from_host_ = .false. + else + from_host_ = .true. + end if end if ! Check if deallocate_systems is present @@ -555,6 +636,10 @@ subroutine update(this, basis_list, from_host, deallocate_systems) ! Add the new basis structures call this%add(basis_list) call this%update_bond_info() + if(present(energy_above_hull_list).and.this%weight_by_hull)then + this%system(this%num_evaluated_allocated + 1:)%energy_above_hull = & + energy_above_hull_list(:) + end if ! If the structures are derived from the host, subtract the interface energy if(from_host_)then @@ -1973,6 +2058,10 @@ subroutine evolve(this, system) num_evaluated = 0 do i = this%num_evaluated_allocated + 1, size(this%system), 1 num_evaluated = num_evaluated + 1 + if(this%weight_by_hull)then + weight = exp( this%system(i)%energy_above_hull / this%kbt ) + if(weight.lt.1.E-6) cycle + end if !------------------------------------------------------------------------ ! get the list of 2-body species pairs the system !------------------------------------------------------------------------ @@ -2012,16 +2101,21 @@ subroutine evolve(this, system) idx1 = findloc( [ this%element_info(:)%name ], & this%system(i)%element_symbols(is), dim=1) - weight = exp( & - ( & - this%best_energy_per_species(is) - & - energy * ( & - this%system(i)%weight_per_species(is) / & - real( sum( this%system(i)%num_per_species(:) ), real12 ) & - ) & - ) / this%kbt & - ) - if(weight.lt.1.E-6) cycle + if(.not.this%weight_by_hull)then + weight = exp( & + ( & + this%best_energy_per_species(is) - & + energy * ( & + this%system(i)%weight_per_species(is) / & + real( & + sum( this%system(i)%num_per_species(:) ), & + real12 & + ) & + ) & + ) / this%kbt & + ) + if(weight.lt.1.E-6) cycle + end if this%total%df_3body(:,idx1) = this%total%df_3body(:,idx1) + & set_difference( weight * this%system(i)%df_3body(:,is), & @@ -2042,16 +2136,21 @@ subroutine evolve(this, system) min( idx1, idx2 ) / 2._real12 ) * & ( min( idx1, idx2 ) - 1._real12 ) + max( idx1, idx2 ) ) - weight = exp( & - ( & - this%best_energy_pair(j) - & - energy * ( & - this%system(i)%weight_pair(idx_list(is,js)) / & - real( sum( this%system(i)%num_per_species(:) ), real12 ) & - ) & - ) / this%kbt & - ) - if(weight.lt.1.E-6) cycle + if(.not.this%weight_by_hull)then + weight = exp( & + ( & + this%best_energy_pair(j) - & + energy * ( & + this%system(i)%weight_pair(idx_list(is,js)) / & + real( & + sum( this%system(i)%num_per_species(:) ), & + real12 & + ) & + ) & + ) / this%kbt & + ) + if(weight.lt.1.E-6) cycle + end if this%total%df_2body(:,j) = this%total%df_2body(:,j) + & set_difference( & From f3b699185115f3ae93bf8dc92c87ec0bd682684a Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Fri, 27 Sep 2024 09:08:36 +0100 Subject: [PATCH 10/11] Add hull distance method --- src/raffle/raffle.py | 108 ++++++++++++++++++------- src/wrapper/f90wrap_mod_evolver.f90 | 117 ++++++++++++---------------- 2 files changed, 130 insertions(+), 95 deletions(-) diff --git a/src/raffle/raffle.py b/src/raffle/raffle.py index 8eaccc03..5ca9bd1a 100644 --- a/src/raffle/raffle.py +++ b/src/raffle/raffle.py @@ -1093,6 +1093,27 @@ def set_kbT(self, kbT): """ self.kbT = kbT + def set_weight_method(self, method): + """ + Parameters + ---------- + this : unknown + method : str + + """ + # method can be 'formation_energy' or 'energy_above_hull' + # allowed abbreviations for 'formation_energy': + # 'formation', 'form', 'e_form' + # allowed abbreviations for 'hull_distance': + # 'hull_distance', 'hull', 'distance', 'convex_hull' + + if method in ['formation_energy', 'formation', 'form', 'e_form']: + self.weight_by_hull = False + elif method in ['energy_above_hull', 'hull_distance', 'hull', 'distance', 'convex_hull']: + self.weight_by_hull = True + else: + raise ValueError("Invalid weight method: {}".format(method)) + def set_width(self, width): """ set_width__binding__gvector_container_type(self, width) @@ -1178,7 +1199,7 @@ def set_radius_distance_tol(self, radius_distance_tol): _raffle.f90wrap_evolver__set_radius_distance_tol__binding__gvector_1dda(this=self._handle, \ radius_distance_tol=radius_distance_tol) - def create(self, basis_list, deallocate_systems=True): + def create(self, basis_list, energy_above_hull_list=None, deallocate_systems=True): """ create__binding__gvector_container_type(self, basis_list) @@ -1189,6 +1210,7 @@ def create(self, basis_list, deallocate_systems=True): ---------- this : unknown basis_list : basis_array or Atoms or list of Atoms + energy_above_hull_list : list of float deallocate_systems : bool """ @@ -1200,9 +1222,12 @@ def create(self, basis_list, deallocate_systems=True): basis_list = rw_geom.basis_array(basis_list) _raffle.f90wrap_evolver__create__binding__gvector_container_type(this=self._handle, \ - basis_list=basis_list._handle, deallocate_systems=deallocate_systems) + basis_list=basis_list._handle, \ + energy_above_hull_list=energy_above_hull_list, \ + deallocate_systems=deallocate_systems \ + ) - def update(self, basis_list, from_host=True, deallocate_systems=True): + def update(self, basis_list, energy_above_hull_list=None, from_host=True, deallocate_systems=True): """ update__binding__gvector_container_type(self, basis_list) @@ -1213,6 +1238,8 @@ def update(self, basis_list, from_host=True, deallocate_systems=True): ---------- this : unknown basis_list : basis_array or list of Atoms + energy_above_hull_list : list of float + from_host : bool deallocate_systems : bool """ @@ -1226,6 +1253,7 @@ def update(self, basis_list, from_host=True, deallocate_systems=True): _raffle.f90wrap_evolver__update__binding__gvector_container_type(this=self._handle, \ basis_list=basis_list._handle, \ + energy_above_hull_list=energy_above_hull_list, \ from_host=from_host, \ deallocate_systems=deallocate_systems \ ) @@ -1672,37 +1700,40 @@ def num_evaluated_allocated(self, num_evaluated_allocated): _raffle.f90wrap_gvector_container_type__set__num_evaluated_allocated(self._handle, \ num_evaluated_allocated) - # @property - # def best_system(self): - # """ - # Element best_system ftype=integer pytype=int + @property + def num_evaluated(self): + """ + Element num_evaluated ftype=integer pytype=int - # Defined at ../src/lib/mod_evolver.f90 line 31 + Defined at /Users/nedtaylor/DCoding/DGit/raffle/src/fortran/lib/mod_evolver.f90 \ + line 82 - # """ - # return _raffle.f90wrap_gvector_container_type__get__best_system(self._handle) + """ + return _raffle.f90wrap_gvector_container_type__get__num_evaluated(self._handle) - # @best_system.setter - # def best_system(self, best_system): - # _raffle.f90wrap_gvector_container_type__set__best_system(self._handle, \ - # best_system) + @num_evaluated.setter + def num_evaluated(self, num_evaluated): + _raffle.f90wrap_gvector_container_type__set__num_evaluated(self._handle, \ + num_evaluated) - # @property - # def best_energy(self): - # """ - # Element best_energy ftype=real(real12) pytype=float + @property + def num_evaluated_allocated(self): + """ + Element num_evaluated_allocated ftype=integer pytype=int - # Defined at ../src/lib/mod_evolver.f90 line 32 + Defined at /Users/nedtaylor/DCoding/DGit/raffle/src/fortran/lib/mod_evolver.f90 \ + line 84 - # """ - # return _raffle.f90wrap_gvector_container_type__get__best_energy(self._handle) + """ + return \ + _raffle.f90wrap_gvector_container_type__get__num_evaluated_allocated(self._handle) - # @best_energy.setter - # def best_energy(self, best_energy): - # _raffle.f90wrap_gvector_container_type__set__best_energy(self._handle, \ - # best_energy) + @num_evaluated_allocated.setter + def num_evaluated_allocated(self, num_evaluated_allocated): + _raffle.f90wrap_gvector_container_type__set__num_evaluated_allocated(self._handle, \ + num_evaluated_allocated) @property def kbT(self): @@ -1720,6 +1751,23 @@ def kbT(self): def kbT(self, kbT): _raffle.f90wrap_gvector_container_type__set__kbt(self._handle, kbT) + @property + def weight_by_hull(self): + """ + Element weight_by_hull ftype=logical pytype=bool + + + Defined at /Users/nedtaylor/DCoding/DGit/raffle/src/fortran/lib/mod_evolver.f90 \ + line 88 + + """ + return _raffle.f90wrap_gvector_container_type__get__weight_by_hull(self._handle) + + @weight_by_hull.setter + def weight_by_hull(self, weight_by_hull): + _raffle.f90wrap_gvector_container_type__set__weight_by_hull(self._handle, \ + weight_by_hull) + @property def nbins(self): """ @@ -1904,12 +1952,14 @@ def _init_array_system(self): def __str__(self): ret = ['{\n'] - # ret.append(' best_system : ') - # ret.append(repr(self.best_system)) - # ret.append(',\n best_energy : ') - # ret.append(repr(self.best_energy)) + ret.append(' num_evaluated : ') + ret.append(repr(self.num_evaluated)) + ret.append(',\n num_evaluated_allocated : ') + ret.append(repr(self.num_evaluated_allocated)) ret.append(',\n kbT : ') ret.append(repr(self.kbT)) + ret.append(',\n weight_by_hull : ') + ret.append(repr(self.weight_by_hull)) ret.append(',\n nbins : ') ret.append(repr(self.nbins)) ret.append(',\n sigma : ') diff --git a/src/wrapper/f90wrap_mod_evolver.f90 b/src/wrapper/f90wrap_mod_evolver.f90 index 3a2c989b..e41d09e5 100644 --- a/src/wrapper/f90wrap_mod_evolver.f90 +++ b/src/wrapper/f90wrap_mod_evolver.f90 @@ -318,62 +318,6 @@ subroutine f90wrap_gvector_container_type__set__num_evaluated_allocated(this, f9 this_ptr%p%num_evaluated_allocated = f90wrap_num_evaluated_allocated end subroutine f90wrap_gvector_container_type__set__num_evaluated_allocated -! subroutine f90wrap_gvector_container_type__get__best_system(this, f90wrap_best_system) -! use evolver, only: gvector_container_type -! implicit none -! type gvector_container_type_ptr_type -! type(gvector_container_type), pointer :: p => NULL() -! end type gvector_container_type_ptr_type -! integer, intent(in) :: this(2) -! type(gvector_container_type_ptr_type) :: this_ptr -! integer, intent(out) :: f90wrap_best_system - -! this_ptr = transfer(this, this_ptr) -! f90wrap_best_system = this_ptr%p%best_system -! end subroutine f90wrap_gvector_container_type__get__best_system - -! subroutine f90wrap_gvector_container_type__set__best_system(this, f90wrap_best_system) -! use evolver, only: gvector_container_type -! implicit none -! type gvector_container_type_ptr_type -! type(gvector_container_type), pointer :: p => NULL() -! end type gvector_container_type_ptr_type -! integer, intent(in) :: this(2) -! type(gvector_container_type_ptr_type) :: this_ptr -! integer, intent(in) :: f90wrap_best_system - -! this_ptr = transfer(this, this_ptr) -! this_ptr%p%best_system = f90wrap_best_system -! end subroutine f90wrap_gvector_container_type__set__best_system - -! subroutine f90wrap_gvector_container_type__get__best_energy(this, f90wrap_best_energy) -! use evolver, only: gvector_container_type -! implicit none -! type gvector_container_type_ptr_type -! type(gvector_container_type), pointer :: p => NULL() -! end type gvector_container_type_ptr_type -! integer, intent(in) :: this(2) -! type(gvector_container_type_ptr_type) :: this_ptr -! real(4), intent(out) :: f90wrap_best_energy - -! this_ptr = transfer(this, this_ptr) -! f90wrap_best_energy = this_ptr%p%best_energy -! end subroutine f90wrap_gvector_container_type__get__best_energy - -! subroutine f90wrap_gvector_container_type__set__best_energy(this, f90wrap_best_energy) -! use evolver, only: gvector_container_type -! implicit none -! type gvector_container_type_ptr_type -! type(gvector_container_type), pointer :: p => NULL() -! end type gvector_container_type_ptr_type -! integer, intent(in) :: this(2) -! type(gvector_container_type_ptr_type) :: this_ptr -! real(4), intent(in) :: f90wrap_best_energy - -! this_ptr = transfer(this, this_ptr) -! this_ptr%p%best_energy = f90wrap_best_energy -! end subroutine f90wrap_gvector_container_type__set__best_energy - subroutine f90wrap_gvector_container_type__get__kbt(this, f90wrap_kbt) use evolver, only: gvector_container_type implicit none @@ -402,6 +346,34 @@ subroutine f90wrap_gvector_container_type__set__kbt(this, f90wrap_kbt) this_ptr%p%kbt = f90wrap_kbt end subroutine f90wrap_gvector_container_type__set__kbt +subroutine f90wrap_gvector_container_type__get__weight_by_hull(this, f90wrap_weight_by_hull) + use evolver, only: gvector_container_type + implicit none + type gvector_container_type_ptr_type + type(gvector_container_type), pointer :: p => NULL() + end type gvector_container_type_ptr_type + integer, intent(in) :: this(2) + type(gvector_container_type_ptr_type) :: this_ptr + logical, intent(out) :: f90wrap_weight_by_hull + + this_ptr = transfer(this, this_ptr) + f90wrap_weight_by_hull = this_ptr%p%weight_by_hull +end subroutine f90wrap_gvector_container_type__get__weight_by_hull + +subroutine f90wrap_gvector_container_type__set__weight_by_hull(this, f90wrap_weight_by_hull) + use evolver, only: gvector_container_type + implicit none + type gvector_container_type_ptr_type + type(gvector_container_type), pointer :: p => NULL() + end type gvector_container_type_ptr_type + integer, intent(in) :: this(2) + type(gvector_container_type_ptr_type) :: this_ptr + logical, intent(in) :: f90wrap_weight_by_hull + + this_ptr = transfer(this, this_ptr) + this_ptr%p%weight_by_hull = f90wrap_weight_by_hull +end subroutine f90wrap_gvector_container_type__set__weight_by_hull + subroutine f90wrap_gvector_container_type__array__nbins(this, nd, dtype, dshape, dloc) use evolver, only: gvector_container_type use, intrinsic :: iso_c_binding, only : c_int @@ -724,7 +696,9 @@ subroutine f90wrap_evolver__set_radius_distance_tol__binding__gvector_1dda(this, call this_ptr%p%set_radius_distance_tol(radius_distance_tol=radius_distance_tol) end subroutine f90wrap_evolver__set_radius_distance_tol__binding__gvector_1dda -subroutine f90wrap_evolver__create__binding__gvector_container_type(this, basis_list, deallocate_systems) +subroutine f90wrap_evolver__create__binding__gvector_container_type( & + this, basis_list, deallocate_systems, energy_above_hull_list, n0 & +) use rw_geom, only: basis_type use evolver, only: gvector_container_type implicit none @@ -745,17 +719,23 @@ subroutine f90wrap_evolver__create__binding__gvector_container_type(this, basis_ type(basis_type_xnum_array_ptr_type) :: basis_list_ptr integer, intent(in), dimension(2) :: basis_list logical, intent(in), optional :: deallocate_systems + real(4), dimension(n0), intent(in), optional :: energy_above_hull_list + integer :: n0 + !f2py intent(hide), depend(energy_above_hull_list) :: n0 = shape(energy_above_hull_list,0) this_ptr = transfer(this, this_ptr) basis_list_ptr = transfer(basis_list, basis_list_ptr) - if(present(deallocate_systems)) then - call this_ptr%p%create(basis_list=basis_list_ptr%p%items, deallocate_systems=deallocate_systems) - else - call this_ptr%p%create(basis_list=basis_list_ptr%p%items) - end if + call this_ptr%p%create( & + basis_list=basis_list_ptr%p%items, & + energy_above_hull_list=energy_above_hull_list, & + deallocate_systems=deallocate_systems & + ) end subroutine f90wrap_evolver__create__binding__gvector_container_type -subroutine f90wrap_evolver__update__binding__gvector_container_type(this, basis_list, from_host, deallocate_systems) +subroutine f90wrap_evolver__update__binding__gvector_container_type( & + this, basis_list, & + from_host, deallocate_systems, energy_above_hull_list, n0 & +) use rw_geom, only: basis_type use evolver, only: gvector_container_type implicit none @@ -775,14 +755,19 @@ subroutine f90wrap_evolver__update__binding__gvector_container_type(this, basis_ integer, intent(in), dimension(2) :: this type(basis_type_xnum_array_ptr_type) :: basis_list_ptr integer, intent(in), dimension(2) :: basis_list - logical, intent(in) :: from_host - logical, intent(in) :: deallocate_systems + logical, intent(in), optional :: from_host + logical, intent(in), optional :: deallocate_systems + real(4), dimension(n0), intent(in), optional :: energy_above_hull_list + integer :: n0 + !f2py intent(hide), depend(energy_above_hull_list) :: n0 = shape(energy_above_hull_list,0) this_ptr = transfer(this, this_ptr) basis_list_ptr = transfer(basis_list, basis_list_ptr) call this_ptr%p%update(basis_list=basis_list_ptr%p%items, & + energy_above_hull_list=energy_above_hull_list, & from_host=from_host, & - deallocate_systems=deallocate_systems) + deallocate_systems=deallocate_systems & + ) end subroutine f90wrap_evolver__update__binding__gvector_container_type subroutine f90wrap_evolver__deallocate_systems__binding__gvector_conta8f02(this) From ed7b1a9e3436601ae97a53cde9aeffc94d6c9017 Mon Sep 17 00:00:00 2001 From: Ned Taylor Date: Fri, 27 Sep 2024 09:08:46 +0100 Subject: [PATCH 11/11] Fix if statement --- src/fortran/lib/mod_evolver.f90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fortran/lib/mod_evolver.f90 b/src/fortran/lib/mod_evolver.f90 index a5cbd426..4f891ed2 100644 --- a/src/fortran/lib/mod_evolver.f90 +++ b/src/fortran/lib/mod_evolver.f90 @@ -589,8 +589,7 @@ subroutine update( & ! Check if energy_above_hull_list and basis_list are the same size if(present(energy_above_hull_list))then if(size(energy_above_hull_list).eq.0 .and. .not. this%weight_by_hull)then - exit - if(size(energy_above_hull_list) .ne. size(basis_list) .and. & + elseif(size(energy_above_hull_list) .ne. size(basis_list) .and. & this%weight_by_hull & )then write(stop_msg,*) "energy_above_hull_list and basis_list " // &