Skip to content

Action: PRINT_NDX

Module generic
Description Usage
Print an ndx file used in 0 tutorialsused in 0 eggs
This action outputs data to a file. You can read more about how PLUMED manages output files here

Details and examples

Print an ndx file

The following example shows how you can use this command to print out the indices of all the atoms that have a coordination number that is greater than or equal to 4.

Click on the labels of the actions for more information on what each action computes
tested on2.11
# These three lines calculate the coordination numbers of 100 atoms
c1: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-100 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL R_0=0.1 NN=6 MM=12}
ones: ONESCreate a constant vector with all elements equal to one This action is a shortcut. More details SIZEthe number of ones that you would like to create=100
cc: MATRIX_VECTOR_PRODUCTCalculate the product of the matrix and the vector More details ARGthe label for the matrix and the vector/scalar that are being multiplied=c1,ones

# This command then prints the indices of the atoms that have a coordination number that is greater than 4
# every step
PRINT_NDXPrint an ndx file More details ATOMSthe list of atoms that have the corresponding arguments=1-100 ARGthe labels of vectors that should be used when printind the NDX file=cc FILEthe name of the file on which to output these quantities=index.ndx GREATER_THAN_OR_EQUALwhen printing with arguments that are vectors only print components of vectors have a value greater than or equal to this value=4

Obviously, if you want to print the indices of the atoms that have a coordination number that is equal to 4 you use a command like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
# These three lines calculate the coordination numbers of 100 atoms
c1: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-100 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL R_0=0.1 NN=6 MM=12}
ones: ONESCreate a constant vector with all elements equal to one This action is a shortcut. More details SIZEthe number of ones that you would like to create=100
cc: MATRIX_VECTOR_PRODUCTCalculate the product of the matrix and the vector More details ARGthe label for the matrix and the vector/scalar that are being multiplied=c1,ones

# This command then prints the indices of the atoms that have a coordination number that is equal to 4
# on every 10th step of the simulation
PRINT_NDXPrint an ndx file More details ...
   ATOMSthe list of atoms that have the corresponding arguments=1-100 ARGthe labels of vectors that should be used when printind the NDX file=cc FILEthe name of the file on which to output these quantities=index.ndx
   LESS_THAN_OR_EQUALwhen printing with arguments that are vectors only print components of vectors have a value less than or equal to this value=4
   GREATER_THAN_OR_EQUALwhen printing with arguments that are vectors only print components of vectors have a value greater than or equal to this value=4
   STRIDE the frequency with which the quantities of interest should be output=10
...

A command like the one above is used in the OUTPUT_CLUSTER command that you can use to output the indices of the atoms that are in a particular cluster.

RESTART, UPDATE_FROM and UPDATE_UNTIL

Notice that the RESTART, UPDATE_FROM and UPDATE_UNTIL keywords keywords can be used in this action in the same way as they are used for PRINT. Consequently, if you would like to append to an existing file called index.ndx instead of backing that file up at the start of the calculation and outputting the data from the calculation on a new file called index.ndx you would use an input like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
c1: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-100 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL R_0=0.1 NN=6 MM=12}
ones: ONESCreate a constant vector with all elements equal to one This action is a shortcut. More details SIZEthe number of ones that you would like to create=100
cc: MATRIX_VECTOR_PRODUCTCalculate the product of the matrix and the vector More details ARGthe label for the matrix and the vector/scalar that are being multiplied=c1,ones

PRINT_NDXPrint an ndx file More details ...
  ATOMSthe list of atoms that have the corresponding arguments=1-100 ARGthe labels of vectors that should be used when printind the NDX file=cc FILEthe name of the file on which to output these quantities=index.ndx
  GREATER_THAN_OR_EQUALwhen printing with arguments that are vectors only print components of vectors have a value greater than or equal to this value=4 RESTARTallows per-action setting of restart (YES/NO/AUTO)=YES
...

Similarly, if you want to only output the index.ndx file during the 400 ps time interval after the first 100 ps of the simulation you would use an input like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
c1: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-100 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL R_0=0.1 NN=6 MM=12}
ones: ONESCreate a constant vector with all elements equal to one This action is a shortcut. More details SIZEthe number of ones that you would like to create=100
cc: MATRIX_VECTOR_PRODUCTCalculate the product of the matrix and the vector More details ARGthe label for the matrix and the vector/scalar that are being multiplied=c1,ones

PRINT_NDXPrint an ndx file More details ...
  ATOMSthe list of atoms that have the corresponding arguments=1-100 ARGthe labels of vectors that should be used when printind the NDX file=cc FILEthe name of the file on which to output these quantities=index.ndx
  GREATER_THAN_OR_EQUALwhen printing with arguments that are vectors only print components of vectors have a value greater than or equal to this value=4
  UPDATE_FROMOnly update this action from this time=100 UPDATE_UNTILOnly update this action until this time=500
...

Input

The arguments and atoms that serve as the input for this action are specified using one or more of the keywords in the following table.

Keyword Type Description
ARG vector the labels of vectors that should be used when printind the NDX file
ATOMS atoms the list of atoms that have the corresponding arguments

Full list of keywords

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
ARG input none the labels of vectors that should be used when printind the NDX file
ATOMS input none the list of atoms that have the corresponding arguments
STRIDE compulsory 1 the frequency with which the quantities of interest should be output
FILE optional not used the name of the file on which to output these quantities
LESS_THAN_OR_EQUAL optional not used when printing with arguments that are vectors only print components of vectors have a value less than or equal to this value
GREATER_THAN_OR_EQUAL optional not used when printing with arguments that are vectors only print components of vectors have a value greater than or equal to this value
RESTART optional not used allows per-action setting of restart (YES/NO/AUTO)
UPDATE_FROM optional not used Only update this action from this time
UPDATE_UNTIL optional not used Only update this action until this time