Help entries
In the Julia REPL type ? name:
FundamentosDMC.Options — Type
Structure containing the options and parameters of the simulation.
Examples
julia> opt = Options()
julia> opt = Options(nsteps=2000)
FundamentosDMC.Point2D — Type
Structure that contains a two-dimensional point, subtype of FieldVector from StaticArrays.
FundamentosDMC.Point3D — Type
Structure that contains a three-dimensional point, subtype of FieldVector from StaticArrays.
FundamentosDMC.System — Type
Structure containing the system initial coordinates and box sides.
Example
julia> sys = System(n=100,sides=[100,100])FundamentosDMC.dim — Method
dim(T::DataType)Returns the dimension associated to a Point2D (2) or Point3D (3).
FundamentosDMC.forces! — Method
forces!(x::Vector{T},f::Vector{T},opt::Options) where TSubroutine that computes the force. It modifies the input f vector.
FundamentosDMC.image — Method
image(x,sides)Move coordinates to minimum periodic image.
FundamentosDMC.init_velocities — Method
init_velocities(sys::System{T},opt::Options) where TInitialize velocities with random distribution.
FundamentosDMC.kinetic — Method
kinetic(v)Function that computes the kinetic energy given a velocity vector v.
FundamentosDMC.mc — Method
mc(sys::System{T},opt=Options=Options()) where TPeforms a Monte-Carlos simulation.
FundamentosDMC.md — Method
md(sys::System{T},opt::Options) where TPerforms a simple MD simulation.
FundamentosDMC.md_berendsen — Method
md_berendsen(sys::System{T},opt::Options) where TPerforms a MD simulation with a Berendsen bath.
FundamentosDMC.md_isokinetic — Method
md_isokinetic(sys::System{T},opt::Options) where TPerforms a MD simulation with an isokinetic bath.
FundamentosDMC.md_langevin — Method
md_langevin(sys::System{T},opt::Options) where TPerforms a MD simulation with a Langevin bath.
FundamentosDMC.minimize! — Method
minimize!(sys::System{T},opt::Options)Minimizes the potential energy of sys.x0. Modifies sys.x0.
Example
julia> sys = System(n=100,sides=[100,100])
julia> minimize!(sys,Options(tol=1e-3))
Energy before minimization: 38322.72337856496
Energy after minimization: -74.15646912098042FundamentosDMC.potential — Method
potential(x::Vector{T},sys::System{T},opt::Options) where TFunction that computes the potential energy given a vector of positions, x.
FundamentosDMC.printxyz — Method
printxyz(time,x,sys,traj_file_buffer)Subroutine that writes the current coordinates (or velocities) to output files, previously opened in respective buffers.
FundamentosDMC.printxyz — Method
printxyz(time,x,v,sys,traj_file_buffer,vel_file_buffer)Subroutine that writes the current coordinates and velocities to output files, previously opened in respective buffers.
FundamentosDMC.printxyz — Method
printxyz(x,sys,file::String)Prints one set of coordinates (or velocities), given in x to file file. Overwrites the file.
FundamentosDMC.radial_distribution — Method
radial_distribution(
sys::System{T},
trajfile::String;
dmax::Float64=10.,
nbins::Int=100
) where TComputes the g(r). If T=Point3D the system will be read as three-dimensional.
FundamentosDMC.random_rotate — Method
random_rotate(v)Randomly rotate vector v, which might be a Point2D or a Point3D
FundamentosDMC.readxyz — Method
readxyz(file; first=1, last=-1)Function that reads a xyz file.
FundamentosDMC.remove_drift! — Method
remove_drift!(v)Removes possible drift from velocities.
FundamentosDMC.simulate_gui — Function
simulate_gui(; n=100, sides=(100.0, 100.0), kind=:md)Opens a graphical interface to interactively run and visualize, in 2D, the simulations described in the tutorial: microcanonical MD (:md), MD with an isokinetic bath (:md_isokinetic), a Berendsen bath (:md_berendsen), a Langevin bath (:md_langevin), and Monte Carlo (:mc).
The interface shows the motion of the particles together with live plots of the potential, kinetic and total energies, and of the temperature (average kinetic energy per particle), and exposes all the relevant System and Options parameters. Changing any parameter or the simulation type restarts the simulation with the new settings.
This function is implemented as a package extension and requires GLMakie to be loaded:
julia> using FundamentosDMC
julia> import GLMakie
julia> simulate_gui()FundamentosDMC.velocity_distribution — Method
velocity_distribution(
sys::System{T},
velfile::String;
vmax::Float64=2.,
nbins::Int=100
) where TComputes the distribution of velocities. If T=Point3D the system will be read as three-dimensional.