STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::chemistry::MaskComponent Class Reference

A mask is a series of operators and more primitive masks. This struct comprises both things, with an indicator as to what it contains. A complete mask for a given scope is composed by stepping through a list of these objects. More...

#include <atommask.h>

Public Member Functions

MaskComponentKind getKind () const
 Get the kind of component.
 
MaskOperator getOperator () const
 Get the operator, if relevant.
 
std::vector< uint > getMask () const
 Get the bitmask, if relevant.
 
std::string getText () const
 Get the textual basis of this mask component.
 
int2 getTextLimits () const
 Get the indices from within the original mask string where this component's textual basis is to be found.
 
void applyNotOperator ()
 Apply the NOT operator to a primitive mask.
 
void applyAndOperator (const std::vector< uint > &other)
 Apply the AND operator to a primitive mask, given another primitive mask.
 
void applyOrOperator (const std::vector< uint > &other)
 Apply the OR operator to a primitive mask, given another primitive mask.
 
MaskComponent applyRangeOperator (const std::vector< uint > &other, const AtomGraph *ag, const CoordinateFrameReader &cfr)
 Apply one of the ranged operators. This will produce a new MASK-kind MaskComponent. Ranged operators are expected to occur last in their scopes. Once the scope is broken into MaskComponents of operators and other masks, the list is processed by applying operators to eliminate MaskComponents until there is a single MASK-kind MaskComponent left. With range operators, the list whittles down to a MASK-kind followed by an OPERATOR MaskComponent. Both of these will be eliminated after the output of this function is tacked onto the end of the list, where it will then become the only element.
 
 MaskComponent (MaskOperator op_in, const std::string &basis_in, int start_idx, int end_idx)
 Constructor takes either an operator designation or a series of atoms or residues.
 
 MaskComponent (MaskOperator op_in, double range, const std::string &basis_in, int start_idx, int end_idx)
 
 MaskComponent (const std::vector< SelectionItem > &parts_in, const AtomGraph *ag, const ChemicalFeatures &chemfe, const std::string &basis_in, int start_idx, int end_idx)
 
 MaskComponent (const std::vector< uint > &primitive_mask_in, const std::string &basis_in, int start_idx, int end_idx)
 

Detailed Description

A mask is a series of operators and more primitive masks. This struct comprises both things, with an indicator as to what it contains. A complete mask for a given scope is composed by stepping through a list of these objects.

Constructor & Destructor Documentation

◆ MaskComponent()

stormm::chemistry::MaskComponent::MaskComponent ( MaskOperator op_in,
const std::string & basis_in,
int start_idx,
int end_idx )

Constructor takes either an operator designation or a series of atoms or residues.

Overloaded:

  • Build a basic "&", "|", or "!" operator component
  • Build a ranged operator component
  • Build a primitive mask component from a list of named or numbered atoms or residues
  • Take a primitive mask component output by a recursive call to parseMask and store it
Parameters
op_inOperator designation
parts_inA series of atom or residue names and indices to find
agSystem topology containing atom and residue names and indices
primitive_mask_inBit mask for all atoms, as output by parseMask (see below)

Member Function Documentation

◆ applyAndOperator()

void stormm::chemistry::MaskComponent::applyAndOperator ( const std::vector< uint > & other)

Apply the AND operator to a primitive mask, given another primitive mask.

Parameters
otherPre-determined primitive mask of atoms

◆ applyOrOperator()

void stormm::chemistry::MaskComponent::applyOrOperator ( const std::vector< uint > & other)

Apply the OR operator to a primitive mask, given another primitive mask.

Parameters
otherPre-determined primitive mask of atoms

◆ applyRangeOperator()

MaskComponent stormm::chemistry::MaskComponent::applyRangeOperator ( const std::vector< uint > & other,
const AtomGraph * ag,
const CoordinateFrameReader & cfr )

Apply one of the ranged operators. This will produce a new MASK-kind MaskComponent. Ranged operators are expected to occur last in their scopes. Once the scope is broken into MaskComponents of operators and other masks, the list is processed by applying operators to eliminate MaskComponents until there is a single MASK-kind MaskComponent left. With range operators, the list whittles down to a MASK-kind followed by an OPERATOR MaskComponent. Both of these will be eliminated after the output of this function is tacked onto the end of the list, where it will then become the only element.

Parameters
otherPre-determined primitive mask of atoms
agPointer to the original topology
cfrCoordinates of the system

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