seams-core v2.14.2
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
seams::Reorientation Class Reference

Owned streaming orientational correlation accumulator. More...

#include <include/seams.hpp>

Inheritance diagram for seams::Reorientation:

Public Member Functions

 Reorientation (std::size_t n_vectors, std::size_t max_lag, std::size_t origin_stride, double dt)
 Allocate a reorientation accumulator.
void push (std::span< const double > vectors)
 Push one frame of molecular 3-vectors.
ReorientationCurve curve () const
 Read C1 and C2 correlation curves.
ReorientationFit fit (double t_start=0.0, double t_end=0.0) const
 Fit integrated and single-exponential reorientation times.
Public Member Functions inherited from seams::detail::Handle< seams_reorient, seams_reorient_destroy >
 Handle ()=default
Handle & operator= (const Handle &)=delete
 ~Handle ()
 operator bool () const noexcept

Additional Inherited Members

Protected Member Functions inherited from seams::detail::Handle< seams_reorient, seams_reorient_destroy >
seams_reorient * get () const noexcept
void reset () noexcept
Protected Attributes inherited from seams::detail::Handle< seams_reorient, seams_reorient_destroy >
seams_reorient * ptr_

Detailed Description

Owned streaming orientational correlation accumulator.

Definition at line 1214 of file seams.hpp.

Constructor & Destructor Documentation

◆ Reorientation()

seams::Reorientation::Reorientation ( std::size_t n_vectors,
std::size_t max_lag,
std::size_t origin_stride,
double dt )
inline

Allocate a reorientation accumulator.

Parameters
n_vectorsMolecular vector count per frame.
max_lagMaximum lag in frames, or 0 for all lags.
origin_strideFrame stride between origins.
dtFrame spacing.

Definition at line 1223 of file seams.hpp.

1223 {
1224 seams_reorient *raw = nullptr;
1225 detail::check(seams_reorient_create(n_vectors, max_lag, origin_stride, dt, &raw), nullptr);
1226 *this = Reorientation(raw);
1227 }
Reorientation(std::size_t n_vectors, std::size_t max_lag, std::size_t origin_stride, double dt)
Allocate a reorientation accumulator.
Definition seams.hpp:1223
SEAMS_API seams_status seams_reorient_create(size_t n_vectors, size_t max_lag, size_t origin_stride, double dt, seams_reorient **out)
Create a streaming orientational correlation accumulator for C1 and C2.
struct seams_reorient seams_reorient
Streaming orientational time-correlation accumulator.
Definition seams.h:264
void check(int status, const void *handle)
Definition seams.hpp:699

Member Function Documentation

◆ curve()

ReorientationCurve seams::Reorientation::curve ( ) const
inlinenodiscard

Read C1 and C2 correlation curves.

Definition at line 1240 of file seams.hpp.

1240 {
1241 std::size_t nl = 0;
1242 detail::check(seams_reorient_curve(get(), nullptr, nullptr, nullptr, nullptr, 0, &nl), get());
1243 ReorientationCurve out;
1244 out.lag_time.resize(nl);
1245 out.c1.resize(nl);
1246 out.c2.resize(nl);
1247 out.n_origins.resize(nl);
1248 detail::check(seams_reorient_curve(get(), out.lag_time.data(), out.c1.data(), out.c2.data(),
1249 out.n_origins.data(), nl, &nl),
1250 get());
1251 return out;
1252 }
SEAMS_API seams_status seams_reorient_curve(const seams_reorient *reorient, double *lag_time, double *c1, double *c2, size_t *n_origins, size_t cap, size_t *n_lags)
Read accumulated C1(t) = <P1(u(0).u(t))> and C2(t) = <P2(u(0).u(t))>.

◆ fit()

ReorientationFit seams::Reorientation::fit ( double t_start = 0.0,
double t_end = 0.0 ) const
inlinenodiscard

Fit integrated and single-exponential reorientation times.

Definition at line 1255 of file seams.hpp.

1255 {
1256 ReorientationFit out;
1257 detail::check(seams_reorient_fit(get(), t_start, t_end, &out.tau1_int, &out.tau1_exp,
1258 &out.tau2_int, &out.tau2_exp),
1259 get());
1260 return out;
1261 }
SEAMS_API seams_status seams_reorient_fit(const seams_reorient *reorient, double t_start, double t_end, double *tau1_int, double *tau1_exp, double *tau2_int, double *tau2_exp)
Integrated and single-exponential reorientation times tau_1 and tau_2.

◆ push()

void seams::Reorientation::push ( std::span< const double > vectors)
inline

Push one frame of molecular 3-vectors.

Definition at line 1232 of file seams.hpp.

1232 {
1233 if (vectors.size() % 3 != 0) {
1234 throw Error(SEAMS_ERR_ARG, "vectors length is not a multiple of 3");
1235 }
1236 detail::check(seams_reorient_push(get(), vectors.data(), vectors.size() / 3), get());
1237 }
Error(int status, std::string message)
Build an error from a status and a message.
Definition seams.hpp:186
SEAMS_API seams_status seams_reorient_push(seams_reorient *reorient, const double *vectors, size_t n_vectors)
Push one frame of molecular 3-vectors into a reorientation accumulator.
@ SEAMS_ERR_ARG
A caller argument is the wrong shape, or a coordinate is not finite.
Definition seams.h:159

The documentation for this class was generated from the following file: