MRMD 0.4.0
Multi Resolution Molecular Dynamics
Loading...
Searching...
No Matches
mrmd::util Namespace Reference

Classes

class  ExponentialMovingAverage
 Calculates the exponential moving average (EMA) for values added with append. More...
 
class  IsInSymmetricSlab
 
struct  Random
 

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)
 
void dumpView (const std::string &filename, const MultiView &view)
 
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)
 

Function Documentation

◆ approxErfc() [1/2]

KOKKOS_INLINE_FUNCTION real_t mrmd::util::approxErfc ( const real_t &  x)

◆ approxErfc() [2/2]

KOKKOS_INLINE_FUNCTION real_t mrmd::util::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:

accuracy: 1.5x10^-7

Parameters
xevaluation point
expX2intermediate value std::exp(-x * x)

◆ degToRad()

KOKKOS_INLINE_FUNCTION constexpr real_t mrmd::util::degToRad ( const real_t &  grd)
constexpr

converts degree to radians

◆ dot3()

KOKKOS_INLINE_FUNCTION real_t mrmd::util::dot3 ( real_t const *const  a,
real_t const *const  b 
)

◆ dumpView() [1/2]

void mrmd::util::dumpView ( const std::string &  filename,
const MultiView &  view 
)

◆ dumpView() [2/2]

void mrmd::util::dumpView ( const std::string &  filename,
const ScalarView &  view 
)

◆ fillDomainWithAtoms()

data::Atoms mrmd::util::fillDomainWithAtoms ( const data::Subdomain &  subdomain,
const idx_t &  numAtoms,
const real_t &  maxVelocity,
const real_t &  inputMass 
)

◆ getEnvironmentVariable()

std::string mrmd::util::getEnvironmentVariable ( const std::string &  variable)
inline

◆ grow()

template<class T , class... P>
void mrmd::util::grow ( Kokkos::View< T, P... > &  view,
idx_t  size,
real_t  safetyMargin = 1.1_r 
)

◆ lerp()

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.

Parameters
leftleft value
rightright value
factorinterpolation factor in [0, 1]
Returns
interpolated value

◆ operator<<()

ExponentialMovingAverage & mrmd::util::operator<< ( ExponentialMovingAverage &  lhs,
const real_t &  rhs 
)
inline

◆ powInt()

KOKKOS_INLINE_FUNCTION real_t mrmd::util::powInt ( const real_t &  x,
const idx_t  n 
)

◆ printTable() [1/2]

template<typename HEAD >
void mrmd::util::printTable ( HEAD  head)

◆ printTable() [2/2]

template<typename HEAD , typename... TAIL>
void mrmd::util::printTable ( HEAD  head,
TAIL...  tail 
)

◆ printTableSep() [1/2]

template<typename HEAD >
void mrmd::util::printTableSep ( HEAD  )

◆ printTableSep() [2/2]

template<typename HEAD , typename... TAIL>
void mrmd::util::printTableSep ( HEAD  ,
TAIL...  tail 
)

◆ radToDeg()

KOKKOS_INLINE_FUNCTION constexpr real_t mrmd::util::radToDeg ( const real_t &  rad)
constexpr

converts radians to degree

◆ sqr()

KOKKOS_INLINE_FUNCTION real_t mrmd::util::sqr ( const real_t &  sqr)

◆ updateInterpolate()

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.

Parameters
inputMultiHistogram containing data to interpolate on coarse grid.
targetMultiHistogram defining the grid to interpolate onto and containing the data to be updated by interpolating the data from input.