FreeBirdIO

Functions

FreeBird.FreeBirdIO.SaveEveryNType
struct SaveEveryN <: DataSavingStrategy

SaveEveryN is a concrete subtype of DataSavingStrategy that specifies saving data every N steps.

Fields

  • df_filename::String: The name of the file to save the DataFrame to.
  • wk_filename::String: The name of the file to save the atom walker to.
  • ls_filename::String: The name of the file to save the liveset to.
  • n_traj::Int: The number of steps between each save of the culled walker into a trajectory file.
  • n_snap::Int: The number of steps between each save of the liveset into a snapshot file.
  • n_info::Int: The number of steps between each print of information.
source
FreeBird.FreeBirdIO.SaveFreePartEveryNType
struct SaveFreePartEveryN <: DataSavingStrategy

SaveFreePartEveryN is a concrete subtype of DataSavingStrategy that specifies saving data every N steps. Only the free particles are saved into the trajectory and snapshot files.

Fields

  • df_filename::String: The name of the file to save the DataFrame to.
  • wk_filename::String: The name of the file to save the atom walker to.
  • ls_filename::String: The name of the file to save the liveset to.
  • n_traj::Int: The number of steps between each save of the culled walker into a trajectory file.
  • n_snap::Int: The number of steps between each save of the liveset into a snapshot file.
  • n_info::Int: The number of steps between each print of information.
source
FreeBird.FreeBirdIO.append_systemMethod
append_system(ats1::FlexibleSystem, ats2::FlexibleSystem)

Append two FlexibleSystem objects into a single FastSystem object. The first argument is the system to be appended to, and its bounding box and boundary conditions will be used for the new system.

Arguments

  • ats1::FlexibleSystem: The base system to be appended.
  • ats2::FlexibleSystem: The system to append.

Returns

  • new_list: A new FastSystem object containing the appended systems.
source
FreeBird.FreeBirdIO.convert_system_to_walkerMethod
convert_system_to_walker(at::FlexibleSystem, resume::Bool)

Converts a FlexibleSystem object to an AtomWalker object.

Arguments

  • at::FlexibleSystem: The FlexibleSystem object to convert.
  • resume::Bool: Whether to resume from previous data.

Returns

  • AtomWalker: The converted AtomWalker object.
source
FreeBird.FreeBirdIO.convert_walker_to_systemMethod
convert_walker_to_system(at::AtomWalker)

Converts an AtomWalker object to an AbstractSystem object.

Arguments

  • at::AtomWalker: The AtomWalker object to be converted.

Returns

  • AbstractSystem: The converted AbstractSystem object.
source
FreeBird.FreeBirdIO.generate_initial_configsMethod
generate_initial_configs(num_walkers::Int, volume_per_particle::Float64, num_particle::Int; particle_type::Symbol=:H)

Generate initial configurations for a given number of walkers.

Arguments

  • num_walkers::Int: The number of walkers.
  • volume_per_particle::Float64: The volume per particle.
  • num_particle::Int: The number of particles.
  • particle_type::Symbol=:H: The type of particle (default is :H).

Returns

An array of initial configurations for each walker.

source
FreeBird.FreeBirdIO.generate_multi_type_random_starting_configMethod
generate_multi_type_random_starting_config(volume_per_particle::Float64, num_particle::Vector{Int}; particle_types::Vector{Symbol}=[Symbol(:H), Symbol(:O)])

Generate a random starting configuration for a system of particles with multiple types.

Arguments

  • volume_per_particle::Float64: The volume per particle.
  • num_particle::Vector{Int}: The number of particles of each type.
  • particle_types::Vector{Symbol}=[Symbol(:H), Symbol(:O)]: The types of particles.

Returns

  • FastSystem: A FastSystem object representing the generated system.
source
FreeBird.FreeBirdIO.generate_random_starting_configMethod
generate_random_starting_config(volume_per_particle::Float64, num_particle::Int; particle_type::Symbol=:H)

Generate a random starting configuration for a system of particles.

Arguments

  • volume_per_particle::Float64: The volume per particle.
  • num_particle::Int: The number of particles.
  • particle_type::Symbol=:H: The type of particle (default is hydrogen).

Returns

  • FastSystem: A FastSystem object representing the generated system.
source
FreeBird.FreeBirdIO.read_configsMethod
read_configs(filename::String, pbc::Vector)

Reads atomic configurations from a file and applies periodic boundary conditions.

Arguments

  • filename::String: The name of the file containing the atomic configurations.
  • pbc::Vector: A vector specifying the periodic boundary conditions.

Returns

An array of atomic configurations with periodic boundary conditions applied.

source
FreeBird.FreeBirdIO.read_configsMethod
read_configs(filename::String; pbc::String="TTT")

Reads configurations from a file.

Arguments

  • filename::String: The name of the file to read configurations from.
  • pbc::String="TTT": Periodic boundary conditions. A string of length 3, where each character represents whether the corresponding dimension has periodic boundary conditions ('T') or not ('F').

Returns

  • The configurations read from the file.
source
FreeBird.FreeBirdIO.read_single_configMethod
read_single_config(filename::String, pbc::Vector)

Reads a single configuration from the specified file and sets the periodic boundary conditions (PBC) for the atoms.

Arguments

  • filename::String: The name of the file to read the configuration from.
  • pbc::Vector: A vector specifying the periodic boundary conditions.

Returns

  • at::Atoms: The atoms with the PBC set.
source
FreeBird.FreeBirdIO.read_single_configMethod
read_single_config(filename::String; pbc::String="TTT")

Reads a single configuration from the specified file.

Arguments

  • filename::String: The name of the file to read from.
  • pbc::String="TTT": The periodic boundary conditions. Default is "TTT".

Returns

  • The configuration read from the file.
source
FreeBird.FreeBirdIO.read_single_walkerMethod
read_single_walker(filename::String; pbc::String="TTT", resume::Bool=true)

Reads a single walker from the specified file.

Arguments

  • filename::String: The path to the file containing the walker data.
  • pbc::String: (optional) The periodic boundary conditions. Default is "TTT".
  • resume::Bool: (optional) Whether to resume reading from a previous checkpoint. Default is true.

Returns

  • The walker object read from the file.
source
FreeBird.FreeBirdIO.read_walkersMethod
read_walkers(filename::String; pbc::String="TTT", resume::Bool=true)

Reads walker configurations from a file.

Arguments

  • filename::String: The name of the file to read the walker configurations from.
  • pbc::String: A string specifying the periodic boundary conditions. Default is "TTT".
  • resume::Bool: A boolean indicating whether to resume reading from a previous checkpoint. Default is true.

Returns

An array of walker objects.

source
FreeBird.FreeBirdIO.set_pbcMethod
set_pbc(at::Atoms, pbc::Vector)

Set the periodic boundary conditions for a system of atoms.

Arguments

  • at::Atoms: The system of atoms.
  • pbc::Vector: A vector of length 3 specifying the periodic boundary conditions for each dimension. Each element can be either true for periodic boundary conditions or false for Dirichlet zero boundary conditions.

Returns

  • FlexibleSystem: A flexible system with the specified boundary conditions.
source
FreeBird.FreeBirdIO.write_dfMethod
write_df(filename::String, df::DataFrame)

Write a DataFrame to a CSV file.

Arguments

  • filename::String: The name of the file to write to.
  • df::DataFrame: The DataFrame to write.
source
FreeBird.FreeBirdIO.write_df_every_nMethod
write_df_every_n(df::DataFrame, step::Int, d_strategy::SaveEveryN)

Write the DataFrame df to a file specified by d_strategy.filename every d_strategy.n steps.

Arguments

  • df::DataFrame: The DataFrame to be written.
  • step::Int: The current step number.
  • d_strategy::SaveEveryN: The save strategy specifying the filename and the step interval.
source
FreeBird.FreeBirdIO.write_ls_every_nMethod
write_ls_every_n(ls::AtomWalkers, step::Int, d_strategy::SaveEveryN)

Write the liveset ls to file every n steps, as specified by the d_strategy.

Arguments

  • ls::AbstractLiveSet: The liveset to be written.
  • step::Int: The current step number.
  • d_strategy::SaveEveryN: The save strategy specifying the frequency of writing.
source
FreeBird.FreeBirdIO.write_single_walkerMethod
write_single_walker(filename::String, at::AtomWalker, append::Bool)

Write a single AtomWalker object to a file. If the file already exists, append the walker to the file.

Arguments

  • filename::String: The name of the file to write to.
  • at::AtomWalker: The AtomWalker object to write.
  • append::Bool: A boolean indicating whether to append the walker to the file if it already exists.
source
FreeBird.FreeBirdIO.write_single_walkerMethod
write_single_walker(filename::String, at::AtomWalker)

Write a single AtomWalker object to a file.

Arguments

  • filename::String: The name of the file to write to.
  • at::AtomWalker: The AtomWalker object to write.
source
FreeBird.FreeBirdIO.write_walker_every_nMethod
write_walker_every_n(at::AtomWalker, step::Int, d_strategy::SaveEveryN)

Write the atom walker at to a file specified by d_strategy.wk_filename every d_strategy.n steps.

Arguments

  • at::AtomWalker: The atom walker to be written.
  • step::Int: The current step number.
  • d_strategy::SaveEveryN: The save strategy specifying the file name and the interval.
source
FreeBird.FreeBirdIO.write_walkersMethod
write_walkers(filename::String, ats::Vector{AtomWalker})

Write a collection of AtomWalker objects to a file.

Arguments

  • filename::String: The name of the file to write the walkers to.
  • ats::Vector{AtomWalker}: The collection of AtomWalker objects to write.
source
FreeBird.FreeBirdIO.write_walkersMethod
write_walkers(filename::String, ats::Vector{LatticeWalker})

Write a collection of LatticeWalker objects to a file.

Arguments

  • filename::String: The name of the file to write the walkers to.
  • ats::Vector{LatticeWalker}: The collection of LatticeWalker objects to write.
source