Gromacs
2024.4
|
#include "gmxpre.h"
#include <cctype>
#include "gromacs/selection/position.h"
#include "gromacs/topology/mtop_lookup.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "selmethod.h"
#include "selmethod_impl.h"
Implements simple keyword selection methods.
Functions | |
static void | evaluate_all (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the all selection keyword. More... | |
static void | evaluate_none (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the none selection keyword. More... | |
static void | evaluate_atomnr (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the atomnr selection keyword. More... | |
static void | evaluate_resnr (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the resnr selection keyword. More... | |
static void | evaluate_resindex (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the resindex selection keyword. More... | |
static void | check_molecules (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Checks whether molecule information is present in the topology. More... | |
static void | evaluate_molindex (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the molindex selection keyword. More... | |
static void | evaluate_atomname (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the atomname selection keyword. More... | |
static void | evaluate_pdbatomname (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the pdbatomname selection keyword. More... | |
static void | check_atomtype (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Checks whether atom types are present in the topology. More... | |
static void | evaluate_atomtype (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the atomtype selection keyword. More... | |
static void | evaluate_insertcode (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the insertcode selection keyword. More... | |
static void | evaluate_chain (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the chain selection keyword. More... | |
static void | evaluate_mass (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the mass selection keyword. More... | |
static void | check_charge (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Checks whether charges are present in the topology. More... | |
static void | evaluate_charge (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the charge selection keyword. More... | |
static void | check_pdbinfo (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Checks whether PDB info is present in the topology. More... | |
static void | evaluate_altloc (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the altloc selection keyword. More... | |
static void | evaluate_occupancy (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the occupancy selection keyword. More... | |
static void | evaluate_betafactor (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the betafactor selection keyword. More... | |
static void | evaluate_resname (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates the resname selection keyword. More... | |
static void | evaluate_x (const gmx::SelMethodEvalContext &context, gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data) |
Evaluates the x selection keyword. More... | |
static void | evaluate_y (const gmx::SelMethodEvalContext &context, gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data) |
Evaluates the y selection keyword. More... | |
static void | evaluate_z (const gmx::SelMethodEvalContext &context, gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data) |
Evaluates the z selection keyword. More... | |
static void | evaluate_coord (real out[], gmx_ana_pos_t *pos, int d) |
Internal utility function for position keyword evaluation. More... | |
Variables | |
static const char | helptitle_atomname [] = "Selecting atoms by name" |
Help title for atom name selection keywords. | |
static const char *const | help_atomname [] |
Help text for atom name selection keywords. More... | |
static const char | helptitle_resindex [] = "Selecting atoms by residue number" |
Help title for residue index selection keywords. | |
static const char *const | help_resindex [] |
Help text for residue index selection keywords. More... | |
gmx_ana_selmethod_t | sm_all |
Selection method data for all selection keyword. More... | |
gmx_ana_selmethod_t | sm_none |
Selection method data for none selection keyword. More... | |
gmx_ana_selmethod_t | sm_atomnr |
Selection method data for atomnr selection keyword. More... | |
gmx_ana_selmethod_t | sm_resnr |
Selection method data for resnr selection keyword. More... | |
gmx_ana_selmethod_t | sm_resindex |
Selection method data for resindex selection keyword. More... | |
gmx_ana_selmethod_t | sm_molindex |
Selection method data for molindex selection keyword. More... | |
gmx_ana_selmethod_t | sm_atomname |
Selection method data for atomname selection keyword. More... | |
gmx_ana_selmethod_t | sm_pdbatomname |
Selection method data for pdbatomname selection keyword. More... | |
gmx_ana_selmethod_t | sm_atomtype |
Selection method data for atomtype selection keyword. More... | |
gmx_ana_selmethod_t | sm_resname |
Selection method data for resname selection keyword. More... | |
gmx_ana_selmethod_t | sm_insertcode |
Selection method data for chain selection keyword. More... | |
gmx_ana_selmethod_t | sm_chain |
Selection method data for chain selection keyword. More... | |
gmx_ana_selmethod_t | sm_mass |
Selection method data for mass selection keyword. More... | |
gmx_ana_selmethod_t | sm_charge |
Selection method data for charge selection keyword. More... | |
gmx_ana_selmethod_t | sm_altloc |
Selection method data for chain selection keyword. More... | |
gmx_ana_selmethod_t | sm_occupancy |
Selection method data for occupancy selection keyword. More... | |
gmx_ana_selmethod_t | sm_betafactor |
Selection method data for betafactor selection keyword. More... | |
gmx_ana_selmethod_t | sm_x |
Selection method data for x selection keyword. More... | |
gmx_ana_selmethod_t | sm_y |
Selection method data for y selection keyword. More... | |
gmx_ana_selmethod_t | sm_z |
Selection method data for z selection keyword. More... | |
|
static |
Checks whether atom types are present in the topology.
[in] | top | Topology structure. |
npar | Not used. | |
param | Not used. | |
data | Not used. |
|
static |
Checks whether charges are present in the topology.
[in] | top | Topology structure. |
npar | Not used. | |
param | Not used. | |
data | Not used. |
|
static |
Checks whether molecule information is present in the topology.
[in] | top | Topology structure. |
npar | Not used. | |
param | Not used. | |
data | Not used. |
If molecule information is not found, also prints an error message.
|
static |
Checks whether PDB info is present in the topology.
[in] | top | Topology structure. |
npar | Not used. | |
param | Not used. | |
data | Not used. |
If PDB info is not found, also prints an error message.
|
static |
Evaluates the all
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Copies g
to out->u.g
.
|
static |
Evaluates the altloc
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the alternate location identifier for each atom in out->u.s
.
|
static |
Evaluates the atomname
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the atom name for each atom in out->u.s
.
|
static |
Evaluates the atomnr
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the indices for each atom in out->u.i
.
|
static |
Evaluates the atomtype
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the atom type for each atom in out->u.s
. Segfaults if atom types are not found in the topology.
|
static |
Evaluates the betafactor
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the B-factors for each atom in out->u.r
. Segfaults if PDB info is not found in the topology.
|
static |
Evaluates the chain
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the chain for each atom in out->u.s
.
|
static |
Evaluates the charge
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the charge for each atom in out->u.r
.
|
static |
Internal utility function for position keyword evaluation.
[out] | out | Output array. |
[in] | pos | Position data to use instead of atomic coordinates. |
[in] | d | Coordinate index to evaluate (XX , YY or ZZ ). |
This function is used internally by evaluate_x(), evaluate_y() and evaluate_z() to do the actual evaluation.
|
static |
Evaluates the insertcode
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the insertion code for each atom in out->u.s
.
|
static |
Evaluates the mass
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the mass for each atom in out->u.r
.
|
static |
Evaluates the molindex
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the molecule indices for each atom in out->u.i
.
|
static |
Evaluates the none
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns an empty out->u.g
.
|
static |
Evaluates the occupancy
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the occupancy numbers for each atom in out->u.r
. Segfaults if PDB info is not found in the topology.
|
static |
Evaluates the pdbatomname
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the PDB atom name for each atom in out->u.s
.
|
static |
Evaluates the resindex
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the residue indices for each atom in out->u.i
.
|
static |
Evaluates the resname
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the residue name for each atom in out->u.s
.
|
static |
Evaluates the resnr
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the residue numbers for each atom in out->u.i
.
|
static |
Evaluates the x
selection keyword.
See sel_updatefunc_pos() for description of the parameters. data
is not used.
Returns the x
coordinate for each position in out->u.r
.
|
static |
Evaluates the y
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the y
coordinate for each position in out->u.r
.
|
static |
Evaluates the z
selection keyword.
See sel_updatefunc() for description of the parameters. data
is not used.
Returns the z
coordinate for each position in out->u.r
.
|
static |
Help text for atom name selection keywords.
|
static |
Help text for residue index selection keywords.
gmx_ana_selmethod_t sm_all |
Selection method data for all
selection keyword.
gmx_ana_selmethod_t sm_altloc |
Selection method data for chain
selection keyword.
gmx_ana_selmethod_t sm_atomname |
Selection method data for atomname
selection keyword.
gmx_ana_selmethod_t sm_atomnr |
Selection method data for atomnr
selection keyword.
gmx_ana_selmethod_t sm_atomtype |
Selection method data for atomtype
selection keyword.
gmx_ana_selmethod_t sm_betafactor |
Selection method data for betafactor
selection keyword.
gmx_ana_selmethod_t sm_chain |
Selection method data for chain
selection keyword.
gmx_ana_selmethod_t sm_charge |
Selection method data for charge
selection keyword.
gmx_ana_selmethod_t sm_insertcode |
Selection method data for chain
selection keyword.
gmx_ana_selmethod_t sm_mass |
Selection method data for mass
selection keyword.
gmx_ana_selmethod_t sm_molindex |
Selection method data for molindex
selection keyword.
gmx_ana_selmethod_t sm_none |
Selection method data for none
selection keyword.
gmx_ana_selmethod_t sm_occupancy |
Selection method data for occupancy
selection keyword.
gmx_ana_selmethod_t sm_pdbatomname |
Selection method data for pdbatomname
selection keyword.
gmx_ana_selmethod_t sm_resindex |
Selection method data for resindex
selection keyword.
gmx_ana_selmethod_t sm_resname |
Selection method data for resname
selection keyword.
gmx_ana_selmethod_t sm_resnr |
Selection method data for resnr
selection keyword.
gmx_ana_selmethod_t sm_x |
Selection method data for x
selection keyword.
gmx_ana_selmethod_t sm_y |
Selection method data for y
selection keyword.
gmx_ana_selmethod_t sm_z |
Selection method data for z
selection keyword.