#include <Matter.h>
Public Member Functions | |
| ~Matter ()=default | |
| Matter (std::shared_ptr< Potential > pot, const Parameters ¶ms) | |
| Matter (const Matter &matter) | |
| const Matter & | operator= (const Matter &matter) |
| Matter (Matter &&other) noexcept | |
| Move: transfers retained movie ConFrames (move-only). | |
| Matter & | operator= (Matter &&other) noexcept |
| bool | compare (const Matter &matter, bool indistinguishable=false) |
| double | distanceTo (const Matter &matter) |
| double | perAtomNorm (const Matter &matter) |
| void | setPotential (std::shared_ptr< Potential > pot) |
| std::shared_ptr< Potential > | getPotential () |
| void | resize (long int nAtoms) |
| long int | numberOfAtoms () const |
| Matrix3d | getCell () const |
| void | setCell (const Matrix3d &newCell) |
| double | getPosition (long int atom, int axis) const |
| void | setPosition (long int atom, int axis, double position) |
| void | setVelocity (long int atom, int axis, double velocity) |
| bool | relax (bool quiet=false, bool writeMovie=false, bool checkpoint=false, std::string prefixMovie=std::string(), std::string prefixCheckpoint=std::string(), bool retainMovieFrames=false) |
| const std::vector< readcon::ConFrame > & | movieFrames () const |
| In-memory minimization movie (same stamps as writeMovie CON). | |
| void | clearMovieFrames () |
| std::vector< readcon::ConFrame > | takeMovieFrames () |
| Take ownership of retained frames (leaves storage empty). | |
| AtomMatrix | pbc (const AtomMatrix &diff) const |
| VectorXd | pbcV (const VectorXd &diff) const |
| size_t | getPotentialCalls () const |
| const AtomMatrix & | getPositions () const |
| AtomMatrix | getPositionsCopy () const |
| VectorXd | getPositionsV () const |
| AtomMatrix | getPositionsFree () const |
| VectorXd | getPositionsFreeV () const |
| void | setPositions (const AtomMatrix &pos) |
| void | setPositionsV (const VectorXd &pos) |
| void | setPositionsFree (const AtomMatrix &pos) |
| void | setPositionsFreeV (const VectorXd &pos) |
| AtomMatrix | getVelocities () const |
| void | setVelocities (const AtomMatrix &v) |
| void | setBiasForces (const AtomMatrix &bf) |
| void | setBiasPotential (BondBoost *bondBoost) |
| void | setForces (const AtomMatrix &f) |
| AtomMatrix | getAccelerations () |
| const AtomMatrix & | getForces () const |
| const AtomMatrix & | getForcesRaw () const |
| AtomMatrix | getBiasForces () |
| VectorXd | getForcesV () const |
| AtomMatrix | getForcesFree () const |
| VectorXd | getForcesFreeV () const |
| PbcConvention | getPbcConvention () const |
| void | setPbcConvention (PbcConvention convention) |
| double | getMass (long int atom) const |
| void | setMass (long int atom, double mass) |
| void | setMasses (const VectorXd &massesIn) |
| long | getAtomicNr (long int atom) const |
| void | setAtomicNr (long int atom, long atomicNr) |
| VectorXi | getAtomicNrs () const |
| VectorXi | getAtomicNrsFree () const |
| void | setAtomicNrs (const VectorXi &atmnrs) |
| int | getFixed (long int atom) const |
| 1 if every Cartesian axis of the atom is fixed, else 0. | |
| int | getFixed (long int atom, int axis) const |
| 1 if this atom's axis is fixed, else 0. axis is 0=x, 1=y, 2=z. | |
| std::array< bool, 3 > | getFixedMask (long int atom) const |
| Per-axis CON column-4 mask (bit0=x, bit1=y, bit2=z). | |
| void | setFixed (long int atom, int isFixed) |
| Broadcast a whole-atom flag onto all three axes. | |
| void | setFixed (long int atom, int axis, int isFixed) |
| Set one Cartesian axis. axis is 0=x, 1=y, 2=z. | |
| void | setFixedMask (long int atom, std::array< bool, 3 > mask) |
| double | getEnergyVariance () const |
| double | getPotentialEnergy () const |
| bool | needsForceUpdate () const |
| Whether forces need recomputation (positions changed since last eval). | |
| double * | forcesData () |
| Mutable access to force storage for batched potential evaluation. | |
| void | setComputedPotential (double energy, double variance) |
| Set energy/variance from external batched evaluation and mark forces as up-to-date (recomputePotential = false). | |
| double | getKineticEnergy () const |
| double | getMechanicalEnergy () const |
| double | distance (long index1, long index2) const |
| double | pdistance (long index1, long index2, int axis) const |
| double | distance (const Matter &matter, long index) const |
| long int | numberOfFreeAtoms () const |
| long int | numberOfFixedAtoms () const |
| long | getForceCalls () const |
| void | resetForceCalls () |
| double | maxForce (void) const |
| bool | getWriteConForces () const noexcept |
| Parameters.main_options.writeConForces for this Matter, if bound. | |
| io::IoStatus | writeTibble (std::string filename) |
| io::IoStatus | con2matter (std::string filename) |
| io::IoStatus | con2matter (const readcon::ConFrame &frame, io::ConFrameMetadata *out_metadata=nullptr) |
| io::IoStatus | convel2matter (std::string filename) |
| io::IoStatus | matter2con (std::string filename, bool append=false, const io::ConFrameMetadata *metadata=nullptr) |
| io::IoStatus | matter2convel (std::string filename) |
| io::IoStatus | matter2xyz (std::string filename, bool append=false) |
| AtomMatrix | getFree () const |
| VectorXd | getFreeV () const |
| Eigen::Matrix< double, Eigen::Dynamic, 1 > | getMasses () const |
| std::int64_t | getAtomIndex (long int atom) const |
| .con column-5 index (pre-grouping); public for I/O / bindings. | |
| void | setAtomIndex (long int atom, std::int64_t index) |
| const std::array< std::string, 5 > & | getHeaderCon () const |
| CON header lines (indices 0..4); public for I/O / bindings. | |
| void | setHeaderCon (const std::array< std::string, 5 > &headers) |
| void | setHeaderConLine (size_t i, std::string line) |
| bool | getPeriodic () const noexcept |
| void | setPeriodic (bool periodic) |
| void | applyPeriodicBoundaryIfEnabled () |
| Apply MIC wrap when periodic boundaries are enabled (I/O path). | |
Private Member Functions | |
| void | assertIsolatedMoleculeLayoutSafe () const |
| Throw if pot forbids PBC (isolated molecular QM backends, issue #188). | |
| void | computePotential () const |
| void | applyPeriodicBoundary () |
| void | applyPeriodicBoundary (double &component, int axis) |
| void | applyPeriodicBoundary (AtomMatrix &diff) |
Private Attributes | |
| eonc::log::Scoped | m_log |
| std::shared_ptr< Potential > | potential |
| bool | usePeriodicBoundaries |
| PbcConvention | pbcConvention |
| bool | recomputePotential |
| long | forceCalls |
| std::array< std::string, 5 > | headerCon |
| bool | removeNetForce {true} |
| Parameters::structure_comparison_options_t | structComp |
| const Parameters * | parameters |
| long | nAtoms |
| AtomMatrix | positions |
| AtomMatrix | velocities |
| AtomMatrix | forces |
| AtomMatrix | biasForces |
| BondBoost * | biasPotential {nullptr} |
| VectorXd | masses |
| VectorXi | atomicNrs |
| AtomMatrix | isFixed |
| Eigen::Matrix< std::int64_t, Eigen::Dynamic, 1 > | atomIndex |
| AtomMatrix | freeMask |
| AtomMatrix | maskedForces |
| std::vector< int > | freeIndices |
| bool | recomputeFreeMask {true} |
| bool | recomputeMaskedForces {true} |
| Matrix3d | cell |
| Matrix3d | cellInverse |
| double | energyVariance |
| std::vector< readcon::ConFrame > | movie_frames_ |
| double | potentialEnergy |
Friends | |
| io::IoStatus | io::con2matter (Matter &, const readcon::ConFrame &, io::ConFrameMetadata *) |
|
default |
|
inline |
Definition at line 95 of file Matter.h.
| Matter::Matter | ( | const Matter & | matter | ) |
Definition at line 23 of file Matter.cpp.
|
noexcept |
Move: transfers retained movie ConFrames (move-only).
User copy suppresses implicit move — without this, relax(inplace=False, retain_frames=True) loses frames when returning the working Matter.
Definition at line 74 of file Matter.cpp.
|
private |
Definition at line 543 of file Matter.cpp.
|
private |
|
private |
|
inline |
Apply MIC wrap when periodic boundaries are enabled (I/O path).
|
private |
Throw if pot forbids PBC (isolated molecular QM backends, issue #188).
Definition at line 486 of file Matter.cpp.
|
inline |
Definition at line 157 of file Matter.h.
| bool Matter::compare | ( | const Matter & | matter, |
| bool | indistinguishable = false ) |
Definition at line 129 of file Matter.cpp.
|
private |
Definition at line 498 of file Matter.cpp.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
| double Matter::distance | ( | const Matter & | matter, |
| long | index ) const |
Definition at line 376 of file Matter.cpp.
| double Matter::distance | ( | long | index1, |
| long | index2 ) const |
Definition at line 360 of file Matter.cpp.
| double Matter::distanceTo | ( | const Matter & | matter | ) |
Definition at line 155 of file Matter.cpp.
|
inline |
Mutable access to force storage for batched potential evaluation.
Caller must also call setComputedPotential() after writing forces.
Definition at line 236 of file Matter.h.
| AtomMatrix Matter::getAccelerations | ( | ) |
Definition at line 612 of file Matter.cpp.
| long Matter::getAtomicNr | ( | long int | atom | ) | const |
Definition at line 392 of file Matter.cpp.
| VectorXi Matter::getAtomicNrs | ( | ) | const |
Definition at line 569 of file Matter.cpp.
| VectorXi Matter::getAtomicNrsFree | ( | ) | const |
Definition at line 253 of file Matter.cpp.
|
inlinenodiscard |
.con column-5 index (pre-grouping); public for I/O / bindings.
Held 64-bit wide: readcon carries the column as a uint64_t, and a 32-bit slot drops the high half of any id past 2^31.
| AtomMatrix Matter::getBiasForces | ( | ) |
Definition at line 305 of file Matter.cpp.
| Matrix3d Matter::getCell | ( | ) | const |
Definition at line 211 of file Matter.cpp.
| double Matter::getEnergyVariance | ( | ) | const |
Definition at line 663 of file Matter.cpp.
| int Matter::getFixed | ( | long int | atom | ) | const |
1 if every Cartesian axis of the atom is fixed, else 0.
Definition at line 402 of file Matter.cpp.
| int Matter::getFixed | ( | long int | atom, |
| int | axis ) const |
1 if this atom's axis is fixed, else 0. axis is 0=x, 1=y, 2=z.
Definition at line 409 of file Matter.cpp.
|
nodiscard |
Per-axis CON column-4 mask (bit0=x, bit1=y, bit2=z).
Definition at line 413 of file Matter.cpp.
| long Matter::getForceCalls | ( | ) | const |
Definition at line 479 of file Matter.cpp.
| const AtomMatrix & Matter::getForces | ( | ) | const |
Definition at line 324 of file Matter.cpp.
| AtomMatrix Matter::getForcesFree | ( | ) | const |
Definition at line 344 of file Matter.cpp.
| VectorXd Matter::getForcesFreeV | ( | ) | const |
Definition at line 354 of file Matter.cpp.
| const AtomMatrix & Matter::getForcesRaw | ( | ) | const |
Definition at line 335 of file Matter.cpp.
| VectorXd Matter::getForcesV | ( | ) | const |
Definition at line 340 of file Matter.cpp.
| AtomMatrix Matter::getFree | ( | ) | const |
Definition at line 580 of file Matter.cpp.
| VectorXd Matter::getFreeV | ( | ) | const |
Definition at line 596 of file Matter.cpp.
|
inlinenodiscard |
| double Matter::getKineticEnergy | ( | ) | const |
Definition at line 454 of file Matter.cpp.
| double Matter::getMass | ( | long int | atom | ) | const |
Definition at line 380 of file Matter.cpp.
| Matrix< double, Eigen::Dynamic, 1 > Matter::getMasses | ( | ) | const |
Definition at line 623 of file Matter.cpp.
| double Matter::getMechanicalEnergy | ( | ) | const |
Definition at line 461 of file Matter.cpp.
|
inline |
|
inlinenodiscardnoexcept |
| double Matter::getPosition | ( | long int | atom, |
| int | axis ) const |
Definition at line 218 of file Matter.cpp.
| const AtomMatrix & Matter::getPositions | ( | ) | const |
Definition at line 236 of file Matter.cpp.
| AtomMatrix Matter::getPositionsCopy | ( | ) | const |
Definition at line 238 of file Matter.cpp.
| AtomMatrix Matter::getPositionsFree | ( | ) | const |
Definition at line 244 of file Matter.cpp.
| VectorXd Matter::getPositionsFreeV | ( | ) | const |
Definition at line 268 of file Matter.cpp.
| VectorXd Matter::getPositionsV | ( | ) | const |
Definition at line 240 of file Matter.cpp.
| std::shared_ptr< Potential > Matter::getPotential | ( | ) |
Definition at line 671 of file Matter.cpp.
| size_t Matter::getPotentialCalls | ( | ) | const |
Definition at line 659 of file Matter.cpp.
| double Matter::getPotentialEnergy | ( | ) | const |
Definition at line 446 of file Matter.cpp.
| AtomMatrix Matter::getVelocities | ( | ) | const |
Definition at line 600 of file Matter.cpp.
|
inlinenodiscardnoexcept |
Parameters.main_options.writeConForces for this Matter, if bound.
|
inlinenodiscard |
Definition at line 281 of file Matter.h.
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 288 of file Matter.h.
| double Matter::maxForce | ( | void | ) | const |
Definition at line 554 of file Matter.cpp.
|
inlinenodiscard |
In-memory minimization movie (same stamps as writeMovie CON).
Cleared when retainMovieFrames=false on the next relax, or via clearMovieFrames().
|
inlinenodiscard |
| long int Matter::numberOfAtoms | ( | ) | const |
Definition at line 209 of file Matter.cpp.
| long int Matter::numberOfFixedAtoms | ( | ) | const |
Definition at line 465 of file Matter.cpp.
| long int Matter::numberOfFreeAtoms | ( | ) | const |
Definition at line 475 of file Matter.cpp.
Definition at line 25 of file Matter.cpp.
Definition at line 76 of file Matter.cpp.
|
inline |
Definition at line 163 of file Matter.h.
|
inline |
Definition at line 166 of file Matter.h.
| double Matter::pdistance | ( | long | index1, |
| long | index2, | ||
| int | axis ) const |
Definition at line 366 of file Matter.cpp.
| double Matter::perAtomNorm | ( | const Matter & | matter | ) |
Definition at line 160 of file Matter.cpp.
| bool Matter::relax | ( | bool | quiet = false, |
| bool | writeMovie = false, | ||
| bool | checkpoint = false, | ||
| std::string | prefixMovie = std::string(), | ||
| std::string | prefixCheckpoint = std::string(), | ||
| bool | retainMovieFrames = false ) |
Definition at line 257 of file Matter.cpp.
| void Matter::resetForceCalls | ( | ) |
Definition at line 481 of file Matter.cpp.
| void Matter::resize | ( | long int | nAtoms | ) |
Definition at line 173 of file Matter.cpp.
| void Matter::setAtomicNr | ( | long int | atom, |
| long | atomicNr ) |
Definition at line 396 of file Matter.cpp.
| void Matter::setAtomicNrs | ( | const VectorXi & | atmnrs | ) |
Definition at line 571 of file Matter.cpp.
|
inline |
| void Matter::setBiasForces | ( | const AtomMatrix & | bf | ) |
Definition at line 318 of file Matter.cpp.
| void Matter::setBiasPotential | ( | BondBoost * | bondBoost | ) |
Definition at line 314 of file Matter.cpp.
| void Matter::setCell | ( | const Matrix3d & | newCell | ) |
Definition at line 213 of file Matter.cpp.
| void Matter::setComputedPotential | ( | double | energy, |
| double | variance ) |
Set energy/variance from external batched evaluation and mark forces as up-to-date (recomputePotential = false).
Definition at line 643 of file Matter.cpp.
| void Matter::setFixed | ( | long int | atom, |
| int | axis, | ||
| int | isFixed ) |
Set one Cartesian axis. axis is 0=x, 1=y, 2=z.
Definition at line 427 of file Matter.cpp.
| void Matter::setFixed | ( | long int | atom, |
| int | isFixed ) |
Broadcast a whole-atom flag onto all three axes.
Definition at line 418 of file Matter.cpp.
| void Matter::setFixedMask | ( | long int | atom, |
| std::array< bool, 3 > | mask ) |
Definition at line 433 of file Matter.cpp.
| void Matter::setForces | ( | const AtomMatrix & | f | ) |
Definition at line 608 of file Matter.cpp.
|
inline |
|
inline |
| void Matter::setMass | ( | long int | atom, |
| double | mass ) |
Definition at line 382 of file Matter.cpp.
| void Matter::setMasses | ( | const VectorXd & | massesIn | ) |
Definition at line 386 of file Matter.cpp.
|
inline |
|
inline |
| void Matter::setPosition | ( | long int | atom, |
| int | axis, | ||
| double | position ) |
Definition at line 222 of file Matter.cpp.
| void Matter::setPositions | ( | const AtomMatrix & | pos | ) |
Definition at line 273 of file Matter.cpp.
| void Matter::setPositionsFree | ( | const AtomMatrix & | pos | ) |
Definition at line 287 of file Matter.cpp.
| void Matter::setPositionsFreeV | ( | const VectorXd & | pos | ) |
Definition at line 301 of file Matter.cpp.
| void Matter::setPositionsV | ( | const VectorXd & | pos | ) |
Definition at line 283 of file Matter.cpp.
| void Matter::setPotential | ( | std::shared_ptr< Potential > | pot | ) |
Definition at line 625 of file Matter.cpp.
| void Matter::setVelocities | ( | const AtomMatrix & | v | ) |
Definition at line 604 of file Matter.cpp.
| void Matter::setVelocity | ( | long int | atom, |
| int | axis, | ||
| double | velocity ) |
Definition at line 231 of file Matter.cpp.
|
inlinenodiscard |
Take ownership of retained frames (leaves storage empty).
|
inlinenodiscard |
Definition at line 266 of file Matter.h.
|
friend |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
private |