PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
methods.h File Reference
#include "point.h"
#include <cstdint>
#include <cstring>
#include <vector>
#include <chrono>
#include <numeric>
#include <algorithm>
#include <map>
Include dependency graph for methods.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  util
 Collection of methods useful in simulation.
 
namespace  util::methods
 Provides fast methods to add/subtract list of data, to find maximum/minimum from list of data.
 

Functions

template<typename T >
size_t util::methods::maxIndex (const std::vector< T > &data)
 Returns the index corresponding to maximum from list of data.
 
template<typename T >
size_t util::methods::minIndex (const std::vector< T > &data)
 Returns the index corresponding to minimum from list of data.
 
template<typename T >
util::methods::max (const std::vector< T > &data)
 Returns the maximum from list of data.
 
template<typename T >
util::methods::min (const std::vector< T > &data)
 Returns the minimim from list of data.
 
template<typename T >
std::pair< size_t, T > util::methods::maxAndMaxIndex (const std::vector< T > &data)
 Returns the maximum and index of maximum from list of data.
 
template<typename T >
std::pair< size_t, T > util::methods::minAndMinIndex (const std::vector< T > &data)
 Returns the minimum and index of minimum from list of data.
 
template<typename T >
size_t util::methods::maxIndex (const std::vector< T > &data, size_t data_start, size_t data_end)
 Returns the index corresponding to maximum from list of data.
 
size_t util::methods::maxLengthIndex (const std::vector< util::Point > &data)
 Returns the index that has maximum length of point from list of points.
 
size_t util::methods::minLengthIndex (const std::vector< util::Point > &data)
 Returns the index that has minimum length of point from list of points.
 
double util::methods::maxLength (const std::vector< util::Point > &data)
 Returns the maximum length of point from list of points.
 
double util::methods::minLength (const std::vector< util::Point > &data)
 Returns the minimum length of point from list of points.
 
std::pair< double, size_t > util::methods::maxLengthAndMaxLengthIndex (const std::vector< util::Point > &data)
 Returns the maximum length of point and index from list of points.
 
std::pair< double, size_t > util::methods::minLengthAndMinLengthIndex (const std::vector< util::Point > &data)
 Returns the minimum length of point and index from list of points.
 
template<typename T >
util::methods::add (const std::vector< T > &data)
 Returns the sum of data.
 
bool util::methods::isFree (const int &i, const unsigned int &dof)
 Returns true if degree of freedom is free.
 
bool util::methods::isFree (const uint8_t &i, const unsigned int &dof)
 Returns true if degree of freedom is free.
 
template<typename T >
bool util::methods::isInList (const T &i, const std::vector< T > &list)
 Find if data is in the list.
 
bool util::methods::isTagInList (const std::string &tag, const std::vector< std::string > &tags)
 Returns true if tag is found in the list of tags.
 
template<typename T >
void util::methods::addToList (const T &i, std::vector< T > &list)
 Add element to the list.
 
float util::methods::timeDiff (std::chrono::steady_clock::time_point begin, std::chrono::steady_clock::time_point end, std::string unit="microseconds")
 Returns difference between two times.
 
template<typename T_out >
T_out util::methods::getKeyData (std::string key, std::map< std::string, T_out > &data_map, bool issue_err=false)
 Get data for a key.
 
template<typename T_out >
void util::methods::appendKeyData (std::string key, T_out data, std::map< std::string, T_out > &data_map, bool issue_err=false)
 Append value to data associated with key.
 
template<typename T_out >
void util::methods::setKeyData (std::string key, T_out data, std::map< std::string, T_out > &data_map, bool issue_err=false)
 Set value to data associated with key.