Action: DUMPVECTOR

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

Input

The arguments 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/matrix the labels of vectors/matrices that should be output in the file

Further details and examples

Print a vector to a file

In the following input the four distances calculated by the DISTANCE command are output to files using this command and using PRINT

Click on the labels of the actions for more information on what each action computes
tested on2.11
d: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,2 ATOMS2the pair of atom that we are calculating the distance between=3,4 ATOMS3the pair of atom that we are calculating the distance between=5,6 ATOMS4the pair of atom that we are calculating the distance between=7,8
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d FILEthe name of the file on which to output these quantities=colvar1 STRIDE the frequency with which the quantities of interest should be output=1
DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=d FILE the file on which to write the vetors=colvar2 STRIDE the frequency with which the grid should be output to the file=1

The PRINT command outputs the instantaneous values of the four distances on a single row. If we have a trajectory with four frames the colvar1 file will look like the one shown below:

! FIELDS time d.1 d.2 d.3 d.4
 0.000000 1.000000 1.000000 1.414214 1.000000
 1.000000 1.000000 1.000000 1.414214 1.000000
 2.000000 1.000000 1.000000 1.414214 1.000000
 3.000000 1.000000 1.000000 1.414214 1.000000
```

By contrast the DUMPVECTOR command will produce four output files - for each step of the simulation. Each of these
output files looks like this:

! FIELDS time parameter d 3.000000 0 1.000000 3.000000 1 1.000000 3.000000 2 1.414214 3.000000 3 1.000000 ```

In other words, the four elements of the vector are printed on different rows of the output. The latest file output will be called colvar2 and all earlier files will be called analysis.n.colvar where n is an integer that indicates the order in which files were produced. By adding the flag PRINT_ONE_FILE as shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,2 ATOMS2the pair of atom that we are calculating the distance between=3,4 ATOMS3the pair of atom that we are calculating the distance between=5,6 ATOMS4the pair of atom that we are calculating the distance between=7,8
DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=d FILE the file on which to write the vetors=colvar2 STRIDE the frequency with which the grid should be output to the file=1 PRINT_ONE_FILE output vectors one after the other in a single file

We can ensure that all the data from all four frames is concatenated to a single file that looks as follows:

#! FIELDS time parameter d
 3.000000 0 1.000000
 3.000000 1 1.000000
 3.000000 2 1.414214
 3.000000 3 1.000000
#! FIELDS time parameter d
 0.000000 0 1.000000
 0.000000 1 1.000000
 0.000000 2 1.414214
 0.000000 3 1.000000
#! FIELDS time parameter d
 1.000000 0 1.000000
 1.000000 1 1.000000
 1.000000 2 1.414214
 1.000000 3 1.000000
#! FIELDS time parameter d
 2.000000 0 1.000000
 2.000000 1 1.000000
 2.000000 2 1.414214
 2.000000 3 1.000000

This command is useful for printing out time series that have been stored using the COLLECT action or for printing out projections that have been generating using the tools in the dimred module. The following input shows how you can use it to calculate and print the time series of values for the distances between atoms 1 and 2 and atoms 3 and 4.

Click on the labels of the actions for more information on what each action computes
tested on2.11
d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4
c1: COLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d1 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1
c2: COLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d2 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1
DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=c1,c2 FILE the file on which to write the vetors=timeseries

In the example input above the time series is output at the end of the calculation.

Outputing matrices

You can also use this command to output matrices as the following input demonstrates:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details GROUPAwhen you are calculating the adjacency matrix between two sets of atoms this keyword is used to specify the atoms along with the keyword GROUPB=1,2 GROUPBwhen you are calculating the adjacency matrix between two sets of atoms this keyword is used to specify the atoms along with the keyword GROUPA=3-6
DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=d FILE the file on which to write the vetors=matrix STRIDE the frequency with which the grid should be output to the file=1

The files matrix and analysis.n.matrix that are output on each step here looks as follows:

! FIELDS time parameter d.1 d.2 d.3 d.4
 4.000000 0 2.000000 2.000000 1.000000 1.000000
 4.000000 1 1.000000 2.000000 2.000000 1.414214

In other words, the rows and columns of the file are used to display the rows and columns of the input matrix.

Further note that if your input matrix was constructed using the VSTACK and COLLECT commands as shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4
d3: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6
c1: COLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d1 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1
c2: COLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d2 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1
c3: COLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d3 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1
v: VSTACKCreate a matrix by stacking vectors together More details ARGthe values that you would like to stack together to construct the output matrix=c1,c2,c3
DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=v FILE the file on which to write the vetors=matrix

The output file looks as follows:

#! FIELDS time parameter d1 d2 d3
 3.000000 0 1.000000 1.000000 1.414214
 3.000000 1 1.000000 1.000000 1.414214
 3.000000 2 1.000000 1.000000 1.414214

In other words, the names of the columns in the output reflect the names of the underlying variables that were collected and stacked together to form the input matrix.

Syntax

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/matrices that should be output in the file
STRIDE compulsory 0 the frequency with which the grid should be output to the file
FILE compulsory density the file on which to write the vetors
FMT optional not used the format that should be used to output real numbers
PRINT_ONE_FILE optional false output vectors one after the other in a single file