Shortcut: SELECT_COMPONENTS
Module |
valtools |
Description |
Usage |
Create a new value to hold a subset of the components that are in a vector or matrix |
  |
output value |
type |
a vector containing the selected components |
vector |
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 value from which we are selecting components |
Further details and examples
Create a new value to hold a subset of the components that are in a vector or matrix
Output a scalar or vector that contains a subset of the elements in the input vector or matrix.
In the example below the value s
is a scalar that contains the distance between atoms 3 and 4.
Click on the labels of the actions for more information on what each action computes
dThe DISTANCE action with label d calculates the following quantities: Quantity | Type | Description |
d | vector | the DISTANCE for each set of specified atoms |
: 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
sThe SELECT_COMPONENTS action with label s calculates the following quantities: Quantity | Type | Description |
s | vector | a vector containing the selected components |
: SELECT_COMPONENTSCreate a new value to hold a subset of the components that are in a vector or matrix This action is a shortcut. More details ARGthe value from which we are selecting components=d COMPONENTSthe components in the input value that you woul like to build a new vector from=2
# s: SELECT_COMPONENTS ARG=d COMPONENTS=2
s_maskThe CONSTANT action with label s_mask calculates the following quantities: Quantity | Type | Description |
s_mask | vector | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details VALUESthe numbers that are in your constant value=1,0,1,1
sThe SELECT_WITH_MASK action with label s calculates the following quantities: Quantity | Type | Description |
s | vector | a vector/matrix of values that is obtained using a mask to select elements of interest |
: SELECT_WITH_MASKUse a mask to select elements of an array More details ARGthe label for the value upon which you are going to apply the mask=d MASKan array with ones in the components that you want to discard=s_mask
# --- End of included input ---
In this example the output z is a 2 dimensional vector containing the distances between atoms 3 and 4
and 7 and 8.
Click on the labels of the actions for more information on what each action computes
dThe DISTANCE action with label d calculates the following quantities: Quantity | Type | Description |
d | vector | the DISTANCE for each set of specified atoms |
: 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
sThe SELECT_COMPONENTS action with label s calculates the following quantities: Quantity | Type | Description |
s | vector | a vector containing the selected components |
: SELECT_COMPONENTSCreate a new value to hold a subset of the components that are in a vector or matrix This action is a shortcut. More details ARGthe value from which we are selecting components=d COMPONENTSthe components in the input value that you woul like to build a new vector from=2,4
# s: SELECT_COMPONENTS ARG=d COMPONENTS=2,4
s_maskThe CONSTANT action with label s_mask calculates the following quantities: Quantity | Type | Description |
s_mask | vector | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details VALUESthe numbers that are in your constant value=1,0,1,0
sThe SELECT_WITH_MASK action with label s calculates the following quantities: Quantity | Type | Description |
s | vector | a vector/matrix of values that is obtained using a mask to select elements of interest |
: SELECT_WITH_MASKUse a mask to select elements of an array More details ARGthe label for the value upon which you are going to apply the mask=d MASKan array with ones in the components that you want to discard=s_mask
# --- End of included input ---
Lastly, in this example we calculate a matrix of distances. The scalar s
that is output from the
SELECT_COMPONENTS action contains the distance between atoms 1 and 3 and 3 and 4.
Click on the labels of the actions for more information on what each action computes
dThe DISTANCE_MATRIX action with label d calculates the following quantities: Quantity | Type | Description |
d | matrix | a matrix containing the weights for the bonds between each pair of atoms |
: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-5
d: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action uses the defaults shown here. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-5 NL_CUTOFF The cutoff for the neighbor list=0.0 NL_STRIDE The frequency with which we are updating the atoms in the neighbor list=1 CUTOFF ignore distances that have a value larger than this cutoff=-1
sThe SELECT_COMPONENTS action with label s calculates the following quantities: Quantity | Type | Description |
s | vector | a vector containing the selected components |
: SELECT_COMPONENTSCreate a new value to hold a subset of the components that are in a vector or matrix This action is a shortcut. More details ARGthe value from which we are selecting components=d COMPONENTSthe components in the input value that you woul like to build a new vector from=1.3,3.4
# s: SELECT_COMPONENTS ARG=d COMPONENTS=1.3,3.4
s_flatThe FLATTEN action with label s_flat calculates the following quantities: Quantity | Type | Description |
s_flat | vector | a vector containing all the elements of the input matrix |
: FLATTENConvert a matrix into a vector More details ARGthe label for the matrix that you would like to flatten to a vector=d
s_maskThe CONSTANT action with label s_mask calculates the following quantities: Quantity | Type | Description |
s_mask | vector | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details VALUESthe numbers that are in your constant value=1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1
sThe SELECT_WITH_MASK action with label s calculates the following quantities: Quantity | Type | Description |
s | vector | a vector/matrix of values that is obtained using a mask to select elements of interest |
: SELECT_WITH_MASKUse a mask to select elements of an array More details ARGthe label for the value upon which you are going to apply the mask=s_flat MASKan array with ones in the components that you want to discard=s_mask
# --- End of included input ---
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
ARG |
input |
none |
the value from which we are selecting components |
COMPONENTS |
compulsory |
none |
the components in the input value that you woul like to build a new vector from |