.. _chap-md_suite_fortran: The md_nvt_constrains function ############################## ================= md_nvt_constrains ================= Performs molecular dynamics in a nvt ensemble holding the indicated constraints :: md_nvt_constrains(latvec_in, xred_in, fcart_in, vel_in, bond_valu, angl_valu, atom_fix_valu, atom_fix_cord, amu, Qmass, dtion_md, temp, s_in, s_in_dot, bond_const, angl_const, atom_fix_const, correc_steps, md_steps,bool_bond_cons, bool_angl_cons, bool_atom_fix_cons, nat, numb_angl_cons, numb_bond_cons, numb_atom_fix_cons, s_out, s_out_dot, x_out, v_out) ============================================== The input parameters for **md_nvt_constrains** ============================================== **latvec_in** real(8), dimension (3,3) lattice vectors given in a matrix where every column of the matrix correspond to a lattice vector. **xred_in** real(8), dimension (3, nat), matrix with the current reduced positions of the atoms in the system. **fcart_in** real(8), dimension (3, nat), matrix with the current cartesian (not reduced) forces over the atoms in the system. **vel_in** real(8), dimension (3, nat), matrix with the current velocities of the atoms in the system, initialize with subroutine **init_vel_atoms**. **bond_valu** real(8), dimension (numb_bond_cons), array with the values of the bond constraints. For example if you use 2 bond constraints between atoms (1,2) and (4,6), then the first value in ****bond_valu**** will be the value of the constraint enforced between atoms (1,2). **In the case of no bond constraints then bond_valu must have at least one value.** **angl_valu** real(8), dimension (numb_angl_cons), array with the values of the angle constraints. For example if you use 2 angle constraints between atoms (1,2,3), and (6,7,8), then the first value in ****angl_valy**** will be the value of the constraint enforced between atoms (1,2,3). **In the case of no angle constraints then angl_valu must have at least one value.** **atom_fix_valu** real(8), dimension (numb_atom_fix_cons,3) coordinates of positions where the atoms are to be fixed. For example if you want to fix atom 1 to [0.0, 0.0, 0.0] and atom 2 to [1.0, 1.0, 1.0], then :: atom_fix_valu -> [[0.0, 0.0, 0.0], [1.0, 1.0, 1.0] ]. **In the case of no atom fix constraints then atom_fix_valu must have at least one value [[0.0, 0.0, 0.0]].** **atom_fix_cord** real(8), dimension (numb_atom_fix_cons,3) Allow for fixing the atoms to a given set of the (x,y,z) coordinates, this can be done by setting a 1 in the coordinate where the constraint is going to be activated and a 0 where there is not going to be a constraint, for instance, if you want the atoms declared in atom_fixed_constrains to be held at the positions given at **atom_fixed_position** then **atom_fix_coordinate** must be declared: :: atom_fix_cord -> [[1.0, 1.0, 1.0] , [1.0, 1.0, 1.0] ] But if for example, you want to fix the atom 1 to 0.00 only in the x coordinate, and fix the atom 2 to y= 1.0, then use: :: atom_fix_cord -> [[1.0, 0.0, 0.0] , [0.0, 1.0, 0.0] ] **In the case of no atom fix constraints then atom_fix_cord must have at least one value [[0.0, 0.0, 0.0]].** **amu** real(8) dimension (nat) array with the atomic mass of the atoms in the structure **Qmass** real(8) mass of the thermostat. **dtion_md** real(8) value of the time differential for integration the unit of time is the femtosecond, we don’t recommend using a dt bigger than 0.1 which would be equivalent to 0.1femtoseconds. **temp** real(8) value of the temperature. **s_in** real(8) thermostat degree of freedom at current time. **s_in_dot** real(8) derivative of thermostat degree of freedom at current time. **bond_const** integer, dimension (numb_bond_cons,2), array indicating the atoms in the bond constraints, for example, to indicate 2 constraints, one between atoms (1,2), and other between atoms (3,5): :: bond_const -> [[1,2],[3,5]] In the case of no having bond constraints then use bond_const -> [[1]] **angl_const** integer, dimension (numb_angl_cons,3), array indicating the atoms in the bond constraints, for example, to indicate 2 constraints, one between atoms (1,2,3), and other between atoms (5,6,7): :: angl_const -> [[1,2,3],[5,6,7]] The first atom in the array of 3 is the atom taken as the vertex of the angle. In the case of no having angle constraints then use angl_const -> [[1,1,1]] **atom_fix_const** integer, dimension (numb_atom_fix_cons,1), array with the list of atoms to be constraint to a given position, for example, to indicate that the atoms 1 and 2 are going to be constraint use: :: atom_fix_const -> [[1],[2]] In the case of no having atoms positions constraints then use atom_fix_const -> [[1]] **correc_steps** number of steps for the predictor-corrector algorithm that performs the integration of the equations of motion. **md_steps** number of md steps to be performed with the given input forces as forces guiding the dynamics. **bool_bond_cons** integer, 1 if there are bond constraints, 0 otherwise. **bool_angl_cons** integer, 1 if there are angle constraints, 0 otherwise. **bool_atom_fix_cons** integer, 1 if there are atom positions constraints, 0 otherwise. **nat** integer, number of atoms in the system. **numb_angl_cons** integer, number of angles constraints, if there are no angles constraints use numb_angl_cons -> 1. **numb_bond_cons** integer, number of bond constraints, if there are no bond constraints use numb_bond_cons -> 1. **numb_atom_fix_cons** integer, number of atom positions constraints, if there are no atom positions constraints use numb_bond_cons -> 1. =============================================== The output parameters for **md_nvt_constrains** =============================================== **s_out** real(8) thermostat degree of freedom at the output time. **s_out_dot** real(8) derivative of the thermostat degree of freedom at the output time. **x_out** real(8) dimensions (3, nat), reduced positions of the atoms in the cell after md_steps. **v_out** real(8) dimensions (3, nat), velocity of the atoms in the cell after md_steps.