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

Namespaces

namespace  impl
 

Classes

struct  ArrayT
 
struct  Bond
 
struct  EnergyAndVirialReducer
 
struct  Histogram
 
struct  MPIInfo
 
struct  MultiHistogram
 
struct  Subdomain
 |X|O|OOOOOOOOOO |X|O|OOOOOOOOOO |X|O+-------— <– minInnerCorner |X|OOOOOOOOOOOO |X+---------— <– minCorner |XXXXXXXXXXXXXX +-----------— <– minGhostCorner More...
 

Typedefs

using HostAtoms = impl::GeneralAtoms< HostType, false >
 atoms with memory allocated on host
 
using DeviceAtoms = impl::GeneralAtoms< DeviceType, true >
 atoms with memory allocated on device
 
using Atoms = DeviceAtoms
 
using BondView = Kokkos::View< Bond * >
 
using HostMolecules = impl::GeneralMolecules< HostType, false >
 
using DeviceMolecules = impl::GeneralMolecules< DeviceType, true >
 
using Molecules = DeviceMolecules
 

Functions

template<class DEVICE_TYPE_A , bool DEVICE_A, class DEVICE_TYPE_B , bool DEVICE_B>
void deep_copy (impl::GeneralAtoms< DEVICE_TYPE_A, DEVICE_A > &dst, const impl::GeneralAtoms< DEVICE_TYPE_B, DEVICE_B > &src)
 
data::Histogram gradient (const data::Histogram &input)
 
std::ostream & operator<< (std::ostream &os, const data::Histogram &hist)
 Overload for writing to console/files.
 
template<class DEVICE_TYPE_A , bool DEVICE_A, class DEVICE_TYPE_B , bool DEVICE_B>
void deep_copy (impl::GeneralMolecules< DEVICE_TYPE_A, DEVICE_A > &dst, const impl::GeneralMolecules< DEVICE_TYPE_B, DEVICE_B > &src)
 
data::Molecules createMoleculeForEachAtom (data::Atoms &atoms)
 
void cumulativeMovingAverage (data::MultiHistogram &average, const data::MultiHistogram &current, const real_t movingAverageFactor=10_r)
 Add new item to the comulative moving average.
 
data::MultiHistogram gradient (const data::MultiHistogram &input, const bool periodic=false)
 Calculates the gradient of the histogram.
 
data::MultiHistogram smoothen (data::MultiHistogram &input, const real_t &sigma, const real_t &range, const bool periodic=false)
 Smoothen a histogram using gaussian convolution.
 
ScalarView createGrid (const MultiHistogram &input)
 
template<class BinaryOp >
void transform (const MultiHistogram &input1, const MultiHistogram &input2, MultiHistogram &output, const BinaryOp &binary_op)
 Applies a binary operation to corresponding elements of two input MultiHistograms and stores the result in an output MultiHistogram.
 
template<OneCoordinatePredicate Pred>
void replace_if_bin_position (MultiHistogram &hist, const Pred &pred, real_t newValue)
 Replaces histogram values with a new value if the bin position satisfies a predicate.
 
void checkInvariants (const Subdomain &subdomain)
 

Typedef Documentation

◆ Atoms

◆ BondView

◆ DeviceAtoms

atoms with memory allocated on device

◆ DeviceMolecules

◆ HostAtoms

atoms with memory allocated on host

◆ HostMolecules

◆ Molecules

Function Documentation

◆ checkInvariants()

void mrmd::data::checkInvariants ( const Subdomain &  subdomain)

◆ createGrid()

ScalarView mrmd::data::createGrid ( const MultiHistogram &  input)

◆ createMoleculeForEachAtom()

data::Molecules mrmd::data::createMoleculeForEachAtom ( data::Atoms &  atoms)

◆ cumulativeMovingAverage()

void mrmd::data::cumulativeMovingAverage ( data::MultiHistogram &  average,
const data::MultiHistogram &  current,
const real_t  movingAverageFactor = 10_r 
)

Add new item to the comulative moving average.

Parameters
averageaveraged histogram (output)
currentcurrent value
movingAverageFactornew value = (n * average + current) / (n + 1)

◆ deep_copy() [1/2]

template<class DEVICE_TYPE_A , bool DEVICE_A, class DEVICE_TYPE_B , bool DEVICE_B>
void mrmd::data::deep_copy ( impl::GeneralAtoms< DEVICE_TYPE_A, DEVICE_A > &  dst,
const impl::GeneralAtoms< DEVICE_TYPE_B, DEVICE_B > &  src 
)

◆ deep_copy() [2/2]

template<class DEVICE_TYPE_A , bool DEVICE_A, class DEVICE_TYPE_B , bool DEVICE_B>
void mrmd::data::deep_copy ( impl::GeneralMolecules< DEVICE_TYPE_A, DEVICE_A > &  dst,
const impl::GeneralMolecules< DEVICE_TYPE_B, DEVICE_B > &  src 
)

◆ gradient() [1/2]

data::Histogram mrmd::data::gradient ( const data::Histogram &  input)

◆ gradient() [2/2]

data::MultiHistogram mrmd::data::gradient ( const data::MultiHistogram &  input,
const bool  periodic = false 
)

Calculates the gradient of the histogram.

Uses central difference for all inner values and one-sided/central difference for boundary values depending on periodicity.

Parameters
inputinput histogram
periodictreat boundaries as periodic
Returns
gradient of the histogram

◆ operator<<()

std::ostream & mrmd::data::operator<< ( std::ostream &  os,
const data::Histogram &  hist 
)

Overload for writing to console/files.

Attention
If the data is located in device memory the data will be copied into host memory.

◆ replace_if_bin_position()

template<OneCoordinatePredicate Pred>
void mrmd::data::replace_if_bin_position ( MultiHistogram &  hist,
const Pred &  pred,
real_t  newValue 
)

Replaces histogram values with a new value if the bin position satisfies a predicate.

Parameters
histThe MultiHistogram object whose values will be conditionally replaced.
predA unary predicate function that is evaluated for each bin position. If it returns true for a bin position, all histogram values at that bin are replaced with newValue.
newValueThe value to assign to histogram entries whose bin position satisfies the predicate.

◆ smoothen()

data::MultiHistogram mrmd::data::smoothen ( data::MultiHistogram &  input,
const real_t &  sigma,
const real_t &  range,
const bool  periodic = false 
)

Smoothen a histogram using gaussian convolution.

Parameters
inputinput histogram
sigmasigma of the gaussian convolution
rangecalculation range in multiples of sigma
periodictreat boundaries as periodic
Returns
smoothened histogram

how many neighboring bins are affected

◆ transform()

template<class BinaryOp >
void mrmd::data::transform ( const MultiHistogram &  input1,
const MultiHistogram &  input2,
MultiHistogram &  output,
const BinaryOp &  binary_op 
)

Applies a binary operation to corresponding elements of two input MultiHistograms and stores the result in an output MultiHistogram.

Template Parameters
BinaryOpThe type of the binary operation to be applied.
Parameters
input1The first input MultiHistogram.
input2The second input MultiHistogram.
outputThe MultiHistogram where the result of the binary operation will be stored.
binary_opThe binary operation to apply to the elements of input1 and input2.
Precondition
The dimensions (numBins and numHistograms) of input1, input2, and output must match.