Reference
PotentialCalculation.Calculators.Calculator — Typemutable struct CalculatorStruct used to hold together different bits of information needed in calculations.
Fields
method: calculation method informatonbasis: basis informationcalculator: calculation program information
Examples
julia> Calculator("method", "basis", Orca())
Calculator{Orca}("method", "basis", Orca("orca", 0x0000000000000001, 0x00000000000003e8, "/tmp/tmpVg959k"))PotentialCalculation.Calculators.Orca — Typemutable struct Orca <: AbstractCalculationProgramHolds 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 =1maxmem:.Uint: maximum memory per core for orca in mega bytes - default =1000tmp_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/")PotentialCalculation.Calculators.bsse_corrected_energy — Methodbsse_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 informationc1: collection of clustersc2: collection of clusters
Keywords
basename="base": base name for input/ouput filesid="": additional information for calculator - needed for multiprocessing in same folderpchannel=undef: (Remote)Channel where progess information is added
PotentialCalculation.Calculators.bsse_corrected_energy — Methodbsse_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 informationc1::Cluster: clusterc2::Cluster: cluster
Keywords
basename="base": base name for input/ouput filesid="": additional information for calculator - needed for multiprocessing in same folderpchannel=undef: (Remote)Channel where progess information is added
PotentialCalculation.Calculators.calculate_energy — Methodcalculate_energy(cal::Calculator, points; basename="base", ghost=undef, id="", pchannel=pchannel)Calculates energy for given clusters.
Arguments
cal::Calculator: calculation informationpoints: collection ofClusterwhich energy is calculated
Keywords
basename="base": base name for input/ouput filesghost=undef: indices for atoms considered as ghostid="": additional information for calculator - needed for multiprocessing in same folderpchannel=undef: (Remote)Channel where progess information is added
PotentialCalculation.Calculators.calculate_energy — Methodcalculate_energy(cal::Calculator, point::Cluster; basename="base", ghost=undef, id="", pchannel=pchannel)Calculates energy for given cluster.
Arguments
cal::Calculator: calculation informationpoint::Cluster: cluster which energy is calculated
Keywords
basename="base": base name for input/ouput filesghost=undef: indices for atoms considered as ghostid="": additional information for calculator - needed for multiprocessing in same folderpchannel=undef: (Remote)Channel where progess information is added
PotentialCalculation.Calculators.clean_calculation_files — Methodclean_calculation_files(;dir=".", basename="base")Deletes files that calculations produced
Arguments
dir=".": directory to be cleanedbasename="base": base name used in calculations
PotentialCalculation.Calculators.getBSSEsteps — MethodgetBSSEsteps(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.
PotentialCalculation.Calculators.read_energy — Methodread_energy(fname)Read ORCA output for final energy. Throws an error if calculation failed.
PotentialCalculation.Calculators.write_input — Methodwrite_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 donecal::Calculator: calculation informationc::AbstractClusterWithSymbols: molecule cluster that is calculatedghost=undef: collection for atom idexes that are considered ghost atoms
PotentialCalculation.Calculators.print_orca_xyz — Methodprintorcaxyz(io::IO, c::AbstractClusterWithSymbols; ghost=undef)
Prints ORCA input style xyz input. Idexes in ghost are marked as ghost atoms.
PotentialCalculation.Restarttools — Modulemodule Restarttools
Primary tools to do calculations. Also contains all methods to restart calculations.
PotentialCalculation.Restarttools.calculate_energy_for_xyzfile — Methodcalculate_energy_for_xyzfile(fname, cal; pbar=true)Reads xyz-file and calculates energy of each point on it
PotentialCalculation.Restarttools.calculate_potential — Methodcalculate_adaptive_sample_inputs(inputs; save_after="", save_after=nworkers(), pbar=true)Uses adaptive_line_sampler to inputs in distributed fashion
Arguments
inputs: calculation inputs array (eg. fromcreate_inputs)save_after: file where data savedsave_after=nworkers(): number of calculated items before data is savedpbar=true: show progress bar
PotentialCalculation.Restarttools.calculate_potential — Methodcalculate_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 readcalculatror::Calculator: calculator used for calculations
Keywords
save_file="": save final results here, if not emptyrestart_file="": save restarts here, if not emptypbar=true: show progress barsave_after=nworkers(): make restart file when given ammount of points is calculated
PotentialCalculation.Restarttools.continue_calculation — Methodcontinuecalculation(fname, calculator::Calculator; savefile="", restartfile="", saveafter=nworkers(), pbar=true)
Restarts calculation from given file
Arguments
fname: file from which calculation is restartedcalculator::Calculator: calculator used in calculationssave_file: file where final results are saved, if givenrestart_file: file where new restart information is saved, if givensave_after=nworkers(): make restart file when given ammount of points is calculatedpbar=true: show progress bar
PotentialCalculation.Restarttools.create_inputs — MethodAbstractClusterthing that can be interpreted as Cluster or an Array of it
cluster2: something that can be interpreted asClusteror an Array of itcalculator::Calculator:Calculatorused 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
PotentialCalculation.Restarttools.load_clusters_and_make_input — Methodloadclustersandmakeinput(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: cluster1cluster2::Cluster: cluster2nlines: number of lines to be sampled in calculationmax_e: Point that is closest and has less energy than this will be starting point for a linenpoints: Number of points in potentialmaxdis: Maximum distance in potential calculationsstep: Search step size for adaptive searchstartdistance: Distance from which adaptive seach is started
PotentialCalculation.Restarttools.load_clusters_and_make_input — Methodloadclustersandmakeinput(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 sampledcluster2::Cluster: cluster2max_e: Point that is closest and has less energy than this will be starting point for a lineunit: Unit in whichmax_eis givennpoints: Number of points in potentialmaxdis: Maximum distance in potential calculationsstep: Search step size for adaptive searchstartdistance: Distance from which adaptive seach is started
PotentialCalculation.Restarttools.load_clusters_and_sample_input — Methodloadclustersandsampleinput(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 sampledcluster2: cluster2nsamples: number of samples taken fromfname_cluster1max_e: Point that is closest and has less energy than this will be starting point for a linenpoints: Number of points in potentialmaxdis: Maximum distance in potential calculationsstep: Search step size for adaptive searchstartdistance: Distance from which adaptive seach is started
PotentialCalculation.Restarttools.load_clusters_and_sample_input — Methodfunction 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 sampledcluster2: file from where cluster2 is samplednsamples: number of samples taken fromfname_cluster1nlines: number of lines to be sampled in calculationmax_e: Point that is closest and has less energy than this will be starting point for a lineunit: Unit in whichmax_eis givennpoints: Number of points in potentialmaxdis: Maximum distance in potential calculationsstep: Search step size for adaptive searchstartdistance: Distance from which adaptive seach is started
PotentialCalculation.Restarttools.load_data_file — Methodload_data_file(fname)Loads saved data
PotentialCalculation.Restarttools.load_restart_file — Methodload_restart_file(fname)Loads restart information from file fname and adds to it key not_calculated, which holds information of which collumns of Points have not been calculated.
PotentialCalculation.Restarttools.write_restart_file — Methodwrite_restart_file(fname, calculator, points, restart_energy, cluster1, cluster2)Saves restart information for energy calculation.
Arguments
fname: name of restartfilecalculator::Calculator: calculator used in calculationspoints: 2d array of point where to calculate energyenergy: energy for points that have been caculetedcluster1: cluster1cluster2: cluster2
PotentialCalculation.Restarttools.write_save_file — Methodwrite_save_file(fname, calculator, points, energy, cluster1, cluster2)Saves final information for energy calculation.
Arguments
fname: name of restartfileusing PotentialCalculationcalculator::Calculator: calculator used in calculationspoints: 2d array of point where to calculate energyenergy: energy for points that have been caculetedcluster1: cluster1cluster2: cluster2
PotentialCalculation.Restarttools._calculate_points — Method_calculate_points(cal, c1_points, c2_points; pchannel=undef)Internal helper function to ease use of distributed calculations. Users should call "calculate_points" instead.
PotentialCalculation.Restarttools._sample_and_calculate — Method_sample_and_calculate(inputs; pchannel=undef )Internal helper function to help implement distributed calculations
PotentialCalculation.Clusters.Cluster — TypeCluster{T} <: AbstractClusterWithSymbols{T} where T<:AbstractAtomStructure to hold location data of clusters/molecules
Fields
xyz::Array{Float64,2}: location of atoms in 3d space, first index is x, y, z coordinateatoms::Vector{T}: atom type information
PotentialCalculation.Clusters.center_cluster! — Methodcenter_cluster!(c::AbstractCluster)Centers cluster to origin of coordinates
PotentialCalculation.Clusters.center_coordinates — Methodcenter_coordinates(c::AbstractCluster)Gives coordinates to aricmetric mean of clusters atoms
PotentialCalculation.Clusters.cluster_angle — Methodcluster_angle(c1::AbstractCluster, i, j, c2::AbstractCluster, k)
Calculates angle (radians) between atons in different clusters
Arguments
c1::AbstractCluster: first clusteri: index inc1j: index inc1c2::AbstractCluster: second clusterk: index inc2
PotentialCalculation.Clusters.cluster_angle — Methodcluster_angle(c::AbstractCluster, i, j, k)
Calculates angle (radians) between atoms i,j,k in cluster
PotentialCalculation.Clusters.dihedral_angle — Methodclusterdihedralangle(c::AbstractCluster, i, j, k, m)
PotentialCalculation.Clusters.distances — Methoddistances(c1::AbstractCluster, c2::AbstractCluster)Return distances between atoms of given clusters
PotentialCalculation.Clusters.distances — Methoddistances(c1::AbstractCluster, ur1::AbstractUnitRange,
c2::AbstractCluster, ur2::AbstractUnitRange)Return distance between atoms ur1 in c1 and atoms ur2 in c2
PotentialCalculation.Clusters.distances — Methoddistances(c::AbstractCluster, ar1::AbstractRange, ar2::AbstractRange)Returns distances between atoms in given unit ranges
PotentialCalculation.Clusters.distances — Methoddistances(c1::AbstractCluster, i, c2::AbstractCluster, j)Return distance between atom i in c1 and atom j in c2
PotentialCalculation.Clusters.distances — Methoddistances(c::AbstractCluster, i, j)Returns distance of atoms i and j
PotentialCalculation.Clusters.move! — Methodmove!(c::AbstractCluster,r)Moves cluster by r
PotentialCalculation.Clusters.print_xyz — Functionprint_xyz(io::IO, c, note=""; printheader=true)Prints cluster in xyz file format
Arguments
io::IO: stream where writing is donec:AtomsBasecompatable structurenote="": message writen on note lineprintheader=true: wheather or not header is writen (number of atoms and note)
PotentialCalculation.Clusters.rotate_randomly! — Methodrotate_randomly!(c::AbstractCluster)Rotate cluster by random angle and axis
PotentialCalculation.Clusters.rotate_x! — Methodrotate_x!(c::AbstractCluster, θ)Rotates cluster around x-axis by angle θ
PotentialCalculation.Clusters.rotate_y! — Methodrotate_y!(c::AbstractCluster, θ)Rotates cluster around y-axis by angle θ
PotentialCalculation.Clusters.rotate_z! — Methodrotate_z!(c::AbstractCluster, θ)Rotates cluster around z-axis by angle θ
PotentialCalculation.Molecules — Modulemodule MoleculesHolds information of molecules.
Main reason form this module is to implement identical atom information when fitting potential
PotentialCalculation.Molecules.Molecule — TypeMolecule{T<:AbstractAtom} <: AbstractMoleculeMolecule representation
Field
atoms::Vector{T}: Contains information of atoms
PotentialCalculation.Molecules.MoleculeIdenticalInformation — TypeMolecule{T<:AbstractAtom} <: AbstractMoleculeMolecule representation with information of identical atoms
Field
atoms::Vector{T}: Contains information of atomsidentical::Identical: identical atom information
PotentialCalculation.Molecules.makeidentical! — Methodmakeidentical!(Mol::MoleculeIdenticalInformation,x)Adds information for identical atoms to molecule.
Arguments
Mol::MoleculeIdenticalInformation: moleculet to which identical information is addedx: collection of indices of identical atoms
Throws
Error if x is out of bounds of Mol
PotentialCalculation.IdenticalTools.areidentical — Methodareidentical(mol::MoleculeIdenticalInformation,x)Checks if atoms with indices given in collection x are identical
PotentialCalculation.Atoms.AtomOnlySymbol — TypeAtomOnlySymbol <: AbstractAtomAtom that only has symbol
Fields
id::String: hold description of atom
PotentialCalculation.Atoms.AtomWithMass — TypeAtomWithMass <: AbstractAtomWithMassAtom that has symbol and mass
Fields
id::String: hold description of atommass::Float64: mass of atom