Shortcut: ONES
Module | generic |
---|---|
Description | Usage |
Create a constant vector with all elements equal to one | |
output value | type |
a vector of ones with the required number of elements | scalar/vector |
Further details and examples
Create a constant vector with all elements equal to one
The following input creates and outputs a constant vector with 10 elements that are all equal to one
onesONESCreate 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=10 : PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=ones FILEthe name of the file on which to output these quantities=onesfile
Notice that the ONES action is a shortcut to CONSTANT.
This action is used extensively when calculating coordination numbers in inputs similar to this one:
c1CONTACT_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-7 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=2.6 NN=6 MM=12} onesONESCreate 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=7 : 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 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=cc FILEthe name of the file on which to output these quantities=colvar:
For more information on why this is useful see CONTACT_MATRIX
Syntax
The following table describes the keywords and options that can be used with this action
Keyword | Type | Default | Description |
---|---|---|---|
SIZE | compulsory | none | the number of ones that you would like to create |