2#ifndef STORMM_AMBMASK_H
3#define STORMM_AMBMASK_H
9#include "Constants/behavior.h"
10#include "Topology/atomgraph.h"
11#include "Trajectory/coordinateframe.h"
12#include "Trajectory/phasespace.h"
13#include "chemical_features.h"
18using constants::ExceptionResponse;
19using parse::WildCardKind;
20using topology::AtomGraph;
21using trajectory::CoordinateFrame;
22using trajectory::PhaseSpace;
26enum class MaskOperator {
43enum class SelectionItemKind {
76 const std::vector<WildCardKind> &wildcards_in);
77 SelectionItem(
const SelectionItemKind kind_in,
const int begin_in,
const int end_in = INT_MIN);
89enum class MaskComponentKind {
114 MaskComponent(MaskOperator op_in,
const std::string &basis_in,
int start_idx,
int end_idx);
115 MaskComponent(MaskOperator op_in,
double range,
const std::string &basis_in,
int start_idx,
120 MaskComponent(
const std::vector<uint> &primitive_mask_in,
const std::string &basis_in,
121 int start_idx,
int end_idx);
125 MaskComponentKind
getKind()
const;
131 std::vector<uint>
getMask()
const;
169 MaskComponentKind kind;
172 std::vector<uint> primitive_mask;
173 std::string text_basis;
182enum class MaskTraversalMode {
190enum class MaskInputMode {
228 MaskInputMode mode = MaskInputMode::AMBMASK,
229 const std::string &description_in = std::string(
"No description provided"));
233 MaskInputMode mode = MaskInputMode::AMBMASK,
234 const std::string &description_in = std::string(
"No description provided"));
238 MaskInputMode mode = MaskInputMode::AMBMASK,
239 const std::string &description_in = std::string(
"No description provided"));
262 std::vector<bool>
getMask()
const;
265 std::vector<int> getMaskedAtomList()
const;
318 void addAtoms(
const std::vector<int> &new_indices,
319 ExceptionResponse policy = ExceptionResponse::DIE);
321 void addAtoms(
const std::vector<char4> &new_names);
335 MaskTraversalMode recommended_scan;
337 int masked_atom_count;
338 std::vector<uint> raw_mask;
339 std::vector<int2> segments;
340 std::string input_text;
342 std::string description;
352 double extractRangeValue(
int start_char,
int final_char,
int *position);
361 std::vector<SelectionItem> evaluateInclusions(
const std::string &inclusion_list);
368 std::vector<uint> parseMask(
const std::vector<int> &scope_levels,
int *position,
const AtomGraph * getTopologyPointer() const
Get a pointer to the topology that this mask describes.
Definition atommask.cpp:597
MaskInputMode getInputKind() const
Get the input text mode, e.g. AMBMASK to indicate that an Amber-style atom mask string was used to ma...
Definition atommask.cpp:587
int getMaskedAtomCount() const
Get a count of the number of masked atoms.
Definition atommask.cpp:546
MaskTraversalMode getRecommendation() const
Get the recommendation for scanning this mask.
Definition atommask.cpp:536
AtomMask(const AtomMask &original)=default
AtomMask(const AtomGraph *ag_in=nullptr)
Constructor takes a mask string, topology, and coordinates.
Definition atommask.cpp:462
void addAtoms(const std::vector< int > &new_indices, ExceptionResponse policy=ExceptionResponse::DIE)
Add atoms to the atom mask.
Definition atommask.cpp:641
std::vector< int2 > getSegments() const
Get the segments of atoms over which the mask applies (only filled out if the recommended scanning me...
Definition atommask.cpp:577
std::string getDescription() const
Get the description of the mask, if provided.
Definition atommask.cpp:592
const std::vector< uint > & getRawMask() const
Get the raw mask as a vector of unsigned long integers (bit strings storing whether each atom is mask...
Definition atommask.cpp:541
std::vector< bool > getMask() const
Get the mask as a vector of boolean values (not just a bit mask as the object stores privately)
Definition atommask.cpp:551
bool isAtomInMask(const char4 atom_name) const
Answer whether an atom is in the mask.
Definition atommask.cpp:602
std::string getInputText() const
Get the input text used to generate this atom mask.
Definition atommask.cpp:582
An object to store information about chemical motifs: participation in rings, planarity,...
Definition chemical_features.h:400
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....
Definition atommask.cpp:297
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.
Definition atommask.cpp:50
std::string getText() const
Get the textual basis of this mask component.
Definition atommask.cpp:266
MaskOperator getOperator() const
Get the operator, if relevant.
Definition atommask.cpp:250
std::vector< uint > getMask() const
Get the bitmask, if relevant.
Definition atommask.cpp:258
int2 getTextLimits() const
Get the indices from within the original mask string where this component's textual basis is to be fo...
Definition atommask.cpp:271
MaskComponentKind getKind() const
Get the kind of component.
Definition atommask.cpp:245
void applyOrOperator(const std::vector< uint > &other)
Apply the OR operator to a primitive mask, given another primitive mask.
Definition atommask.cpp:290
void applyAndOperator(const std::vector< uint > &other)
Apply the AND operator to a primitive mask, given another primitive mask.
Definition atommask.cpp:283
void applyNotOperator()
Apply the NOT operator to a primitive mask.
Definition atommask.cpp:276
SelectionItem(const SelectionItemKind kind_in, const char4 name_in, const std::vector< WildCardKind > &wildcards_in)
Initialization for this struct makes it simpler to create an array of such objects and be assured tha...
Definition atommask.cpp:30
char4 name
Definition atommask.h:81
int scan_begin
Point at which to begin the scan.
Definition atommask.h:84
SelectionItemKind kind
Indicates the type of selection, i.e. atom name.
Definition atommask.h:80
std::vector< WildCardKind > wildcards
Indicators of wildcards in the name.
Definition atommask.h:83
int scan_end
Point at which to end the scan.
Definition atommask.h:85
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
Store the coordinates and box information for a frame, only. This abridged struct can serve when the ...
Definition coordinateframe.h:111
An object to complement a topology and hold positions, velocities, and forces of all particles in a s...
Definition phasespace.h:141
Definition stormm_vector_types.h:141
Definition stormm_vector_types.h:22
Collect C-style pointers for the elements of a read-only CoordinateFrame object.
Definition coordinateframe.h:65