16#ifndef SEAMS_SMOOTH_CV_H_
17#define SEAMS_SMOOTH_CV_H_
147 std::vector<std::array<int, 2>>
edges;
170 return ringOff[
static_cast<std::size_t
>(k) + 1] -
ringOff[
static_cast<std::size_t
>(k)];
173 [[nodiscard]]
int edgeOf(
int i,
int j)
const;
189 const std::vector<double> &wbar, std::vector<double> &sbar);
195 const std::vector<double> &w, std::vector<double> *sbar,
196 std::vector<double> *wbar);
205 const std::vector<double> &pbar, std::vector<double> &wbar);
238 void rebuild(
const Cloud &cloud, std::vector<int> selected,
double skin);
240 [[nodiscard]]
bool built()
const {
return built_; }
244 [[nodiscard]]
int maxRing()
const {
return maxRing_; }
245 [[nodiscard]]
int stateCount()
const {
return static_cast<int>(states_.size()); }
261 void addClause(
int state,
Kind kind,
int arg,
double threshold,
double width,
bool above);
277 void edgeWeights(
const Cloud &cloud);
278 double channel(
const Cloud &cloud,
Kind kind,
int arg, std::vector<double> *grad);
279 double gyration(
const Cloud &cloud,
bool volume,
int arg, std::vector<double> *grad);
280 void stateValues(
const Cloud &cloud, std::vector<double> &chi,
281 std::vector<std::vector<double>> *grads);
282 void edgesToAtoms(
const std::vector<double> &sbar, std::vector<double> &grad)
const;
288 std::vector<int> selected_;
289 std::vector<double> reference_;
290 std::vector<int> types_;
291 std::vector<double> box_;
292 std::vector<double> boxLow_;
294 std::vector<std::vector<Clause>> states_;
295 std::vector<double> s_;
296 std::vector<double> ds_;
297 std::vector<std::array<double, 3>> unit_;
const Topology & topology() const
const RationalSwitch & switching() const
void addClause(int state, Kind kind, int arg, double threshold, double width, bool above)
double value(const Cloud &cloud, Kind kind, int arg, double *grad)
Workspace(const RationalSwitch &sw, int maxRing)
void checkKind(Kind kind, int arg) const
bool stale(const Cloud &cloud) const
void rebuild(const Cloud &cloud, std::vector< int > selected, double skin)
void states(const Cloud &cloud, double *chi, double *grad)
The main molecular system handler.
Functions for bond-related analyses.
Smooth collective variables on the primitive-ring network.
RationalSwitch makeSwitch(double r0, double d0, int n, int m, double dOn, double dMax)
constexpr int kMaxSwitchExponent
constexpr int kMaxShortcutPaths
std::vector< double > ringParticipation(const Topology &topo, const std::vector< double > &w, int size)
constexpr double kFlatEigenRatio
Kind
The collective variables of one frame, with their gradients.
void ringParticipationAdjoint(const Topology &topo, const std::vector< double > &w, int size, const std::vector< double > &pbar, std::vector< double > &wbar)
Adds d(sum_i pbar[i] p[i]) / dw to wbar.
constexpr std::int64_t kMaxShortcutSearchSteps
void ringWeightsAdjoint(const Topology &topo, const std::vector< double > &s, const std::vector< double > &wbar, std::vector< double > &sbar)
Adds d(sum_k wbar[k] w[k]) / ds to sbar.
constexpr std::int64_t kMaxRingSearchSteps
std::vector< double > ringWeights(const Topology &topo, const std::vector< double > &s)
Ring weights for bond weights s, one per edge.
Topology buildTopology(const std::vector< std::vector< int > > &rows, int maxRing)
double hexBasalPairs(const Topology &topo, const std::vector< double > &s, const std::vector< double > &w, std::vector< double > *sbar, std::vector< double > *wbar)
constexpr int kMaxCandidateRings
molSys::PointCloud< molSys::Point< double >, double > Cloud
This contains a collection of points; contains information for a particular frame.
PLUMED RATIONAL switching function times a C2 taper.
double operator()(double r, double &dsdr) const
Two vertex-disjoint candidate hexagons a < b that may pass the HC basal test.
Candidate rings, shortcut paths and hexagon pairs of one graph.
std::vector< int > ringEdges
std::vector< int > pathEdgeOff
std::vector< int > ringOff
std::vector< int > adjEdge
std::vector< int > adjAtom
int edgeOf(int i, int j) const
Edge id of the pair (i, j), or -1.
std::vector< int > adjOff
int ringSize(int k) const
std::vector< HexPair > hexPairs
std::vector< int > pathOff
std::vector< int > pathEdges
std::vector< std::array< int, 2 > > edges
std::vector< int > ringAtoms