STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::structure::AtomMask Class Reference

An atom selection within a system. Internally, this stores a bitmask, one bit for every particle, to denote whether it is in the mask. The object also stores the original string upon which the mask was constructed and a description of the mask, as it is a significant computation to build. More...

#include <atommask.h>

Public Member Functions

MaskTraversalMode getRecommendation () const
 Get the recommendation for scanning this mask.
 
const std::vector< uint > & getRawMask () const
 Get the raw mask as a vector of unsigned long integers (bit strings storing whether each atom is masked at one atom per bit)
 
int getMaskedAtomCount () const
 Get a count of the number of masked atoms.
 
std::vector< bool > getMask () const
 Get the mask as a vector of boolean values (not just a bit mask as the object stores privately)
 
std::vector< int > getMaskedAtomList () const
 
std::vector< int2getSegments () const
 Get the segments of atoms over which the mask applies (only filled out if the recommended scanning method is by segment)
 
std::string getInputText () const
 Get the input text used to generate this atom mask.
 
MaskInputMode getInputKind () const
 Get the input text mode, e.g. AMBMASK to indicate that an Amber-style atom mask string was used to make this mask.
 
std::string getDescription () const
 Get the description of the mask, if provided.
 
const AtomGraphgetTopologyPointer () const
 Get a pointer to the topology that this mask describes.
 
 AtomMask (const AtomGraph *ag_in=nullptr)
 Constructor takes a mask string, topology, and coordinates.
 
 AtomMask (const std::string &input_text_in, const AtomGraph *ag_in, const ChemicalFeatures &chemfe, const CoordinateFrameReader &cfr, MaskInputMode mode=MaskInputMode::AMBMASK, const std::string &description_in=std::string("No description provided"))
 
 AtomMask (const std::string &input_text_in, const AtomGraph *ag_in, const ChemicalFeatures &chemfe, const CoordinateFrame &cf, MaskInputMode mode=MaskInputMode::AMBMASK, const std::string &description_in=std::string("No description provided"))
 
 AtomMask (const std::string &input_text_in, const AtomGraph *ag_in, const ChemicalFeatures &chemfe, const PhaseSpace &ps, MaskInputMode mode=MaskInputMode::AMBMASK, const std::string &description_in=std::string("No description provided"))
 
 AtomMask (const AtomMask &original)=default
 
 AtomMask (AtomMask &&original)=default
 
bool isAtomInMask (const char4 atom_name) const
 Answer whether an atom is in the mask.
 
bool isAtomInMask (const char4 res_name, const char4 atom_name) const
 
bool isAtomInMask (int atom_index) const
 
void addAtoms (const std::vector< int > &new_indices, ExceptionResponse policy=ExceptionResponse::DIE)
 Add atoms to the atom mask.
 
void addAtoms (const std::vector< char4 > &new_names)
 
void addAtoms (const AtomMask &new_mask, const CoordinateFrame &cf, const ChemicalFeatures &chemfe)
 
void addAtoms (const std::string &new_mask, const CoordinateFrame &cf, const ChemicalFeatures &chemfe)
 
void addAtoms (const AtomMask &new_mask, const CoordinateFrame &cf)
 
void addAtoms (const std::string &new_mask, const CoordinateFrame &cf)
 

Detailed Description

An atom selection within a system. Internally, this stores a bitmask, one bit for every particle, to denote whether it is in the mask. The object also stores the original string upon which the mask was constructed and a description of the mask, as it is a significant computation to build.

Constructor & Destructor Documentation

◆ AtomMask() [1/2]

stormm::chemistry::AtomMask::AtomMask ( const AtomGraph * ag_in = nullptr)

Constructor takes a mask string, topology, and coordinates.

Overloaded:

  • Blank constructor (build later from a provided topology and optional coordinates)
  • Require no coordinates (only valid if the mask has no range operators)
  • Take coordinates as a PhaseSpace object
  • Take coordinates as a CoordinateFrame object
  • Take coordinates as three std::vectors for Cartesian X, Y, and Z positions, with or without unit cell transforms (if the transform vectors do not exist, the system is assumed to have isolated boundary conditions)
  • Take coordinates as three C-style arrays, with unit cell transforms (if the transform arrays are nullptr, the system is assumed to exist in isolated boundary conditions)
Parameters
input_text_inThe mask string
ag_inSystem topology
chemfeChemical features computed for the topology
crdCoordinates obtained from a CoordinateFrame object
xcrdCartesian X coordinates of all atoms
ycrdCartesian Y coordinates of all atoms
zcrdCartesian Z coordinates of all atoms
description[Optional] description of the mask and its purpose

◆ AtomMask() [2/2]

stormm::chemistry::AtomMask::AtomMask ( const AtomMask & original)
default

The standard copy and move constructors will be effective for this object, which has no pointers to repair. Because there is a const member, the copy and move assignment operators will be implicitly deleted.

Member Function Documentation

◆ addAtoms()

void stormm::chemistry::AtomMask::addAtoms ( const std::vector< int > & new_indices,
ExceptionResponse policy = ExceptionResponse::DIE )

Add atoms to the atom mask.

Overloaded:

  • Add a series of atom indices, with indexing beginning at 0.
  • Add a series of atom names. All examples of any supplied name will be matched and added to the mask (an O(NM) operation for N atom names and a topology of M atoms)
  • Add the atoms of another mask (the topologies will be checked for a reasonable degree of congruity)
  • Add atoms implied by another mask string.
  • Supply the system's pre-computed chemical features, or have it constructed temporarily.
Parameters
new_indicesThe atom indices to add to the current mask
new_namesThe names of atoms to add to the current mask
new_maskAnother atom mask (or mask string) to add to the current mask
policyThe policy to take in the event that an error is encountered

◆ isAtomInMask()

bool stormm::chemistry::AtomMask::isAtomInMask ( const char4 atom_name) const

Answer whether an atom is in the mask.

Overloaded:

  • Provide the atom name only (any instance of the atom name found in the mask will suffice to say that an atom with the specified name is present in the mask)
  • Provide the atom residue name and atom name (any instance of an atom conforming to this pair of names will result in the function returning TRUE)
  • Provide the atom index number (indexing starting at zero)
Parameters
atom_nameName of the atom of interest
res_nameName of the residue of interest
atom_indexTopological index number of the atom of interest

The documentation for this class was generated from the following files: