CP2K 2.4 (Revision 12889)
Classes | Functions | Variables

mc_types Namespace Reference

holds all the structure types needed for Monte Carlo, except the mc_environment_type More...

Classes

struct  mc_simpar_type
struct  mc_ekin_type
struct  mc_input_file_type
struct  mc_molecule_info_type
struct  mc_simulation_parameters_p_type
struct  mc_averages_type
struct  mc_averages_p_type
struct  mc_moves_type
struct  accattempt
struct  mc_moves_p_type

Functions

subroutine, public get_mc_input_file (mc_input_file, run_type_row, run_type_column, coord_row_start, coord_row_end, cell_row, cell_column, global_row_end, mol_set_nmol_row, mol_set_nmol_column, in_use, text, atom_names_empty, nunits_empty, coordinates_empty, motion_row_end, motion_row_start)
 accesses the private elements of the mc_input_file_type
subroutine, public get_mc_par (mc_par, nstep, nvirial, iuptrans, iupvolume, nmoves, nswapmoves, rm, cl, diff, nstart, source, group, lbias, ionode, lrestart, lstop, rmvolume, rmbond, rmangle, rmrot, rmtrans, temperature, pressure, BETA, pmswap, pmvolume, pmtraion, pmtrans, ensemble, PROGRAM, restart_file_name, molecules_file, moves_file, coords_file, energy_file, displacement_file, cell_file, dat_file, data_file, box2_file, fft_lib, iprint, rcut, ldiscrete, discrete_step, pmavbmc, pbias, avbmc_atom, avbmc_rmin, avbmc_rmax, rmdihedral, input_file, mc_molecule_info, pmswap_mol, pmavbmc_mol, pmtrans_mol, pmrot_mol, pmtraion_mol, mc_input_file, mc_bias_file, pmvol_box, virial_temps, exp_min_val, exp_max_val, min_val, max_val, eta, pmhmc, pmhmc_box, lhmc, rand2skip)
subroutine, public get_mc_molecule_info (mc_molecule_info, nmol_types, nchain_total, nboxes, names, conf_prob, nchains, nunits, mol_type, nunits_tot, in_box, atom_names, mass)
subroutine, public set_mc_par (mc_par, rm, cl, diff, nstart, rmvolume, rmbond, rmangle, rmdihedral, rmrot, rmtrans, PROGRAM, nmoves, nswapmoves, lstop, temperature, pressure, iuptrans, iupvolume, pmswap, pmvolume, pmtraion, pmtrans, BETA, rcut, iprint, lbias, nstep, lrestart, ldiscrete, discrete_step, pmavbmc, mc_molecule_info, pmavbmc_mol, pmtrans_mol, pmrot_mol, pmtraion_mol, pmswap_mol, avbmc_rmin, avbmc_rmax, avbmc_atom, pbias, ensemble, pmvol_box, eta, mc_input_file, mc_bias_file, exp_max_val, exp_min_val, min_val, max_val, pmhmc, pmhmc_box, lhmc, ionode, source, group, rand2skip)
subroutine, public mc_sim_par_create (mc_par, nmol_types)
 creates (allocates) the mc_simulation_parameters type
subroutine, public mc_sim_par_destroy (mc_par)
 destroys (deallocates) the mc_simulation_parameters type
subroutine, public mc_input_file_create (mc_input_file, input_file_name, mc_molecule_info, empty_coords, lhmc, error)
 creates (allocates) the mc_input_file_type
subroutine, public mc_input_file_destroy (mc_input_file)
 destroys (deallocates) things in the mc_input_file_type
subroutine mc_parse_text (text, nstart, nend, string_search, lend, row_number, column_number, start_row_number)
 a basic text parser used to find the row and column numbers of various strings in the input file, to store as indices for when we create a dat_file... returns 0 for the row if nothing is found
subroutine, public read_mc_section (mc_par, para_env, globenv, input_file_name, input_file, force_env_section, error)
 reads in the Monte Carlo simulation parameters from an input file
subroutine, public find_mc_rcut (mc_par, force_env, lterminate)
 finds the largest interaction cutoff value in a classical simulation so we know the smallest size we can make the box in a volume move
subroutine, public mc_determine_molecule_info (force_env, mc_molecule_info, error, box_number, coordinates_empty)
 figures out the number of total molecules, the number of atoms in each molecule, an array with the molecule types, etc...a lot of information that we need. I did this because I use multiple force_env (simulation boxes) for MC, and they don't know about each other.
subroutine, public mc_molecule_info_destroy (mc_molecule_info)
 deallocates all the arrays in the mc_molecule_info_type
subroutine, public mc_input_parameters_check (mc_par)

Variables

CHARACTER(len=*), parameter,
private 
moduleN = 'mc_types'

Detailed Description

holds all the structure types needed for Monte Carlo, except the mc_environment_type

History
none
Author:
MJM

Function Documentation

subroutine,public mc_types::find_mc_rcut ( TYPE(mc_simpar_type),intent(inout)  mc_par,
TYPE(force_env_type),pointer  force_env,
LOGICAL,intent(out)  lterminate 
)

finds the largest interaction cutoff value in a classical simulation so we know the smallest size we can make the box in a volume move

Parameters:
mc_parthe structure that will store the parameters
force_envthe force environment that we'll grab the rcut parameter out of
lterminateset to .TRUE. if one of the sides of the box is less than twice the cutoff

Suitable for parallel.

Author:
MJM

Definition at line 1664 of file mc_types.f90.

References fist_environment_types::fist_env_get(), fist_nonbond_env_types::fist_nonbond_env_get(), and force_env_types::force_env_get().

Referenced by mc_run::do_mon_car().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public mc_types::get_mc_input_file ( TYPE(mc_input_file_type),pointer  mc_input_file,
INTEGER,intent(out),optional  run_type_row,
INTEGER,intent(out),optional  run_type_column,
INTEGER,intent(out),optional  coord_row_start,
INTEGER,intent(out),optional  coord_row_end,
INTEGER,intent(out),optional  cell_row,
INTEGER,intent(out),optional  cell_column,
INTEGER,intent(out),optional  global_row_end,
INTEGER,dimension(:),optional,pointer  mol_set_nmol_row,
INTEGER,dimension(:),optional,pointer  mol_set_nmol_column,
INTEGER,intent(out),optional  in_use,
CHARACTER(LEN=default_string_length),dimension(:),optional,pointer  text,
CHARACTER(LEN=default_string_length),dimension(:),optional,pointer  atom_names_empty,
INTEGER,intent(out),optional  nunits_empty,
REAL(dp),dimension(:, :),optional,pointer  coordinates_empty,
INTEGER,intent(out),optional  motion_row_end,
INTEGER,intent(out),optional  motion_row_start 
)

accesses the private elements of the mc_input_file_type

Parameters:
mc_input_filethe input file you want data for

Suitable for parallel.

Author:
MJM

Definition at line 249 of file mc_types.f90.

Referenced by mc_misc::mc_make_dat_file_new().

Here is the caller graph for this function:

subroutine,public mc_types::get_mc_molecule_info ( TYPE(mc_molecule_info_type),pointer  mc_molecule_info,
INTEGER,intent(out),optional  nmol_types,
INTEGER,intent(out),optional  nchain_total,
INTEGER,intent(out),optional  nboxes,
CHARACTER(LEN=default_string_length),dimension(:),optional,pointer  names,
REAL(dp),dimension(:, :),optional,pointer  conf_prob,
INTEGER,dimension(:, :),optional,pointer  nchains,
INTEGER,dimension(:),optional,pointer  nunits,
INTEGER,dimension(:),optional,pointer  mol_type,
INTEGER,dimension(:),optional,pointer  nunits_tot,
INTEGER,dimension(:),optional,pointer  in_box,
CHARACTER(LEN=default_string_length),dimension(:, :),optional,pointer  atom_names,
REAL(dp),dimension(:, :),optional,pointer  mass 
)
subroutine,public mc_types::get_mc_par ( TYPE(mc_simpar_type),pointer  mc_par,
INTEGER,intent(out),optional  nstep,
INTEGER,intent(out),optional  nvirial,
INTEGER,intent(out),optional  iuptrans,
INTEGER,intent(out),optional  iupvolume,
INTEGER,intent(out),optional  nmoves,
INTEGER,intent(out),optional  nswapmoves,
INTEGER,intent(out),optional  rm,
INTEGER,intent(out),optional  cl,
INTEGER,intent(out),optional  diff,
INTEGER,intent(out),optional  nstart,
INTEGER,intent(out),optional  source,
INTEGER,intent(out),optional  group,
LOGICAL,intent(out),optional  lbias,
LOGICAL,intent(out),optional  ionode,
LOGICAL,intent(out),optional  lrestart,
LOGICAL,intent(out),optional  lstop,
REAL(KIND=dp),intent(out),optional  rmvolume,
REAL(KIND=dp),dimension(:),optional,pointer  rmbond,
REAL(KIND=dp),dimension(:),optional,pointer  rmangle,
REAL(KIND=dp),dimension(:),optional,pointer  rmrot,
REAL(KIND=dp),dimension(:),optional,pointer  rmtrans,
REAL(KIND=dp),intent(out),optional  temperature,
REAL(KIND=dp),intent(out),optional  pressure,
REAL(KIND=dp),intent(out),optional  BETA,
REAL(KIND=dp),intent(out),optional  pmswap,
REAL(KIND=dp),intent(out),optional  pmvolume,
REAL(KIND=dp),intent(out),optional  pmtraion,
REAL(KIND=dp),intent(out),optional  pmtrans,
CHARACTER(LEN=*),intent(out),optional  ensemble,
CHARACTER(LEN=*),intent(out),optional  PROGRAM,
CHARACTER(LEN=*),intent(out),optional  restart_file_name,
CHARACTER(LEN=*),intent(out),optional  molecules_file,
CHARACTER(LEN=*),intent(out),optional  moves_file,
CHARACTER(LEN=*),intent(out),optional  coords_file,
CHARACTER(LEN=*),intent(out),optional  energy_file,
CHARACTER(LEN=*),intent(out),optional  displacement_file,
CHARACTER(LEN=*),intent(out),optional  cell_file,
CHARACTER(LEN=*),intent(out),optional  dat_file,
CHARACTER(LEN=*),intent(out),optional  data_file,
CHARACTER(LEN=*),intent(out),optional  box2_file,
CHARACTER(LEN=*),intent(out),optional  fft_lib,
INTEGER,intent(out),optional  iprint,
REAL(KIND=dp),intent(out),optional  rcut,
LOGICAL,intent(out),optional  ldiscrete,
REAL(KIND=dp),intent(out),optional  discrete_step,
REAL(KIND=dp),intent(out),optional  pmavbmc,
REAL(KIND=dp),dimension(:),optional,pointer  pbias,
INTEGER,dimension(:),optional,pointer  avbmc_atom,
REAL(KIND=dp),dimension(:),optional,pointer  avbmc_rmin,
REAL(KIND=dp),dimension(:),optional,pointer  avbmc_rmax,
REAL(KIND=dp),dimension(:),optional,pointer  rmdihedral,
TYPE(section_vals_type),optional,pointer  input_file,
TYPE(mc_molecule_info_type),optional,pointer  mc_molecule_info,
REAL(dp),dimension(:),optional,pointer  pmswap_mol,
REAL(KIND=dp),dimension(:),optional,pointer  pmavbmc_mol,
REAL(KIND=dp),dimension(:),optional,pointer  pmtrans_mol,
REAL(KIND=dp),dimension(:),optional,pointer  pmrot_mol,
REAL(KIND=dp),dimension(:),optional,pointer  pmtraion_mol,
TYPE(mc_input_file_type),optional,pointer  mc_input_file,
TYPE(mc_input_file_type),optional,pointer  mc_bias_file,
REAL(KIND=dp),intent(out),optional  pmvol_box,
REAL(KIND=dp),dimension(:),optional,pointer  virial_temps,
REAL(KIND=dp),intent(out),optional  exp_min_val,
REAL(KIND=dp),intent(out),optional  exp_max_val,
REAL(KIND=dp),intent(out),optional  min_val,
REAL(KIND=dp),intent(out),optional  max_val,
REAL(KIND=dp),dimension(:),optional,pointer  eta,
REAL(KIND=dp),intent(out),optional  pmhmc,
REAL(KIND=dp),intent(out),optional  pmhmc_box,
LOGICAL,intent(out),optional  lhmc,
INTEGER,intent(out),optional  rand2skip 
)
Parameters:
mc_paraccesses the private elements of the mc_parameters_type
mc_parthe structure mc parameters you want

Suitable for parallel.

Author:
MJM

Definition at line 288 of file mc_types.f90.

Referenced by mc_run::do_mon_car(), mc_run::equilize_mc_sim_parameters(), mc_misc::final_mc_write(), tamc_run::HMCsampler(), tamc_run::langevinVEC(), mc_ge_moves::mc_ge_swap_move(), mc_ge_moves::mc_ge_volume_move(), tamc_run::mc_hmc_move(), mc_input_parameters_check(), and mc_ge_moves::mc_Quickstep_move().

Here is the caller graph for this function:

subroutine,public mc_types::mc_determine_molecule_info ( TYPE(force_env_p_type),dimension(:),pointer  force_env,
TYPE(mc_molecule_info_type),pointer  mc_molecule_info,
TYPE(cp_error_type),intent(inout)  error,
INTEGER,intent(in),optional  box_number,
REAL(dp),dimension(:, :),optional,pointer  coordinates_empty 
)

figures out the number of total molecules, the number of atoms in each molecule, an array with the molecule types, etc...a lot of information that we need. I did this because I use multiple force_env (simulation boxes) for MC, and they don't know about each other.

Parameters:
force_envthe pointer containing all the force environments in the simulation
mc_molecule_infothe structure that will hold all the information for the molecule types

Suitable for parallel.

Author:
MJM

Definition at line 1724 of file mc_types.f90.

References cp_subsys_types::cp_subsys_get(), and force_env_types::force_env_get().

Referenced by mc_run::do_mon_car(), and mc_ge_moves::mc_ge_swap_move().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public mc_types::mc_input_file_create ( TYPE(mc_input_file_type),pointer  mc_input_file,
CHARACTER(LEN=*),intent(in)  input_file_name,
TYPE(mc_molecule_info_type),pointer  mc_molecule_info,
REAL(dp),dimension(:, :)  empty_coords,
LOGICAL,intent(in)  lhmc,
TYPE(cp_error_type),intent(inout)  error 
)

creates (allocates) the mc_input_file_type

Parameters:
mc_input_filethe structure that will be created (allocated)
input_file_namethe name of the file to read
nmol_typesthe number of molecule types in the system
Author:
MJM

Definition at line 852 of file mc_types.f90.

References cp_files::close_file(), error, get_mc_molecule_info(), mc_parse_text(), and string_utilities::uppercase().

Referenced by mc_run::do_mon_car().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public mc_types::mc_input_file_destroy ( TYPE(mc_input_file_type),pointer  mc_input_file)

destroys (deallocates) things in the mc_input_file_type

Parameters:
mc_input_filethe structure that will be released (deallocated)
Author:
MJM

Definition at line 1058 of file mc_types.f90.

Referenced by mc_run::do_mon_car().

Here is the caller graph for this function:

subroutine,public mc_types::mc_input_parameters_check ( TYPE(mc_simpar_type),pointer  mc_par)
Parameters:
mc_paraccesses the private elements of the mc_molecule_info_type
mc_molecule_infothe structure you want the parameters for
nmol_typesthe number of molecule types in the simulation

Suitable for parallel.

Author:
MJM

Definition at line 2011 of file mc_types.f90.

References get_mc_molecule_info(), and get_mc_par().

Referenced by mc_run::do_mon_car().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public mc_types::mc_molecule_info_destroy ( TYPE(mc_molecule_info_type),pointer  mc_molecule_info)

deallocates all the arrays in the mc_molecule_info_type

Parameters:
mc_molecule_infothe structure we wish to deallocate

Suitable for parallel.

Author:
MJM

Definition at line 1976 of file mc_types.f90.

Referenced by mc_run::do_mon_car(), and mc_ge_moves::mc_ge_swap_move().

Here is the caller graph for this function:

subroutine mc_types::mc_parse_text ( CHARACTER(LEN=*),dimension(:),intent(in)  text,
INTEGER,intent(in)  nstart,
INTEGER,intent(in)  nend,
CHARACTER(LEN=*),intent(in)  string_search,
LOGICAL,intent(in)  lend,
INTEGER,intent(out)  row_number,
INTEGER,intent(out)  column_number,
INTEGER,intent(out),optional  start_row_number 
) [private]

a basic text parser used to find the row and column numbers of various strings in the input file, to store as indices for when we create a dat_file... returns 0 for the row if nothing is found

Parameters:
textthe text to parse
nstartthe line to start searching from
nendthe line to end searching
string_searchthe text we're looking for
lendif .TRUE., find the &END that comes after string_search...assumes that the row is the first row with & in the same column as the search string
row_numberthe row the string is first found on
column_numberthe column number that the string first appears on
Author:
MJM

Definition at line 1099 of file mc_types.f90.

Referenced by mc_input_file_create().

Here is the caller graph for this function:

subroutine,public mc_types::mc_sim_par_create ( TYPE(mc_simpar_type),pointer  mc_par,
INTEGER,intent(in)  nmol_types 
)

creates (allocates) the mc_simulation_parameters type

Parameters:
mc_parthe structure that will be created (allocated)
nmol_typesthe number of molecule types in the system
Author:
MJM

Definition at line 692 of file mc_types.f90.

Referenced by mc_run::do_mon_car().

Here is the caller graph for this function:

subroutine,public mc_types::mc_sim_par_destroy ( TYPE(mc_simpar_type),pointer  mc_par)

destroys (deallocates) the mc_simulation_parameters type

Parameters:
mc_parthe structure that will be destroyed
Author:
MJM

Definition at line 768 of file mc_types.f90.

Referenced by mc_run::do_mon_car().

Here is the caller graph for this function:

subroutine,public mc_types::read_mc_section ( TYPE(mc_simpar_type),pointer  mc_par,
TYPE(cp_para_env_type),pointer  para_env,
TYPE(global_environment_type),pointer  globenv,
CHARACTER(LEN=*),intent(in)  input_file_name,
TYPE(section_vals_type),pointer  input_file,
TYPE(section_vals_type),pointer  force_env_section,
TYPE(cp_error_type),intent(inout)  error 
)

reads in the Monte Carlo simulation parameters from an input file

Parameters:
mc_parthe structure that will store the parameters
globenvthe global environment for the simulation
input_file_namethe name of the input_file
input_filethe structure that contains all the keywords in the input file
force_env_sectionused to grab the type of force_env
errorthe cp_error_type
Author:
MJM

Definition at line 1159 of file mc_types.f90.

References physcon::boltzmann, cp_units::cp_unit_to_cp2k(), input_constants::do_fist, error, mathconstants::pi, input_section_types::section_vals_get_subs_vals(), and timings::timeset().

Referenced by mc_run::do_mon_car().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public mc_types::set_mc_par ( TYPE(mc_simpar_type),pointer  mc_par,
INTEGER,intent(in),optional  rm,
INTEGER,intent(in),optional  cl,
INTEGER,intent(in),optional  diff,
INTEGER,intent(in),optional  nstart,
REAL(KIND=dp),intent(in),optional  rmvolume,
REAL(KIND=dp),dimension(:),optional,pointer  rmbond,
REAL(KIND=dp),dimension(:),optional,pointer  rmangle,
REAL(KIND=dp),dimension(:),optional,pointer  rmdihedral,
REAL(KIND=dp),dimension(:),optional,pointer  rmrot,
REAL(KIND=dp),dimension(:),optional,pointer  rmtrans,
CHARACTER(LEN=*),intent(in),optional  PROGRAM,
INTEGER,intent(in),optional  nmoves,
INTEGER,intent(in),optional  nswapmoves,
LOGICAL,intent(in),optional  lstop,
REAL(KIND=dp),intent(in),optional  temperature,
REAL(KIND=dp),intent(in),optional  pressure,
INTEGER,intent(in),optional  iuptrans,
INTEGER,intent(in),optional  iupvolume,
REAL(KIND=dp),intent(in),optional  pmswap,
REAL(KIND=dp),intent(in),optional  pmvolume,
REAL(KIND=dp),intent(in),optional  pmtraion,
REAL(KIND=dp),intent(in),optional  pmtrans,
REAL(KIND=dp),intent(in),optional  BETA,
REAL(KIND=dp),intent(in),optional  rcut,
INTEGER,intent(in),optional  iprint,
LOGICAL,intent(in),optional  lbias,
INTEGER,intent(in),optional  nstep,
LOGICAL,intent(in),optional  lrestart,
LOGICAL,intent(in),optional  ldiscrete,
REAL(KIND=dp),intent(in),optional  discrete_step,
REAL(KIND=dp),intent(in),optional  pmavbmc,
TYPE(mc_molecule_info_type),optional,pointer  mc_molecule_info,
REAL(dp),dimension(:),optional,pointer  pmavbmc_mol,
REAL(dp),dimension(:),optional,pointer  pmtrans_mol,
REAL(dp),dimension(:),optional,pointer  pmrot_mol,
REAL(dp),dimension(:),optional,pointer  pmtraion_mol,
REAL(dp),dimension(:),optional,pointer  pmswap_mol,
REAL(dp),dimension(:),optional,pointer  avbmc_rmin,
REAL(dp),dimension(:),optional,pointer  avbmc_rmax,
INTEGER,dimension(:),optional,pointer  avbmc_atom,
REAL(dp),dimension(:),optional,pointer  pbias,
CHARACTER(LEN=*),intent(in),optional  ensemble,
REAL(KIND=dp),intent(in),optional  pmvol_box,
REAL(KIND=dp),dimension(:),optional,pointer  eta,
TYPE(mc_input_file_type),optional,pointer  mc_input_file,
TYPE(mc_input_file_type),optional,pointer  mc_bias_file,
REAL(KIND=dp),intent(in),optional  exp_max_val,
REAL(KIND=dp),intent(in),optional  exp_min_val,
REAL(KIND=dp),intent(in),optional  min_val,
REAL(KIND=dp),intent(in),optional  max_val,
REAL(KIND=dp),intent(in),optional  pmhmc,
REAL(KIND=dp),intent(in),optional  pmhmc_box,
LOGICAL,intent(in),optional  lhmc,
LOGICAL,intent(in),optional  ionode,
INTEGER,intent(in),optional  source,
INTEGER,intent(in),optional  group,
INTEGER,intent(in),optional  rand2skip 
)
Parameters:
mc_parchanges the private elements of the mc_parameters_type
mc_parthe structure mc parameters you want

Suitable for parallel.

Author:
MJM

Definition at line 490 of file mc_types.f90.

Referenced by mc_run::do_mon_car(), mc_run::equilize_mc_sim_parameters(), and mc_ge_moves::mc_ge_swap_move().

Here is the caller graph for this function:


Variable Documentation

CHARACTER(len=*),parameter,private mc_types::moduleN = 'mc_types'

Definition at line 238 of file mc_types.f90.