Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TclFastPBC.C File Reference

#include <stdlib.h>
#include <stdio.h>
#include <tcl.h>
#include "TclCommands.h"
#include "AtomSel.h"
#include "VMDApp.h"
#include "MoleculeList.h"
#include "utilities.h"
#include "config.h"
#include "Atom.h"
#include "Molecule.h"
#include "Measure.h"
#include "FastPBC.h"

Go to the source code of this file.

Functions

int compoundmapper (int compound, Molecule *mol, AtomSel *sel, int *&indexlist, int *&fragmentmap)
int check_timesteps (Tcl_Interp *interp, Molecule *mol, int first, int last)
int fpbc_wrap (VMDApp *app, int argc, Tcl_Obj *const objv[], Tcl_Interp *interp)
int fpbc_unwrap (VMDApp *app, int argc, Tcl_Obj *const objv[], Tcl_Interp *interp)
int fpbc_join (VMDApp *app, int argc, Tcl_Obj *const objv[], Tcl_Interp *interp)
int fpbc_recenter (VMDApp *app, int argc, Tcl_Obj *const objv[], Tcl_Interp *interp)
int obj_fastpbc (ClientData cd, Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])


Function Documentation

int check_timesteps Tcl_Interp *    interp,
Molecule   mol,
int    first,
int    last
 

Definition at line 98 of file TclFastPBC.C.

References Timestep::a_length, Timestep::alpha, Timestep::b_length, Timestep::beta, Timestep::c_length, Timestep::gamma, DrawMolecule::get_frame, NULL, and DrawMolecule::numframes.

Referenced by fpbc_join, fpbc_recenter, fpbc_unwrap, and fpbc_wrap.

int compoundmapper int    compound,
Molecule   mol,
AtomSel   sel,
int *&    indexlist,
int *&    fragmentmap
[static]
 

Definition at line 40 of file TclFastPBC.C.

References Residue::atoms, BaseMolecule::fragment, BaseMolecule::nFragments, BaseMolecule::nResidues, ResizeArray< int >::num, AtomSel::on, BaseMolecule::residue, Fragment::residues, and AtomSel::selected.

Referenced by fpbc_join, fpbc_recenter, and fpbc_wrap.

int fpbc_join VMDApp   app,
int    argc,
Tcl_Obj *const    objv[],
Tcl_Interp *    interp
[static]
 

Join molecules/residues that were splitted due to PBC wrapping

## User Usage

 join <atom selection> [first <first frame ID>] [last <last frame ID>] [compound residue/fragment]
 

### User Options

| Keyword | Type | Value | -------------------- |:------: | --------------------------------------------------------------| | <**atom selection**> | object | An atom selection object created VMD **atomselect** command. | | **first** | int | The staring frame ID | | **last** | int | The last frame ID |

Definition at line 411 of file TclFastPBC.C.

References check_timesteps, compoundmapper, DrawMolecule::force_recalc, fpbc_exec_join, fpbc_exec_join_cpu, MoleculeList::mol_from_id, DrawMolItem::MOL_REGEN, VMDApp::moleculeList, AtomSel::molid, NULL, DrawMolecule::numframes, AtomSel::selected, strupncmp, and tcl_commands_get_sel.

Referenced by obj_fastpbc.

int fpbc_recenter VMDApp   app,
int    argc,
Tcl_Obj *const    objv[],
Tcl_Interp *    interp
[static]
 

Definition at line 486 of file TclFastPBC.C.

References check_timesteps, compoundmapper, AtomSel::firstsel, DrawMolecule::force_recalc, fpbc_exec_recenter, fpbc_exec_recenter_cpu, AtomSel::lastsel, BaseMolecule::mass, measure_error, MoleculeList::mol_from_id, DrawMolItem::MOL_REGEN, VMDApp::moleculeList, AtomSel::molid, NULL, DrawMolecule::numframes, AtomSel::on, AtomSel::selected, strupncmp, tcl_commands_get_sel, and tcl_get_weights.

Referenced by obj_fastpbc.

int fpbc_unwrap VMDApp   app,
int    argc,
Tcl_Obj *const    objv[],
Tcl_Interp *    interp
[static]
 

**Unwrap the molecule coordinates such that there are no jumps in the trajectory**.

## User Usage

  unwrap <atom selection> [first <first frame ID>] [last <last frame ID>]
 

### User Options | Keyword | Type | Value | -------------------- |:------: | --------------------------------------------------------------| | <**atom selection**> | object | An atom selection object created VMD **atomselect** command. | | **first** | int | The staring frame ID | | **last** | int | The last frame ID | | **compound** | string | Either "residue" or "fragment".
"residue" means the wrapping will be done by residue.
"fragment" means the wrapping will be donw by fragment
(i.e. a group of particles chemically bounded together). |

Parameters:
app  VMD application object that contains all the information about the current molecule object such as atomic coordinates.
argc  Total number of arguments, i.e. the length of array objv[]
objv  [] An array containging user-specified options with even number of elements (i.e. keyword-value pairs) Note: objv[0] should be one the fpbc keywords, e.g. wrap, join.
interp  Tcl interpreter object
Returns:
**TCL_OK**: (Tcl's C enum type) a flag meaning everything was okay;
**TCL_ERROR**: (Tcl's C enum type) a flag indicating the case where user specified illegal options

Definition at line 326 of file TclFastPBC.C.

References check_timesteps, AtomSel::firstsel, DrawMolecule::force_recalc, fpbc_exec_unwrap, fpbc_exec_unwrap_cpu, AtomSel::lastsel, MoleculeList::mol_from_id, DrawMolItem::MOL_REGEN, VMDApp::moleculeList, AtomSel::molid, NULL, DrawMolecule::numframes, AtomSel::on, AtomSel::selected, strupncmp, and tcl_commands_get_sel.

Referenced by obj_fastpbc.

int fpbc_wrap VMDApp   app,
int    argc,
Tcl_Obj *const    objv[],
Tcl_Interp *    interp
[static]
 

**Wrap all the molecule within the unit cell**.

## User Usage

 fpbc wrap <atom selection> [first <first frame ID>] [last <last frame ID>] [center [list x y z]]
      [centersel <atom selection>] [compound "residue"/"fragment"]
 

### User Options | Keyword | Type | Value | -------------------- |:------: | --------------------------------------------------------------| | <**atom selection**> | object | An atom selection object created VMD **atomselect** command. | | **first** | int | The staring frame ID | | **last** | int | The last frame ID | | **center** | list of float| The 3D coordinate of the point around which everything is wrapped.| | **centersel** | object | An atom selection object created VMD **atomselect** command.
Note: if the atom selection represents a range (e.g. "within 5 of index 0"),
this atom selection will not be updated inside **fpbc wrap**.| | **compound** | string | Either "residue" or "fragment".
"residue" means the wrapping will be done by residue.
"fragment" means the wrapping will be donw by fragment
(i.e. a group of particles chemically bounded together). |

Parameters:
app  VMD application object that contains all the information about the current molecule object such as atomic coordinates.
argc  Total number of arguments, i.e. the length of array objv[]
objv  [] An array containging user-specified options with even number of elements (i.e. keyword-value pairs) Note: objv[0] should be one the fpbc keywords, e.g. wrap, join.
interp  Tcl interpreter object
Returns:
**TCL_OK**: (Tcl's C enum type) a flag meaning everything was okay;
**TCL_ERROR**: (Tcl's C enum type) a flag indicating the case where user specified illegal options

Definition at line 152 of file TclFastPBC.C.

References check_timesteps, compoundmapper, AtomSel::firstsel, DrawMolecule::force_recalc, fpbc_exec_wrapatomic, fpbc_exec_wrapatomic_cpu, fpbc_exec_wrapcompound, fpbc_exec_wrapcompound_cpu, AtomSel::lastsel, BaseMolecule::mass, measure_error, MoleculeList::mol_from_id, DrawMolItem::MOL_REGEN, VMDApp::moleculeList, AtomSel::molid, NULL, DrawMolecule::numframes, AtomSel::on, AtomSel::selected, strupncmp, tcl_commands_get_sel, and tcl_get_weights.

Referenced by obj_fastpbc.

int obj_fastpbc ClientData    cd,
Tcl_Interp *    interp,
int    argc,
Tcl_Obj *const    objv[]
 

The interface between user and Fast PBC module (works as a controller)

Function obj_fastpbc() trys to find the content of the first user argument given to fpbc (i.e. objv[0]) and decide which sub-function to call e.g. "wrap", "unwrap", "join".

## Implementation Call VMD's function **strupncmp()** (case-insensitive string comparison) to find which sub-function the user want to call.

Definition at line 614 of file TclFastPBC.C.

References fpbc_join, fpbc_recenter, fpbc_unwrap, fpbc_wrap, NULL, and strupncmp.


Generated on Thu Apr 18 02:46:14 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002