STORMM Source Documentation
Loading...
Searching...
No Matches
nml_restraint.h
1// -*-c++-*-
2#ifndef STORMM_NML_RESTRAINT_H
3#define STORMM_NML_RESTRAINT_H
4
5#include "copyright.h"
6#include "input.h"
7#include "namelist_emulator.h"
8#include "namelist_enumerators.h"
9#include "Chemistry/chemical_features.h"
10#include "Parsing/textfile.h"
11#include "Restraints/bounded_restraint.h"
12#include "Restraints/restraint_enumerators.h"
13#include "Topology/atomgraph.h"
14#include "Topology/atomgraph_abstracts.h"
15#include "Trajectory/coordinateframe.h"
16#include "Trajectory/phasespace.h"
17
18namespace stormm {
19namespace namelist {
20
21using chemistry::ChemicalFeatures;
22using parse::WrapTextSearch;
23using restraints::BoundedRestraint;
24using restraints::RestraintEnsemble;
25using topology::AtomGraph;
26using topology::NonbondedKit;
27using trajectory::CoordinateFrame;
28using trajectory::CoordinateFrameReader;
29using trajectory::PhaseSpace;
30
33constexpr char default_heavy_atom_mask[] = "@/2-200";
34constexpr double default_restraint_ensemble_penalty = 1.0;
35constexpr double default_restraint_ensemble_half_width = 0.0;
36constexpr double default_restraint_ensemble_hbond_proximity = 3.0;
37constexpr double default_restraint_ensemble_distance_cutoff = 6.0;
39
43public:
44
55 RestraintControls(ExceptionResponse policy_in = ExceptionResponse::DIE);
56
57 RestraintControls(const TextFile &tf, int *start_line, bool *found_nml,
58 ExceptionResponse policy_in = ExceptionResponse::DIE,
59 WrapTextSearch wrap = WrapTextSearch::NO);
61
65 RestraintControls(const RestraintControls &original) = default;
66 RestraintControls(RestraintControls &&original) = default;
67 RestraintControls& operator=(const RestraintControls &original) = default;
68 RestraintControls& operator=(RestraintControls &&original) = default;
70
73 int getOrder() const;
74
76 std::string getSystemLabel() const;
77
96 std::vector<BoundedRestraint> getRestraint(const AtomGraph *ag, const ChemicalFeatures &chemfe,
97 const CoordinateFrameReader &cf) const;
98
99 std::vector<BoundedRestraint> getRestraint(const AtomGraph *ag, const ChemicalFeatures &chemfe,
100 const CoordinateFrame &cf) const;
101
102 std::vector<BoundedRestraint> getRestraint(const AtomGraph *ag, const ChemicalFeatures &chemfe,
103 const PhaseSpace &ps) const;
105
107 const NamelistEmulator& getTranscript() const;
108
109private:
110
111 // General information about the status of the restraint
112 ExceptionResponse policy;
113 bool restraint_is_valid;
114 std::string system;
116 RestraintEnsemble domain;
119
120 // Parameters for a typical Amber flat-bottom well NMR restraint applied to specific atoms
121 std::string mask_i;
122 std::string mask_j;
123 std::string mask_k;
124 std::string mask_l;
125 std::string ensemble_mask;
127 int atom_i;
128 int atom_j;
129 int atom_k;
130 int atom_l;
131 int order;
134 int initiation_step;
135 int maturation_step;
136 double initial_k2;
137 double initial_k3;
138 double initial_r1;
139 double initial_r2;
140 double initial_r3;
141 double initial_r4;
142 double mature_k2;
143 double mature_k3;
144 double mature_r1;
145 double mature_r2;
146 double mature_r3;
147 double mature_r4;
148 double3 initial_crd;
149 double3 mature_crd;
150
151 // Parameters for ensembles of restraints
152 double penalty;
153 double flat_bottom_half_width;
154 double cutoff;
156 double proximity;
159
161 NamelistEmulator nml_transcript;
162
164 RestraintAnchoring getAtomSpecification() const;
165
169 void enforceSpecification();
170
185 void checkFinalRestraintSettings(bool nstep1_found, bool r2a_found, bool r3a_found,
186 bool k2a_found, bool k3a_found, int starting_line,
187 const std::string &filename);
188};
189
202NamelistEmulator restraintInput(const TextFile &tf, int *start_line, bool *found,
203 ExceptionResponse policy = ExceptionResponse::DIE,
204 WrapTextSearch wrap = WrapTextSearch::NO);
205
206} // namespace namelist
207} // namespace stormm
208
209#endif
An object to store information about chemical motifs: participation in rings, planarity,...
Definition chemical_features.h:400
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
const NamelistEmulator & getTranscript() const
Get the original namelist emulator object as a transcript of the user input.
Definition nml_restraint.cpp:558
std::vector< BoundedRestraint > getRestraint(const AtomGraph *ag, const ChemicalFeatures &chemfe, const CoordinateFrameReader &cf) const
Get the restraint specified by this namelist. There are no other getter functions for individual deta...
Definition nml_restraint.cpp:489
RestraintControls(const RestraintControls &original)=default
As with other control objects, copy and move constructors, plus copy and move assignment operators,...
std::string getSystemLabel() const
Get the system label, to indicate which system(s) this restraint applies to.
Definition nml_restraint.cpp:483
int getOrder() const
Get the order of the restraint. If the object describes a collection (ensemble) of restraints,...
Definition nml_restraint.cpp:469
RestraintControls(ExceptionResponse policy_in=ExceptionResponse::DIE)
The constructor can prepare an object with default settings or read the corresponding namelist to acc...
Definition nml_restraint.cpp:24
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45
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:117
Collect C-style pointers for the elements of a read-only CoordinateFrame object.
Definition coordinateframe.h:65