#include <Matter.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| ~Matter () | |
| 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) |
| BondBoost * | getBiasPotential () const |
| The bias potential added to this Matter's forces, or nullptr. | |
| void | assignKeepingBias (const Matter &other) |
| Copy another structure in and keep this Matter's own bias potential. | |
| 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 |
| Matrix3d | cauchyStress () |
| Cauchy stress in eV/Angstrom^3. | |
| bool | needsForceUpdate () const |
| Whether forces need recomputation (positions changed since last eval). | |
| double * | forcesData () |
| Mutable access to force storage for batched potential evaluation. | |
| void | setEvaluation (const AtomMatrix &forces, double energy) |
| Puts a known evaluation back after a position reset: the forces and energy of a geometry this object held before, so no potential call follows. | |
| 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 |
| double | maxFreeAtomForce (const AtomMatrix &rows) const |
| Max per-atom Euclidean norm of rows. | |
| 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) |
| long | mapFileRow (long file_row) const |
| Map a CON file-order row onto the Matter row after matter_order. | |
| void | setFileToMatter (std::vector< long > map) |
| 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) |
| void | restoreFileForces (const AtomMatrix &fileForces, bool trustEnergy, double energy) |
| Write .con forces without the fixed-atom mask setForces applies. | |
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} |
| StructureComparisonOptions | structComp |
| const Parameters * | parameters |
| long | nAtoms |
| std::unique_ptr< Impl > | impl_ |
| BondBoost * | biasPotential {nullptr} |
| std::vector< long > | fileToMatter |
| std::vector< int > | freeIndices |
| bool | recomputeFreeMask {true} |
| bool | recomputeMaskedForces {true} |
| double | energyVariance |
| std::vector< readcon::ConFrame > | movie_frames_ |
| double | potentialEnergy |
Friends | |
| io::IoStatus | io::con2matter (Matter &, const readcon::ConFrame &, io::ConFrameMetadata *) |
|
default |
| eonc::Matter::Matter | ( | std::shared_ptr< Potential > | pot, |
| const Parameters & | params ) |
Definition at line 49 of file Matter.cpp.
| eonc::Matter::Matter | ( | const Matter & | matter | ) |
Definition at line 81 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 136 of file Matter.cpp.
|
private |
Definition at line 666 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 594 of file Matter.cpp.
| void eonc::Matter::assignKeepingBias | ( | const Matter & | other | ) |
Copy another structure in and keep this Matter's own bias potential.
operator= clears the bias pointer, because it names the source's boost.
Definition at line 400 of file Matter.cpp.
| Matrix3d eonc::Matter::cauchyStress | ( | ) |
Cauchy stress in eV/Angstrom^3.
Recomputes the potential so the tensor belongs to this image. The potential must report stress.
Definition at line 794 of file Matter.cpp.
|
inline |
Definition at line 132 of file Matter.h.
| bool eonc::Matter::compare | ( | const Matter & | matter, |
| bool | indistinguishable = false ) |
Definition at line 184 of file Matter.cpp.
|
private |
Definition at line 606 of file Matter.cpp.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
| double eonc::Matter::distance | ( | const Matter & | matter, |
| long | index ) const |
Definition at line 471 of file Matter.cpp.
| double eonc::Matter::distance | ( | long | index1, |
| long | index2 ) const |
| double eonc::Matter::distanceTo | ( | const Matter & | matter | ) |
Definition at line 206 of file Matter.cpp.
| double * eonc::Matter::forcesData | ( | ) |
Mutable access to force storage for batched potential evaluation.
Caller must also call setComputedPotential() after writing forces.
Definition at line 824 of file Matter.cpp.
| AtomMatrix eonc::Matter::getAccelerations | ( | ) |
Definition at line 739 of file Matter.cpp.
| long eonc::Matter::getAtomicNr | ( | long int | atom | ) | const |
Definition at line 495 of file Matter.cpp.
| VectorXi eonc::Matter::getAtomicNrs | ( | ) | const |
Definition at line 691 of file Matter.cpp.
| VectorXi eonc::Matter::getAtomicNrsFree | ( | ) | const |
Definition at line 325 of file Matter.cpp.
|
nodiscard |
.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.
Definition at line 826 of file Matter.cpp.
| AtomMatrix eonc::Matter::getBiasForces | ( | ) |
Definition at line 385 of file Matter.cpp.
| BondBoost * eonc::Matter::getBiasPotential | ( | ) | const |
The bias potential added to this Matter's forces, or nullptr.
Definition at line 398 of file Matter.cpp.
| Matrix3d eonc::Matter::getCell | ( | ) | const |
Definition at line 275 of file Matter.cpp.
| double eonc::Matter::getEnergyVariance | ( | ) | const |
Definition at line 792 of file Matter.cpp.
| int eonc::Matter::getFixed | ( | long int | atom | ) | const |
1 if every Cartesian axis of the atom is fixed, else 0.
Definition at line 505 of file Matter.cpp.
| int eonc::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 514 of file Matter.cpp.
|
nodiscard |
| long eonc::Matter::getForceCalls | ( | ) | const |
Definition at line 587 of file Matter.cpp.
| const AtomMatrix & eonc::Matter::getForces | ( | ) | const |
Definition at line 412 of file Matter.cpp.
| AtomMatrix eonc::Matter::getForcesFree | ( | ) | const |
Definition at line 432 of file Matter.cpp.
| VectorXd eonc::Matter::getForcesFreeV | ( | ) | const |
Definition at line 442 of file Matter.cpp.
| const AtomMatrix & eonc::Matter::getForcesRaw | ( | ) | const |
Definition at line 423 of file Matter.cpp.
| VectorXd eonc::Matter::getForcesV | ( | ) | const |
Definition at line 428 of file Matter.cpp.
| AtomMatrix eonc::Matter::getFree | ( | ) | const |
Definition at line 704 of file Matter.cpp.
| VectorXd eonc::Matter::getFreeV | ( | ) | const |
Definition at line 720 of file Matter.cpp.
|
inlinenodiscard |
| double eonc::Matter::getKineticEnergy | ( | ) | const |
Definition at line 562 of file Matter.cpp.
| double eonc::Matter::getMass | ( | long int | atom | ) | const |
Definition at line 478 of file Matter.cpp.
| Matrix< double, Eigen::Dynamic, 1 > eonc::Matter::getMasses | ( | ) | const |
Definition at line 750 of file Matter.cpp.
| double eonc::Matter::getMechanicalEnergy | ( | ) | const |
Definition at line 569 of file Matter.cpp.
|
inline |
|
inlinenodiscardnoexcept |
| double eonc::Matter::getPosition | ( | long int | atom, |
| int | axis ) const |
Definition at line 284 of file Matter.cpp.
| const AtomMatrix & eonc::Matter::getPositions | ( | ) | const |
Definition at line 308 of file Matter.cpp.
| AtomMatrix eonc::Matter::getPositionsCopy | ( | ) | const |
Definition at line 310 of file Matter.cpp.
| AtomMatrix eonc::Matter::getPositionsFree | ( | ) | const |
Definition at line 316 of file Matter.cpp.
| VectorXd eonc::Matter::getPositionsFreeV | ( | ) | const |
Definition at line 345 of file Matter.cpp.
| VectorXd eonc::Matter::getPositionsV | ( | ) | const |
Definition at line 312 of file Matter.cpp.
| std::shared_ptr< Potential > eonc::Matter::getPotential | ( | ) |
Definition at line 808 of file Matter.cpp.
| size_t eonc::Matter::getPotentialCalls | ( | ) | const |
Definition at line 788 of file Matter.cpp.
| double eonc::Matter::getPotentialEnergy | ( | ) | const |
Definition at line 554 of file Matter.cpp.
| AtomMatrix eonc::Matter::getVelocities | ( | ) | const |
Definition at line 724 of file Matter.cpp.
|
nodiscardnoexcept |
Parameters.main_options().writeConForces for this Matter, if bound.
Definition at line 64 of file Matter.cpp.
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 268 of file Matter.h.
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 275 of file Matter.h.
| double eonc::Matter::maxForce | ( | void | ) | const |
Definition at line 685 of file Matter.cpp.
|
nodiscard |
Max per-atom Euclidean norm of rows.
Atoms fixed on every axis are ignored. rows must have one row per atom.
Definition at line 677 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 eonc::Matter::numberOfAtoms | ( | ) | const |
Definition at line 273 of file Matter.cpp.
| long int eonc::Matter::numberOfFixedAtoms | ( | ) | const |
Definition at line 573 of file Matter.cpp.
| long int eonc::Matter::numberOfFreeAtoms | ( | ) | const |
Definition at line 583 of file Matter.cpp.
Definition at line 86 of file Matter.cpp.
Definition at line 141 of file Matter.cpp.
| AtomMatrix eonc::Matter::pbc | ( | const AtomMatrix & | diff | ) | const |
Definition at line 810 of file Matter.cpp.
| VectorXd eonc::Matter::pbcV | ( | const VectorXd & | diff | ) | const |
Definition at line 817 of file Matter.cpp.
| double eonc::Matter::pdistance | ( | long | index1, |
| long | index2, | ||
| int | axis ) const |
Definition at line 457 of file Matter.cpp.
| double eonc::Matter::perAtomNorm | ( | const Matter & | matter | ) |
Definition at line 214 of file Matter.cpp.
| bool eonc::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 334 of file Matter.cpp.
| void eonc::Matter::resetForceCalls | ( | ) |
Definition at line 589 of file Matter.cpp.
| void eonc::Matter::resize | ( | long int | nAtoms | ) |
Definition at line 227 of file Matter.cpp.
|
private |
Write .con forces without the fixed-atom mask setForces applies.
Definition at line 834 of file Matter.cpp.
| void eonc::Matter::setAtomicNr | ( | long int | atom, |
| long | atomicNr ) |
Definition at line 499 of file Matter.cpp.
| void eonc::Matter::setAtomicNrs | ( | const VectorXi & | atmnrs | ) |
Definition at line 693 of file Matter.cpp.
| void eonc::Matter::setAtomIndex | ( | long int | atom, |
| std::int64_t | index ) |
Definition at line 830 of file Matter.cpp.
| void eonc::Matter::setBiasForces | ( | const AtomMatrix & | bf | ) |
Definition at line 406 of file Matter.cpp.
| void eonc::Matter::setBiasPotential | ( | BondBoost * | bondBoost | ) |
Definition at line 394 of file Matter.cpp.
| void eonc::Matter::setCell | ( | const Matrix3d & | newCell | ) |
Definition at line 277 of file Matter.cpp.
| void eonc::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 772 of file Matter.cpp.
|
inline |
Puts a known evaluation back after a position reset: the forces and energy of a geometry this object held before, so no potential call follows.
Fixed-atom masking applies on read as for any evaluation.
Definition at line 219 of file Matter.h.
|
inline |
Definition at line 300 of file Matter.h.
| void eonc::Matter::setFixed | ( | long int | atom, |
| int | axis, | ||
| int | isFixed ) |
Set one Cartesian axis. axis is 0=x, 1=y, 2=z.
Definition at line 537 of file Matter.cpp.
| void eonc::Matter::setFixed | ( | long int | atom, |
| int | isFixed ) |
Broadcast a whole-atom flag onto all three axes.
Definition at line 527 of file Matter.cpp.
| void eonc::Matter::setFixedMask | ( | long int | atom, |
| std::array< bool, 3 > | mask ) |
Definition at line 545 of file Matter.cpp.
| void eonc::Matter::setForces | ( | const AtomMatrix & | f | ) |
Definition at line 732 of file Matter.cpp.
|
inline |
|
inline |
| void eonc::Matter::setMass | ( | long int | atom, |
| double | mass ) |
Definition at line 483 of file Matter.cpp.
| void eonc::Matter::setMasses | ( | const VectorXd & | massesIn | ) |
Definition at line 488 of file Matter.cpp.
|
inline |
|
inline |
| void eonc::Matter::setPosition | ( | long int | atom, |
| int | axis, | ||
| double | position ) |
Definition at line 290 of file Matter.cpp.
| void eonc::Matter::setPositions | ( | const AtomMatrix & | pos | ) |
Definition at line 350 of file Matter.cpp.
| void eonc::Matter::setPositionsFree | ( | const AtomMatrix & | pos | ) |
Definition at line 367 of file Matter.cpp.
| void eonc::Matter::setPositionsFreeV | ( | const VectorXd & | pos | ) |
Definition at line 381 of file Matter.cpp.
| void eonc::Matter::setPositionsV | ( | const VectorXd & | pos | ) |
Definition at line 363 of file Matter.cpp.
| void eonc::Matter::setPotential | ( | std::shared_ptr< Potential > | pot | ) |
Definition at line 754 of file Matter.cpp.
| void eonc::Matter::setVelocities | ( | const AtomMatrix & | v | ) |
Definition at line 728 of file Matter.cpp.
| void eonc::Matter::setVelocity | ( | long int | atom, |
| int | axis, | ||
| double | velocity ) |
Definition at line 301 of file Matter.cpp.
|
inlinenodiscard |
Take ownership of retained frames (leaves storage empty).
|
inlinenodiscard |
Definition at line 253 of file Matter.h.
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |