CP2K 2.4 (Revision 12889)
Functions | Variables

mc_coordinates Namespace Reference

contains miscellaneous subroutines used in the Monte Carlo runs,mostly geared towards changes in coordinates More...

Functions

subroutine, public check_for_overlap (force_env, nchains, nunits, loverlap, mol_type, cell_length, molecule_number)
 looks for overlaps (intermolecular distances less than rmin)
subroutine, public get_center_of_mass (coordinates, natom, center_of_mass, mass)
 calculates the center of mass of a given molecule
subroutine, public mc_coordinate_fold (coordinates, nchains_tot, mol_type, mass, nunits, box_length)
 folds all the coordinates into the center simulation box using a center of mass cutoff
subroutine, public generate_cbmc_swap_config (force_env, BETA, max_val, min_val, exp_max_val, exp_min_val, nswapmoves, rosenbluth_weight, start_atom, natoms_tot, nunits, nunits_mol, mass, loverlap, choosen_energy, old_energy, ionode, lremove, mol_type, nchains, source, group, rng_stream, error, avbmc_atom, rmin, rmax, move_type, target_atom)
 takes the last molecule in a force environment and moves it around to different center of mass positions and orientations, selecting one based on the rosenbluth weight
subroutine, public rotate_molecule (r, mass, natoms, rng_stream, error)
 rotates a molecule randomly around the center of mass, sequentially in x, y, and z directions
subroutine, public find_mc_test_molecule (mc_molecule_info, start_atom, box_number, molecule_type, rng_stream, box, molecule_type_old, error)
 selects a molecule at random to perform a MC move on...you can specify the box the molecule should be in, its type, both, or neither
subroutine, public create_discrete_array (cell, discrete_array, step_size)
 generates an array that tells us which sides of the simulation cell we can increase or decrease using a discrete volume move
subroutine, private generate_avbmc_insertion (rmin, rmax, r_target, move_type, r_insert, abc, rng_stream, error)
 generates an insertion point in either the "in" or the "out" volume of a target atom, where the "in" volume is a shell with inner radius rmin and outer radius rmax

Variables

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

Detailed Description

contains miscellaneous subroutines used in the Monte Carlo runs,mostly geared towards changes in coordinates

Author:
MJM

Function Documentation

subroutine,public mc_coordinates::check_for_overlap ( TYPE(force_env_type),pointer  force_env,
INTEGER,dimension(:),intent(in)  nchains,
INTEGER,dimension(:),intent(in)  nunits,
LOGICAL,intent(out)  loverlap,
INTEGER,dimension(:),intent(in)  mol_type,
REAL(KIND=dp),dimension(1:3),intent(in),optional  cell_length,
INTEGER,intent(in),optional  molecule_number 
)

looks for overlaps (intermolecular distances less than rmin)

Parameters:
force_envthe force environment containing the coordinates
nchainsthe number of molecules of each type in the box
nunitsthe number of interaction sites for each molecule
loverlapreturns .TRUE. if atoms overlap
mol_typean array that indicates the type of each molecule
cell_lengththe length of the box...if none is specified, it uses the cell found in the force_env
molecule_numberif present, just look for overlaps with this molecule

Suitable for parallel use.

Author:
MJM

Definition at line 69 of file mc_coordinates.f90.

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

Referenced by generate_cbmc_swap_config(), mc_ensembles::mc_compute_virial(), mc_moves::mc_conformation_change(), mc_ge_moves::mc_ge_swap_move(), mc_ge_moves::mc_ge_volume_move(), mc_moves::mc_molecule_rotation(), mc_moves::mc_molecule_translation(), mc_ge_moves::mc_Quickstep_move(), mc_ensembles::mc_run_ensemble(), and mc_moves::mc_volume_move().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public mc_coordinates::create_discrete_array ( REAL(dp),dimension(1:3),intent(in)  cell,
INTEGER,dimension(1:3, 1:2),intent(out)  discrete_array,
REAL(dp),intent(in)  step_size 
)

generates an array that tells us which sides of the simulation cell we can increase or decrease using a discrete volume move

Parameters:
cellthe lengths of the sides of the cell
discrete_arraythe array that indicates which sides we can move
step_sizethe size of the discrete volume move

Suitable for parallel.

Author:
MJM

Definition at line 931 of file mc_coordinates.f90.

subroutine,public mc_coordinates::find_mc_test_molecule ( TYPE(mc_molecule_info_type),pointer  mc_molecule_info,
INTEGER,intent(out)  start_atom,
INTEGER,intent(out)  box_number,
INTEGER,intent(out)  molecule_type,
TYPE(rng_stream_type),pointer  rng_stream,
INTEGER,intent(in),optional  box,
INTEGER,intent(in),optional  molecule_type_old,
TYPE(cp_error_type),intent(inout)  error 
)

selects a molecule at random to perform a MC move on...you can specify the box the molecule should be in, its type, both, or neither

Parameters:
mc_molecule_infothe structure that contains some global molecule data
start_atomthe number of the first atom in the choosen molecule in relation to the force_env it's in
box_numberthe box the choosen molecule is in
molecule_typethe type of molecule the choosen molecule is
rng_streamthe stream we pull random numbers from
boxif present, tells the routine which box to grab a molecule from
molecule_type_oldif present, tells the routine which molecule type to select from
errorthe optional cp_error_type

Designed only for serial use.

Author:
MJM

Definition at line 774 of file mc_coordinates.f90.

References CPPostcondition, error, mc_types::get_mc_molecule_info(), and timings::timeset().

Here is the call graph for this function:

subroutine,private mc_coordinates::generate_avbmc_insertion ( REAL(KIND=dp),intent(in)  rmin,
REAL(KIND=dp),intent(in)  rmax,
REAL(KIND=dp),dimension(1:3),intent(in)  r_target,
CHARACTER(LEN=*),intent(in)  move_type,
REAL(KIND=dp),dimension(1:3),intent(out)  r_insert,
REAL(KIND=dp),dimension(1:3),intent(in)  abc,
TYPE(rng_stream_type),pointer  rng_stream,
TYPE(cp_error_type),intent(inout)  error 
) [private]

generates an insertion point in either the "in" or the "out" volume of a target atom, where the "in" volume is a shell with inner radius rmin and outer radius rmax

Parameters:
rminthe minimum AVBMC radius for the shell around the target
rmaxthe maximum AVBMC radius for the shell around the target
r_targetthe coordinates of the target atom
move_typegenerate configs in the "in" or "out" volume
r_insertthe output insertion site
abcthe lengths of the sides of the simulation box
rng_streamthe random number stream that we draw from

Use only in serial.

Author:
MJM

Definition at line 997 of file mc_coordinates.f90.

References error.

Referenced by generate_cbmc_swap_config().

Here is the caller graph for this function:

subroutine,public mc_coordinates::generate_cbmc_swap_config ( TYPE(force_env_type),pointer  force_env,
REAL(KIND=dp),intent(in)  BETA,
REAL(KIND=dp),intent(in)  max_val,
REAL(KIND=dp),intent(in)  min_val,
REAL(KIND=dp),intent(in)  exp_max_val,
REAL(KIND=dp),intent(in)  exp_min_val,
INTEGER,intent(in)  nswapmoves,
REAL(KIND=dp),intent(out)  rosenbluth_weight,
INTEGER,intent(in)  start_atom,
INTEGER,intent(in)  natoms_tot,
INTEGER,dimension(:),intent(in)  nunits,
INTEGER,intent(in)  nunits_mol,
REAL(dp),dimension(1:nunits_mol),intent(in)  mass,
LOGICAL,intent(out)  loverlap,
REAL(KIND=dp),intent(out)  choosen_energy,
REAL(KIND=dp),intent(in)  old_energy,
LOGICAL,intent(in)  ionode,
LOGICAL,intent(in)  lremove,
INTEGER,dimension(:),intent(in)  mol_type,
INTEGER,dimension(:),intent(in)  nchains,
INTEGER,intent(in)  source,
INTEGER,intent(in)  group,
TYPE(rng_stream_type),pointer  rng_stream,
TYPE(cp_error_type)  error,
INTEGER,intent(in),optional  avbmc_atom,
REAL(KIND=dp),intent(in),optional  rmin,
REAL(KIND=dp),intent(in),optional  rmax,
CHARACTER(LEN=*),intent(in),optional  move_type,
INTEGER,intent(in),optional  target_atom 
)

takes the last molecule in a force environment and moves it around to different center of mass positions and orientations, selecting one based on the rosenbluth weight

Optional Avbmc Flags
  • avbmc_atom: the atom number that serves for the target atom in each molecule (1 is the first atom in the molecule, etc.)
  • rmin: the minimum AVBMC radius for the shell around the target
  • rmax: the maximum AVBMC radius for the shell around the target
  • move_type: generate configs in the "in" or "out" volume
  • target_atom: the number of the avbmc atom in the target molecule
Suitable for parallel.
Parameters:
force_envthe force environment containing the coordinates
BETAthe value of 1/kT for this simulations, in a.u.
nswapmovesthe number of desired trial configurations
rosenbluth_weightthe Rosenbluth weight for this set of configs
start_atomthe atom number that the molecule to be swapped starts on
natoms_totthe total number of interaction sites in the box
nunitsthe number of interaction sites for every molecule_type
nunits_totthe number of interaction sites in the choosen molecule
massthe mass for every interaction site of every molecule type
loverlapthe flag that indicates if all of the configs have an atomic overlap
choosen_energythe energy of the choosen config
old_energythe energy that we subtract from all of the trial energies to prevent numerical overflows
ionodeindicates if we're on the main CPU
lremoveis this the Rosenbluth weight for a removal box?
mol_typean array that contains the molecule type for every atom in the box
nchainsthe number of molecules of each type in this box
sourcethe MPI source value, for broadcasts
groupthe MPI group value, for broadcasts
rng_streamthe random number stream that we draw from
errorthe the cp_error type
Author:
MJM

Definition at line 338 of file mc_coordinates.f90.

References physcon::angstrom, check_for_overlap(), cp_subsys_types::cp_subsys_get(), error, force_env_methods::force_env_calc_energy_force(), force_env_types::force_env_get(), generate_avbmc_insertion(), get_center_of_mass(), rotate_molecule(), and timings::timeset().

Here is the call graph for this function:

subroutine,public mc_coordinates::get_center_of_mass ( REAL(KIND=dp),dimension(:, :),intent(in)  coordinates,
INTEGER,intent(in)  natom,
REAL(KIND=dp),dimension(1:3),intent(out)  center_of_mass,
REAL(KIND=dp),dimension(:),intent(in)  mass 
)

calculates the center of mass of a given molecule

Parameters:
coordinatesthe coordiantes of the atoms in the molecule
natomthe number of atoms in the molecule
center_of_massthe coordinates of the center of mass
massthe mass of the atoms in the molecule

Designed for parallel use.

Author:
MJM

Definition at line 200 of file mc_coordinates.f90.

References timings::timeset().

Referenced by generate_cbmc_swap_config(), mc_coordinate_fold(), and rotate_molecule().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public mc_coordinates::mc_coordinate_fold ( REAL(KIND=dp),dimension(:, :),intent(inout)  coordinates,
INTEGER,intent(in)  nchains_tot,
INTEGER,dimension(:),intent(in)  mol_type,
REAL(KIND=dp),dimension(:, :),intent(in)  mass,
INTEGER,dimension(:),intent(in)  nunits,
REAL(KIND=dp),dimension(1:3),intent(in)  box_length 
)

folds all the coordinates into the center simulation box using a center of mass cutoff

Parameters:
coordinatesthe coordiantes of the atoms in the system
nchains_totthe total number of molecules in the box
mol_typean array that indicates the type of every molecule in the box
massthe mass of every atom for all molecule types
nunitsthe number of interaction sites for each molecule type
box_lengthan array for the lengths of the simulation box sides

Designed for parallel use.

Author:
MJM

Definition at line 250 of file mc_coordinates.f90.

References get_center_of_mass(), and timings::timeset().

Here is the call graph for this function:

subroutine,public mc_coordinates::rotate_molecule ( REAL(KIND=dp),dimension(1:3, 1:natoms),intent(inout)  r,
REAL(KIND=dp),dimension(1:natoms),intent(in)  mass,
INTEGER,intent(in)  natoms,
TYPE(rng_stream_type),pointer  rng_stream,
TYPE(cp_error_type),intent(inout)  error 
)

rotates a molecule randomly around the center of mass, sequentially in x, y, and z directions

Parameters:
rthe coordinates of the molecule to rotate
massthe mass of all the atoms in the molecule
natomsthe number of atoms in the molecule
rng_streamthe stream we pull random numbers from

Use only in serial.

Author:
MJM

Definition at line 678 of file mc_coordinates.f90.

References get_center_of_mass(), mathconstants::pi, and timings::timeset().

Referenced by generate_cbmc_swap_config().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

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

Definition at line 50 of file mc_coordinates.f90.