Gromacs
2020.4
|
#include "gmxpre.h"
#include "gromacs/selection/indexutil.h"
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/smalloc.h"
#include "keywords.h"
#include "poscalc.h"
#include "position.h"
#include "selelem.h"
#include "selmethod.h"
#include "selmethod_impl.h"
Implements position evaluation selection methods.
Classes | |
struct | t_methoddata_pos |
Data structure for position keyword evaluation. More... | |
Functions | |
static void * | init_data_pos (int npar, gmx_ana_selparam_t *param) |
Allocates data for position evaluation selection methods. More... | |
static void | set_poscoll_pos (gmx::PositionCalculationCollection *pcc, void *data) |
Sets the position calculation collection for position evaluation selection methods. More... | |
static void | init_kwpos (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Initializes position evaluation keywords. More... | |
static void | init_cog (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Initializes the cog selection method. More... | |
static void | init_com (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Initializes the cog selection method. More... | |
static void | init_output_pos (const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data) |
Initializes output for position evaluation selection methods. More... | |
static void | free_data_pos (void *data) |
Frees the data allocated for position evaluation selection methods. More... | |
static void | evaluate_pos (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *, gmx_ana_selvalue_t *out, void *data) |
Evaluates position evaluation selection methods. More... | |
bool | _gmx_selelem_is_default_kwpos (const gmx::SelectionTreeElement &sel) |
Returns whether the selection element is a default position keyword. More... | |
static void | set_pos_method_flags (gmx_ana_selmethod_t *method, t_methoddata_pos *d) |
Updates selection method flags about required topology information. More... | |
void | _gmx_selelem_set_kwpos_type (gmx::SelectionTreeElement *sel, const char *type) |
Sets the position type for position keyword evaluation. More... | |
void | _gmx_selelem_set_kwpos_flags (gmx::SelectionTreeElement *sel, int flags) |
Sets the flags for position keyword evaluation. More... | |
Variables | |
static gmx_ana_selparam_t | smparams_keyword_pos [] |
Parameters for position keyword evaluation. More... | |
static gmx_ana_selparam_t | smparams_com [] |
Parameters for the cog and com selection methods. More... | |
gmx_ana_selmethod_t | sm_keyword_pos |
Selection method data for position keyword evaluation. More... | |
gmx_ana_selmethod_t | sm_cog |
Selection method data for the cog method. More... | |
gmx_ana_selmethod_t | sm_com |
Selection method data for the com method. More... | |
bool _gmx_selelem_is_default_kwpos | ( | const gmx::SelectionTreeElement & | sel | ) |
Returns whether the selection element is a default position keyword.
[in] | sel | Selection element to query. |
true
if sel
represents a position keyword evaluation that uses the default (implicit) position keyword.This method only works before the selection has been compiled.
void _gmx_selelem_set_kwpos_flags | ( | gmx::SelectionTreeElement * | sel, |
int | flags | ||
) |
Sets the flags for position keyword evaluation.
[in,out] | sel | Selection element to initialize. |
[in] | flags | Default completion flags (see PositionCalculationCollection::typeFromEnum()). |
Initializes the flags for position evaluation. If called multiple times, the first setting takes effect, and later calls are neglected.
void _gmx_selelem_set_kwpos_type | ( | gmx::SelectionTreeElement * | sel, |
const char * | type | ||
) |
Sets the position type for position keyword evaluation.
[in,out] | sel | Selection element to initialize. |
[in] | type | One of the enum values acceptable for PositionCalculationCollection::typeFromEnum(). |
Initializes the reference position type for position evaluation. If called multiple times, the first setting takes effect, and later calls are neglected.
|
static |
Evaluates position evaluation selection methods.
See sel_updatefunc() for description of the parameters. data
should point to a t_methoddata_pos
.
Calculates the positions using t_methoddata_pos::pc
for the index group in t_methoddata_pos::g
and stores the results in out->u.p
.
|
static |
Frees the data allocated for position evaluation selection methods.
data | Data to free (should point to a t_methoddata_pos ). |
Frees the memory allocated for t_methoddata_pos::g
and t_methoddata_pos::pc
.
|
static |
Initializes the cog
selection method.
[in] | top | Topology data structure. |
[in] | npar | Not used. |
[in] | param | Not used. |
[in,out] | data | Should point to t_methoddata_pos . |
|
static |
Initializes the cog
selection method.
[in] | top | Topology data structure. |
[in] | npar | Not used. |
[in] | param | Not used. |
[in,out] | data | Should point to t_methoddata_pos . |
|
static |
Allocates data for position evaluation selection methods.
[in] | npar | Should be 1 or 2. |
[in,out] | param | Method parameters (should point to smparams_keyword_pos or smparams_com). |
t_methoddata_pos
).Allocates memory for a t_methoddata_pos
structure and initializes the first parameter to define the value for t_methoddata_pos::g
. If a second parameter is present, it is used for setting the t_methoddata_pos::bPBC
flag.
|
static |
Initializes position evaluation keywords.
[in] | top | Not used. |
[in] | npar | Not used. |
[in] | param | Not used. |
[in,out] | data | Should point to t_methoddata_pos . |
The t_methoddata_pos::type
field should have been initialized externally using _gmx_selelem_set_kwpos_type().
|
static |
Initializes output for position evaluation selection methods.
[in] | top | Topology data structure. |
[in,out] | out | Pointer to output data structure. |
[in,out] | data | Should point to t_methoddata_pos . |
|
static |
Updates selection method flags about required topology information.
Sets the flags to require topology and/or masses if the position calculation requires them.
|
static |
Sets the position calculation collection for position evaluation selection methods.
[in] | pcc | Position calculation collection to use. |
[in,out] | data | Should point to t_methoddata_pos . |
gmx_ana_selmethod_t sm_cog |
Selection method data for the cog
method.
gmx_ana_selmethod_t sm_com |
Selection method data for the com
method.
gmx_ana_selmethod_t sm_keyword_pos |
Selection method data for position keyword evaluation.
|
static |
Parameters for the cog
and com
selection methods.
|
static |
Parameters for position keyword evaluation.