|
Multi Resolution Molecular Dynamics 0.4.0
Multi Resolution Molecular Dynamics
|
Utility functions used throughout the library. More...
Classes | |
| class | ExponentialMovingAverage |
| Calculates the exponential moving average (EMA) for values added with append. More... | |
| class | IsInSymmetricSlab |
| Predicate to check if a point is within an axis-aligned slab. More... | |
| struct | Random |
| GPU compatible random number generator. More... | |
Functions | |
| KOKKOS_INLINE_FUNCTION constexpr real_t | degToRad (const real_t &grd) |
| converts degree to radians | |
| KOKKOS_INLINE_FUNCTION constexpr real_t | radToDeg (const real_t &rad) |
| converts radians to degree | |
| void | dumpView (const std::string &filename, const ScalarView &view) |
| Dump a scalar view to a text file. | |
| void | dumpView (const std::string &filename, const MultiView &view) |
| Dump a multi view to a text file. | |
| std::string | getEnvironmentVariable (const std::string &variable) |
| ExponentialMovingAverage & | operator<< (ExponentialMovingAverage &lhs, const real_t &rhs) |
| void | updateInterpolate (const data::MultiHistogram &target, const data::MultiHistogram &input) |
| Linear interpolation of data contained in input MultiHistogram onto grid of target histogram, adding the interpolated data to the data already contained in target. | |
| KOKKOS_INLINE_FUNCTION real_t | lerp (const real_t &left, const real_t &right, const real_t &factor) |
| Linear interpolation between two values. | |
| template<class T, class... P> | |
| void | grow (Kokkos::View< T, P... > &view, idx_t size, real_t safetyMargin=1.1_r) |
| KOKKOS_INLINE_FUNCTION real_t | dot3 (real_t const *const a, real_t const *const b) |
| KOKKOS_INLINE_FUNCTION real_t | sqr (const real_t &sqr) |
| KOKKOS_INLINE_FUNCTION real_t | powInt (const real_t &x, const idx_t n) |
| KOKKOS_INLINE_FUNCTION real_t | approxErfc (const real_t &x, real_t &expX2) |
| "Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Table" Milton Abramowitz (1970) "Rational Approximations", equation 7.1.27: | |
| KOKKOS_INLINE_FUNCTION real_t | approxErfc (const real_t &x) |
| template<typename HEAD> | |
| void | printTable (HEAD head) |
| template<typename HEAD, typename... TAIL> | |
| void | printTable (HEAD head, TAIL... tail) |
| template<typename HEAD> | |
| void | printTableSep (HEAD) |
| template<typename HEAD, typename... TAIL> | |
| void | printTableSep (HEAD, TAIL... tail) |
| data::Atoms | fillDomainWithAtoms (const data::Subdomain &subdomain, const idx_t &numAtoms, const real_t &maxVelocity, const real_t &inputMass) |
| Helper function to provide an initial atoms ensamble. | |
Utility functions used throughout the library.
Angle handling, interpolation, random numbers, small math helpers, moving averages and the simulation setup helpers used by the examples.
"Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Table" Milton Abramowitz (1970) "Rational Approximations", equation 7.1.27:
accuracy: 1.5x10^-7
| x | evaluation point |
| expX2 | intermediate value std::exp(-x * x) |
converts degree to radians
| void mrmd::util::dumpView | ( | const std::string & | filename, |
| const MultiView & | view ) |
Dump a multi view to a text file.
| filename | output filename |
| view | view that should be written to file |
| void mrmd::util::dumpView | ( | const std::string & | filename, |
| const ScalarView & | view ) |
Dump a scalar view to a text file.
| filename | output filename |
| view | view that should be written to file |
| data::Atoms mrmd::util::fillDomainWithAtoms | ( | const data::Subdomain & | subdomain, |
| const idx_t & | numAtoms, | ||
| const real_t & | maxVelocity, | ||
| const real_t & | inputMass ) |
Helper function to provide an initial atoms ensamble.
| subdomain | Area where to place atoms. |
| numAtoms | How many atoms to place. |
| maxVelocity | Maximial initial absolute velocity of the atoms. |
| inputMass | Mass of the atoms. |
|
inline |
| void mrmd::util::grow | ( | Kokkos::View< T, P... > & | view, |
| idx_t | size, | ||
| real_t | safetyMargin = 1.1_r ) |
| KOKKOS_INLINE_FUNCTION real_t mrmd::util::lerp | ( | const real_t & | left, |
| const real_t & | right, | ||
| const real_t & | factor ) |
Linear interpolation between two values.
| left | left value |
| right | right value |
| factor | interpolation factor in [0, 1] |
|
inline |
| void mrmd::util::printTable | ( | HEAD | head | ) |
| void mrmd::util::printTable | ( | HEAD | head, |
| TAIL... | tail ) |
| void mrmd::util::printTableSep | ( | HEAD | ) |
| void mrmd::util::printTableSep | ( | HEAD | , |
| TAIL... | tail ) |
converts radians to degree
| void mrmd::util::updateInterpolate | ( | const data::MultiHistogram & | target, |
| const data::MultiHistogram & | input ) |
Linear interpolation of data contained in input MultiHistogram onto grid of target histogram, adding the interpolated data to the data already contained in target.
Data for target grid points outside of the grid range of the input MultiHistogram is not updated.
| input | MultiHistogram containing data to interpolate on coarse grid. |
| target | MultiHistogram defining the grid to interpolate onto and containing the data to be updated by interpolating the data from input. |