Gromacs
2024.4
|
#include "gmxpre.h"
#include "gromacs/math/vec.h"
#include "gromacs/selection/nbsearch.h"
#include "gromacs/selection/position.h"
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/exceptions.h"
#include "selmethod.h"
#include "selmethod_impl.h"
Implements distance-based selection methods.
This file implements the distance
, mindistance
and within
selection methods.
Classes | |
struct | t_methoddata_distance |
Data structure for distance-based selection method. More... | |
Functions | |
static void * | init_data_common (int npar, gmx_ana_selparam_t *param) |
Allocates data for distance-based selection methods. More... | |
static void | init_common (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Initializes a distance-based selection method. More... | |
static void | free_data_common (void *data) |
Frees the data allocated for a distance-based selection method. More... | |
static void | init_frame_common (const gmx::SelMethodEvalContext &context, void *data) |
Initializes the evaluation of a distance-based within selection method for a frame. More... | |
static void | evaluate_distance (const gmx::SelMethodEvalContext &, gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data) |
Evaluates the distance selection method. More... | |
static void | evaluate_within (const gmx::SelMethodEvalContext &, gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data) |
Evaluates the within selection method. More... | |
Variables | |
static gmx_ana_selparam_t | smparams_distance [] |
Parameters for the distance selection method. More... | |
static gmx_ana_selparam_t | smparams_mindistance [] |
Parameters for the mindistance selection method. More... | |
static gmx_ana_selparam_t | smparams_within [] |
Parameters for the within selection method. More... | |
static const char | helptitle_distance [] = "Selecting based on distance" |
Help title for distance selection methods. | |
static const char *const | help_distance [] |
Help text for distance selection methods. More... | |
gmx_ana_selmethod_t | sm_distance |
Selection method data for the distance method. More... | |
gmx_ana_selmethod_t | sm_mindistance |
Selection method data for the distance method. More... | |
gmx_ana_selmethod_t | sm_within |
Selection method data for the within method. More... | |
|
static |
Evaluates the distance
selection method.
See sel_updatefunc_pos() for description of the parameters. data
should point to a t_methoddata_distance
.
Calculates the distance of each position from t_methoddata_distance::p
and puts them in out->u.r
.
|
static |
Evaluates the within
selection method.
See sel_updatefunc() for description of the parameters. data
should point to a t_methoddata_distance
.
Finds the atoms that are closer than the defined cutoff to t_methoddata_distance::xref
and puts them in out.g
.
|
static |
Frees the data allocated for a distance-based selection method.
data | Data to free (should point to a t_methoddata_distance ). |
Frees the memory allocated for t_methoddata_distance::xref
and t_methoddata_distance::nb
.
|
static |
Initializes a distance-based selection method.
top | Not used. |
npar | Not used (should be 2). |
param | Method parameters (should point to one of the distance parameter arrays). |
data | Pointer to t_methoddata_distance to initialize. |
Initializes the neighborhood search data structure (t_methoddata_distance::nb
). Also checks that the cutoff is valid.
|
static |
Allocates data for distance-based selection methods.
[in] | npar | Not used (should be 2). |
[in,out] | param | Method parameters (should point to one of the distance parameter arrays). |
t_methoddata_distance
).Allocates memory for a t_methoddata_distance
structure and initializes the parameter as follows:
t_methoddata_distance::cutoff
.t_methoddata_distance::p
.
|
static |
Initializes the evaluation of a distance-based within selection method for a frame.
[in] | context | Evaluation context. |
data | Should point to a t_methoddata_distance . |
Initializes the neighborhood search for the current frame.
|
static |
Help text for distance selection methods.
gmx_ana_selmethod_t sm_distance |
Selection method data for the distance
method.
gmx_ana_selmethod_t sm_mindistance |
Selection method data for the distance
method.
gmx_ana_selmethod_t sm_within |
Selection method data for the within
method.
|
static |
Parameters for the distance
selection method.
|
static |
Parameters for the mindistance
selection method.
|
static |
Parameters for the within
selection method.