Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
colvarcomp.h
1// -*- c++ -*-
2
3// This file is part of the Collective Variables module (Colvars).
4// The original version of Colvars and its updates are located at:
5// https://github.com/Colvars/colvars
6// Please update all Colvars source files before making any changes.
7// If you wish to distribute your changes, please submit them to the
8// Colvars repository at GitHub.
9
10#ifndef COLVARCOMP_H
11#define COLVARCOMP_H
12
13// Declaration of colvar::cvc base class and derived ones.
14//
15// Future cvc's could be declared on additional header files.
16// After the declaration of a new derived class, its metric
17// functions must be reimplemented as well.
18// If the new cvc has no symmetry or periodicity,
19// this can be done straightforwardly by using the macro:
20// simple_scalar_dist_functions (derived_class)
21
22#include <memory>
23
24#include "colvarmodule.h"
25#include "colvaratoms.h"
26#include "colvar.h"
27#include "colvar_geometricpath.h"
28
29
67
69 : public colvarparse, public colvardeps
70{
71public:
72
75 std::string name;
76
78 std::string function_type() const;
79
81 std::string config_key;
82
85
87 int sup_np = 1;
88
91
94
96 cvc();
97
99 virtual ~cvc();
100
104 virtual int init(std::string const &conf);
105
107 virtual int init_dependencies();
108
110 int setup();
111
113 virtual const std::vector<feature *> &features() const
114 {
115 return cvc_features;
116 }
117
118 virtual std::vector<feature *> &modify_features()
119 {
120 return cvc_features;
121 }
122
123 static void delete_features() {
124 for (size_t i=0; i < cvc_features.size(); i++) {
125 delete cvc_features[i];
126 }
127 cvc_features.clear();
128 }
129
131 virtual std::vector<std::vector<int> > get_atom_lists();
132
134 virtual void read_data();
135
137 virtual void calc_value() = 0;
138
141 virtual void calc_gradients() {}
142
144 void calc_fit_gradients();
145
147 virtual void debug_gradients();
148
151 virtual void collect_gradients(std::vector<int> const &atom_ids, std::vector<cvm::rvector> &atomic_gradients);
152
155 virtual void calc_force_invgrads();
156
158 virtual void calc_Jacobian_derivative();
159
160
162 colvarvalue const & value() const;
163
165 colvarvalue const & total_force() const;
166
169 colvarvalue const & Jacobian_derivative() const;
170
180 virtual void apply_force(colvarvalue const &cvforce);
181
200 virtual cvm::real dist2(colvarvalue const &x1,
201 colvarvalue const &x2) const;
202
206 virtual colvarvalue dist2_lgrad(colvarvalue const &x1,
207 colvarvalue const &x2) const;
208
212 virtual colvarvalue dist2_rgrad(colvarvalue const &x1,
213 colvarvalue const &x2) const;
214
216 virtual void wrap(colvarvalue &x_unwrapped) const;
217
220 std::vector<cvm::atom_group *> atom_groups;
221
224
226 virtual colvarvalue const *get_param_grad(std::string const &param_name);
227
229 virtual int set_param(std::string const &param_name, void const *new_value);
230
232 bool b_try_scalable = true;
233
236 inline void set_value(colvarvalue const &new_value) {
237 x = new_value;
238 }
239
240protected:
241
243 int set_function_type(std::string const &type);
244
246 int update_description();
247
249 cvm::atom_group *parse_group(std::string const &conf, char const *group_key,
250 bool optional = false);
251
253 virtual int init_total_force_params(std::string const &conf);
254
256 static std::vector<feature *> cvc_features;
257
259 std::vector<std::string> function_types;
260
263
266
272
276
278 void init_as_distance();
279
281 void init_as_angle();
282
285
288
291
294
297};
298
299
300inline colvarvalue const & colvar::cvc::value() const
301{
302 return x;
303}
304
305
307{
308 return ft;
309}
310
311
313{
314 return jd;
315}
316
317
318
321
323 : public colvar::cvc
324{
325protected:
332public:
333 distance();
334 virtual ~distance() {}
335 virtual int init(std::string const &conf);
336 virtual void calc_value();
337 virtual void calc_gradients();
338 virtual void calc_force_invgrads();
339 virtual void calc_Jacobian_derivative();
340};
341
342
343
344// \brief Colvar component: distance vector between centers of mass
345// of two groups (\link colvarvalue::type_3vector \endlink type,
346// range (-*:*)x(-*:*)x(-*:*))
348 : public colvar::distance
349{
350public:
351 distance_vec();
352 virtual ~distance_vec() {}
353 virtual void calc_value();
354 virtual void calc_gradients();
355 virtual void apply_force(colvarvalue const &force);
357 virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const;
359 virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const;
361 virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const;
363 virtual void wrap(colvarvalue &x_unwrapped) const;
364};
365
366
371 : public colvar::distance
372{
373public:
374 distance_dir();
375 virtual ~distance_dir() {}
376 virtual void calc_value();
377 virtual void calc_gradients();
378 virtual void apply_force(colvarvalue const &force);
380 virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const;
382 virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const;
384 virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const;
386 virtual void wrap(colvarvalue &x_unwrapped) const;
387};
388
389
390
394 : public colvar::cvc
395{
396protected:
410 bool fixed_axis = true;
411public:
412 distance_z();
413 virtual ~distance_z() {}
414 virtual int init(std::string const &conf);
415 virtual void calc_value();
416 virtual void calc_gradients();
417 virtual void calc_force_invgrads();
418 virtual void calc_Jacobian_derivative();
419};
420
421
422
426 : public colvar::distance_z
427{
428protected:
433public:
434 distance_xy();
435 virtual ~distance_xy() {}
436 virtual void calc_value();
437 virtual void calc_gradients();
438 virtual void calc_force_invgrads();
439 virtual void calc_Jacobian_derivative();
440};
441
442
446 : public colvar::cvc
447{
448protected:
449 cvm::atom_group *atoms = nullptr;
450 cvm::real r, theta, phi;
451
452public:
453 polar_phi();
454 virtual ~polar_phi() {}
455 virtual int init(std::string const &conf);
456 virtual void calc_value();
457 virtual void calc_gradients();
458};
459
460
464 : public colvar::cvc
465{
466public:
467 polar_theta();
468 virtual ~polar_theta() {}
469 virtual int init(std::string const &conf);
470protected:
471 cvm::atom_group *atoms = nullptr;
472 cvm::real r, theta, phi;
473public:
474 virtual void calc_value();
475 virtual void calc_gradients();
476};
477
478
482 : public colvar::cvc
483{
484protected:
490 int exponent = 6;
491public:
492 distance_inv();
493 virtual ~distance_inv() {}
494 virtual int init(std::string const &conf);
495 virtual void calc_value();
496 virtual void calc_gradients();
497};
498
499
500
504 : public colvar::cvc
505{
506protected:
511public:
513 virtual ~distance_pairs() {}
514 virtual int init(std::string const &conf);
515 virtual void calc_value();
516 virtual void calc_gradients();
517 virtual void apply_force(colvarvalue const &force);
519 virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const;
521 virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const;
523 virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const;
525 virtual void wrap(colvarvalue &x_unwrapped) const;
526};
527
528
531 : public colvar::cvc
532{
533protected:
536 cvm::atom_pos dipoleV;
537public:
539 virtual ~dipole_magnitude() {}
540 virtual int init(std::string const &conf);
541 virtual void calc_value();
542 virtual void calc_gradients();
543};
544
545
546
550 : public colvar::cvc
551{
552protected:
555public:
556 gyration();
557 virtual ~gyration() {}
558 virtual int init(std::string const &conf);
559 virtual void calc_value();
560 virtual void calc_gradients();
561 virtual void calc_force_invgrads();
562 virtual void calc_Jacobian_derivative();
563};
564
565
566
570 : public colvar::gyration
571{
572public:
573 inertia();
574 virtual ~inertia() {}
575 virtual void calc_value();
576 virtual void calc_gradients();
577};
578
579
580
584 : public colvar::inertia
585{
586protected:
589public:
590 inertia_z();
591 virtual ~inertia_z() {}
592 virtual int init(std::string const &conf);
593 virtual void calc_value();
594 virtual void calc_gradients();
595};
596
597
598
602 : public colvar::cvc
603{
604protected:
605
608
610 std::vector<cvm::atom_pos> ref_pos;
611
613 std::vector<cvm::rvector> eigenvec;
614
617
618public:
619
620 eigenvector();
621 virtual ~eigenvector() {}
622 virtual int init(std::string const &conf);
623 virtual void calc_value();
624 virtual void calc_gradients();
625 virtual void calc_force_invgrads();
626 virtual void calc_Jacobian_derivative();
627};
628
629
630
634 : public colvar::cvc
635{
636protected:
637
644
651
655 bool b_1site_force = false;
656public:
657
658 angle();
660 angle(cvm::atom const &a1, cvm::atom const &a2, cvm::atom const &a3);
661 virtual ~angle() {}
662 virtual int init(std::string const &conf);
663 virtual void calc_value();
664 virtual void calc_gradients();
665 virtual void calc_force_invgrads();
666 virtual void calc_Jacobian_derivative();
667};
668
669
670
674 : public colvar::cvc
675{
676protected:
677
684
691
695 bool b_1site_force = false;
696public:
697
698 dipole_angle();
699 virtual ~dipole_angle() {}
700 virtual int init(std::string const &conf);
701 virtual void calc_value();
702 virtual void calc_gradients();
703};
704
705
706
710 : public colvar::cvc
711{
712protected:
713
723 cvm::rvector r12, r23, r34;
724
727 bool b_1site_force = false;
728
729public:
730
732 dihedral(cvm::atom const &a1, cvm::atom const &a2, cvm::atom const &a3, cvm::atom const &a4);
733 dihedral();
734 virtual ~dihedral() {}
735 virtual int init(std::string const &conf);
736 virtual void calc_value();
737 virtual void calc_gradients();
738 virtual void calc_force_invgrads();
739 virtual void calc_Jacobian_derivative();
740};
741
742
743
747 : public colvar::cvc
748{
749protected:
759 bool b_anisotropic = false;
761 int en = 6;
763 int ed = 12;
764
767
770
772 int pairlist_freq = 100;
773
775 bool *pairlist = nullptr;
776
777public:
778
779 coordnum();
780 virtual ~coordnum();
781 virtual int init(std::string const &conf);
782 virtual void calc_value();
783 virtual void calc_gradients();
784
785 enum {
786 ef_null = 0,
787 ef_gradients = 1,
788 ef_anisotropic = (1<<8),
789 ef_use_pairlist = (1<<9),
790 ef_rebuild_pairlist = (1<<10)
791 };
792
800 template<int flags>
802 cvm::rvector const &r0_vec,
803 int en,
804 int ed,
805 cvm::atom &A1,
806 cvm::atom &A2,
807 bool **pairlist_elem,
809
811 template<int flags> int compute_coordnum();
812
814 template<int flags> void main_loop(bool **pairlist_elem);
815
816};
817
818
819
823 : public colvar::cvc
824{
825protected:
826
832 int en = 6;
834 int ed = 12;
835 cvm::real tolerance = 0.0;
836 int pairlist_freq = 100;
837
838 bool *pairlist = nullptr;
839
840public:
841
842 selfcoordnum();
844 virtual int init(std::string const &conf);
845 virtual void calc_value();
846 virtual void calc_gradients();
847
849 template<int flags> int compute_selfcoordnum();
850};
851
852
853
857 : public colvar::distance
858{
859protected:
866 bool b_anisotropic = false;
868 int en = 6;
870 int ed = 12;
871public:
873 virtual ~groupcoordnum() {}
874 virtual int init(std::string const &conf);
875 virtual void calc_value();
876 virtual void calc_gradients();
877};
878
879
880
885 : public colvar::cvc
886{
887protected:
891 int en = 6;
893 int ed = 8;
894public:
896 h_bond(cvm::atom const &acceptor,
897 cvm::atom const &donor,
898 cvm::real r0, int en, int ed);
899 h_bond();
900 virtual ~h_bond() {}
901 virtual int init(std::string const &conf);
902 virtual void calc_value();
903 virtual void calc_gradients();
904};
905
906
912 : public colvar::cvc
913{
914protected:
915
918
921
923 std::vector<angle *> theta;
924
926 std::vector<h_bond *> hb;
927
930
933
935 int en = 6;
936
938 int ed = 8;
939
940public:
941
942 alpha_angles();
943 virtual ~alpha_angles();
944 virtual int init(std::string const &conf);
945 void calc_value();
946 void calc_gradients();
948 void collect_gradients(std::vector<int> const &atom_ids, std::vector<cvm::rvector> &atomic_gradients);
949 void apply_force(colvarvalue const &force);
950};
951
952
953
959 : public colvar::cvc
960{
961protected:
962
963 std::vector<dihedral *> theta;
964 std::vector<cvm::real> coeffs;
965
966public:
967
968 dihedPC();
969 virtual ~dihedPC();
970 virtual int init(std::string const &conf);
971 virtual void calc_value();
972 virtual void calc_gradients();
974 virtual void collect_gradients(std::vector<int> const &atom_ids, std::vector<cvm::rvector> &atomic_gradients);
975 virtual void apply_force(colvarvalue const &force);
976};
977
978
979
985 : public colvar::cvc
986{
987protected:
988
993
995 std::vector<cvm::atom_pos> ref_pos;
996
998 std::vector<cvm::atom_pos> shifted_pos;
999
1002
1006
1009 std::unique_ptr<rotation_derivative_impl_> rot_deriv_impl;
1010
1011public:
1012
1013 orientation();
1014 virtual ~orientation();
1015 virtual int init(std::string const &conf);
1016 virtual void calc_value();
1017 virtual void calc_gradients();
1018 virtual void apply_force(colvarvalue const &force);
1020 virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const;
1022 virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const;
1024 virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const;
1026 virtual void wrap(colvarvalue &x_unwrapped) const;
1027};
1028
1029
1034 : public colvar::orientation
1035{
1036public:
1037
1039 virtual ~orientation_angle() {}
1040 virtual void calc_value();
1041 virtual void calc_gradients();
1042 virtual void apply_force(colvarvalue const &force);
1044 virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const;
1046 virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const;
1048 virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const;
1050 virtual void wrap(colvarvalue &x_unwrapped) const;
1051};
1052
1053
1054
1060{
1061public:
1062
1064 virtual ~orientation_proj() {}
1065 virtual void calc_value();
1066 virtual void calc_gradients();
1067};
1068
1069
1070
1075{
1076protected:
1077
1078 cvm::rvector axis;
1079
1080public:
1081
1082 tilt();
1083 virtual ~tilt() {}
1084 virtual int init(std::string const &conf);
1085 virtual void calc_value();
1086 virtual void calc_gradients();
1087};
1088
1089
1090
1094 : public colvar::tilt
1095{
1096public:
1097
1098 spin_angle();
1099 virtual ~spin_angle() {}
1100 virtual void calc_value();
1101 virtual void calc_gradients();
1102};
1103
1104
1107{
1108public:
1109 euler_phi();
1110 virtual ~euler_phi() {}
1111 virtual void calc_value();
1112 virtual void calc_gradients();
1113};
1114
1115
1118{
1119public:
1120 euler_psi();
1121 virtual ~euler_psi() {}
1122 virtual void calc_value();
1123 virtual void calc_gradients();
1124};
1125
1126
1129{
1130public:
1131 euler_theta();
1132 virtual ~euler_theta() {}
1133 virtual void calc_value();
1134 virtual void calc_gradients();
1135};
1136
1137
1143 : public colvar::cvc
1144{
1145protected:
1146
1149
1152 std::vector<cvm::atom_pos> ref_pos;
1153
1155 size_t n_permutations = 1;
1156
1159
1161 int init_permutation(std::string const &conf);
1162
1163public:
1164 rmsd();
1165 virtual ~rmsd() {}
1166 virtual int init(std::string const &conf);
1167 virtual void calc_value();
1168 virtual void calc_gradients();
1169 virtual void calc_force_invgrads();
1170 virtual void calc_Jacobian_derivative();
1171};
1172
1173
1174
1175// \brief Colvar component: flat vector of Cartesian coordinates
1176// Mostly useful to compute scripted colvar values
1178 : public colvar::cvc
1179{
1180protected:
1184 std::vector<size_t> axes;
1185public:
1186 cartesian();
1187 virtual ~cartesian() {}
1188 virtual int init(std::string const &conf);
1189 virtual void calc_value();
1190 virtual void calc_gradients();
1191 virtual void apply_force(colvarvalue const &force);
1193 virtual cvm::real dist2(colvarvalue const &x1,
1194 colvarvalue const &x2) const;
1196 virtual colvarvalue dist2_lgrad(colvarvalue const &x1,
1197 colvarvalue const &x2) const;
1199 virtual colvarvalue dist2_rgrad(colvarvalue const &x1,
1200 colvarvalue const &x2) const;
1202 virtual void wrap(colvarvalue &x_unwrapped) const;
1203};
1204
1205
1206// \brief Colvar component: alch_lambda
1207// To communicate value with back-end in lambda-dynamics
1209 : public colvar::cvc
1210{
1211protected:
1212 // No atom groups needed
1213public:
1214 alch_lambda();
1215 virtual ~alch_lambda() {}
1216 virtual void calc_value();
1217 virtual void calc_gradients();
1218 virtual void apply_force(colvarvalue const &force);
1219};
1220
1221
1222// \brief Colvar component: alch_Flambda
1223// To communicate force on lambda with back-end in lambda-dynamics
1225 : public colvar::cvc
1226{
1227protected:
1228 // No atom groups needed
1229public:
1230 alch_Flambda();
1231 virtual ~alch_Flambda() {}
1232 virtual void calc_value();
1233 virtual void calc_gradients();
1234 virtual void apply_force(colvarvalue const &force);
1235};
1236
1237
1239 : public colvar::cvc
1240{
1241protected:
1242 virtual void computeDistanceBetweenReferenceFrames(std::vector<cvm::real>& result);
1243 virtual void computeDistanceToReferenceFrames(std::vector<cvm::real>& result);
1249 std::vector<std::vector<cvm::atom_pos>> reference_frames;
1250 std::vector<std::vector<cvm::atom_pos>> reference_fitting_frames;
1252 std::vector<cvm::atom_group*> comp_atoms;
1255public:
1257 virtual ~CartesianBasedPath();
1258 virtual int init(std::string const &conf);
1259 virtual void calc_value() = 0;
1261 virtual void apply_force(colvarvalue const &force);
1262};
1263
1268 : public colvar::CartesianBasedPath, public GeometricPathCV::GeometricPathBase<cvm::atom_pos, cvm::real, GeometricPathCV::path_sz::S>
1269{
1270private:
1271 // Optimal rotation for compute v3
1272 cvm::rotation rot_v3;
1273protected:
1274 virtual void prepareVectors();
1275 virtual void updateDistanceToReferenceFrames();
1276public:
1277 gspath();
1278 virtual ~gspath() {}
1279 virtual int init(std::string const &conf);
1280 virtual void calc_value();
1281 virtual void calc_gradients();
1282 virtual void apply_force(colvarvalue const &force);
1283};
1284
1285
1286
1290 : public colvar::CartesianBasedPath, public GeometricPathCV::GeometricPathBase<cvm::atom_pos, cvm::real, GeometricPathCV::path_sz::Z>
1291{
1292private:
1293 // Optimal rotation for compute v3, v4
1294 cvm::rotation rot_v3;
1295 cvm::rotation rot_v4;
1296protected:
1297 virtual void prepareVectors();
1298 virtual void updateDistanceToReferenceFrames();
1299public:
1300 gzpath();
1301 virtual ~gzpath() {}
1302 virtual int init(std::string const &conf);
1303 virtual void calc_value();
1304 virtual void calc_gradients();
1305 virtual void apply_force(colvarvalue const &force);
1306};
1307
1310 : public colvar::cvc
1311{
1312protected:
1314 std::vector<colvar::cvc*> cv;
1317protected:
1318 cvm::real getPolynomialFactorOfCVGradient(size_t i_cv) const;
1319public:
1321 virtual ~linearCombination();
1322 virtual int init(std::string const &conf);
1323 virtual void calc_value();
1324 virtual void calc_gradients();
1325 virtual void apply_force(colvarvalue const &force);
1327 virtual cvm::real dist2(colvarvalue const &x1,
1328 colvarvalue const &x2) const;
1330 virtual colvarvalue dist2_lgrad(colvarvalue const &x1,
1331 colvarvalue const &x2) const;
1333 virtual colvarvalue dist2_rgrad(colvarvalue const &x1,
1334 colvarvalue const &x2) const;
1336 virtual void wrap(colvarvalue &x_unwrapped) const;
1337};
1338
1339
1343{
1344protected:
1345 bool use_custom_function = false;
1346#ifdef LEPTON
1348 std::vector<Lepton::CompiledExpression *> value_evaluators;
1350 std::vector<Lepton::CompiledExpression *> gradient_evaluators;
1352 std::vector<double *> value_eval_var_refs;
1353 std::vector<double *> grad_eval_var_refs;
1355 double dev_null = 0.0;
1356#endif
1357public:
1358 customColvar();
1359 virtual ~customColvar();
1360 virtual int init(std::string const &conf);
1361 virtual void calc_value();
1362 virtual void calc_gradients();
1363 virtual void apply_force(colvarvalue const &force);
1364};
1365
1366
1368 : public colvar::cvc
1369{
1370protected:
1372 std::vector<colvar::cvc*> cv;
1374 std::vector<std::vector<colvarvalue>> ref_cv;
1379protected:
1380 virtual void computeDistanceToReferenceFrames(std::vector<cvm::real>& result);
1382 virtual void computeDistanceBetweenReferenceFrames(std::vector<cvm::real>& result) const;
1383 cvm::real getPolynomialFactorOfCVGradient(size_t i_cv) const;
1384public:
1385 CVBasedPath();
1386 virtual ~CVBasedPath();
1387 virtual int init(std::string const &conf);
1388 virtual void calc_value() = 0;
1390 virtual void apply_force(colvarvalue const &force);
1392 virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const;
1394 virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const;
1396 virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const;
1398 virtual void wrap(colvarvalue &x_unwrapped) const;
1399};
1400
1401
1407 : public colvar::CVBasedPath, public GeometricPathCV::GeometricPathBase<colvarvalue, cvm::real, GeometricPathCV::path_sz::S>
1408{
1409protected:
1410 virtual void updateDistanceToReferenceFrames();
1411 virtual void prepareVectors();
1412public:
1413 gspathCV();
1414 virtual ~gspathCV();
1415 virtual int init(std::string const &conf);
1416 virtual void calc_value();
1417 virtual void calc_gradients();
1418 virtual void apply_force(colvarvalue const &force);
1419};
1420
1421
1422
1424 : public colvar::CVBasedPath, public GeometricPathCV::GeometricPathBase<colvarvalue, cvm::real, GeometricPathCV::path_sz::Z>
1425{
1426protected:
1427 virtual void updateDistanceToReferenceFrames();
1428 virtual void prepareVectors();
1429public:
1430 gzpathCV();
1431 virtual ~gzpathCV();
1432 virtual int init(std::string const &conf);
1433 virtual void calc_value();
1434 virtual void calc_gradients();
1435 virtual void apply_force(colvarvalue const &force);
1436};
1437
1438struct ArithmeticPathImpl;
1439
1442{
1443private:
1444 std::unique_ptr<ArithmeticPathImpl> impl_;
1445 friend struct ArithmeticPathImpl;
1446public:
1447 aspath();
1448 virtual ~aspath();
1449 virtual int init(std::string const &conf);
1450 virtual void calc_value();
1451 virtual void calc_gradients();
1452 virtual void apply_force(colvarvalue const &force);
1453};
1454
1457{
1458private:
1459 std::unique_ptr<ArithmeticPathImpl> impl_;
1460 friend struct ArithmeticPathImpl;
1461public:
1462 azpath();
1463 virtual ~azpath();
1464 virtual int init(std::string const &conf);
1465 virtual void calc_value();
1466 virtual void calc_gradients();
1467 virtual void apply_force(colvarvalue const &force);
1468};
1469
1471 : public colvar::CVBasedPath
1472{
1473private:
1474 std::unique_ptr<ArithmeticPathImpl> impl_;
1475 friend struct ArithmeticPathImpl;
1476public:
1477 aspathCV();
1478 virtual ~aspathCV();
1479 virtual int init(std::string const &conf);
1480 virtual void calc_value();
1481 virtual void calc_gradients();
1482 virtual void apply_force(colvarvalue const &force);
1483};
1484
1485
1487 : public colvar::CVBasedPath
1488{
1489private:
1490 std::unique_ptr<ArithmeticPathImpl> impl_;
1491 friend struct ArithmeticPathImpl;
1492public:
1493 azpathCV();
1494 virtual ~azpathCV();
1495 virtual int init(std::string const &conf);
1496 virtual void calc_value();
1497 virtual void calc_gradients();
1498 virtual void apply_force(colvarvalue const &force);
1499};
1500
1501// forward declaration
1502namespace neuralnetworkCV {
1503 class neuralNetworkCompute;
1504}
1505
1506
1508 : public linearCombination
1509{
1510protected:
1512 std::unique_ptr<neuralnetworkCV::neuralNetworkCompute> nn;
1514 size_t m_output_index = 0;
1515public:
1516 neuralNetwork();
1517 virtual ~neuralNetwork();
1518 virtual int init(std::string const &conf);
1519 virtual void calc_value();
1520 virtual void calc_gradients();
1521 virtual void apply_force(colvarvalue const &force);
1523 virtual cvm::real dist2(colvarvalue const &x1,
1524 colvarvalue const &x2) const;
1526 virtual colvarvalue dist2_lgrad(colvarvalue const &x1,
1527 colvarvalue const &x2) const;
1529 virtual colvarvalue dist2_rgrad(colvarvalue const &x1,
1530 colvarvalue const &x2) const;
1532 virtual void wrap(colvarvalue &x_unwrapped) const;
1533};
1534
1535
1536// \brief Colvar component: total value of a scalar map
1537// (usually implemented as a grid by the simulation engine)
1539 : public colvar::cvc
1540{
1541public:
1542
1543 map_total();
1544 virtual ~map_total() {}
1545 virtual int init(std::string const &conf);
1546 virtual void calc_value();
1547 virtual void calc_gradients();
1548 virtual void apply_force(colvarvalue const &force);
1549
1550protected:
1551
1553 std::string volmap_name;
1554
1556 int volmap_id = -1;
1557
1560
1563
1565 std::vector<cvm::real> atom_weights;
1566};
1567
1568
1569
1570#endif
Definition: colvar_geometricpath.h:24
Definition: colvarcomp.h:1369
std::vector< colvar::cvc * > cv
Sub-colvar components.
Definition: colvarcomp.h:1372
size_t total_reference_frames
Total number of reference frames.
Definition: colvarcomp.h:1378
bool use_explicit_gradients
If all sub-cvs use explicit gradients then we also use it.
Definition: colvarcomp.h:1376
std::vector< std::vector< colvarvalue > > ref_cv
Reference colvar values from path.
Definition: colvarcomp.h:1374
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_gpath.cpp:644
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use the metric of the returned colvarvalue (defined at runtime)
Definition: colvarcomp_gpath.cpp:651
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use the metric of the returned colvarvalue (defined at runtime)
Definition: colvarcomp_gpath.cpp:657
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to use the metric of the returned colvarvalue (defined at runtime)
Definition: colvarcomp_gpath.cpp:669
virtual int init(std::string const &conf)
Definition: colvarcomp_gpath.cpp:484
virtual void calc_value()=0
Calculate the variable.
virtual void computeDistanceBetweenReferenceFrames(std::vector< cvm::real > &result) const
Helper function to determine the distance between reference frames.
Definition: colvarcomp_gpath.cpp:599
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use the metric of the returned colvarvalue (defined at runtime)
Definition: colvarcomp_gpath.cpp:663
Definition: colvarcomp.h:1240
cvm::atom_group * atoms
Selected atoms.
Definition: colvarcomp.h:1245
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_gpath.cpp:169
std::vector< std::vector< cvm::atom_pos > > reference_frames
Reference frames.
Definition: colvarcomp.h:1249
size_t total_reference_frames
Total number of reference frames.
Definition: colvarcomp.h:1254
bool has_user_defined_fitting
Fitting options.
Definition: colvarcomp.h:1247
virtual void calc_value()=0
Calculate the variable.
virtual int init(std::string const &conf)
Definition: colvarcomp_gpath.cpp:31
std::vector< cvm::atom_group * > comp_atoms
Atom groups for RMSD calculation together with reference frames.
Definition: colvarcomp.h:1252
Definition: colvarcomp.h:1226
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_alchlambda.cpp:81
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_alchlambda.cpp:86
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_alchlambda.cpp:70
Definition: colvarcomp.h:1210
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_alchlambda.cpp:32
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_alchlambda.cpp:46
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_alchlambda.cpp:51
Colvar component: alpha helix content of a contiguous segment of 5 or more residues,...
Definition: colvarcomp.h:913
void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_protein.cpp:223
cvm::real theta_tol
Tolerance on the Calpha-Calpha angle.
Definition: colvarcomp.h:920
int en
Integer exponent of the HB numerator.
Definition: colvarcomp.h:935
cvm::real theta_ref
Reference Calpha-Calpha angle (default: 88 degrees)
Definition: colvarcomp.h:917
void collect_gradients(std::vector< int > const &atom_ids, std::vector< cvm::rvector > &atomic_gradients)
Re-implementation of cvc::collect_gradients() to carry over atomic gradients of sub-cvcs.
Definition: colvarcomp_protein.cpp:234
void calc_value()
Calculate the variable.
Definition: colvarcomp_protein.cpp:179
cvm::real hb_coeff
Contribution of the HB terms.
Definition: colvarcomp.h:929
int ed
Integer exponent of the HB denominator.
Definition: colvarcomp.h:938
void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_protein.cpp:286
cvm::real r0
Cutoff for HB.
Definition: colvarcomp.h:932
std::vector< h_bond * > hb
List of hydrogen bonds.
Definition: colvarcomp.h:926
virtual int init(std::string const &conf)
Definition: colvarcomp_protein.cpp:28
std::vector< angle * > theta
List of Calpha-Calpha angles.
Definition: colvarcomp.h:923
Colvar component: angle between the centers of mass of three groups (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:635
bool b_1site_force
Definition: colvarcomp.h:655
cvm::atom_group * group3
Atom group.
Definition: colvarcomp.h:643
cvm::rvector r21
Inter site vectors.
Definition: colvarcomp.h:646
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_angles.cpp:72
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_angles.cpp:112
cvm::atom_group * group2
Atom group.
Definition: colvarcomp.h:641
virtual int init(std::string const &conf)
Definition: colvarcomp_angles.cpp:26
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_angles.cpp:51
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_angles.cpp:89
cvm::rvector dxdr1
Derivatives wrt group centers of mass.
Definition: colvarcomp.h:650
cvm::real r21l
Inter site vector norms.
Definition: colvarcomp.h:648
cvm::atom_group * group1
Atom group.
Definition: colvarcomp.h:639
Definition: colvarcomp.h:1472
virtual int init(std::string const &conf)
Definition: colvarcomp_apath.cpp:254
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_apath.cpp:278
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_apath.cpp:293
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_apath.cpp:317
Definition: colvarcomp.h:1442
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_apath.cpp:186
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_apath.cpp:177
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_apath.cpp:162
virtual int init(std::string const &conf)
Definition: colvarcomp_apath.cpp:144
Definition: colvarcomp.h:1488
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_apath.cpp:396
virtual int init(std::string const &conf)
Definition: colvarcomp_apath.cpp:359
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_apath.cpp:381
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_apath.cpp:420
Definition: colvarcomp.h:1457
virtual int init(std::string const &conf)
Definition: colvarcomp_apath.cpp:199
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_apath.cpp:232
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_apath.cpp:241
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_apath.cpp:217
Definition: colvarcomp.h:1179
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:1427
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:1390
cvm::atom_group * atoms
Atom group.
Definition: colvarcomp.h:1182
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:1433
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:1349
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:1378
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:1415
std::vector< size_t > axes
Which Cartesian coordinates to include.
Definition: colvarcomp.h:1184
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:1421
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_distances.cpp:1398
Colvar component: coordination number between two groups (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:748
int en
Integer exponent of the function numerator.
Definition: colvarcomp.h:761
static cvm::real switching_function(cvm::real const &r0, cvm::rvector const &r0_vec, int en, int ed, cvm::atom &A1, cvm::atom &A2, bool **pairlist_elem, cvm::real tolerance)
Calculate a coordination number through the function (1-x**n)/(1-x**m), where x = |A1-A2|/r0.
Definition: colvarcomp_coordnums.cpp:19
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_coordnums.cpp:271
int compute_coordnum()
Workhorse function.
Definition: colvarcomp_coordnums.cpp:222
cvm::atom_group * group2
Second atom group.
Definition: colvarcomp.h:753
cvm::real tolerance
Tolerance for the pair list.
Definition: colvarcomp.h:769
bool b_group2_center_only
If true, group2 will be treated as a single atom.
Definition: colvarcomp.h:766
int ed
Integer exponent of the function denominator.
Definition: colvarcomp.h:763
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_coordnums.cpp:282
int pairlist_freq
Frequency of update of the pair list.
Definition: colvarcomp.h:772
cvm::real r0
"Cutoff" for isotropic calculation (default)
Definition: colvarcomp.h:755
bool b_anisotropic
Whether r/r0 or \vec{r}*\vec{1/r0_vec} should be used.
Definition: colvarcomp.h:759
virtual int init(std::string const &conf)
Definition: colvarcomp_coordnums.cpp:104
bool * pairlist
Pair list.
Definition: colvarcomp.h:775
void main_loop(bool **pairlist_elem)
Workhorse function.
Definition: colvarcomp_coordnums.cpp:195
cvm::atom_group * group1
First atom group.
Definition: colvarcomp.h:751
cvm::rvector r0_vec
"Cutoff vector" for anisotropic calculation
Definition: colvarcomp.h:757
custom expression of colvars
Definition: colvarcomp.h:1343
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_combination.cpp:301
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_combination.cpp:339
virtual int init(std::string const &conf)
Definition: colvarcomp_combination.cpp:170
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_combination.cpp:270
Colvar component (base class for collective variables)
Definition: colvarcomp.h:70
virtual void collect_gradients(std::vector< int > const &atom_ids, std::vector< cvm::rvector > &atomic_gradients)
Calculate atomic gradients and add them to the corresponding item in gradient vector May be overridde...
Definition: colvarcomp.cpp:476
virtual int init_total_force_params(std::string const &conf)
Parse options pertaining to total force calculation.
Definition: colvarcomp.cpp:137
virtual void wrap(colvarvalue &x_unwrapped) const
Wrap value (for periodic/symmetric cvcs)
Definition: colvarcomp.cpp:703
void set_value(colvarvalue const &new_value)
Definition: colvarcomp.h:236
int sup_np
Exponent in the polynomial combination (default: 1)
Definition: colvarcomp.h:87
int set_function_type(std::string const &type)
Set the value of function_type and its dependencies.
Definition: colvarcomp.cpp:47
cvm::real sup_coeff
Coefficient in the polynomial combination (default: 1.0)
Definition: colvarcomp.h:84
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp.cpp:518
colvarvalue jd
Calculated Jacobian derivative (divergence of the inverse gradients): serves to calculate the phase s...
Definition: colvarcomp.h:275
std::vector< std::string > function_types
Record the type of this class as well as those it is derived from.
Definition: colvarcomp.h:259
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Gradient(with respect to x2) of the square distance (can be redefined to transparently implement cons...
Definition: colvarcomp.cpp:697
std::string function_type() const
String identifier for the type of collective variable.
Definition: colvarcomp.cpp:38
virtual int init(std::string const &conf)
Definition: colvarcomp.cpp:60
virtual void debug_gradients()
Calculate finite-difference gradients alongside the analytical ones, for each Cartesian component.
Definition: colvarcomp.cpp:556
virtual ~cvc()
Destructor.
Definition: colvarcomp.cpp:352
colvarvalue const & Jacobian_derivative() const
Return the previously calculated divergence of the inverse atomic gradients.
Definition: colvarcomp.h:312
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp.h:141
cvm::real width
CVC-specific default colvar width (default: not provided)
Definition: colvarcomp.h:296
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Gradient(with respect to x1) of the square distance (can be redefined to transparently implement cons...
Definition: colvarcomp.cpp:686
virtual colvarvalue const * get_param_grad(std::string const &param_name)
Pointer to the gradient of parameter param_name.
Definition: colvarcomp.cpp:410
int setup()
After construction, set data related to dependency handling.
Definition: colvarcomp.cpp:345
virtual int set_param(std::string const &param_name, void const *new_value)
Set the named parameter to the given value.
Definition: colvarcomp.cpp:418
colvarvalue const & value() const
Return the previously calculated value.
Definition: colvarcomp.h:300
static std::vector< feature * > cvc_features
Implementation of the feature list for colvar.
Definition: colvarcomp.h:256
virtual int init_dependencies()
Initialize dependency tree.
Definition: colvarcomp.cpp:234
colvarvalue ft
Calculated total force (Note: this is calculated from the total atomic forces read from the program,...
Definition: colvarcomp.h:271
int update_description()
Update the description string based on name and type.
Definition: colvarcomp.cpp:26
std::string name
The name of the object (helps to identify this cvc instance when debugging)
Definition: colvarcomp.h:75
bool b_try_scalable
Whether or not this CVC will be computed in parallel whenever possible.
Definition: colvarcomp.h:232
cvm::real wrap_center
If the component is periodic, wrap around this value (default: 0.0)
Definition: colvarcomp.h:93
virtual void calc_value()=0
Calculate the variable.
virtual void read_data()
Obtain data needed for the calculation for the backend.
Definition: colvarcomp.cpp:444
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Definition: colvarcomp.cpp:675
colvarvalue x
Cached value.
Definition: colvarcomp.h:262
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp.cpp:526
void calc_fit_gradients()
Calculate the atomic fit gradients.
Definition: colvarcomp.cpp:534
void init_as_periodic_angle()
Set data types for a periodic angle (-180° to 180°)
Definition: colvarcomp.cpp:379
virtual std::vector< std::vector< int > > get_atom_lists()
Get vector of vectors of atom IDs for all atom groups.
Definition: colvarcomp.cpp:458
cvc()
Constructor.
Definition: colvarcomp.cpp:19
void register_atom_group(cvm::atom_group *ag)
Store a pointer to new atom group, and list as child for dependencies.
Definition: colvarcomp.cpp:402
void init_as_angle()
Set data types for a bounded angle (0° to 180°)
Definition: colvarcomp.cpp:372
void init_as_distance()
Set data types for a scalar distance (convenience function)
Definition: colvarcomp.cpp:362
colvarvalue const & total_force() const
Return the previously calculated total force.
Definition: colvarcomp.h:306
colvarvalue x_old
Value at the previous step.
Definition: colvarcomp.h:265
colvarvalue upper_boundary
Location of the upper boundary (not defined by user choice)
Definition: colvarcomp.h:293
colvarvalue lower_boundary
Location of the lower boundary (not defined by user choice)
Definition: colvarcomp.h:290
void init_scalar_boundaries(cvm::real lb, cvm::real ub)
Set two scalar boundaries (convenience function)
Definition: colvarcomp.cpp:389
std::vector< cvm::atom_group * > atom_groups
Pointers to all atom groups, to let colvars collect info e.g. atomic gradients.
Definition: colvarcomp.h:220
std::string config_key
Keyword used in the input to denote this CVC.
Definition: colvarcomp.h:81
virtual const std::vector< feature * > & features() const
Implementation of the feature list accessor for colvar.
Definition: colvarcomp.h:113
cvm::atom_group * parse_group(std::string const &conf, char const *group_key, bool optional=false)
Parse a group definition.
Definition: colvarcomp.cpp:167
virtual void apply_force(colvarvalue const &cvforce)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp.cpp:544
cvm::real period
Period of the values of this CVC (default: 0.0, non periodic)
Definition: colvarcomp.h:90
Colvar component: dihedPC Projection of the config onto a dihedral principal component See e....
Definition: colvarcomp.h:960
virtual void collect_gradients(std::vector< int > const &atom_ids, std::vector< cvm::rvector > &atomic_gradients)
Re-implementation of cvc::collect_gradients() to carry over atomic gradients of sub-cvcs.
Definition: colvarcomp_protein.cpp:532
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_protein.cpp:512
virtual int init(std::string const &conf)
Definition: colvarcomp_protein.cpp:337
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_protein.cpp:524
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_protein.cpp:555
Colvar component: dihedral between the centers of mass of four groups (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:711
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_angles.cpp:268
cvm::atom_group * group4
Atom group.
Definition: colvarcomp.h:721
virtual int init(std::string const &conf)
Definition: colvarcomp_angles.cpp:208
cvm::rvector r12
Inter site vectors.
Definition: colvarcomp.h:723
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_angles.cpp:290
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_angles.cpp:321
cvm::atom_group * group1
Atom group.
Definition: colvarcomp.h:715
cvm::atom_group * group3
Atom group.
Definition: colvarcomp.h:719
bool b_1site_force
Compute total force on first site only to avoid unwanted coupling to other colvars (see e....
Definition: colvarcomp.h:727
cvm::atom_group * group2
Atom group.
Definition: colvarcomp.h:717
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_angles.cpp:239
Colvar component: angle between the dipole of a molecule and an axis formed by two groups of atoms(co...
Definition: colvarcomp.h:675
bool b_1site_force
Definition: colvarcomp.h:695
cvm::rvector r21
Inter site vectors.
Definition: colvarcomp.h:686
cvm::real r21l
Inter site vector norms.
Definition: colvarcomp.h:688
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_angles.cpp:142
cvm::rvector dxdr1
Derivatives wrt group centers of mass.
Definition: colvarcomp.h:690
cvm::atom_group * group1
Dipole atom group.
Definition: colvarcomp.h:679
virtual int init(std::string const &conf)
Definition: colvarcomp_angles.cpp:129
cvm::atom_group * group3
Atom group.
Definition: colvarcomp.h:683
cvm::atom_group * group2
Atom group.
Definition: colvarcomp.h:681
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_angles.cpp:166
Colvar component: dipole magnitude of a molecule.
Definition: colvarcomp.h:532
cvm::atom_group * atoms
Dipole atom group.
Definition: colvarcomp.h:535
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:631
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:640
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:622
Colvar component: distance unit vector (direction) between centers of mass of two groups (colvarvalue...
Definition: colvarcomp.h:372
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:402
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_distances.cpp:381
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:371
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:414
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:396
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:359
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:408
Colvar component: average distance between two groups of atoms, weighted as the sixth power,...
Definition: colvarcomp.h:483
cvm::atom_group * group2
Second atom group.
Definition: colvarcomp.h:488
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:425
int exponent
Components of the distance vector orthogonal to the axis.
Definition: colvarcomp.h:490
cvm::atom_group * group1
First atom group.
Definition: colvarcomp.h:486
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:461
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:505
Colvar component: N1xN2 vector of pairwise distances (colvarvalue::type_vector type,...
Definition: colvarcomp.h:505
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:599
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:611
cvm::atom_group * group2
Second atom group.
Definition: colvarcomp.h:510
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:605
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:519
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:531
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_distances.cpp:568
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:593
cvm::atom_group * group1
First atom group.
Definition: colvarcomp.h:508
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:562
Definition: colvarcomp.h:349
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:140
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:131
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:94
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:122
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:105
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_distances.cpp:112
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to deal with multiple dimensions.
Definition: colvarcomp_distances.cpp:146
Colvar component: projection of the distance vector on a plane (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:427
cvm::rvector dist_v_ortho
Components of the distance vector orthogonal to the axis.
Definition: colvarcomp.h:430
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:301
cvm::rvector v12
Vector distances.
Definition: colvarcomp.h:432
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:277
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:330
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:343
Colvar component: projection of the distance vector along an axis(colvarvalue::type_scalar type,...
Definition: colvarcomp.h:395
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:223
cvm::rvector dist_v
Vector distance, cached to be recycled.
Definition: colvarcomp.h:408
cvm::atom_group * main
Main atom group.
Definition: colvarcomp.h:398
bool fixed_axis
Flag: using a fixed axis vector?
Definition: colvarcomp.h:410
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:249
cvm::real axis_norm
Norm of the axis.
Definition: colvarcomp.h:406
cvm::atom_group * ref1
Reference atom group.
Definition: colvarcomp.h:400
cvm::atom_group * ref2
Optional, second ref atom group.
Definition: colvarcomp.h:402
cvm::rvector axis
Vector on which the distance vector is projected.
Definition: colvarcomp.h:404
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:193
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:160
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:262
Colvar component: distance between the centers of mass of two groups (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:324
cvm::atom_group * group2
Second atom group.
Definition: colvarcomp.h:329
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:79
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:47
cvm::rvector dist_v
Vector distance, cached to be recycled.
Definition: colvarcomp.h:331
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:67
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:30
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:59
cvm::atom_group * group1
First atom group.
Definition: colvarcomp.h:327
Colvar component: projection of 3N coordinates onto an eigenvector(colvarvalue::type_scalar type,...
Definition: colvarcomp.h:603
std::vector< cvm::atom_pos > ref_pos
Reference coordinates.
Definition: colvarcomp.h:610
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:1061
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:1287
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:1258
std::vector< cvm::rvector > eigenvec
Eigenvector (of a normal or essential mode): will always have zero center.
Definition: colvarcomp.h:613
cvm::atom_group * atoms
Atom group.
Definition: colvarcomp.h:607
cvm::real eigenvec_invnorm2
Inverse square norm of the eigenvector.
Definition: colvarcomp.h:616
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:1267
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:1275
Definition: colvarcomp.h:1107
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:391
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:374
Definition: colvarcomp.h:1118
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:440
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:423
Definition: colvarcomp.h:1129
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:487
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:472
Colvar component: coordination number between two groups (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:858
cvm::rvector r0_vec
"Cutoff vector" for anisotropic calculation
Definition: colvarcomp.h:863
bool b_anisotropic
Wheter dist/r0 or \vec{dist}*\vec{1/r0_vec} should ne be used.
Definition: colvarcomp.h:866
int en
Integer exponent of the function numerator.
Definition: colvarcomp.h:868
int ed
Integer exponent of the function denominator.
Definition: colvarcomp.h:870
virtual int init(std::string const &conf)
Definition: colvarcomp_coordnums.cpp:538
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_coordnums.cpp:582
cvm::real r0
"Cutoff" for isotropic calculation (default)
Definition: colvarcomp.h:861
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_coordnums.cpp:605
Colvar component: alternative path collective variable using geometry, variable s Allow any combinati...
Definition: colvarcomp.h:1408
virtual int init(std::string const &conf)
Definition: colvarcomp_gpath.cpp:679
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_gpath.cpp:748
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_gpath.cpp:779
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_gpath.cpp:743
Colvar component: alternative path collective variable using geometry, variable s For more informatio...
Definition: colvarcomp.h:1269
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_gpath.cpp:304
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_gpath.cpp:299
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_gpath.cpp:325
virtual int init(std::string const &conf)
Definition: colvarcomp_gpath.cpp:183
Colvar component: Radius of gyration of an atom group (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:551
cvm::atom_group * atoms
Atoms involved.
Definition: colvarcomp.h:554
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:679
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:698
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:689
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:711
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:661
Definition: colvarcomp.h:1425
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_gpath.cpp:918
virtual int init(std::string const &conf)
Definition: colvarcomp_gpath.cpp:809
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_gpath.cpp:886
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_gpath.cpp:891
Colvar component: alternative path collective variable using geometry, variable z This should be merg...
Definition: colvarcomp.h:1291
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_gpath.cpp:453
virtual int init(std::string const &conf)
Definition: colvarcomp_gpath.cpp:338
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_gpath.cpp:458
virtual void apply_force(colvarvalue const &force)
Redefined to raise error because this is an abstract type.
Definition: colvarcomp_gpath.cpp:469
Colvar component: hydrogen bond, defined as the product of a colvar::coordnum and 1/2*(1-cos((180-ang...
Definition: colvarcomp.h:886
int ed
Integer exponent of the function denominator.
Definition: colvarcomp.h:893
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_coordnums.cpp:360
cvm::real r0
"Cutoff" distance between acceptor and donor
Definition: colvarcomp.h:889
int en
Integer exponent of the function numerator.
Definition: colvarcomp.h:891
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_coordnums.cpp:372
virtual int init(std::string const &conf)
Definition: colvarcomp_coordnums.cpp:301
Colvar component: moment of inertia of an atom group around a user-defined axis (colvarvalue::type_sc...
Definition: colvarcomp.h:585
cvm::rvector axis
Vector on which the inertia tensor is projected.
Definition: colvarcomp.h:588
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:764
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:774
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:748
Colvar component: moment of inertia of an atom group (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:571
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:724
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:733
Current only linear combination of sub-CVCs is available.
Definition: colvarcomp.h:1311
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_combination.cpp:146
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_combination.cpp:122
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_combination.cpp:92
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_combination.cpp:160
std::vector< colvar::cvc * > cv
Sub-colvar components.
Definition: colvarcomp.h:1314
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_combination.cpp:106
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_combination.cpp:140
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_combination.cpp:153
virtual int init(std::string const &conf)
Definition: colvarcomp_combination.cpp:19
bool use_explicit_gradients
If all sub-cvs use explicit gradients then we also use it.
Definition: colvarcomp.h:1316
Definition: colvarcomp.h:1540
std::string volmap_name
String identifier of the map object (as used by the simulation engine)
Definition: colvarcomp.h:1553
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_volmaps.cpp:87
int volmap_index
Index of the map objet in the proxy arrays.
Definition: colvarcomp.h:1559
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_volmaps.cpp:117
cvm::atom_group * atoms
Group of atoms selected internally (optional)
Definition: colvarcomp.h:1562
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_volmaps.cpp:111
virtual int init(std::string const &conf)
Definition: colvarcomp_volmaps.cpp:24
std::vector< cvm::real > atom_weights
Weights assigned to each atom (default: uniform weights)
Definition: colvarcomp.h:1565
int volmap_id
Numeric identifier of the map object (as used by the simulation engine)
Definition: colvarcomp.h:1556
Definition: colvarcomp.h:1509
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_neuralnetwork.cpp:208
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_neuralnetwork.cpp:220
size_t m_output_index
the index of nn output components
Definition: colvarcomp.h:1514
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_neuralnetwork.cpp:227
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_neuralnetwork.cpp:155
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to allow arbitrary dimensions.
Definition: colvarcomp_neuralnetwork.cpp:214
std::unique_ptr< neuralnetworkCV::neuralNetworkCompute > nn
actual computation happens in neuralnetworkCV::neuralNetworkCompute
Definition: colvarcomp.h:1512
virtual int init(std::string const &conf)
Definition: colvarcomp_neuralnetwork.cpp:25
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_neuralnetwork.cpp:172
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_neuralnetwork.cpp:189
Definition: colvarcomp.h:1035
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:186
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:201
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_rotations.cpp:217
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to use scalar metrics.
Definition: colvarcomp_rotations.cpp:243
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use scalar metrics.
Definition: colvarcomp_rotations.cpp:236
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use scalar metrics.
Definition: colvarcomp_rotations.cpp:223
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use scalar metrics.
Definition: colvarcomp_rotations.cpp:229
Colvar component: cosine of the angle of rotation with respect to a set of reference coordinates (col...
Definition: colvarcomp.h:1060
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:256
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:265
Colvar component: orientation in space of an atom group, with respect to a set of reference coordinat...
Definition: colvarcomp.h:986
virtual void apply_force(colvarvalue const &force)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp_rotations.cpp:133
virtual cvm::real dist2(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use quaternion metrics.
Definition: colvarcomp_rotations.cpp:153
cvm::rotation rot
Rotation object.
Definition: colvarcomp.h:1001
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:109
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:124
std::vector< cvm::atom_pos > shifted_pos
Shifted atomic positions.
Definition: colvarcomp.h:998
cvm::atom_pos atoms_cog
Center of geometry of the group.
Definition: colvarcomp.h:992
virtual colvarvalue dist2_rgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use quaternion metrics.
Definition: colvarcomp_rotations.cpp:167
virtual colvarvalue dist2_lgrad(colvarvalue const &x1, colvarvalue const &x2) const
Redefined to use quaternion metrics.
Definition: colvarcomp_rotations.cpp:160
virtual void wrap(colvarvalue &x_unwrapped) const
Redefined to use quaternion metrics.
Definition: colvarcomp_rotations.cpp:174
std::vector< cvm::atom_pos > ref_pos
Reference coordinates.
Definition: colvarcomp.h:995
cvm::quaternion ref_quat
This is used to remove jumps in the sign of the quaternion, which may be annoying in the colvars traj...
Definition: colvarcomp.h:1005
virtual int init(std::string const &conf)
Definition: colvarcomp_rotations.cpp:37
cvm::atom_group * atoms
Atom group.
Definition: colvarcomp.h:990
Colvar component: polar coordinate phi of a group (colvarvalue::type_scalar type, range [-180:180])
Definition: colvarcomp.h:447
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_angles.cpp:389
virtual int init(std::string const &conf)
Definition: colvarcomp_angles.cpp:380
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_angles.cpp:400
Colvar component: polar coordinate theta of a group (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:465
virtual int init(std::string const &conf)
Definition: colvarcomp_angles.cpp:338
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_angles.cpp:347
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_angles.cpp:358
Colvar component: root mean square deviation (RMSD) of a group with respect to a set of reference coo...
Definition: colvarcomp.h:1144
int init_permutation(std::string const &conf)
Permutation RMSD input parsing.
Definition: colvarcomp_distances.cpp:887
size_t best_perm_index
Index of the permutation yielding the smallest RMSD (0 for identity)
Definition: colvarcomp.h:1158
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_distances.cpp:961
virtual void calc_Jacobian_derivative()
Calculate the divergence of the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:989
std::vector< cvm::atom_pos > ref_pos
Definition: colvarcomp.h:1152
cvm::atom_group * atoms
Atom group.
Definition: colvarcomp.h:1148
size_t n_permutations
Number of permutations of symmetry-related atoms.
Definition: colvarcomp.h:1155
virtual void calc_force_invgrads()
Calculate the total force from the system using the inverse atomic gradients.
Definition: colvarcomp_distances.cpp:975
virtual int init(std::string const &conf)
Definition: colvarcomp_distances.cpp:791
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_distances.cpp:934
Colvar component: self-coordination number within a group (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:824
cvm::atom_group * group1
Selected atoms.
Definition: colvarcomp.h:828
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_coordnums.cpp:518
virtual int init(std::string const &conf)
Definition: colvarcomp_coordnums.cpp:392
int compute_selfcoordnum()
Main workhorse function.
Definition: colvarcomp_coordnums.cpp:445
int ed
Integer exponent of the function denominator.
Definition: colvarcomp.h:834
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_coordnums.cpp:507
cvm::real r0
"Cutoff" for isotropic calculation (default)
Definition: colvarcomp.h:830
int en
Integer exponent of the function numerator.
Definition: colvarcomp.h:832
Colvar component: angle of rotation around a predefined axis (colvarvalue::type_scalar type,...
Definition: colvarcomp.h:1095
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:337
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:349
Colvar component: projection of the orientation vector onto a predefined axis (colvarvalue::type_scal...
Definition: colvarcomp.h:1075
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp_rotations.cpp:312
virtual int init(std::string const &conf)
Definition: colvarcomp_rotations.cpp:287
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_rotations.cpp:301
std::vector< cvm::rvector > atomic_gradients
Array of atomic gradients collected from all cvcs with appropriate components, rotations etc....
Definition: colvar.h:714
colvarvalue ft
Total force, as derived from the atomic trajectory; should equal the system force plus f.
Definition: colvar.h:223
std::vector< int > atom_ids
Sorted array of (zero-based) IDs for all atoms involved.
Definition: colvar.h:709
Parent class for a member object of a bias, cv or cvc etc. containing features and their dependencies...
Definition: colvardeps.h:34
Group of atom objects, mostly used by a colvar::cvc object to gather all atomic data.
Definition: colvaratoms.h:159
Stores numeric id, mass and all mutable data for an atom, mostly used by a colvar::cvc.
Definition: colvaratoms.h:31
1-dimensional vector of real numbers with four components and a quaternion algebra
Definition: colvartypes.h:958
A rotation between two sets of coordinates (for the moment a wrapper for colvarmodule::quaternion)
Definition: colvartypes.h:1363
vector of real numbers with three components
Definition: colvartypes.h:727
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:95
Base class containing parsing functions; all objects which need to parse input inherit from this.
Definition: colvarparse.h:27
Value of a collective variable: this is a metatype which can be set at runtime. By default it is set ...
Definition: colvarvalue.h:43
Collective variables main module.
Definition: colvarcomp_apath.cpp:22
Definition: colvarcomp_rotations.cpp:17