11#ifndef UTIL_FUNCTION_H
12#define UTIL_FUNCTION_H
18#define COMPARE_EPS 1e-5
28bool isGreater(
const double &a,
const double &b);
36bool isLess(
const double &a,
const double &b);
61double hatFunction(
const double &x,
const double &x_min,
const double &x_max);
114double linearStepFunc(
const double &x,
const double &x1,
const double &x2);
128double gaussian(
const double &r,
const double &a,
const double &beta);
149 const std::vector<double> ¶ms);
166 const std::vector<double> ¶ms);
Collection of methods useful in simulation.
bool isGreater(const double &a, const double &b)
Returns true if a > b.
double hatFunction(const double &x, const double &x_min, const double &x_max)
Computes hat function at given point.
double linearStepFunc(const double &x, const double &x1, const double &x2)
Compute linear step function.
double doubleGaussian2d(const util::Point &x, const size_t &dof, const std::vector< double > ¶ms)
Compute sum of two gaussian function in 2-d.
double equivalentMass(const double &m1, const double &m2)
Compute harmonic mean of m1 and m2.
double hatFunctionQuick(const double &x, const double &x_min, const double &x_max)
Computes hat function at given point.
double gaussian(const double &r, const double &a, const double &beta)
Compute gaussian function in 1-d.
bool isLess(const double &a, const double &b)
Returns true if a < b.
double gaussian2d(const util::Point &x, const size_t &dof, const std::vector< double > ¶ms)
Compute gaussian function in 2-d.
A structure to represent 3d vectors.