ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Utils Namespace Reference

Namespaces

namespace  Interpolation
 
namespace  Mpi
 
namespace  Statistics
 

Classes

class  Accumulator
 
struct  AccumulatorData
 
struct  Array
 
class  Bag
 Bag of elements. More...
 
class  Cache
 
class  compact_vector
 Custom vector container optimized for size. More...
 
struct  conjunction
 
struct  conjunction< B1 >
 
struct  conjunction< B1, Bn... >
 
class  Counter
 
class  CylindricalHistogram
 Histogram in cylindrical coordinates. More...
 
class  CylindricalTransformationParameters
 A class to hold and validate parameters for a cylindrical coordinate transformations. More...
 
struct  decay_to_scalar
 Meta function to turns a Vector<1, T> into T. More...
 
struct  decay_to_scalar< Vector< T, 1 > >
 
struct  decay_to_scalar< Vector< T, N > >
 
class  Factory
 Factory template. More...
 
struct  function_remove_const
 Remove const from a function signature. More...
 
struct  function_remove_const< R(Args...) const >
 
struct  function_remove_const< R(Args...)>
 
class  Histogram
 Histogram in Cartesian coordinates. More...
 
struct  is_statically_serializable
 Type trait to indicate that a type is serializable with a static size, e.g. More...
 
struct  Matrix
 Matrix representation with static size. More...
 
class  MemcpyIArchive
 Archive that deserializes from a buffer via memcpy. More...
 
class  MemcpyOArchive
 Archive that serializes to a buffer via memcpy. More...
 
class  NumeratedContainer
 Container for objects that are identified by a numeric id. More...
 
struct  Quaternion
 Quaternion representation. More...
 
struct  size_in_bits
 Size of a type in bits. More...
 
class  Span
 A stripped-down version of std::span from C++17. More...
 
struct  tuple_element
 
struct  tuple_element< I, Array< T, N > >
 
struct  tuple_element< I, Vector< T, N > >
 
struct  tuple_size
 
struct  tuple_size< Array< T, N > >
 
struct  tuple_size< Vector< T, N > >
 
class  Vector
 

Typedefs

using Vector3b = Utils::Vector< bool, 3 >
 
template<std::size_t I, class Tuple >
using tuple_element_t = typename tuple_element< I, Tuple >::type
 
template<class T >
using Vector3 = Vector< T, 3 >
 
template<std::size_t N>
using VectorXd = Vector< double, N >
 
using Vector2d = VectorXd< 2 >
 
using Vector3d = VectorXd< 3 >
 
using Vector4d = VectorXd< 4 >
 
using Vector6d = VectorXd< 6 >
 
using Vector9d = VectorXd< 9 >
 
template<std::size_t N>
using VectorXf = Vector< float, N >
 
using Vector3f = VectorXf< 3 >
 
template<std::size_t N>
using VectorXi = Vector< int, N >
 
using Vector3i = VectorXi< 3 >
 

Enumerations

enum class  MemoryOrder { COLUMN_MAJOR , ROW_MAJOR }
 

Functions

template<std::size_t I, class T , std::size_t N>
auto get (Array< T, N > const &a) -> std::enable_if_t<(I< N), const T & >
 
template<typename Body , typename... ForwardRange>
void cartesian_product (const Body &op, const ForwardRange &...rng)
 Call op with each element of the cartesian product set of rng.
 
template<typename ParticleRange >
bool check_charge_neutrality (ParticleRange &prange)
 
template<class InputIt , class T >
bool contains (InputIt first, InputIt last, T const &value)
 Check whether an iterator range contains a value.
 
template<class Range , class T >
bool contains (const Range &rng, T const &value)
 Check whether a range contains a value.
 
template<class T >
std::string demangle ()
 Get a human-readable name for a type.
 
template<class Range , class OutputIterator >
void flatten (Range const &v, OutputIterator out)
 Flatten a range of ranges.
 
template<typename ForwardIterator , typename BinaryOp >
void for_each_pair (ForwardIterator first, ForwardIterator last, BinaryOp op)
 Execute op for each pair of elements in [first, last) once.
 
template<typename ForwardRange , typename BinaryOp >
void for_each_pair (ForwardRange &&rng, BinaryOp &&op)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename ForwardIterator , typename BinaryOp >
void for_each_cartesian_pair (ForwardIterator first1, ForwardIterator last1, ForwardIterator first2, ForwardIterator last2, BinaryOp op)
 Execute op for each pair of elements between [first1, last1) and [first2, last2).
 
template<typename ForwardRange , typename BinaryOp >
void for_each_cartesian_pair (ForwardRange &&rng1, ForwardRange &&rng2, BinaryOp &&op)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename ForwardIterator , typename BinaryOp , typename BinaryCmp >
void for_each_cartesian_pair_if (ForwardIterator first1, ForwardIterator last1, ForwardIterator first2, ForwardIterator last2, BinaryOp op, BinaryCmp cmp)
 Execute op for each pair of elements between [first1, last1) and [first2, last2) if a condition is satisfied.
 
template<typename ForwardRange , typename BinaryOp , typename BinaryCmp >
void for_each_cartesian_pair_if (ForwardRange &&rng1, ForwardRange &&rng2, BinaryOp &&op, BinaryCmp cmp)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<std::size_t I, typename T >
const std::tuple_element_t< I, T > & get (const T &v)
 
int get_linear_index (int a, int b, int c, const Vector3i &adim, MemoryOrder memory_order=MemoryOrder::COLUMN_MAJOR)
 get the linear index from the position (a,b,c) in a 3D grid of dimensions adim.
 
int get_linear_index (const Vector3i &ind, const Vector3i &adim, MemoryOrder memory_order=MemoryOrder::COLUMN_MAJOR)
 
template<class T >
lower_triangular (T i, T j)
 Linear index into a lower triangular matrix.
 
template<typename T , template< T > class F, T min, T max, class... Args>
decltype(auto) integral_parameter (T i, Args &&...args)
 Generate a call table for an integral non-type template parameter.
 
template<typename Map >
auto keys (Map const &m) -> std::vector< typename Map::key_type >
 Return the keys of a map type.
 
template<typename T , typename Container >
linear_interpolation (Container const &table, T hi, T offset, T x)
 Linear interpolation between two data points.
 
template<class T , class Integral >
auto mask (Integral mask, T t) -> std::enable_if_t< std::is_unsigned_v< Integral > &&(size_in_bits< Integral >::value >=tuple_size< T >::value), T >
 Pick elements of a tuple-like by a bit mask.
 
DEVICE_QUALIFIER double abs (double x)
 Return the absolute value of x.
 
DEVICE_QUALIFIER float abs (float x)
 Return the absolute value of x.
 
template<typename T >
constexpr T AS_erfc_part (T d)
 Approximate \( \exp(d^2) \mathrm{erfc}(d)\) by applying a formula from [1] chapter 7.
 
template<int order, typename T >
DEVICE_QUALIFIER auto bspline (int i, T x) -> std::enable_if_t<(order > 0) &&(order<=7), T >
 Formula of the B-spline.
 
template<class T >
auto bspline (int i, T x, int k)
 Calculate B-splines.
 
template<int order, typename T = double>
DEVICE_QUALIFIER auto bspline_d (int i, T x) -> std::enable_if_t<(order > 0) &&(order<=7), T >
 Derivative of the B-spline.
 
Vector3d basis_change (Vector3d const &b1, Vector3d const &b2, Vector3d const &b3, Vector3d const &v, bool reverse=false)
 Basis change.
 
Vector3d transform_coordinate_cartesian_to_cylinder (Vector3d const &pos)
 Coordinate transformation from Cartesian to cylindrical coordinates.
 
Vector3d transform_coordinate_cartesian_to_cylinder (Vector3d const &pos, Vector3d const &axis, Vector3d const &orientation)
 Coordinate transformation from Cartesian to cylindrical coordinates with change of basis.
 
Vector3d transform_coordinate_cylinder_to_cartesian (Vector3d const &pos)
 Coordinate transformation from cylindrical to Cartesian coordinates.
 
Vector3d transform_coordinate_cylinder_to_cartesian (Vector3d const &pos, Vector3d const &axis, Vector3d const &orientation)
 Coordinate transformation from cylindrical to Cartesian coordinates with change of basis.
 
Vector3d transform_vector_cartesian_to_cylinder (Vector3d const &vec, Vector3d const &axis, Vector3d const &pos)
 Vector transformation from Cartesian to cylindrical coordinates.
 
double gaussian (Vector3d x, Vector3d x0, double sigma)
 
Utils::Vector3d del_gaussian (Vector3d x, Vector3d x0, double sigma)
 
template<unsigned n, typename T >
DEVICE_QUALIFIER constexpr T int_pow (T x)
 Calculate integer powers.
 
template<class T >
auto make_lin_space (T start, T stop, std::size_t number, bool endpoint=true)
 Equally spaced values in interval.
 
template<typename T , std::size_t N, const std::array< std::array< int, N >, N > & matrix, typename Container >
constexpr std::array< T, Nmatrix_vector_product (const Container &vec)
 Calculate the matrix-vector product for a statically given (square) matrix.
 
template<typename T , std::size_t N>
Vector< T, Ncalc_orthonormal_vector (Vector< T, N > const &vec)
 Return a vector that is orthonormal to vec.
 
void permute_ifield (int *field, int size, int permute)
 permute an integer array field of size size about permute positions.
 
template<class T >
Vector< T, 3 > convert_quaternion_to_director (Quaternion< T > const &quat)
 Convert quaternion to director.
 
template<class T >
Quaternion< T > convert_director_to_quaternion (Vector< T, 3 > const &d)
 Convert director to quaternion.
 
template<typename T >
constexpr int sgn (T val)
 Calculate signum of val.
 
template<typename T >
DEVICE_QUALIFIERsinc (T d)
 Calculates the sinc-function as sin(PI*x)/(PI*x).
 
template<typename T >
DEVICE_QUALIFIER constexpr T sqr (T x)
 Calculates the SQuaRe of x.
 
template<typename T , std::size_t N, std::size_t M>
Matrix< T, N, M > tensor_product (const Vector< T, N > &x, const Vector< T, M > &y)
 
template<typename T , std::size_t N>
Vector< T, Ntensor_product (const T &x, const Vector< T, N > &y)
 
Vector3d get_n_triangle (const Vector3d &P1, const Vector3d &P2, const Vector3d &P3)
 Computes the normal vector of a triangle.
 
double area_triangle (const Vector3d &P1, const Vector3d &P2, const Vector3d &P3)
 Computes the area of triangle between vectors P1,P2,P3, by computing the cross product P1P2 x P1P3 and taking the half of its norm.
 
double angle_btw_triangles (const Vector3d &P1, const Vector3d &P2, const Vector3d &P3, const Vector3d &P4)
 Computes the angle between two triangles in 3D space.
 
Vector3d vec_rotate (const Vector3d &axis, double angle, const Vector3d &vector)
 Rotate a vector around an axis.
 
double angle_between (Vector3d const &v1, Vector3d const &v2)
 Determine the angle between two vectors.
 
template<typename T , std::size_t M, std::size_t N>
Utils::Vector< T, M *Nflatten (Matrix< T, M, N > const &m)
 
template<typename T , std::size_t Rows, std::size_t Cols>
Matrix< T, Rows, Cols > diagonal_mat (Utils::Vector< T, Rows > const &v)
 
template<typename T , std::size_t Rows, std::size_t Cols>
Matrix< T, Rows, Cols > identity_mat ()
 
template<typename T , typename U , std::enable_if_t< std::is_arithmetic_v< U >, bool > = true>
Quaternion< T > operator* (const U &b, const Quaternion< T > &a)
 Product quaternion and arithmetic type.
 
template<typename T >
Matrix< T, 3, 3 > rotation_matrix (Quaternion< T > const &q)
 Convert quaternion to rotation matrix.
 
template<class T , class F >
auto raster (Vector< T, 3 > const &offset, Vector< T, 3 > const &grid_spacing, Vector3i size, F f)
 Raster a function over a regular 3d grid.
 
std::vector< Vector3dget_cylindrical_sampling_positions (std::pair< double, double > const &r_limits, std::pair< double, double > const &phi_limits, std::pair< double, double > const &z_limits, std::size_t n_r_bins, std::size_t n_phi_bins, std::size_t n_z_bins, double sampling_density)
 Generate sampling positions for a cylindrical histogram.
 
template<class T >
std::string pack (T const &v)
 Pack a serialize type into a string.
 
template<class T >
unpack (std::string const &state)
 Unpack a serialize type into a string.
 
template<typename T >
DEVICE_QUALIFIER constexpr Span< T > make_span (T *p, std::size_t N)
 
template<class C >
DEVICE_QUALIFIER constexpr auto make_span (C &c)
 
template<typename T >
DEVICE_QUALIFIER constexpr Span< std::add_const_t< T > > make_const_span (T *p, std::size_t N)
 
template<class C >
DEVICE_QUALIFIER constexpr auto make_const_span (C &c)
 
template<class F , class Tuple >
void for_each (F &&f, Tuple &t)
 
template<class F , class Tuple >
void for_each (F &&f, Tuple &&t)
 
constexpr uint64_t u32_to_u64 (uint32_t high, uint32_t low)
 
constexpr std::pair< uint32_t, uint32_t > u64_to_u32 (uint64_t in)
 
constexpr double uniform (uint64_t in)
 Uniformly map unsigned integer to double.
 
template<std::size_t N, typename T >
constexpr bool operator< (Vector< T, N > const &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T >
constexpr bool operator> (Vector< T, N > const &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T >
constexpr bool operator<= (Vector< T, N > const &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T >
constexpr bool operator>= (Vector< T, N > const &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T >
constexpr bool operator== (Vector< T, N > const &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T >
constexpr bool operator!= (Vector< T, N > const &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T , typename U >
auto operator+ (Vector< T, N > const &a, Vector< U, N > const &b)
 
template<std::size_t N, typename T >
Vector< T, N > & operator+= (Vector< T, N > &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T , typename U >
auto operator- (Vector< T, N > const &a, Vector< U, N > const &b)
 
template<std::size_t N, typename T >
Vector< T, Noperator- (Vector< T, N > const &a)
 
template<std::size_t N, typename T >
Vector< T, N > & operator-= (Vector< T, N > &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T , class U , std::enable_if_t< std::is_arithmetic_v< U >, bool > = true>
auto operator* (U const &a, Vector< T, N > const &b)
 
template<std::size_t N, typename T , class U , std::enable_if_t< std::is_arithmetic_v< U >, bool > = true>
auto operator* (Vector< T, N > const &b, U const &a)
 
template<std::size_t N, typename T >
Vector< T, N > & operator*= (Vector< T, N > &b, T const &a)
 
template<std::size_t N, typename T >
Vector< T, Noperator/ (Vector< T, N > const &a, T const &b)
 
template<std::size_t N, typename T >
Vector< T, N > & operator/= (Vector< T, N > &a, T const &b)
 
template<std::size_t N, typename T , class U , class = std::enable_if_t<not(detail::is_vector<T>::value or detail::is_vector<U>::value)>>
auto operator* (Vector< T, N > const &a, Vector< U, N > const &b)
 
template<std::size_t N, typename T , class U , class = std::enable_if_t<std::is_integral_v<T> and std::is_integral_v<U>>>
auto operator% (Vector< T, N > const &a, Vector< U, N > const &b)
 
template<std::size_t N, typename T >
Vector< T, Nsqrt (Vector< T, N > const &a)
 
template<class T >
Vector< T, 3 > vector_product (Vector< T, 3 > const &a, Vector< T, 3 > const &b)
 
template<class T , std::size_t N>
product (Vector< T, N > const &v)
 
template<class T , class U , std::size_t N>
auto hadamard_product (Vector< T, N > const &a, Vector< U, N > const &b)
 
template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<T>::value)>>
auto hadamard_product (T const &a, Vector< U, N > const &b)
 
template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<U>::value)>>
auto hadamard_product (Vector< T, N > const &a, U const &b)
 
template<typename T , typename U , class = std::enable_if_t<not(detail::is_vector<T>::value or detail::is_vector<U>::value)>>
auto hadamard_product (T const &a, U const &b)
 
template<class T , class U , std::size_t N>
auto hadamard_division (Vector< T, N > const &a, Vector< U, N > const &b)
 
template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<U>::value)>>
auto hadamard_division (Vector< T, N > const &a, U const &b)
 
template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<T>::value)>>
auto hadamard_division (T const &a, Vector< U, N > const &b)
 
template<typename T , typename U , class = std::enable_if_t<not(detail::is_vector<T>::value or detail::is_vector<U>::value)>>
auto hadamard_division (T const &a, U const &b)
 
template<typename T >
Vector< T, 3 > unit_vector (unsigned int i)
 
template<std::size_t I, class T , std::size_t N>
auto get (Vector< T, N > const &a) -> std::enable_if_t<(I< N), const T & >
 
Mathematical, physical and chemical constants. <br>
template<class T = double>
DEVICE_QUALIFIER constexpr T pi ()
 Ratio of diameter and circumference of a circle.
 
template<class T = double>
DEVICE_QUALIFIER constexpr T sqrt_pi_i ()
 One over square root of pi.
 
template<class T = double>
DEVICE_QUALIFIER constexpr T gamma ()
 Euler-Mascheroni constant.
 
template<class T = double>
DEVICE_QUALIFIER constexpr T ln_2 ()
 Natural logarithm of 2.
 
template<class T = double>
DEVICE_QUALIFIER constexpr T sqrt_2 ()
 Square root of 2.
 
template<class T = double>
DEVICE_QUALIFIER constexpr T cbrt_2 ()
 Cube root of 2.
 

Typedef Documentation

◆ tuple_element_t

template<std::size_t I, class Tuple >
using Utils::tuple_element_t = typedef typename tuple_element<I, Tuple>::type

Definition at line 37 of file get.hpp.

◆ Vector2d

using Utils::Vector2d = typedef VectorXd<2>

Definition at line 156 of file Vector.hpp.

◆ Vector3

template<class T >
using Utils::Vector3 = typedef Vector<T, 3>

Definition at line 153 of file Vector.hpp.

◆ Vector3b

using Utils::Vector3b = typedef Utils::Vector<bool, 3>

Definition at line 54 of file Variant.hpp.

◆ Vector3d

using Utils::Vector3d = typedef VectorXd<3>

Definition at line 157 of file Vector.hpp.

◆ Vector3f

using Utils::Vector3f = typedef VectorXf<3>

Definition at line 163 of file Vector.hpp.

◆ Vector3i

using Utils::Vector3i = typedef VectorXi<3>

Definition at line 166 of file Vector.hpp.

◆ Vector4d

using Utils::Vector4d = typedef VectorXd<4>

Definition at line 158 of file Vector.hpp.

◆ Vector6d

using Utils::Vector6d = typedef VectorXd<6>

Definition at line 159 of file Vector.hpp.

◆ Vector9d

using Utils::Vector9d = typedef VectorXd<9>

Definition at line 160 of file Vector.hpp.

◆ VectorXd

template<std::size_t N>
using Utils::VectorXd = typedef Vector<double, N>

Definition at line 155 of file Vector.hpp.

◆ VectorXf

template<std::size_t N>
using Utils::VectorXf = typedef Vector<float, N>

Definition at line 162 of file Vector.hpp.

◆ VectorXi

template<std::size_t N>
using Utils::VectorXi = typedef Vector<int, N>

Definition at line 165 of file Vector.hpp.

Enumeration Type Documentation

◆ MemoryOrder

enum class Utils::MemoryOrder
strong
Enumerator
COLUMN_MAJOR 
ROW_MAJOR 

Definition at line 32 of file index.hpp.

Function Documentation

◆ abs() [1/2]

DEVICE_QUALIFIER double Utils::abs ( double  x)
inline

Return the absolute value of x.

Definition at line 32 of file abs.hpp.

Referenced by Shapes::HollowConicalFrustum::calculate_dist(), and sinc().

◆ abs() [2/2]

DEVICE_QUALIFIER float Utils::abs ( float  x)
inline

Return the absolute value of x.

Definition at line 37 of file abs.hpp.

◆ angle_between()

double Utils::angle_between ( Vector3d const &  v1,
Vector3d const &  v2 
)
inline

◆ angle_btw_triangles()

double Utils::angle_btw_triangles ( const Vector3d P1,
const Vector3d P2,
const Vector3d P3,
const Vector3d P4 
)
inline

Computes the angle between two triangles in 3D space.

Returns the angle between two triangles in 3D space given by points P1P2P3 and P2P3P4. Note, that the common edge is given as the second and the third argument. Here, the angle can have values from 0 to 2 * PI, depending on the orientation of the two triangles. So the angle can be convex or concave. For each triangle, an inward direction has been defined as the direction of one of the two normal vectors. Particularly, for triangle P1P2P3 it is the vector N1 = P2P1 x P2P3 and for triangle P2P3P4 it is N2 = P2P3 x P2P4. The method first computes the angle between N1 and N2, which gives always value between 0 and PI and then it checks whether this value must be corrected to a value between PI and 2 * PI.

As an example, consider 4 points A,B,C,D in space given by coordinates A = [1,1,1], B = [2,1,1], C = [1,2,1], D = [1,1,2]. We want to determine the angle between triangles ABC and ACD. In case the orientation of the triangle ABC is [0,0,1] and orientation of ACD is [1,0,0], the resulting angle must be PI/2.0. To get correct results, note that the common edge is AC, and one must call the method as angle_btw_triangles(B,A,C,D). With this call we have ensured that N1 = AB x AC (which coincides with [0,0,1]) and N2 = AC x AD (which coincides with [1,0,0]). Alternatively, if the orientations of the two triangles were the opposite, the correct call would be angle_btw_triangles(B,C,A,D) so that N1 = CB x CA and N2 = CA x CD.

Definition at line 79 of file triangle_functions.hpp.

References get_n_triangle(), and pi().

Referenced by OifLocalForcesBond::calc_forces().

◆ area_triangle()

double Utils::area_triangle ( const Vector3d P1,
const Vector3d P2,
const Vector3d P3 
)
inline

Computes the area of triangle between vectors P1,P2,P3, by computing the cross product P1P2 x P1P3 and taking the half of its norm.

Definition at line 48 of file triangle_functions.hpp.

References get_n_triangle(), and Utils::Vector< T, N >::norm().

Referenced by add_oif_global_forces(), OifLocalForcesBond::calc_forces(), and calc_oif_global().

◆ AS_erfc_part()

template<typename T >
constexpr T Utils::AS_erfc_part ( d)
constexpr

Approximate \( \exp(d^2) \mathrm{erfc}(d)\) by applying a formula from [1] chapter 7.

Definition at line 29 of file AS_erfc_part.hpp.

Referenced by CoulombP3M::pair_energy(), DipolarP3M::pair_energy(), CoulombP3M::pair_force(), and DipolarP3M::pair_force().

◆ basis_change()

Vector3d Utils::basis_change ( Vector3d const &  b1,
Vector3d const &  b2,
Vector3d const &  b3,
Vector3d const &  v,
bool  reverse = false 
)
inline

◆ bspline() [1/2]

template<int order, typename T >
DEVICE_QUALIFIER auto Utils::bspline ( int  i,
x 
) -> std::enable_if_t<(order > 0) && (order <= 7), T>

◆ bspline() [2/2]

template<class T >
auto Utils::bspline ( int  i,
x,
int  k 
)

Calculate B-splines.

Parameters
iknot number, using 0-based indexing
xposition in the range (-0.5, 0.5)
korder of the B-spline, using 1-based indexing, i.e. a B-spline of order k is a polynomial of degree k-1

Definition at line 186 of file bspline.hpp.

◆ bspline_d()

template<int order, typename T = double>
DEVICE_QUALIFIER auto Utils::bspline_d ( int  i,
x 
) -> std::enable_if_t<(order > 0) && (order <= 7), T>

Derivative of the B-spline.

Definition at line 210 of file bspline.hpp.

References DEVICE_ASSERT, and DEVICE_THROW.

◆ calc_orthonormal_vector()

template<typename T , std::size_t N>
Vector< T, N > Utils::calc_orthonormal_vector ( Vector< T, N > const &  vec)

Return a vector that is orthonormal to vec.

Definition at line 32 of file orthonormal_vec.hpp.

References Utils::Vector< T, N >::broadcast(), Utils::Vector< T, N >::norm(), Utils::Vector< T, N >::norm2(), and sqrt_2().

◆ cartesian_product()

template<typename Body , typename... ForwardRange>
void Utils::cartesian_product ( const Body &  op,
const ForwardRange &...  rng 
)

Call op with each element of the cartesian product set of rng.

Parameters
opOperation to call for each element of the product set.
rngRanges to form the product over

Definition at line 54 of file cartesian_product.hpp.

Referenced by for_each_image().

◆ cbrt_2()

template<class T = double>
DEVICE_QUALIFIER constexpr T Utils::cbrt_2 ( )
constexpr

Cube root of 2.

Definition at line 71 of file constants.hpp.

Referenced by LJcos_Parameters::LJcos_Parameters().

◆ check_charge_neutrality()

template<typename ParticleRange >
bool Utils::check_charge_neutrality ( ParticleRange prange)

Definition at line 31 of file charge_neutrality.hpp.

◆ contains() [1/2]

template<class Range , class T >
bool Utils::contains ( const Range &  rng,
T const &  value 
)

Check whether a range contains a value.

Parameters
rngThe range to search in.
valueThe value to search for.
Returns
True iff range contains the value.

Definition at line 49 of file contains.hpp.

References contains().

◆ contains() [2/2]

template<class InputIt , class T >
bool Utils::contains ( InputIt  first,
InputIt  last,
T const &  value 
)

Check whether an iterator range contains a value.

Parameters
firstBeginning of the range
lastEnd of the range.
valueThe value to search for.
Returns
True iff range contains the value.

Definition at line 36 of file contains.hpp.

Referenced by add_exclusion(), contains(), ReactionMethods::ReactionAlgorithm::displacement_mc_move(), gather_traits_for_types(), mindist(), and CellStructure::remove_particle().

◆ convert_director_to_quaternion()

template<class T >
Quaternion< T > Utils::convert_director_to_quaternion ( Vector< T, 3 > const &  d)

Convert director to quaternion.

Parameters
dDirector
Returns
A (non-normalized) quaternion from the director, or {1, 0, 0, 0} if the director is the null vector.

Definition at line 54 of file math/quaternion.hpp.

References Utils::Vector< T, N >::norm().

Referenced by calculate_vs_relate_to_params(), convert_dip_to_quat(), and ScriptInterface::Particles::ParticleHandle::ParticleHandle().

◆ convert_quaternion_to_director()

template<class T >
Vector< T, 3 > Utils::convert_quaternion_to_director ( Quaternion< T > const &  quat)

Convert quaternion to director.

Returns
A (non-normalized) director.

Definition at line 41 of file math/quaternion.hpp.

Referenced by ParticlePosition::calc_director(), connection_vector(), gb_pair_energy(), gb_pair_force(), and ScriptInterface::Particles::ParticleHandle::ParticleHandle().

◆ del_gaussian()

Utils::Vector3d Utils::del_gaussian ( Vector3d  x,
Vector3d  x0,
double  sigma 
)
inline

Definition at line 31 of file utils/include/utils/math/gaussian.hpp.

References gaussian().

◆ demangle()

template<class T >
std::string Utils::demangle ( )

Get a human-readable name for a type.

Uses boost to demangle the name, for details see documentation for boost::core::demangle.

Template Parameters
Ttype
Returns
name

Definition at line 36 of file demangle.hpp.

◆ diagonal_mat()

template<typename T , std::size_t Rows, std::size_t Cols>
Matrix< T, Rows, Cols > Utils::diagonal_mat ( Utils::Vector< T, Rows > const &  v)

Definition at line 225 of file matrix.hpp.

◆ flatten() [1/2]

template<typename T , std::size_t M, std::size_t N>
Utils::Vector< T, M *N > Utils::flatten ( Matrix< T, M, N > const &  m)

◆ flatten() [2/2]

template<class Range , class OutputIterator >
void Utils::flatten ( Range const &  v,
OutputIterator  out 
)

Flatten a range of ranges.

Copy a range of ranges to an output range by subsequently copying the nested ranges to the output. Arbitrary deep nesting is supported, the elements are copied into the output in a depth-first fashion.

Template Parameters
RangeA Forward Range
OutputIteratorAn OutputIterator
Parameters
vInput Range
outOutput iterator

Definition at line 63 of file flatten.hpp.

Referenced by System::System::calculate_pressure(), dpd_stress(), Observables::ParticleObservable< ObsType >::evaluate(), and Utils::Matrix< T, Rows, Cols >::Matrix().

◆ for_each() [1/2]

template<class F , class Tuple >
void Utils::for_each ( F &&  f,
Tuple &&  t 
)

Definition at line 52 of file tuple.hpp.

References f.

◆ for_each() [2/2]

template<class F , class Tuple >
void Utils::for_each ( F &&  f,
Tuple &  t 
)

Definition at line 46 of file tuple.hpp.

References f.

◆ for_each_cartesian_pair() [1/2]

template<typename ForwardIterator , typename BinaryOp >
void Utils::for_each_cartesian_pair ( ForwardIterator  first1,
ForwardIterator  last1,
ForwardIterator  first2,
ForwardIterator  last2,
BinaryOp  op 
)

Execute op for each pair of elements between [first1, last1) and [first2, last2).

Diagonal elements are not excluded. Pairs are traversed ordered, so that for op(*it, *jt), it holds that distance(it - first) < distance(jt - first), and distance(it_n - first) < distance(it_n+1 - first) for consecutive calls.

Definition at line 62 of file for_each_pair.hpp.

Referenced by for_each_cartesian_pair().

◆ for_each_cartesian_pair() [2/2]

template<typename ForwardRange , typename BinaryOp >
void Utils::for_each_cartesian_pair ( ForwardRange &&  rng1,
ForwardRange &&  rng2,
BinaryOp &&  op 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 76 of file for_each_pair.hpp.

References for_each_cartesian_pair().

◆ for_each_cartesian_pair_if() [1/2]

template<typename ForwardIterator , typename BinaryOp , typename BinaryCmp >
void Utils::for_each_cartesian_pair_if ( ForwardIterator  first1,
ForwardIterator  last1,
ForwardIterator  first2,
ForwardIterator  last2,
BinaryOp  op,
BinaryCmp  cmp 
)

Execute op for each pair of elements between [first1, last1) and [first2, last2) if a condition is satisfied.

Diagonal elements are not excluded. Pairs are traversed ordered, so that for op(*it, *jt), it holds that distance(it - first) < distance(jt - first), and distance(it_n - first) < distance(it_n+1 - first) for consecutive calls.

Definition at line 93 of file for_each_pair.hpp.

Referenced by for_each_cartesian_pair_if().

◆ for_each_cartesian_pair_if() [2/2]

template<typename ForwardRange , typename BinaryOp , typename BinaryCmp >
void Utils::for_each_cartesian_pair_if ( ForwardRange &&  rng1,
ForwardRange &&  rng2,
BinaryOp &&  op,
BinaryCmp  cmp 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 109 of file for_each_pair.hpp.

References for_each_cartesian_pair_if().

◆ for_each_pair() [1/2]

template<typename ForwardIterator , typename BinaryOp >
void Utils::for_each_pair ( ForwardIterator  first,
ForwardIterator  last,
BinaryOp  op 
)

Execute op for each pair of elements in [first, last) once.

Diagonal elements are excluded. Pairs are traversed ordered, so that for op(*it, *jt), it holds that distance(it - first) < distance(jt - first), and distance(it_n - first) < distance(it_n+1 - first) for consecutive calls.

Definition at line 35 of file for_each_pair.hpp.

Referenced by for_each_pair(), and ClusterAnalysis::ClusterStructure::run_for_all_pairs().

◆ for_each_pair() [2/2]

template<typename ForwardRange , typename BinaryOp >
void Utils::for_each_pair ( ForwardRange &&  rng,
BinaryOp &&  op 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 47 of file for_each_pair.hpp.

References for_each_pair().

◆ gamma()

template<class T = double>
DEVICE_QUALIFIER constexpr T Utils::gamma ( )
constexpr

Euler-Mascheroni constant.

Definition at line 50 of file constants.hpp.

Referenced by CoulombMMM1D::pair_energy(), and preparePolygammaEven().

◆ gaussian()

double Utils::gaussian ( Vector3d  x,
Vector3d  x0,
double  sigma 
)
inline

Definition at line 27 of file utils/include/utils/math/gaussian.hpp.

Referenced by del_gaussian().

◆ get() [1/3]

template<std::size_t I, class T , std::size_t N>
auto Utils::get ( Array< T, N > const &  a) -> std::enable_if_t<(I < N), const T &>

Definition at line 214 of file Array.hpp.

◆ get() [2/3]

template<std::size_t I, typename T >
const std::tuple_element_t< I, T > & Utils::get ( const T &  v)

Definition at line 27 of file get.hpp.

◆ get() [3/3]

template<std::size_t I, class T , std::size_t N>
auto Utils::get ( Vector< T, N > const &  a) -> std::enable_if_t<(I < N), const T &>

Definition at line 481 of file Vector.hpp.

◆ get_cylindrical_sampling_positions()

std::vector< Vector3d > Utils::get_cylindrical_sampling_positions ( std::pair< double, double > const &  r_limits,
std::pair< double, double > const &  phi_limits,
std::pair< double, double > const &  z_limits,
std::size_t  n_r_bins,
std::size_t  n_phi_bins,
std::size_t  n_z_bins,
double  sampling_density 
)

Generate sampling positions for a cylindrical histogram.

Parameters
r_limitsRange for radial coordinate as std::pair.
phi_limitsRange for azimuthal angle as std::pair.
z_limitsRange for z coordinate as std::pair.
n_r_binsNumber of bins in radial direction.
n_phi_binsNumber of bins in azimuthal direction.
n_z_binsNumber of bins in z direction.
sampling_densityThe number of samples per unit volume.
Return values
Cartesiansampling coordinates.

Definition at line 47 of file sampling.hpp.

References Utils::Array< T, N >::begin(), make_lin_space(), and sqr().

Referenced by Observables::CylindricalLBProfileObservable::calculate_sampling_positions().

◆ get_linear_index() [1/2]

int Utils::get_linear_index ( const Vector3i ind,
const Vector3i adim,
MemoryOrder  memory_order = MemoryOrder::COLUMN_MAJOR 
)
inline

Definition at line 56 of file index.hpp.

References get_linear_index().

◆ get_linear_index() [2/2]

int Utils::get_linear_index ( int  a,
int  b,
int  c,
const Vector3i adim,
MemoryOrder  memory_order = MemoryOrder::COLUMN_MAJOR 
)
inline

get the linear index from the position (a,b,c) in a 3D grid of dimensions adim.

Returns
The linear index
Parameters
a,b,cPosition in 3D space
adimDimensions of the underlying grid
memory_orderRow- or column-major

Definition at line 43 of file index.hpp.

References COLUMN_MAJOR, and get_linear_index().

Referenced by get_linear_index(), get_linear_index(), grid_influence_function(), grid_influence_function(), grid_influence_function_self_energy(), and p3m_calculate_interpolation_weights().

◆ get_n_triangle()

Vector3d Utils::get_n_triangle ( const Vector3d P1,
const Vector3d P2,
const Vector3d P3 
)
inline

Computes the normal vector of a triangle.

The sign convention is such that P1P2, P1P3 and the normal form a right-handed system. The normal vector is not normalized, i.e. its length is arbitrary.

Definition at line 37 of file triangle_functions.hpp.

References u, and vector_product().

Referenced by add_oif_global_forces(), angle_btw_triangles(), area_triangle(), OifLocalForcesBond::calc_forces(), and calc_oif_global().

◆ hadamard_division() [1/4]

template<typename T , typename U , class = std::enable_if_t<not(detail::is_vector<T>::value or detail::is_vector<U>::value)>>
auto Utils::hadamard_division ( T const &  a,
U const &  b 
)

Definition at line 446 of file Vector.hpp.

◆ hadamard_division() [2/4]

template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<T>::value)>>
auto Utils::hadamard_division ( T const &  a,
Vector< U, N > const &  b 
)

Definition at line 433 of file Vector.hpp.

References Utils::Array< T, N >::begin().

◆ hadamard_division() [3/4]

template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<U>::value)>>
auto Utils::hadamard_division ( Vector< T, N > const &  a,
U const &  b 
)

Definition at line 422 of file Vector.hpp.

◆ hadamard_division() [4/4]

template<class T , class U , std::size_t N>
auto Utils::hadamard_division ( Vector< T, N > const &  a,
Vector< U, N > const &  b 
)

◆ hadamard_product() [1/4]

template<typename T , typename U , class = std::enable_if_t<not(detail::is_vector<T>::value or detail::is_vector<U>::value)>>
auto Utils::hadamard_product ( T const &  a,
U const &  b 
)

Definition at line 402 of file Vector.hpp.

◆ hadamard_product() [2/4]

template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<T>::value)>>
auto Utils::hadamard_product ( T const &  a,
Vector< U, N > const &  b 
)

Definition at line 379 of file Vector.hpp.

◆ hadamard_product() [3/4]

template<class T , class U , std::size_t N, class = std::enable_if_t<not(detail::is_vector<U>::value)>>
auto Utils::hadamard_product ( Vector< T, N > const &  a,
U const &  b 
)

Definition at line 390 of file Vector.hpp.

◆ hadamard_product() [4/4]

◆ identity_mat()

template<typename T , std::size_t Rows, std::size_t Cols>
Matrix< T, Rows, Cols > Utils::identity_mat ( )

Definition at line 231 of file matrix.hpp.

◆ int_pow()

template<unsigned n, typename T >
DEVICE_QUALIFIER constexpr T Utils::int_pow ( x)
constexpr

Calculate integer powers.

This functions calculates x^n, where n is a positive integer that is known at compile time. It uses exponentiation by squaring to construct an efficient function.

Definition at line 61 of file int_pow.hpp.

References int_pow().

Referenced by G_opt(), G_opt_dipolar(), gb_pair_energy(), gb_pair_force(), and int_pow().

◆ integral_parameter()

template<typename T , template< T > class F, T min, T max, class... Args>
decltype(auto) Utils::integral_parameter ( i,
Args &&...  args 
)

Generate a call table for an integral non-type template parameter.

Can be used to dynamically create a switch statement for contiguous values.

Definition at line 57 of file integral_parameter.hpp.

◆ keys()

template<typename Map >
auto Utils::keys ( Map const &  m) -> std::vector<typename Map::key_type>

Return the keys of a map type.

Returns a vector of copies of the keys of a map, unordered_map, ...

Definition at line 34 of file keys.hpp.

Referenced by ComFixed::get_fixed_types(), get_particle_ids(), and get_particle_ids_parallel().

◆ linear_interpolation()

template<typename T , typename Container >
T Utils::linear_interpolation ( Container const &  table,
hi,
offset,
x 
)

Linear interpolation between two data points.

Parameters
[in]tableTabulated values, equally-spaced along the x-axis
[in]hiDistance on the x-axis between tabulated values
[in]offsetPosition on the x-axis of the first tabulated value
[in]xPosition on the x-axis at which to interpolate the value
Returns
Interpolated value on the y-axis at x.

Definition at line 33 of file linear_interpolation.hpp.

Referenced by TabulatedPotential::energy(), and TabulatedPotential::force().

◆ ln_2()

template<class T = double>
DEVICE_QUALIFIER constexpr T Utils::ln_2 ( )
constexpr

Natural logarithm of 2.

Definition at line 57 of file constants.hpp.

Referenced by K0(), K1(), LPK0(), LPK01(), LPK1(), and CoulombMMM1D::pair_energy().

◆ lower_triangular()

template<class T >
T Utils::lower_triangular ( i,
j 
)

Linear index into a lower triangular matrix.

This is row-major.

Template Parameters
TIntegral type
Parameters
irow index
jcolumn index
Returns
linear index

Definition at line 71 of file index.hpp.

Referenced by InteractionsNonBonded::get_ia_param_key(), and Observable_stat::Observable_stat().

◆ make_const_span() [1/2]

template<class C >
DEVICE_QUALIFIER constexpr auto Utils::make_const_span ( C &  c)
constexpr

Definition at line 126 of file Span.hpp.

References make_const_span().

◆ make_const_span() [2/2]

template<typename T >
DEVICE_QUALIFIER constexpr Span< std::add_const_t< T > > Utils::make_const_span ( T *  p,
std::size_t  N 
)
constexpr

Definition at line 122 of file Span.hpp.

References N.

Referenced by p3m_interpolation_cache::load(), make_const_span(), and AssignForces< cao >::operator()().

◆ make_lin_space()

template<class T >
auto Utils::make_lin_space ( start,
stop,
std::size_t  number,
bool  endpoint = true 
)

Equally spaced values in interval.

Returns a range of equally spaced values in the range of start and stop, like numpy.linspace.

Template Parameters
Tfloating point type
Parameters
startStart value of the interval
stopEnd value of the interval
numberNumber of partition points
endpointIf true, the last point is stop, otherwise one less.
Returns
Range of equally spaced values

Definition at line 45 of file make_lin_space.hpp.

Referenced by Observables::ProfileObservable::edges(), get_cylindrical_sampling_positions(), and raster().

◆ make_span() [1/2]

template<class C >
DEVICE_QUALIFIER constexpr auto Utils::make_span ( C &  c)
constexpr

Definition at line 116 of file Span.hpp.

References make_span().

◆ make_span() [2/2]

◆ mask()

template<class T , class Integral >
auto Utils::mask ( Integral  mask,
t 
) -> std::enable_if_t<std::is_unsigned_v<Integral> && (size_in_bits<Integral>::value >= tuple_size<T>::value), T>

Pick elements of a tuple-like by a bit mask.

E.g. every element of the input for which the corresponding bit is set in the mask is set is copied to the output unmodified, the elements that are not set are set to zero (default constructed instance of the type).

Example: mask(0b1011, {1, 2, 3, 4}) => {1, 0, 3, 4}

Template Parameters
Timplements the tuple interface(get, tuple_size, ...)
IntegralAn unsigned integral type
Parameters
maskbit mask, if the i-th bit is set, the i-th element in t is copied to the output, otherwise it is set to zero.
tinput elements
Returns
t partially zeroed out according to mask

Definition at line 57 of file mask.hpp.

References mask().

Referenced by mask(), and propagate_omega_quat_particle().

◆ matrix_vector_product()

template<typename T , std::size_t N, const std::array< std::array< int, N >, N > & matrix, typename Container >
constexpr std::array< T, N > Utils::matrix_vector_product ( const Container &  vec)
constexpr

Calculate the matrix-vector product for a statically given (square) matrix.

Template Parameters
Tdata type for the vector.
Nsize of the vector.
matrixconst reference to a static integer array (size N) of arrays (each of size N).
Containercontainer type for the vector.
Parameters
vecContainer with data of type T and length N with the vector data.
Return values
Anarray with the result of the matrix-vector product.

Definition at line 104 of file matrix_vector_product.hpp.

◆ operator!=()

template<std::size_t N, typename T >
constexpr bool Utils::operator!= ( Vector< T, N > const &  a,
Vector< T, N > const &  b 
)
constexpr

Definition at line 227 of file Vector.hpp.

◆ operator%()

template<std::size_t N, typename T , class U , class = std::enable_if_t<std::is_integral_v<T> and std::is_integral_v<U>>>
auto Utils::operator% ( Vector< T, N > const &  a,
Vector< U, N > const &  b 
)

Definition at line 330 of file Vector.hpp.

◆ operator*() [1/4]

template<typename T , typename U , std::enable_if_t< std::is_arithmetic_v< U >, bool > = true>
Quaternion< T > Utils::operator* ( const U &  b,
const Quaternion< T > &  a 
)

Product quaternion and arithmetic type.

Template Parameters
TData type of quaternion a.
UType of multiplier b.
Parameters
bQuaternion.
aMultiplier.
Returns
Multiplied quaternion.

Definition at line 141 of file quaternion.hpp.

References operator*().

Referenced by operator*(), operator*(), operator*(), and operator*().

◆ operator*() [2/4]

template<std::size_t N, typename T , class U , std::enable_if_t< std::is_arithmetic_v< U >, bool > = true>
auto Utils::operator* ( U const &  a,
Vector< T, N > const &  b 
)

Definition at line 264 of file Vector.hpp.

References operator*().

◆ operator*() [3/4]

template<std::size_t N, typename T , class U , class = std::enable_if_t<not(detail::is_vector<T>::value or detail::is_vector<U>::value)>>
auto Utils::operator* ( Vector< T, N > const &  a,
Vector< U, N > const &  b 
)

Definition at line 320 of file Vector.hpp.

References operator*().

◆ operator*() [4/4]

template<std::size_t N, typename T , class U , std::enable_if_t< std::is_arithmetic_v< U >, bool > = true>
auto Utils::operator* ( Vector< T, N > const &  b,
U const &  a 
)

Definition at line 276 of file Vector.hpp.

References operator*().

◆ operator*=()

template<std::size_t N, typename T >
Vector< T, N > & Utils::operator*= ( Vector< T, N > &  b,
T const &  a 
)

Definition at line 287 of file Vector.hpp.

References operator*=().

Referenced by operator*=().

◆ operator+()

template<std::size_t N, typename T , typename U >
auto Utils::operator+ ( Vector< T, N > const &  a,
Vector< U, N > const &  b 
)

Definition at line 232 of file Vector.hpp.

References operator+().

Referenced by operator+().

◆ operator+=()

template<std::size_t N, typename T >
Vector< T, N > & Utils::operator+= ( Vector< T, N > &  a,
Vector< T, N > const &  b 
)

Definition at line 237 of file Vector.hpp.

References operator+=().

Referenced by operator+=().

◆ operator-() [1/2]

template<std::size_t N, typename T >
Vector< T, N > Utils::operator- ( Vector< T, N > const &  a)

Definition at line 247 of file Vector.hpp.

References operator-().

◆ operator-() [2/2]

template<std::size_t N, typename T , typename U >
auto Utils::operator- ( Vector< T, N > const &  a,
Vector< U, N > const &  b 
)

Definition at line 242 of file Vector.hpp.

References operator-().

Referenced by operator-(), and operator-().

◆ operator-=()

template<std::size_t N, typename T >
Vector< T, N > & Utils::operator-= ( Vector< T, N > &  a,
Vector< T, N > const &  b 
)

Definition at line 257 of file Vector.hpp.

References operator-=().

Referenced by operator-=().

◆ operator/()

template<std::size_t N, typename T >
Vector< T, N > Utils::operator/ ( Vector< T, N > const &  a,
T const &  b 
)

Definition at line 295 of file Vector.hpp.

References Utils::Array< T, N >::begin(), and operator/().

Referenced by operator/().

◆ operator/=()

template<std::size_t N, typename T >
Vector< T, N > & Utils::operator/= ( Vector< T, N > &  a,
T const &  b 
)

Definition at line 304 of file Vector.hpp.

References operator/=().

Referenced by operator/=().

◆ operator<()

template<std::size_t N, typename T >
constexpr bool Utils::operator< ( Vector< T, N > const &  a,
Vector< T, N > const &  b 
)
constexpr

Definition at line 202 of file Vector.hpp.

◆ operator<=()

template<std::size_t N, typename T >
constexpr bool Utils::operator<= ( Vector< T, N > const &  a,
Vector< T, N > const &  b 
)
constexpr

Definition at line 212 of file Vector.hpp.

◆ operator==()

template<std::size_t N, typename T >
constexpr bool Utils::operator== ( Vector< T, N > const &  a,
Vector< T, N > const &  b 
)
constexpr

Definition at line 222 of file Vector.hpp.

References operator==().

Referenced by operator==().

◆ operator>()

template<std::size_t N, typename T >
constexpr bool Utils::operator> ( Vector< T, N > const &  a,
Vector< T, N > const &  b 
)
constexpr

Definition at line 207 of file Vector.hpp.

◆ operator>=()

template<std::size_t N, typename T >
constexpr bool Utils::operator>= ( Vector< T, N > const &  a,
Vector< T, N > const &  b 
)
constexpr

Definition at line 217 of file Vector.hpp.

◆ pack()

template<class T >
std::string Utils::pack ( T const &  v)

Pack a serialize type into a string.

Template Parameters
TSerializable type
Parameters
vValue to serialize
Returns
String representation

Definition at line 38 of file pack.hpp.

Referenced by ScriptInterface::Particles::ParticleList::get_internal_state(), and ScriptInterface::ContextManager::serialize().

◆ permute_ifield()

void Utils::permute_ifield ( int *  field,
int  size,
int  permute 
)
inline

permute an integer array field of size size about permute positions.

Definition at line 24 of file permute_ifield.hpp.

References permute_ifield().

Referenced by permute_ifield().

◆ pi()

◆ product()

◆ raster()

template<class T , class F >
auto Utils::raster ( Vector< T, 3 > const &  offset,
Vector< T, 3 > const &  grid_spacing,
Vector3i  size,
f 
)

Raster a function over a regular 3d grid.

This evaluates a function over a regular grid and returns the function values at the grid points.

Parameters
offsetPosition of the lowest grid point
grid_spacingGrid constant
sizeGrid size
fFunction to evaluate
Returns
Function values at the grid points.

Definition at line 42 of file raster.hpp.

References Utils::Array< T, N >::data(), f, make_lin_space(), and res.

◆ rotation_matrix()

template<typename T >
Matrix< T, 3, 3 > Utils::rotation_matrix ( Quaternion< T > const &  q)

Convert quaternion to rotation matrix.

Template Parameters
TData type of quaternion.
Parameters
qQuaternion.
Returns
Rotation matrix.

Definition at line 151 of file quaternion.hpp.

References Utils::Quaternion< T >::normalized().

◆ sgn()

template<typename T >
constexpr int Utils::sgn ( val)
constexpr

Calculate signum of val.

Definition at line 27 of file sgn.hpp.

Referenced by BoxGeometry::velocity_difference().

◆ sinc()

template<typename T >
DEVICE_QUALIFIER T Utils::sinc ( d)

Calculates the sinc-function as sin(PI*x)/(PI*x).

(same convention as in [23]). In order to avoid divisions by 0, arguments, whose modulus is smaller than epsi, will be evaluated by an 8th order Taylor expansion of the sinc function. Note that the difference between sinc(x) and this expansion is smaller than 0.235e-12, if x is smaller than 0.1. (The next term in the expansion is the 10th order contribution PI^10/39916800 * x^10 = 0.2346...*x^12). This expansion should also save time, since it reduces the number of function calls to sin().

Definition at line 45 of file sinc.hpp.

References abs().

Referenced by Aliasing_sums_ik(), dp3m_tune_aliasing_sums(), G_opt(), G_opt_dipolar(), G_opt_dipolar_self_energy(), p3m_k_space_error_gpu_kernel_ik(), and p3m_tune_aliasing_sums().

◆ sqr()

template<typename T >
DEVICE_QUALIFIER constexpr T Utils::sqr ( x)
constexpr

Calculates the SQuaRe of x.

Definition at line 26 of file sqr.hpp.

References sqr().

Referenced by bspline(), IBMTriel::calc_forces(), calc_part_distribution(), calc_re(), calc_rg(), calc_rh(), Shapes::Ellipsoid::calculate_dist(), Shapes::Slitpore::calculate_dist(), Shapes::Torus::calculate_dist(), CoulombMMM1D::CoulombMMM1D(), CoulombP3M::count_charged_particles(), elc_data::dielectric_layers_self_energy(), elc_data::dielectric_layers_self_forces(), dp3m_k_space_error(), dp3m_real_space_error(), dp3m_tune_aliasing_sums(), dpd_pair_force(), energiesKernel(), HarmonicBond::energy(), QuarticBond::energy(), AngleCosineBond::energy(), AngleCossquareBond::energy(), AngleHarmonicBond::energy(), DipolarLayerCorrection::energy_correction(), Accumulators::fcs_acf(), FeneBond::FeneBond(), force_capping(), AngleCosineBond::forces(), AngleHarmonicBond::forces(), TabulatedAngleBond::forces(), forcesKernel(), G_opt(), G_opt_dipolar(), gaussian_pair_energy(), gaussian_pair_force_factor(), gb_pair_energy(), gb_pair_force(), get_cylindrical_sampling_positions(), get_interacting_neighbors(), get_pairs_filtered(), get_short_range_neighbors(), grid_influence_function(), hzeta(), Collision_parameters::initialize(), lj_pair_energy(), ljcos2_pair_energy(), ljcos_pair_energy(), ljcos_pair_force_factor(), LJcos_Parameters::LJcos_Parameters(), ljgen_pair_force_factor(), CoulombP3M::long_range_kernel(), DipolarP3M::long_range_kernel(), CoulombP3M::long_range_pressure(), modify_p3m_sums(), morse_pair_energy(), morse_pair_force_factor(), numBlocks(), Observables::LBFluidPressureTensor::operator()(), VerletCriterion< CutoffGetter >::operator()(), p3m_analytic_cotangent_sum(), p3m_k_space_error(), p3m_real_space_error(), p3m_tune_aliasing_sums(), DipolarP3M::pair_energy(), DipolarP3M::pair_force(), LB::ParticleCoupling::ParticleCoupling(), SmSt_pair_force_factor(), sqr(), steepest_descent_step(), structure_factor(), CoulombMMM1D::tune(), vectorReductionKernel(), velocity_verlet_npt_finalize_p_inst(), velocity_verlet_npt_propagate_pos(), velocity_verlet_npt_propagate_vel(), velocity_verlet_npt_propagate_vel_final(), and wca_pair_energy().

◆ sqrt()

template<std::size_t N, typename T >
Vector< T, N > Utils::sqrt ( Vector< T, N > const &  a)

Definition at line 342 of file Vector.hpp.

References Utils::Array< T, N >::begin().

Referenced by LB::ParticleCoupling::get_noise_term().

◆ sqrt_2()

template<class T = double>
DEVICE_QUALIFIER constexpr T Utils::sqrt_2 ( )
constexpr

◆ sqrt_pi_i()

template<class T = double>
DEVICE_QUALIFIER constexpr T Utils::sqrt_pi_i ( )
constexpr

◆ tensor_product() [1/2]

template<typename T , std::size_t N>
Vector< T, N > Utils::tensor_product ( const T &  x,
const Vector< T, N > &  y 
)

Definition at line 38 of file tensor_product.hpp.

◆ tensor_product() [2/2]

◆ transform_coordinate_cartesian_to_cylinder() [1/2]

Vector3d Utils::transform_coordinate_cartesian_to_cylinder ( Vector3d const &  pos)
inline

Coordinate transformation from Cartesian to cylindrical coordinates.

The origins and z-axis of the coordinate systems co-incide. The \( \phi = 0 \) direction corresponds to the x-axis in the original coordinate system.

Parameters
posVector to transform

Definition at line 72 of file coordinate_transformation.hpp.

References pos.

Referenced by Shapes::HollowConicalFrustum::calculate_dist(), Observables::CylindricalDensityProfile::evaluate(), Observables::CylindricalFluxDensityProfile::evaluate(), Observables::CylindricalLBFluxDensityProfileAtParticlePositions::evaluate(), Observables::CylindricalVelocityProfile::evaluate(), Observables::CylindricalLBVelocityProfileAtParticlePositions::evaluate(), Observables::CylindricalLBVelocityProfile::operator()(), and transform_coordinate_cartesian_to_cylinder().

◆ transform_coordinate_cartesian_to_cylinder() [2/2]

Vector3d Utils::transform_coordinate_cartesian_to_cylinder ( Vector3d const &  pos,
Vector3d const &  axis,
Vector3d const &  orientation 
)
inline

Coordinate transformation from Cartesian to cylindrical coordinates with change of basis.

The origins of the coordinate systems co-incide.

If the parameter axis is not equal to [0, 0, 1], the value of the angle \( \phi \) in cylindrical coordinates is under-defined. To fully define it, it is necessary to provide an orientation vector in Cartesian coordinates that will be used as the reference point (i.e. such that \( \phi = 0 \)), by default it is the x-axis.

Parameters
posVector to transform
axisLongitudinal axis of the cylindrical coordinates
orientationReference point (in untransformed coordinates) for which \( \phi = 0 \)

Definition at line 93 of file coordinate_transformation.hpp.

References basis_change(), pos, transform_coordinate_cartesian_to_cylinder(), and vector_product().

◆ transform_coordinate_cylinder_to_cartesian() [1/2]

Vector3d Utils::transform_coordinate_cylinder_to_cartesian ( Vector3d const &  pos)
inline

Coordinate transformation from cylindrical to Cartesian coordinates.

The origins and z-axis of the coordinate systems co-incide. The \( \phi = 0 \) direction corresponds to the x-axis in the transformed coordinate system.

Parameters
posVector to transform

Definition at line 111 of file coordinate_transformation.hpp.

References pos.

Referenced by Shapes::HollowConicalFrustum::calculate_dist(), Observables::CylindricalLBProfileObservable::calculate_sampling_positions(), and transform_coordinate_cylinder_to_cartesian().

◆ transform_coordinate_cylinder_to_cartesian() [2/2]

Vector3d Utils::transform_coordinate_cylinder_to_cartesian ( Vector3d const &  pos,
Vector3d const &  axis,
Vector3d const &  orientation 
)
inline

Coordinate transformation from cylindrical to Cartesian coordinates with change of basis.

The origins of the coordinate systems co-incide.

If the parameter axis is not equal to [0, 0, 1], the value of the angle \( \phi \) in cylindrical coordinates is under-defined. To fully define it, it is necessary to provide an orientation vector in Cartesian coordinates that will be used as the reference point (i.e. such that \( \phi = 0 \)).

Parameters
posVector to transform
axisLongitudinal axis of the cylindrical coordinates
orientationReference point (in Cartesian coordinates) for which \( \phi = 0 \)

Definition at line 133 of file coordinate_transformation.hpp.

References basis_change(), pos, transform_coordinate_cylinder_to_cartesian(), and vector_product().

◆ transform_vector_cartesian_to_cylinder()

Vector3d Utils::transform_vector_cartesian_to_cylinder ( Vector3d const &  vec,
Vector3d const &  axis,
Vector3d const &  pos 
)
inline

Vector transformation from Cartesian to cylindrical coordinates.

Parameters
vecVector to transform
axisLongitudinal axis of the cylindrical coordinates
posOrigin of the vector

Definition at line 149 of file coordinate_transformation.hpp.

References angle_between(), pos, vec_rotate(), and vector_product().

Referenced by Observables::CylindricalFluxDensityProfile::evaluate(), Observables::CylindricalLBFluxDensityProfileAtParticlePositions::evaluate(), Observables::CylindricalVelocityProfile::evaluate(), Observables::CylindricalLBVelocityProfileAtParticlePositions::evaluate(), and Observables::CylindricalLBVelocityProfile::operator()().

◆ u32_to_u64()

constexpr uint64_t Utils::u32_to_u64 ( uint32_t  high,
uint32_t  low 
)
inlineconstexpr

Definition at line 26 of file u32_to_u64.hpp.

Referenced by Random::philox_4_uint64s().

◆ u64_to_u32()

constexpr std::pair< uint32_t, uint32_t > Utils::u64_to_u32 ( uint64_t  in)
inlineconstexpr

Definition at line 30 of file u32_to_u64.hpp.

◆ uniform()

constexpr double Utils::uniform ( uint64_t  in)
inlineconstexpr

Uniformly map unsigned integer to double.

This maps a unsigned integer to the double interval (0., 1.], where 0 is mapped to the smallest representable value larger than 0., and the maximal integer value is mapped to 1.

Parameters
inUnsigned integer value
Returns
Mapped floating point value.

Definition at line 36 of file uniform.hpp.

◆ unit_vector()

template<typename T >
Vector< T, 3 > Utils::unit_vector ( unsigned int  i)

Definition at line 450 of file Vector.hpp.

◆ unpack()

template<class T >
T Utils::unpack ( std::string const &  state)

Unpack a serialize type into a string.

Template Parameters
TSerializable type
Parameters
stateString to construct the value from, as returned by Utils::pack.
Returns
Unpacked value

Definition at line 53 of file pack.hpp.

◆ vec_rotate()

Vector3d Utils::vec_rotate ( const Vector3d axis,
double  angle,
const Vector3d vector 
)
inline

Rotate a vector around an axis.

Parameters
axisThe axis to rotate about
angleAngle to rotate
vectorVector to act on
Returns
Rotated vector

Definition at line 40 of file vec_rotate.hpp.

Referenced by Observables::CylindricalLBProfileObservable::calculate_sampling_positions(), draw_polymer_positions(), ScriptInterface::System::rotate_system(), and transform_vector_cartesian_to_cylinder().

◆ vector_product()