Owned streaming MSD accumulator.
More...
#include <include/seams.hpp>
|
| | Msd (std::size_t natoms, std::size_t max_lag, std::size_t origin_stride, double dt, std::span< const double, 3 > axis) |
| | Allocate a streaming MSD accumulator.
|
| void | push (std::span< const double > xyz) |
| | Push one unwrapped coordinate frame.
|
| void | push (std::span< const double > xyz, std::span< const double, 9 > box9) |
| | Push one periodic coordinate frame and unwrap incrementally.
|
| MsdCurve | curve () const |
| | Copy out accumulated total, axial, and lateral MSD curves.
|
| DiffusionFit | fit (double t_start=0.0, double t_end=0.0) const |
| | Fit Einstein diffusion coefficients over [t_start, t_end].
|
| Public Member Functions inherited from seams::detail::Handle< seams_msd, seams_msd_destroy > |
| | Handle ()=default |
| Handle & | operator= (const Handle &)=delete |
| | ~Handle () |
| | operator bool () const noexcept |
Owned streaming MSD accumulator.
Definition at line 1089 of file seams.hpp.
◆ Msd()
| seams::Msd::Msd |
( |
std::size_t | natoms, |
|
|
std::size_t | max_lag, |
|
|
std::size_t | origin_stride, |
|
|
double | dt, |
|
|
std::span< const double, 3 > | axis ) |
|
inline |
Allocate a streaming MSD accumulator.
- Parameters
-
| natoms | Particle count per frame. |
| max_lag | Maximum lag in frames, or 0 for all lags. |
| origin_stride | Frame stride between origins. |
| dt | Frame spacing in physical time units. |
| axis | Axial direction 3-vector. |
Definition at line 1099 of file seams.hpp.
1100 {
1104 }
Msd(std::size_t natoms, std::size_t max_lag, std::size_t origin_stride, double dt, std::span< const double, 3 > axis)
Allocate a streaming MSD accumulator.
SEAMS_API seams_status seams_msd_create(size_t natoms, size_t max_lag, size_t origin_stride, double dt, const double axis[3], seams_msd **out)
Create a streaming multi-origin MSD accumulator with axial/lateral split.
struct seams_msd seams_msd
Streaming mean-squared displacement accumulator.
void check(int status, const void *handle)
◆ curve()
Copy out accumulated total, axial, and lateral MSD curves.
Definition at line 1125 of file seams.hpp.
1125 {
1126 std::size_t nl = 0;
1129 MsdCurve out;
1130 out.lag_time.resize(nl);
1131 out.total.resize(nl);
1132 out.axial.resize(nl);
1133 out.lateral.resize(nl);
1134 out.n_origins.resize(nl);
1136 out.lateral.data(), out.n_origins.data(), nl, &nl),
1138 return out;
1139 }
seams_msd * get() const noexcept
SEAMS_API seams_status seams_msd_curve(const seams_msd *msd, double *lag_time, double *total, double *axial, double *lateral, size_t *n_origins, size_t cap, size_t *n_lags)
Read accumulated lag times and total, axial, and lateral MSD curves.
◆ fit()
| DiffusionFit seams::Msd::fit |
( |
double | t_start = 0.0, |
|
|
double | t_end = 0.0 ) const |
|
inlinenodiscard |
Fit Einstein diffusion coefficients over [t_start, t_end].
Definition at line 1142 of file seams.hpp.
1142 {
1143 DiffusionFit out;
1145 seams_msd_fit(
get(), t_start, t_end, &out.d_total, &out.d_axial, &out.d_lateral, &out.alpha),
1147 out.alpha_fitted = !std::isnan(out.alpha);
1148 return out;
1149 }
SEAMS_API seams_status seams_msd_fit(const seams_msd *msd, double t_start, double t_end, double *d_total, double *d_axial, double *d_lateral, double *alpha)
Linear Einstein diffusion fit on an MSD accumulator.
◆ push() [1/2]
| void seams::Msd::push |
( |
std::span< const double > | xyz | ) |
|
|
inline |
Push one unwrapped coordinate frame.
Definition at line 1109 of file seams.hpp.
1109 {
1110 if (xyz.size() % 3 != 0) {
1112 }
1114 }
Error(int status, std::string message)
Build an error from a status and a message.
SEAMS_API seams_status seams_msd_push(seams_msd *msd, const double *xyz, size_t natoms, const double *box9, size_t box_len)
Push one frame into a streaming MSD accumulator.
@ SEAMS_ERR_ARG
A caller argument is the wrong shape, or a coordinate is not finite.
◆ push() [2/2]
| void seams::Msd::push |
( |
std::span< const double > | xyz, |
|
|
std::span< const double, 9 > | box9 ) |
|
inline |
Push one periodic coordinate frame and unwrap incrementally.
Definition at line 1117 of file seams.hpp.
1117 {
1118 if (xyz.size() % 3 != 0) {
1120 }
1122 }
The documentation for this class was generated from the following file: