Reference

PotentialCalculation.Calculators.CalculatorType
mutable struct Calculator

Struct used to hold together different bits of information needed in calculations.

Fields

  • method : calculation method informaton
  • basis : basis information
  • calculator : calculation program information

Examples

julia> Calculator("method", "basis", Orca())
Calculator{Orca}("method", "basis", Orca("orca", 0x0000000000000001, 0x00000000000003e8, "/tmp/tmpVg959k"))
source
PotentialCalculation.Calculators.OrcaType
mutable struct Orca <: AbstractCalculationProgram

Holds information of how to use ORCA program.

Note that if you are using more than 1 core you need to specify exact path to orca executable.

Fields

  • executable : path to "orca" executable - default = "orca"
  • ncore::Uint : number of cores used by orca - default = 1
  • maxmem:.Uint : maximum memory per core for orca in mega bytes - default = 1000
  • tmp_dir : directory where calculations are done - default = mktempdir()

Examples

julia> Orca()
Orca("orca", 0x0000000000000001, 0x00000000000003e8, "/tmp/jl_k4hnkY")

julia> Orca(executable="/opt/Orca/bin/orca", maxmem=4000, tmp_dir="/tmp/calculations/")
Orca("/opt/Orca/bin/orca", 0x0000000000000001, 0x0000000000000fa0, "/tmp/calculations/")
source
PotentialCalculation.Calculators.bsse_corrected_energyMethod
bsse_corrected_energy(cal::Calculator, c1, c2; basename="base", id="", pchannel=pchannel)

Calculates energy of combined clusters taking into account basis set superposition error

Arguments

  • cal::Calculator : calcualation information
  • c1 : collection of clusters
  • c2 : collection of clusters

Keywords

  • basename="base" : base name for input/ouput files
  • id="" : additional information for calculator - needed for multiprocessing in same folder
  • pchannel=undef : (Remote)Channel where progess information is added
source
PotentialCalculation.Calculators.bsse_corrected_energyMethod
bsse_corrected_energy(cal::Calculator, c1::Cluster, c2::Cluster; basename="base", id="", pchannel=pchannel)

Calculates energy of combined cluster taking into account basis set superposition error

Arguments

  • cal::Calculator : calcualation information
  • c1::Cluster : cluster
  • c2::Cluster : cluster

Keywords

  • basename="base" : base name for input/ouput files
  • id="" : additional information for calculator - needed for multiprocessing in same folder
  • pchannel=undef : (Remote)Channel where progess information is added
source
PotentialCalculation.Calculators.calculate_energyMethod
calculate_energy(cal::Calculator, points; basename="base", ghost=undef, id="", pchannel=pchannel)

Calculates energy for given clusters.

Arguments

  • cal::Calculator : calculation information
  • points : collection of Cluster which energy is calculated

Keywords

  • basename="base" : base name for input/ouput files
  • ghost=undef : indices for atoms considered as ghost
  • id="" : additional information for calculator - needed for multiprocessing in same folder
  • pchannel=undef : (Remote)Channel where progess information is added
source
PotentialCalculation.Calculators.calculate_energyMethod
calculate_energy(cal::Calculator, point::Cluster; basename="base", ghost=undef, id="", pchannel=pchannel)

Calculates energy for given cluster.

Arguments

  • cal::Calculator : calculation information
  • point::Cluster : cluster which energy is calculated

Keywords

  • basename="base" : base name for input/ouput files
  • ghost=undef : indices for atoms considered as ghost
  • id="" : additional information for calculator - needed for multiprocessing in same folder
  • pchannel=undef : (Remote)Channel where progess information is added
source
PotentialCalculation.Calculators.getBSSEstepsMethod
getBSSEsteps(cal::AbstractCalculationProgram)

Used to set up progressbar. Returns 1, if calculator program has a method to calculate counter poise correction with a single command and 3, if program needs to be called multiple times to make counter poise correction.

source
PotentialCalculation.Calculators.write_inputMethod
write_input(io::IO, cal::Calculator,
                 c::AbstractClusterWithSymbols; ghost=undef)

Writes input files for calculation program. Only ORCA input is supported now.

Arguments

  • io::IO : stream where writing is done
  • cal::Calculator : calculation information
  • c::AbstractClusterWithSymbols : molecule cluster that is calculated
  • ghost=undef : collection for atom idexes that are considered ghost atoms
source
PotentialCalculation.Restarttools.calculate_potentialMethod
calculate_potential(fname::AbstractString, calculator::Calculator;
                    save_file="", restart_file="", pbar=true, save_after=nworkers()
                   )

With this function you can use already chosen points on to which to do energy calculation.

Arguments

  • fname : name of save/restart file where points are read
  • calculatror::Calculator : calculator used for calculations

Keywords

  • save_file="" : save final results here, if not empty
  • restart_file="" : save restarts here, if not empty
  • pbar=true : show progress bar
  • save_after=nworkers() : make restart file when given ammount of points is calculated
source
PotentialCalculation.Restarttools.continue_calculationMethod

continuecalculation(fname, calculator::Calculator; savefile="", restartfile="", saveafter=nworkers(), pbar=true)

Restarts calculation from given file

Arguments

  • fname : file from which calculation is restarted
  • calculator::Calculator : calculator used in calculations
  • save_file : file where final results are saved, if given
  • restart_file : file where new restart information is saved, if given
  • save_after=nworkers() : make restart file when given ammount of points is calculated
  • pbar=true : show progress bar
source
PotentialCalculation.Restarttools.create_inputsMethod

AbstractClusterthing that can be interpreted as Cluster or an Array of it

  • cluster2 : something that can be interpreted as Cluster or an Array of it
  • calculator::Calculator : Calculator used in sampling

Keywords

  • max_e=15000 : energy treshold in sampling. Enegy is lower than this value.
  • maxdis=9.0 : maximun distance in calculation
  • nline=1 : number of lines sampled for given structure pair
  • npoints=10 : number of points in each sampled line
  • nsamples=2 : number of points picked randomly from trajectories for line sampling
  • sstep=0.1 : step size used in sampling
  • startdistance= 3.5 : starting distance in sampling
  • unit="cm-1" : unit for max_e
source
PotentialCalculation.Restarttools.load_clusters_and_make_inputMethod

loadclustersandmakeinput(cluster1::Cluster, cluster2::Cluster, calculator; nlines=1, max_e=0, unit="cm-1", npoints=10, maxdis=9.0, sstep=0.1, startdistance=2.5)

Loads cluster1 from xyz-file and returns them all as an Array that can then be used with calculate_adaptive_sample_inputs to calculate energy data. Differs from load_clusters_and_sample_input by taking every point from file

Arguments

  • cluster1::Cluster : cluster1
  • cluster2::Cluster : cluster2
  • nlines : number of lines to be sampled in calculation
  • max_e : Point that is closest and has less energy than this will be starting point for a line
  • npoints : Number of points in potential
  • maxdis : Maximum distance in potential calculation
  • sstep : Search step size for adaptive search
  • startdistance : Distance from which adaptive seach is started
source
PotentialCalculation.Restarttools.load_clusters_and_make_inputMethod

loadclustersandmakeinput(cluster1::String, cluster2::Cluster, calculator, nsamples; max_e=0, unit="cm-1", npoints=10, maxdis=9.0, sstep=0.1, startdistance=2.5)

Loads cluster1 from xyz-file and returns them all as an Array that can then be used with calculate_adaptive_sample_inputs to calculate energy data. Differs from load_clusters_and_sample_input by taking every point from file

Arguments

  • cluster1::String : file from where cluster1 is sampled
  • cluster2::Cluster : cluster2
  • max_e : Point that is closest and has less energy than this will be starting point for a line
  • unit : Unit in which max_e is given
  • npoints : Number of points in potential
  • maxdis : Maximum distance in potential calculation
  • sstep : Search step size for adaptive search
  • startdistance : Distance from which adaptive seach is started
source
PotentialCalculation.Restarttools.load_clusters_and_sample_inputMethod

loadclustersandsampleinput(fnamecluster1, cluster2, calculator, nsamples; maxe=0, npoints=10, maxdis=9.0, sstep=0.1, startdistance=2.5)

Loads cluster1 from xyz-file and takes nsamples samples of it and returns them as an Array that can then be used with calculate_adaptive_sample_inputs to calculate energy data

Arguments

  • cluster1 : file from where cluster1 is sampled
  • cluster2 : cluster2
  • nsamples : number of samples taken from fname_cluster1
  • max_e : Point that is closest and has less energy than this will be starting point for a line
  • npoints : Number of points in potential
  • maxdis : Maximum distance in potential calculation
  • sstep : Search step size for adaptive search
  • startdistance : Distance from which adaptive seach is started
source
PotentialCalculation.Restarttools.load_clusters_and_sample_inputMethod

function loadclustersandsampleinput(cluster1::String, cluster2::String, calculator, nsamples; nlines=1, max_e=0, unit="cm-1", npoints=10, maxdis=9.0, sstep=0.1, startdistance=2.5)

Arguments

  • cluster1 : file from where cluster1 is sampled
  • cluster2 : file from where cluster2 is sampled
  • nsamples : number of samples taken from fname_cluster1
  • nlines : number of lines to be sampled in calculation
  • max_e : Point that is closest and has less energy than this will be starting point for a line
  • unit : Unit in which max_e is given
  • npoints : Number of points in potential
  • maxdis : Maximum distance in potential calculation
  • sstep : Search step size for adaptive search
  • startdistance : Distance from which adaptive seach is started
source
PotentialCalculation.Restarttools.write_restart_fileMethod
write_restart_file(fname, calculator, points, restart_energy, cluster1, cluster2)

Saves restart information for energy calculation.

Arguments

  • fname : name of restartfile
  • calculator::Calculator : calculator used in calculations
  • points : 2d array of point where to calculate energy
  • energy : energy for points that have been caculeted
  • cluster1 : cluster1
  • cluster2 : cluster2
source
PotentialCalculation.Restarttools.write_save_fileMethod
write_save_file(fname, calculator, points, energy, cluster1, cluster2)

Saves final information for energy calculation.

Arguments

  • fname : name of restartfileusing PotentialCalculation
  • calculator::Calculator : calculator used in calculations
  • points : 2d array of point where to calculate energy
  • energy : energy for points that have been caculeted
  • cluster1 : cluster1
  • cluster2 : cluster2
source
PotentialCalculation.Clusters.ClusterType
Cluster{T} <: AbstractClusterWithSymbols{T} where T<:AbstractAtom

Structure to hold location data of clusters/molecules

Fields

  • xyz::Array{Float64,2} : location of atoms in 3d space, first index is x, y, z coordinate
  • atoms::Vector{T} : atom type information
source
PotentialCalculation.Clusters.cluster_angleMethod

cluster_angle(c1::AbstractCluster, i, j, c2::AbstractCluster, k)

Calculates angle (radians) between atons in different clusters

Arguments

  • c1::AbstractCluster : first cluster
  • i : index in c1
  • j : index in c1
  • c2::AbstractCluster : second cluster
  • k : index in c2
source
PotentialCalculation.Clusters.print_xyzFunction
print_xyz(io::IO, c, note=""; printheader=true)

Prints cluster in xyz file format

Arguments

  • io::IO : stream where writing is done
  • c : AtomsBase compatable structure
  • note="" : message writen on note line
  • printheader=true : wheather or not header is writen (number of atoms and note)
source
PotentialCalculation.MoleculesModule
module Molecules

Holds information of molecules.

Main reason form this module is to implement identical atom information when fitting potential

source
PotentialCalculation.Molecules.makeidentical!Method
makeidentical!(Mol::MoleculeIdenticalInformation,x)

Adds information for identical atoms to molecule.

Arguments

  • Mol::MoleculeIdenticalInformation : moleculet to which identical information is added
  • x : collection of indices of identical atoms

Throws

Error if x is out of bounds of Mol

source